@enonic/ui 0.19.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enonic-ui.cjs +1 -1
- package/dist/enonic-ui.es.js +79 -68
- package/dist/styles/style.css +1 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components/tree-list/index.d.ts +1 -0
- package/dist/types/components/tree-list/tree-list.d.ts +114 -0
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/tree-list-provider.d.ts +21 -0
- package/package.json +1 -1
package/dist/enonic-ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("preact"),t=require("react"),r=require("@radix-ui/react-slot"),o=require("focus-trap-react"),n=require("react-dom");var a=0;function i(t,r,o,n,i,s){r||(r={});var l,c,d=r;if("ref"in d)for(c in d={},r)"ref"==c?l=r[c]:d[c]=r[c];var u={type:t,props:d,key:o,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--a,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof t&&(l=t.defaultProps))for(c in l)void 0===d[c]&&(d[c]=l[c]);return e.options.vnode&&e.options.vnode(u),u}const s=t.createContext(void 0),l=({value:e,children:t})=>i(s.Provider,{value:e,children:t});l.displayName="AvatarProvider";const c=()=>{const e=t.useContext(s);if(!e)throw new Error("useAvatar must be used within an Avatar");return e},d=t.createContext(void 0),u=({value:e,children:t})=>i(d.Provider,{value:e,children:t});u.displayName="ComboboxProvider";const f=()=>{const e=t.useContext(d);if(!e)throw new Error("useCombobox must be used within a ComboboxProvider");return e},m=t.createContext(void 0),b=({value:e,children:t})=>i(m.Provider,{value:e,children:t});b.displayName="DialogProvider";const p=()=>{const e=t.useContext(m);if(!e)throw new Error("useDialog must be used within a DialogProvider");return e},g=t.createContext(void 0),h=({children:e,prefix:t})=>i(g.Provider,{value:{prefix:t},children:e});h.displayName="IdProvider";const v=(e,r)=>{const o=t.useId(),n=e??o,a=t.useContext(g);return[a?.prefix,r,n].filter(Boolean).join("-")},x=t.createContext(void 0),w=({value:e,children:t})=>i(x.Provider,{value:e,children:t});w.displayName="ListboxProvider";const y=()=>{const e=t.useContext(x);if(!e)throw new Error("useListbox must be used within a Listbox");return e},k=t.createContext(void 0),I=({value:e,children:t})=>i(k.Provider,{value:e,children:t}),C=()=>{const e=t.useContext(k);if(!e)throw new Error("useMenu must be used within a MenuProvider");return e},N=t.createContext(void 0),R=N.Provider;function M(){const e=t.useContext(N);if(!e)throw new Error("useMenubarMenu must be used within a Menubar.Menu component");return e}const D=t.createContext(void 0),S=({value:e,children:t})=>i(D.Provider,{value:e,children:t});S.displayName="MenubarProvider";const E=()=>{const e=t.useContext(D);if(!e)throw new Error("useMenubar must be used within a MenubarProvider");return e},z=t.createContext(void 0),P=({value:e,children:t})=>i(z.Provider,{value:e,children:t});P.displayName="SearchFieldProvider";const A=()=>{const e=t.useContext(z);if(!e)throw new Error("useSearchField must be used within a SearchFieldProvider");return e},O=t.createContext(void 0),L=({value:e,children:t})=>i(O.Provider,{value:e,children:t}),T=()=>{const e=t.useContext(O);if(!e)throw new Error("useToggleGroup must be used within a ToggleGroupProvider");return e};function V(e,t){return`${e}-${t}`}function j(e,t,r){return`${e}-${t}-item-${r}`}function F(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=F(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function G(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=F(e))&&(o&&(o+=" "),o+=t);return o}const $=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),W="-",B=[],K=e=>{const t=H(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return q(e);const r=e.split(W),o=""===r[0]&&r.length>1?1:0;return _(r,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=o[e],n=r[e];return t?n?((e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r})(n,t):t:n||B}return r[e]||B}}},_=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const o=e[t],n=r.nextPart.get(o);if(n){const r=_(e,t+1,n);if(r)return r}const a=r.validators;if(null===a)return;const i=0===t?e.join(W):e.slice(t).join(W),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(i))return e.classGroupId}},q=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?"arbitrary.."+o:void 0})(),H=e=>{const{theme:t,classGroups:r}=e;return U(r,t)},U=(e,t)=>{const r=$();for(const o in e){const n=e[o];X(n,r,o,t)}return r},X=(e,t,r,o)=>{const n=e.length;for(let a=0;a<n;a++){const n=e[a];Y(n,t,r,o)}},Y=(e,t,r,o)=>{"string"!=typeof e?"function"!=typeof e?Q(e,t,r,o):J(e,t,r,o):Z(e,t,r)},Z=(e,t,r)=>{(""===e?t:ee(t,e)).classGroupId=r},J=(e,t,r,o)=>{te(e)?X(e(o),t,r,o):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},Q=(e,t,r,o)=>{const n=Object.entries(e),a=n.length;for(let i=0;i<a;i++){const[e,a]=n[i];X(a,ee(t,e),r,o)}},ee=(e,t)=>{let r=e;const o=t.split(W),n=o.length;for(let a=0;a<n;a++){const e=o[a];let t=r.nextPart.get(e);t||(t=$(),r.nextPart.set(e,t)),r=t}return r},te=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,re=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const n=(n,a)=>{r[n]=a,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=o[e])?(n(e,t),t):void 0},set(e,t){e in r?r[e]=t:n(e,t)}}},oe=[],ne=(e,t,r,o,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:n}),ae=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=e=>{const t=[];let r,o=0,n=0,a=0;const i=e.length;for(let d=0;d<i;d++){const i=e[d];if(0===o&&0===n){if(":"===i){t.push(e.slice(a,d)),a=d+1;continue}if("/"===i){r=d;continue}}"["===i?o++:"]"===i?o--:"("===i?n++:")"===i&&n--}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 ne(t,c,l,r&&r>a?r-a:void 0)};if(t){const e=t+":",r=o;o=t=>t.startsWith(e)?r(t.slice(e.length)):ne(oe,!1,t,void 0,!0)}if(r){const e=o;o=t=>r({className:t,parseClassName:e})}return o},ie=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let o=[];for(let n=0;n<e.length;n++){const a=e[n],i="["===a[0],s=t.has(a);i||s?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},se=/\s+/,le=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=le(e[o]))&&(r&&(r+=" "),r+=t);return r},ce=[],de=e=>{const t=t=>t[e]||ce;return t.isThemeGetter=!0,t},ue=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,me=/^\d+\/\d+$/,be=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pe=/\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$/,ge=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,he=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ve=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xe=e=>me.test(e),we=e=>!!e&&!Number.isNaN(Number(e)),ye=e=>!!e&&Number.isInteger(Number(e)),ke=e=>e.endsWith("%")&&we(e.slice(0,-1)),Ie=e=>be.test(e),Ce=()=>!0,Ne=e=>pe.test(e)&&!ge.test(e),Re=()=>!1,Me=e=>he.test(e),De=e=>ve.test(e),Se=e=>!ze(e)&&!Ve(e),Ee=e=>Ke(e,Ue,Re),ze=e=>ue.test(e),Pe=e=>Ke(e,Xe,Ne),Ae=e=>Ke(e,Ye,we),Oe=e=>Ke(e,qe,Re),Le=e=>Ke(e,He,De),Te=e=>Ke(e,Je,Me),Ve=e=>fe.test(e),je=e=>_e(e,Xe),Fe=e=>_e(e,Ze),Ge=e=>_e(e,qe),$e=e=>_e(e,Ue),We=e=>_e(e,He),Be=e=>_e(e,Je,!0),Ke=(e,t,r)=>{const o=ue.exec(e);return!!o&&(o[1]?t(o[1]):r(o[2]))},_e=(e,t,r=!1)=>{const o=fe.exec(e);return!!o&&(o[1]?t(o[1]):r)},qe=e=>"position"===e||"percentage"===e,He=e=>"image"===e||"url"===e,Ue=e=>"length"===e||"size"===e||"bg-size"===e,Xe=e=>"length"===e,Ye=e=>"number"===e,Ze=e=>"family-name"===e,Je=e=>"shadow"===e,Qe=((e,...t)=>{let r,o,n,a;const i=e=>{const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:a}=t,i=[],s=e.trim().split(se);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:m}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let b=!!m,p=o(b?f.substring(0,m):f);if(!p){if(!b){l=e+(l.length>0?" "+l:l);continue}if(p=o(f),!p){l=e+(l.length>0?" "+l:l);continue}b=!1}const g=0===d.length?"":1===d.length?d[0]:a(d).join(":"),h=u?g+"!":g,v=h+p;if(i.indexOf(v)>-1)continue;i.push(v);const x=n(p,b);for(let r=0;r<x.length;++r){const e=x[r];i.push(h+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return n(e,a),a};return a=s=>{const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:re(e.cacheSize),parseClassName:ae(e),sortModifiers:ie(e),...K(e)}))(l),o=r.cache.get,n=r.cache.set,a=i,i(s)},(...e)=>a(((...e)=>{let t,r,o=0,n="";for(;o<e.length;)(t=e[o++])&&(r=le(t))&&(n&&(n+=" "),n+=r);return n})(...e))})(()=>{const e=de("color"),t=de("font"),r=de("text"),o=de("font-weight"),n=de("tracking"),a=de("leading"),i=de("breakpoint"),s=de("container"),l=de("spacing"),c=de("radius"),d=de("shadow"),u=de("inset-shadow"),f=de("text-shadow"),m=de("drop-shadow"),b=de("blur"),p=de("perspective"),g=de("aspect"),h=de("ease"),v=de("animate"),x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ve,ze],w=()=>[Ve,ze,l],y=()=>[xe,"full","auto",...w()],k=()=>[ye,"none","subgrid",Ve,ze],I=()=>["auto",{span:["full",ye,Ve,ze]},ye,Ve,ze],C=()=>[ye,"auto",Ve,ze],N=()=>["auto","min","max","fr",Ve,ze],R=()=>["auto",...w()],M=()=>[xe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],D=()=>[e,Ve,ze],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ge,Oe,{position:[Ve,ze]}],E=()=>["auto","cover","contain",$e,Ee,{size:[Ve,ze]}],z=()=>[ke,je,Pe],P=()=>["","none","full",c,Ve,ze],A=()=>["",we,je,Pe],O=()=>[we,ke,Ge,Oe],L=()=>["","none",b,Ve,ze],T=()=>["none",we,Ve,ze],V=()=>["none",we,Ve,ze],j=()=>[we,Ve,ze],F=()=>[xe,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ie],breakpoint:[Ie],color:[Ce],container:[Ie],"drop-shadow":[Ie],ease:["in","out","in-out"],font:[Se],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ie],shadow:[Ie],spacing:["px",we],text:[Ie],"text-shadow":[Ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xe,ze,Ve,g]}],container:["container"],columns:[{columns:[we,ze,Ve,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:x()}],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:y()}],"inset-x":[{"inset-x":y()}],"inset-y":[{"inset-y":y()}],start:[{start:y()}],end:[{end:y()}],top:[{top:y()}],right:[{right:y()}],bottom:[{bottom:y()}],left:[{left:y()}],visibility:["visible","invisible","collapse"],z:[{z:[ye,"auto",Ve,ze]}],basis:[{basis:[xe,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,xe,"auto","initial","none",ze]}],grow:[{grow:["",we,Ve,ze]}],shrink:[{shrink:["",we,Ve,ze]}],order:[{order:[ye,"first","last","none",Ve,ze]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],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:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],w:[{w:[s,"screen",...M()]}],"min-w":[{"min-w":[s,"screen","none",...M()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",r,je,Pe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ve,Ae]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ke,ze]}],"font-family":[{font:[Fe,ze,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:[n,Ve,ze]}],"line-clamp":[{"line-clamp":[we,"none",Ve,Ae]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",Ve,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",Ve,Pe]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[we,"auto",Ve,ze]}],"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",Ve,ze]}],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",Ve,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:S()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ye,Ve,ze],radial:["",Ve,ze],conic:[ye,Ve,ze]},We,Le]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"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:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[we,Ve,ze]}],"outline-w":[{outline:["",we,je,Pe]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,Be,Te]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",u,Be,Te]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[we,Pe]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",f,Be,Te]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[we,Ve,ze]}],"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":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Ve,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:S()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,ze]}],filter:[{filter:["","none",Ve,ze]}],blur:[{blur:L()}],brightness:[{brightness:[we,Ve,ze]}],contrast:[{contrast:[we,Ve,ze]}],"drop-shadow":[{"drop-shadow":["","none",m,Be,Te]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",we,Ve,ze]}],"hue-rotate":[{"hue-rotate":[we,Ve,ze]}],invert:[{invert:["",we,Ve,ze]}],saturate:[{saturate:[we,Ve,ze]}],sepia:[{sepia:["",we,Ve,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,ze]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[we,Ve,ze]}],"backdrop-contrast":[{"backdrop-contrast":[we,Ve,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,Ve,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,Ve,ze]}],"backdrop-invert":[{"backdrop-invert":["",we,Ve,ze]}],"backdrop-opacity":[{"backdrop-opacity":[we,Ve,ze]}],"backdrop-saturate":[{"backdrop-saturate":[we,Ve,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",we,Ve,ze]}],"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",Ve,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",Ve,ze]}],ease:[{ease:["linear","initial",h,Ve,ze]}],delay:[{delay:[we,Ve,ze]}],animate:[{animate:["none",v,Ve,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Ve,ze]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:T()}],"rotate-x":[{"rotate-x":T()}],"rotate-y":[{"rotate-y":T()}],"rotate-z":[{"rotate-z":T()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[Ve,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"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:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Ve,ze]}],"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",Ve,ze]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[we,je,Pe,Ae]}],stroke:[{stroke:["none",...D()]}],"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 et(...e){return Qe(G(e))}function tt(e,t){if(e)if("function"==typeof e)e(t);else try{e.current=t}catch{}}function rt(...e){return t.useCallback(t=>{e.forEach(e=>tt(e,t))},e)}function ot(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 nt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,at=G,it=(e,t)=>r=>{var o;if(null==(null==t?void 0:t.variants))return at(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:n,defaultVariants:a}=t,i=Object.keys(n).map(e=>{const t=null==r?void 0:r[e],o=null==a?void 0:a[e];if(null===t)return null;const i=nt(t)||nt(o);return n[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,o]=t;return void 0===o||(e[r]=o),e},{}),l=null==t||null===(o=t.compoundVariants)||void 0===o?void 0:o.reduce((e,t)=>{let{class:r,className:o,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,o]:e},[]);return at(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},st=it("relative flex shrink-0 overflow-hidden",{variants:{size:{sm:"w-6 h-6 text-xs",md:"w-8 h-8 text-sm",lg:"w-12 h-12 text-base"},shape:{circle:"rounded-full",square:"rounded-md"}},defaultVariants:{size:"md",shape:"circle"}}),lt=t.forwardRef(({children:e,className:r,size:o,shape:n,...a},s)=>{const[c,d]=t.useState("idle"),u=t.useCallback(e=>{d(e)},[]),f=t.useMemo(()=>({imageLoadingStatus:c,onImageLoadingStatusChange:u}),[c,u]);return i(l,{value:f,children:i("span",{ref:s,className:et(st({size:o,shape:n}),r),...a,children:e})})});lt.displayName="AvatarRoot";const ct=t.forwardRef(({src:e,alt:r,className:o,onLoadingStatusChange:n,...a},s)=>{const{imageLoadingStatus:l,onImageLoadingStatusChange:d}=c(),[u,f]=t.useState(!1);return t.useEffect(()=>{if(f(!1),!e)return;d("loading"),n?.("loading");const t=new Image,r=()=>{d("loaded"),n?.("loaded")},o=()=>{f(!0),d("error"),n?.("error")};return t.addEventListener("load",r),t.addEventListener("error",o),t.src=e,()=>{t.removeEventListener("load",r),t.removeEventListener("error",o)}},[e,d,n]),!e||u||"error"===l?null:i("img",{ref:s,src:e,alt:r,className:et("aspect-square h-full w-full object-cover",o),...a})});ct.displayName="AvatarImage";const dt=t.forwardRef(({children:e,className:r,delayMs:o=0,...n},a)=>{const{imageLoadingStatus:s}=c(),[l,d]=t.useState(0===o);t.useEffect(()=>{if(0===o)return;const e=setTimeout(()=>{d(!0)},o);return()=>{clearTimeout(e)}},[o]);return l&&("idle"===s||"error"===s)?i("span",{ref:a,className:et("flex h-full w-full items-center justify-center","bg-surface-secondary text-alt font-medium uppercase cursor-default",r),...n,children:e}):null});dt.displayName="AvatarFallback";const ut=Object.assign(lt,{Root:lt,Image:ct,Fallback:dt}),ft=it(["inline-flex items-center justify-center","text-main font-semibold","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","active:bg-btn-active active:text-alt data-[active=true]:bg-btn-active data-[active=true]:text-alt","disabled:select-none disabled:pointer-events-none disabled:opacity-30","overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer"],{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:"bg-btn-primary hover:bg-btn-primary-hover border border-bdr-strong"},size:{sm:"h-9 px-3.5 gap-2 text-sm",md:"h-10 px-3.5 gap-2.5 text-base",lg:"h-11.5 px-4 gap-3 text-lg"}},defaultVariants:{variant:"text",size:"md"}}),mt=t.forwardRef(({className:e,variant:t="text",size:r="md",iconSize:o,iconStrokeWidth:n=1.5,startIcon:a,label:s,endIcon:l,title:c,children:d,disabled:u,...f},m)=>{const b=a,p=l,g=o??(e=>{switch(e){case"sm":return 14;case"md":return 20;case"lg":return 24}})(r??"md");return i("button",{ref:m,type:"button",className:et(ft({variant:t,size:r}),e),title:c,"aria-label":c??s,"aria-disabled":u,"data-disabled":u?"":void 0,disabled:u,...f,children:[b&&i(b,{size:g,strokeWidth:n}),d,s,p&&i(p,{size:g,strokeWidth:n})]})});function bt({ref:e,isActive:r,disabled:o,focusMode:n="roving-tabindex",checkFocusWithin:a}){t.useEffect(()=>{if(e?.current&&"activedescendant"!==n&&!o&&r&&document.activeElement!==e.current){if(a?.enabled){const t=e.current.closest(`[role="${a.containerRole}"]`),r=t?.contains(document.activeElement);if(!r)return}"function"==typeof e.current.focus&&e.current.focus()}},[r,o,n,a,e])}function pt({enabled:e,contentRef:r,excludeRefs:o=[],onPointerDownOutside:n,onInteractOutside:a,onClose:i}){const s=t.useCallback(e=>{const t=e.target;if(t instanceof Node&&!r.current?.contains(t)){for(const e of o)if(e?.current?.contains(t))return;n?.(e),a?.(e),e.defaultPrevented||i?.()}},[r,o,n,a,i]);t.useEffect(()=>{if(e)return document.addEventListener("pointerdown",s),()=>{document.removeEventListener("pointerdown",s)}},[e,s])}function gt(e,r,o){const[n,a]=t.useState(r),i=void 0!==e;return[i?e:n,t.useCallback(e=>{i||a(e),o?.(e)},[i,o])]}function ht(e,r,o){const n=null===e?void 0:e,a=t.useCallback(e=>{o?.(e??null)},[o]),[i,s]=gt(n,r,a);return[i,t.useCallback(e=>{s(e??void 0)},[s])]}mt.displayName="Button";function vt({enabled:e,triggerRef:r,contentRef:o,align:n="start"}){const[a,i]=t.useState(null);return t.useEffect(()=>{if(!e||!r?.current||!o?.current)return;const t=()=>{if(!r.current||!o.current)return;const e=r.current.getBoundingClientRect(),t=o.current.getBoundingClientRect(),a=window.innerWidth,s=window.innerHeight;let l,c,d=e.bottom;if(d+t.height>s-10){const r=e.top-t.height;r>=10&&(d=r)}"start"===n?(l=e.left,l+t.width>a-10&&(l=void 0,c=a-e.right)):(c=a-e.right,e.right-t.width<10&&(c=void 0,l=e.left)),i({top:d,left:l,right:c})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e,n,r]),a}function xt(){const e=t.useRef(new Map);return{registerItem:t.useCallback((t,r=!1)=>{e.current.set(t,{disabled:r})},[]),unregisterItem:t.useCallback(t=>{e.current.delete(t)},[]),getItems:t.useCallback(()=>Array.from(e.current.keys()),[]),isItemDisabled:t.useCallback(t=>e.current.get(t)?.disabled??!1,[])}}function wt(e){const{getItems:r,isItemDisabled:o,active:n,setActive:a,loop:i=!1,orientation:s="vertical",onSelect:l,onEscape:c}=e,d=t.useCallback(e=>{const t=r();if(!t.length)return;const s=n?t.indexOf(n):-1;let l,c=0;const d=t.length;for(l=-1===s?e>0?0:t.length-1:s+e;c<d;){if(i)l<0?l=t.length-1:l>=t.length&&(l=0);else if(l<0||l>=t.length)return;if(!o(t[l]))return void a(t[l]);l+=e,c++}},[r,n,a,i,o]),u=t.useCallback(e=>{const t=r();if(!t.length)return;const i="vertical"===s,u=i?"ArrowDown":"ArrowRight",f=i?"ArrowUp":"ArrowLeft";switch(e.key){case u:e.preventDefault(),d(1);break;case f:e.preventDefault(),d(-1);break;case"Home":e.preventDefault();{const e=t.find(e=>!o(e));e&&a(e)}break;case"End":e.preventDefault();{const e=[...t].reverse().find(e=>!o(e));e&&a(e)}break;case"Enter":case" ":e.preventDefault(),n&&!o(n)&&l?.(n);break;case"Escape":e.preventDefault(),c?.()}},[r,n,d,a,o,s,l,c]);return{moveActive:d,handleKeyDown:u}}function yt({id:e,active:r,disabled:o,getItems:n,isItemDisabled:a,focusMode:i="roving-tabindex"}){return t.useMemo(()=>{if("activedescendant"===i)return{isFocusable:!1,tabIndex:-1};if(o)return{isFocusable:!1,tabIndex:-1};const t=n(),s=t.length>0?t[0]:void 0,l=(r??t.find(e=>!a(e))??s??e)===e;return{isFocusable:l,tabIndex:l?0:-1}},[e,r,o,n,a,i])}function kt({containerRef:e,activeId:r,orientation:o="vertical",buildElementId:n}){t.useEffect(()=>{if(!r||!e?.current)return;const t=n?n(r):r,a=e.current.querySelector(`#${t}`);a&&a.scrollIntoView({block:"nearest",inline:"horizontal"===o?"nearest":void 0,behavior:"auto"})},[r,e,o,n])}const It=(e,r)=>{t.useEffect(()=>{if(!e)return;const t=r??document.body,o=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=o}},[e,r])},Ct=(e,r)=>{t.useEffect(()=>{const t=ot(e);t&&r(t)},[e,r])},Nt=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Rt=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Mt=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var Dt={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 St=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:s,...l},c)=>t.createElement("svg",{ref:c,...Dt,width:r,height:r,stroke:e,strokeWidth:n?24*Number(o)/Number(r):o,className:Rt("lucide",a),...!i&&!Mt(l)&&{"aria-hidden":"true"},...l},[...s.map(([e,r])=>t.createElement(e,r)),...Array.isArray(i)?i:[i]])),Et=(e,r)=>{const o=t.forwardRef(({className:o,...n},a)=>{return t.createElement(St,{ref:a,iconNode:r,className:Rt(`lucide-${i=Nt(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...n});var i});return o.displayName=Nt(e),o},zt=Et("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Pt=Et("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),At=Et("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Ot=Et("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),Lt=Et("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Tt=Et("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"}]]),Vt=Et("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"}]]),jt=Et("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Ft=Et("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{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 2z",key:"1fd625"}]]),Gt=Et("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),$t=Et("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Wt=it(["inline-block","flex-shrink-0 flex items-center justify-center","h-3.5 w-3.5","border-[1.5px] rounded-xs","bg-transparent","transition-highlight"],{variants:{editable:{true:[],false:"opacity-30"},state:{default:["border-main","peer-checked:bg-main peer-checked:border-main","peer-indeterminate:bg-main peer-indeterminate:border-main","group-data-[tone=inverse]:border-alt","group-data-[tone=inverse]:peer-checked:bg-alt","group-data-[tone=inverse]:peer-checked:border-alt","group-data-[tone=inverse]:peer-indeterminate:bg-alt","group-data-[tone=inverse]:peer-indeterminate:border-alt"],error:["border-error","peer-checked:bg-error peer-checked:border-error","peer-indeterminate:bg-error peer-indeterminate:border-error"]}},defaultVariants:{state:"default",editable:!0}}),Bt=t.forwardRef(({id:e,className:t,name:r,label:o,defaultChecked:n=!1,checked:a,align:s="left",error:l,disabled:c,readOnly:d,required:u,value:f="on",onCheckedChange:m,errorMessage:b,...p},g)=>{const h=v(ot(e)),x=l?"error":"default",w=!c&&!d,[y,k]=gt(a,n,m),I="indeterminate"===y,C=!0===y;return i("div",{className:"flex flex-col gap-1 w-fit",children:[i("label",{htmlFor:h,className:et("relative flex items-center select-none gap-2 my-0.75 rounded-xs leading-4 transition-highlight","right"===s&&"flex-row-reverse justify-end",w&&["cursor-pointer","focus-within:outline-none focus-within:ring-3 focus-within:ring-ring focus-within:ring-offset-3 focus-within:ring-offset-ring-offset"],l&&w&&"focus-within:ring-error",t),children:[i("input",{ref:e=>{"function"==typeof g?g(e):g&&(g.current=e),e&&(e.indeterminate=I)},...p,id:h,type:"checkbox",className:"peer sr-only",checked:C,disabled:d??c,required:u,name:r,value:f,"aria-checked":I?"mixed":C,"aria-disabled":c,"aria-invalid":l,"aria-readonly":d,"data-state":I?"indeterminate":C?"checked":"unchecked","data-disabled":c?"":void 0,onChange:e=>{if(!w)return;let t;t=!I&&e.currentTarget.checked,k(t)}}),i("span",{className:et(Wt({state:x,editable:w})),"aria-hidden":"true",children:I?i(jt,{size:10,className:et("text-rev",!l&&"group-data-[tone=inverse]:text-alt-rev"),strokeWidth:4}):C?i(Pt,{size:10,className:et("text-rev",!l&&"group-data-[tone=inverse]:text-alt-rev"),strokeWidth:4}):null}),o&&i("span",{className:et("text-main group-data-[tone=inverse]:text-alt",c&&"opacity-30"),children:o})]}),"error"===x&&b&&i("div",{className:et("flex items-center gap-2 text-error leading-5",c&&"opacity-30"),children:[i(Ft,{size:14,strokeWidth:2.5}),b]})]})});Bt.displayName="Checkbox";const Kt=it(["p-0"],{variants:{size:{sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11.5 w-11.5"},shape:{square:"rounded-sm",round:"rounded-full"}},defaultVariants:{size:"md",shape:"square"}}),_t=t.forwardRef(({className:e,variant:t="text",size:r="md",shape:o="square",icon:n,...a},s)=>i(mt,{ref:s,className:et(Kt({size:r,shape:o}),e),variant:t,size:r,startIcon:n,label:"",...a}));function qt(e,t,r="any"){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const o="any"===r?[...e].sort():e,n="any"===r?[...t].sort():t;for(let a=0;a<o.length;a+=1)if(o[a]!==n[a])return!1;return!0}_t.displayName="IconButton";const Ht=[],Ut=e=>t=>qt(t,e)?t:e,Xt=({children:e,open:r,defaultOpen:o=!1,onOpenChange:n,closeOnBlur:a=!0,value:s,defaultValue:l="",onChange:c,disabled:d=!1,error:f=!1,selectionMode:m="single",selection:b,defaultSelection:p=Ht,onSelectionChange:g,active:h,defaultActive:x,setActive:w})=>{const y=v(),[k,I]=gt(r,o,n),[C,N]=gt(s,l,c),R="single"!==m,M="staged"===m,[D,S]=t.useState(()=>new Set(p)),E=void 0!==b,z=t.useMemo(()=>E?new Set(b):D,[E,b,D]),P=t.useMemo(()=>Array.from(z),[z]),[A,O]=t.useState(P);t.useEffect(()=>{O(M?Ut(P):P)},[P,M]);const L=M?A:P,T=t.useMemo(()=>new Set(L),[L]),V=t.useMemo(()=>M&&!qt(A,P),[M,A,P]),j=t.useCallback(()=>{M&&O(Ut(P))},[M,P]),[F,G]=ht(h,x,w),{registerItem:$,unregisterItem:W,getItems:B,isItemDisabled:K}=xt(),_=t.useCallback(e=>{N(e),I(!0)},[N,I]),q=t.useCallback(e=>{I(e),e||j()},[I,j]),H=t.useCallback(e=>{const t=new Set(e);E||S(t),g?.(e),"single"===m&&I(!1)},[E,g,m,I]),U=t.useCallback(e=>{M?O(e):H(e)},[M,H]),X=t.useCallback(()=>{M&&(qt(A,P)||H(A),I(!1))},[M,A,P,H,I]),{handleKeyDown:Y}=wt({getItems:B,isItemDisabled:K,active:F,setActive:G,loop:!1,orientation:"vertical",onSelect:e=>{let t;t=R?L.includes(e)?L.filter(t=>t!==e):[...L,e]:[e],U(t)}}),Z=t.useCallback(e=>{if(!d){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key||k||(e.preventDefault(),I(!0)),"Escape"===e.key)return e.preventDefault(),void q(!1);Y(e)}},[d,k,I,q,Y]);t.useEffect(()=>{if(k&&void 0===F){const e=B();e.length>0&&G(e[0])}},[k,F,B,G]);const J=t.useMemo(()=>({open:k,setOpen:q,inputValue:C,setInputValue:_,baseId:y,active:F,disabled:d,error:f,closeOnBlur:a,keyHandler:Z,selection:T,appliedSelection:P,stagedSelection:A,stagingEnabled:M,hasStagedChanges:V,applyStagedSelection:X,resetStagedSelection:j}),[k,q,a,Z,C,_,F,y,d,f,T,P,A,M,V,X,j]);return i(u,{value:J,children:i(Vr.Root,{selectionMode:R?"multiple":"single",selection:L,onSelectionChange:U,disabled:d,active:F,focusMode:"activedescendant",baseId:y,setActive:G,keyHandler:Z,registerItem:$,unregisterItem:W,getItems:B,isItemDisabled:K,children:e})})};Xt.displayName="Combobox.Root";const Yt=t.forwardRef(({className:e,children:r,...o},n)=>{const a=t.useRef(null),{setOpen:s,closeOnBlur:l}=f(),c=l?t.useCallback(e=>{const{relatedTarget:t}=e;t instanceof Node&&a.current?.contains(t)||s(!1)},[s]):void 0;return i("div",{ref:rt(n,a),className:e,onBlur:c,...o,children:r})});Yt.displayName="Combobox.Content";const Zt=it(["flex gap-2.5 items-center","h-12 rounded-sm border bg-surface-neutral","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"],{variants:{error:{true:"border-error focus-within:border-error focus-within:ring-error",false:"border-bdr-subtle focus-within:border-bdr-strong"},open:{true:"border-bdr-strong",false:null},disabled:{true:"pointer-events-none select-none opacity-30",false:null}},defaultVariants:{error:!1,open:!1,disabled:!1}}),Jt=({className:e,children:t,...r})=>{const{open:o,disabled:n,error:a}=f();return i("div",{className:et(Zt({error:a,open:o,disabled:n}),e),"data-open":o?"true":void 0,...r,children:t})};Jt.displayName="Combobox.Control";const Qt=t.forwardRef((e,r)=>{const o=t.useRef(null),{open:n,keyHandler:a,baseId:s,active:l,disabled:c,error:d}=f();return t.useEffect(()=>{n&&!c&&o.current?.focus()},[n,c]),i(ko.Input,{ref:rt(r,o),id:`${s}-input`,onKeyDown:a,"aria-disabled":c,"aria-invalid":d??void 0,role:"combobox","aria-autocomplete":"list","aria-expanded":n,"aria-haspopup":"listbox","aria-controls":`${s}-listbox`,"aria-activedescendant":l?`${s}-listbox-option-${l}`:void 0,...e})});Qt.displayName="Combobox.Input";const er=({children:e,className:t,...r})=>{const{inputValue:o,setInputValue:n}=f();return i(ko.Root,{value:o,onChange:n,className:et("w-full pr-0","border-0 focus-within:border-0 focus-within:ring-0",t),...r,children:e})};er.displayName="Combobox.Search";const tr=({className:e,...t})=>i(ko.Icon,{className:e,...t});tr.displayName="Combobox.SearchIcon";const rr=({className:e,...t})=>{const{open:r,setOpen:o,disabled:n}=f();return i(_t,{type:"button",variant:"text",size:"lg",icon:At,"aria-label":"Toggle",onClick:()=>{n||o(!r)},disabled:n,tabIndex:-1,className:et("shrink-0 text-subtle transition-transform hover:bg-surface-neutral-hover",r&&"rotate-180",e),...t})};rr.displayName="Combobox.Toggle";const or=({className:e,label:t="Apply",...r})=>{const{stagingEnabled:o,hasStagedChanges:n,applyStagedSelection:a}=f();return o&&n?i(mt,{className:et("h-7 px-2.5 min-w-14 gap-2 text-xs",e),type:"button",label:t,variant:"outline",onClick:a,...r}):null};or.displayName="Combobox.Apply";const nr=({children:e,className:t,...r})=>{const{open:o}=f();return o?i("div",{className:et("absolute left-0 right-0 z-50 mt-1 rounded-sm bg-surface-neutral shadow-lg ring-1 ring-bdr-subtle",t),...r,children:e}):null};nr.displayName="Combobox.Popup";const ar=Object.assign(Xt,{Root:Xt,Content:Yt,Control:Jt,Search:er,Input:Qt,SearchIcon:tr,Toggle:rr,Apply:or,Popup:nr}),ir=({open:e,defaultOpen:r=!1,onOpenChange:o,children:n})=>{const[a,s]=gt(e,r,o),l=v(),c=v(),[d,u]=t.useState(l),[f,m]=t.useState(c),p=t.useMemo(()=>({open:a,setOpen:s,titleId:d,descriptionId:f,setTitleId:u,setDescriptionId:m}),[a,d,f]);return i(b,{value:p,children:n})};ir.displayName="Dialog.Root";const sr=t.forwardRef(({asChild:e,children:t,onClick:o,...n},a)=>{const{setOpen:s}=p();return i(e?r.Slot:"button",{ref:a,type:e?void 0:"button",onClick:e=>{o?.(e),s(!0)},...n,children:t})});sr.displayName="Dialog.Trigger";const lr=({children:e,container:r,forceMount:o})=>{const{open:a}=p(),[i,s]=t.useState(!1);return t.useEffect(()=>{s(!0)},[]),i&&(o||a)?n.createPortal(e,r??document.body):null};lr.displayName="Dialog.Portal";const cr=t.forwardRef(({className:e,forceMount:t,...r},o)=>{const{open:n}=p();return t||n?i("div",{ref:o,"data-state":n?"open":"closed",className:et("fixed inset-0 z-30 bg-overlay backdrop-blur-xs","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}):null});cr.displayName="Dialog.Overlay";const dr=t.forwardRef(({children:e,className:r,forceMount:n,onEscapeKeyDown:a,onPointerDownOutside:s,onInteractOutside:l,onOpenAutoFocus:c,onCloseAutoFocus:d,...u},f)=>{const{open:m,setOpen:b,titleId:g,descriptionId:h}=p(),v=t.useRef(null),x=rt(f,v);It(m);const w=t.useCallback(e=>{"Escape"===e.key&&(a?.(e),e.defaultPrevented||b(!1))},[a,b]);return t.useEffect(()=>{if(m)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[m,w]),pt({enabled:m,contentRef:v,onPointerDownOutside:s,onInteractOutside:l,onClose:()=>b(!1)}),n||m?i(o.FocusTrap,{active:m,focusTrapOptions:{initialFocus:!1,fallbackFocus:()=>v.current??document.body,escapeDeactivates:!1,clickOutsideDeactivates:!1,returnFocusOnDeactivate:!0,allowOutsideClick:!0,preventScroll:!1,onActivate:()=>{requestAnimationFrame(()=>{const e=new Event("openautofocus",{bubbles:!0,cancelable:!0});c?.(e),!e.defaultPrevented&&v.current&&v.current.focus()})},onDeactivate:()=>{requestAnimationFrame(()=>{const e=new Event("closeautofocus",{bubbles:!0,cancelable:!0});d?.(e)})}},children:i("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-4",children:i("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":h,"data-state":m?"open":"closed",tabIndex:-1,className:et("relative rounded-lg shadow-xl bg-surface-neutral","flex flex-col max-w-lg w-full max-h-[90vh] gap-10 p-10","border border-bdr-subtle outline-none overflow-hidden","focus:outline-none focus:ring-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",r),...u,children:e})})}):null});dr.displayName="Dialog.Content";const ur=t.forwardRef(({className:e,children:t,...r},o)=>i("header",{ref:o,className:et("relative grid gap-2.5 self-stretch",e),...r,children:t}));ur.displayName="Dialog.Header";const fr=t.forwardRef(({children:e,asChild:o,onClick:n,...a},s)=>{const{setOpen:l}=p(),c=t.useCallback(e=>{n?.(e),e.defaultPrevented||l(!1)},[n,l]);return i(o?r.Slot:"button",{ref:s,type:o?void 0:"button",onClick:c,...a,children:e})});fr.displayName="Dialog.Close";const mr=t.forwardRef(({children:e,className:t,asChild:o,id:n,...a},s)=>{const{titleId:l,setTitleId:c}=p(),d=o?r.Slot:"h2";return Ct(n,c),i(d,{ref:s,id:l,className:et("text-2xl font-semibold",t),...a,children:e})});mr.displayName="Dialog.Title";const br=t.forwardRef(({id:e,children:t,asChild:o,...n},a)=>{const{descriptionId:s,setDescriptionId:l}=p(),c=o?r.Slot:"p";return Ct(e,l),i(c,{ref:a,id:s,...n,children:t})});br.displayName="Dialog.Description";const pr=t.forwardRef(({className:e,children:t,...r},o)=>i("div",{ref:o,className:et("min-h-0 flex-1 overflow-y-auto",e),...r,children:t}));pr.displayName="Dialog.Body";const gr=t.forwardRef(({className:e,children:t,...r},o)=>i("footer",{ref:o,className:et("flex justify-end gap-2.5",e),...r,children:t}));gr.displayName="Dialog.Footer";const hr=t.forwardRef((e,t)=>i(fr,{asChild:!0,ref:t,...e,children:i(_t,{"aria-label":"Close","data-area":"close",icon:$t,size:"lg",iconSize:36,iconStrokeWidth:1,shape:"round",variant:"filled"})}));hr.displayName="Dialog.DefaultClose";const vr=t.forwardRef(({title:e,description:t,withClose:r,className:o,children:n,...a},s)=>i(ur,{ref:s,className:et(r&&"grid-cols-[minmax(0,1fr)_auto]",o),...a,children:[i(mr,{className:et(r&&"col-start-1 row-start-1 min-w-0"),children:e}),r&&i(hr,{className:"col-start-2 row-start-1 row-span-2 self-start justify-self-end"}),t&&i(br,{className:et(r&&"row-start-2"),children:t}),n]}));vr.displayName="Dialog.DefaultHeader";const xr=Object.assign(ir,{Root:ir,Trigger:sr,Portal:lr,Overlay:cr,Content:dr,Header:ur,Close:fr,Title:mr,Description:br,Body:pr,Footer:gr,DefaultClose:hr,DefaultHeader:vr}),wr=it(["relative flex rounded-sm overflow-hidden","h-12 border focus-within:border-bdr-solid","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"],{variants:{state:{default:"border-bdr-subtle focus-within:border-bdr-strong",error:"border-error focus-within:border-error focus-within:ring-error"},disabled:{true:"select-none"}},defaultVariants:{state:"default",disabled:!1}}),yr=({children:e,error:t})=>i("div",{className:et("flex items-center justify-center shrink-0 min-w-12 px-4","text-sm text-subtle bg-surface-primary","first:rounded-l-sm first:border-r first:border-bdr-subtle","last:rounded-r-sm last:border-l last:border-bdr-subtle",t&&"first:border-error last:border-error"),children:e}),kr=t.forwardRef(({className:e,label:t,description:r,error:o,startAddon:n,endAddon:a,id:s,disabled:l,readOnly:c,...d},u)=>{const f=v(ot(s)),m=o?"error":"default",b="error"===m;return i("div",{className:et("w-full",l&&"opacity-30",e),children:[(!!t||!!r)&&i("div",{className:"mb-2",children:[t&&i("label",{htmlFor:f,className:"block text-base font-semibold text-main",children:i("div",{className:"flex items-center gap-2",children:[c&&i(Vt,{size:16,strokeWidth:2.5}),t]})}),r&&i("div",{className:"text-sm text-subtle",children:r})]}),i("div",{className:et(wr({state:m,disabled:l})),children:[n&&i(yr,{error:b,children:n}),i("input",{ref:u,id:f,className:et("flex-1 w-full px-4.5 text-base","text-main bg-surface-neutral placeholder:text-subtle","border-0 focus:outline-none","disabled:select-none enabled:read-only:bg-surface-primary",n&&"rounded-l-none",a&&"rounded-r-none"),disabled:l,readOnly:c,...d}),a&&i(yr,{error:b,children:a})]}),o&&i("div",{className:"flex items-center gap-2 mt-2 leading-5 text-error",children:[i(Ft,{size:16,strokeWidth:2.5}),o]})]})});function Ir(e,t,r=!1){return"function"==typeof e?e:!0===e||void 0===e&&r?t:void 0}kr.displayName="Input";const Cr=t.forwardRef(({className:e,href:t,external:r="auto",newTab:o,leftIcon:n,rightIcon:a,children:s,rel:l,...c},d)=>{const u="auto"===r?function(e){try{if(e.startsWith("mailto:")||e.startsWith("tel:"))return!0;const t="undefined"!=typeof window?window.location:void 0;return!t||new URL(e,t.origin).origin!==t.origin}catch{return!0}}(t):r,f=o??u?"_blank":void 0,m=Ir(n,zt),b=Ir(a,Tt,u);return i("a",{ref:d,href:t,className:et("inline-flex items-center align-baseline gap-1","text-sm font-normal underline underline-offset-3 decoration-1","visited:text-link-visited hover:text-main-hover","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-bdr-strong focus-visible:bg-main focus-visible:text-rev","transition-highlight",e),target:f,rel:o||u?"noopener noreferrer":"noreferrer",...c,children:[m&&i(m,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"}),s,b&&i(b,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"})]})});function Nr(e,r){return t.Children.toArray(e).find(e=>function(e,r){return t.isValidElement(e)&&e.type===r}(e,r))}Cr.displayName="Link";const Rr=({children:e,className:t,...r})=>i("div",{className:et("flex items-center gap-2.5 flex-shrink-0",t),...r,children:e}),Mr=({className:e,children:t,...r})=>i("div",{className:et("flex-1 min-w-0",e),...r,children:t});Mr.displayName="ListItem.Content";const Dr=({className:e,label:t,description:r,metadata:o,icon:n})=>i(Mr,{className:et(n&&"grid grid-cols-[auto_1fr] gap-2.5 items-center",e),children:[n&&i("div",{className:"flex items-center justify-center flex-shrink-0 group-data-[tone=inverse]:text-alt",children:n}),i("div",{className:"min-w-0 text-left",children:[t&&i("h1",{className:"truncate font-semibold group-data-[tone=inverse]:text-alt",children:t}),r&&i("p",{className:"truncate text-sm text-subtle group-data-[tone=inverse]:text-alt",children:r}),o&&i("p",{className:"text-xs text-subtle group-data-[tone=inverse]:text-alt",children:o})]})]}),Sr=({children:e,className:t,...r})=>i("div",{className:et("flex items-center gap-5 flex-shrink-0",t),...r,children:e});Sr.displayName="ListItem.Right";const Er=({children:e,className:t,selected:r,...o})=>{const n=Nr(e,Rr),a=Nr(e,Mr)??Nr(e,Dr),s=Nr(e,Sr);return i("div",{className:et("group flex items-center px-2.5 py-1 gap-2.5",r&&"bg-surface-selected text-alt",t),"data-tone":r?"inverse":void 0,role:"listitem",...o,children:[n,a,s]})};Er.displayName="ListItem";const zr=Object.assign(Er,{Left:Rr,Content:Mr,DefaultContent:Dr,Right:Sr}),Pr=[],Ar=({baseId:e,selection:r,defaultSelection:o=Pr,onSelectionChange:n,active:a,defaultActive:s,setActive:l,selectionMode:c="single",focusMode:d="roving-tabindex",disabled:u,children:f,keyHandler:m,registerItem:b,unregisterItem:p,getItems:g,isItemDisabled:h})=>{const x=e??v(),[y,k]=t.useState(()=>new Set(o)),I=void 0!==r,C=t.useMemo(()=>I?new Set(r):y,[I,r,y]),[N,R]=ht(a,s,l),M=xt(),D=b??M.registerItem,S=p??M.unregisterItem,E=g??M.getItems,z=h??M.isItemDisabled;t.useEffect(()=>{if(void 0===N&&!u){const e=E();if(0===e.length)return;const t=e.find(e=>C.has(e)&&!z(e));if(t)return void R(t);const r=e.find(e=>!z(e));r&&R(r)}},[N,u,E,z,C,R]);const P=t.useCallback(e=>{const t=C.has(e),r=new Set(C);"single"===c?(r.clear(),t||r.add(e)):t?r.delete(e):r.add(e),I||k(r),n?.(Array.from(r)),R(e)},[C,c,I,n,R]),A=t.useMemo(()=>({active:N,selection:C,selectionMode:c,focusMode:d,disabled:u,setActive:R,toggleValue:P,baseId:x,keyHandler:m,registerItem:D,unregisterItem:S,getItems:E,isItemDisabled:z}),[N,C,c,d,u,R,P,x,m,D,S,E,z]);return i(w,{value:A,children:f})};Ar.displayName="ListboxRoot";const Or=t.forwardRef(({className:e,label:r,children:o,...n},a)=>{const s=t.useRef(null),{active:l,disabled:c,setActive:d,toggleValue:u,baseId:f,selectionMode:m,keyHandler:b,focusMode:p="roving-tabindex",getItems:g,isItemDisabled:h}=y(),{handleKeyDown:v}=wt({getItems:g,isItemDisabled:h,active:l,setActive:d,loop:!1,orientation:"vertical",onSelect:e=>{u(e)}}),x=b??v,w=t.useCallback(()=>{if("activedescendant"===p&&!l&&!c){const e=g().find(e=>!h(e));e&&d(e)}},[p,l,c,d,g,h]),k=t.useCallback(()=>{if("roving-tabindex"===p){const e=s.current?.contains(document.activeElement);e||d(void 0)}},[p,d]);return kt({containerRef:s,activeId:l??void 0,orientation:"vertical",buildElementId:e=>`${f}-listbox-option-${e}`}),i("div",{ref:rt(a,s),id:`${f}-listbox`,className:et("flex flex-col items-start grow shrink-0 basis-0","max-h-100 overflow-y-auto","outline-none","transition-highlight",c&&"pointer-events-none select-none opacity-30",e),role:"listbox","aria-disabled":c,"aria-label":r,"aria-multiselectable":"multiple"===m||void 0,"aria-activedescendant":"activedescendant"===p&&l?`${f}-listbox-option-${l}`:void 0,tabIndex:"activedescendant"!==p||c?void 0:0,onFocus:"activedescendant"===p?w:void 0,onPointerLeave:"roving-tabindex"===p?k:void 0,onKeyDown:x,...n,children:o})});Or.displayName="ListboxContent";const Lr=it("group flex w-full items-center px-4.5 py-1 gap-x-2.5 cursor-pointer outline-none transition-highlight",{variants:{selected:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover data-[active=true]:bg-surface-neutral-hover"},disabled:{true:"opacity-30 cursor-not-allowed pointer-events-none",false:""},focusMode:{"roving-tabindex":["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"],activedescendant:""}},defaultVariants:{selected:!1,disabled:!1,focusMode:"roving-tabindex"}}),Tr=({value:e,disabled:r=!1,children:o,className:n,...a})=>{const s=y(),{disabled:l,toggleValue:c,baseId:d,active:u,setActive:f,focusMode:m="roving-tabindex",registerItem:b,unregisterItem:p,getItems:g,isItemDisabled:h}=s,v=s.selection.has(e),x=u===e,w=r||!!l,k=t.useRef(null);t.useEffect(()=>(b(e,w),()=>p(e)),[e,w,b,p]);const{tabIndex:I}=yt({id:e,active:u,disabled:w,getItems:g,isItemDisabled:h,focusMode:m});bt({ref:k,isActive:x,disabled:w,focusMode:m,checkFocusWithin:{enabled:!0,containerRole:"listbox"}});const C=t.useCallback(()=>{w||c(e)},[w,c,e]),N=t.useCallback(()=>{x||w||f(e)},[x,f,e,w]),R=t.useCallback(()=>{w||f(e)},[w,f,e]);return i("div",{ref:k,id:`${d}-listbox-option-${e}`,className:et(Lr({selected:v,disabled:w,focusMode:m}),n),role:"option","aria-selected":v,"aria-disabled":w||void 0,tabIndex:"roving-tabindex"===m?I:void 0,"data-value":e,"data-active":x||void 0,"data-tone":v?"inverse":void 0,onClick:C,onPointerMove:"roving-tabindex"===m?N:void 0,onFocus:"roving-tabindex"===m?R:void 0,...a,children:o})};Tr.displayName="ListboxItem";const Vr=Object.assign(Ar,{Root:Ar,Content:Or,Item:Tr}),jr=({open:e,defaultOpen:r=!1,onOpenChange:o,children:n})=>{const a=t.useRef(null),s=v(void 0,"menu-trigger"),l=v(void 0,"menu"),[c,d]=gt(e,r,o),[u,f]=t.useState(void 0),{registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:g}=xt(),h=t.useMemo(()=>({open:c,setOpen:d,active:u,setActive:f,registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:g,triggerId:s,menuId:l,triggerRef:a}),[c,u,m,b,p,g,s,l]),[x,w]=t.useState(!1);return t.useEffect(()=>{c?w(!0):x&&a.current&&a.current.focus()},[c,x,a]),i(I,{value:h,children:n})};jr.displayName="Menu.Root";const Fr=t.forwardRef(({asChild:e,onClick:t,onKeyDown:o,className:n,children:a,...s},l)=>{const{open:c,setOpen:d,triggerId:u,menuId:f,triggerRef:m}=C();return i(e?r.Slot:"button",{ref:rt(l,m),id:u,type:e?void 0:"button","aria-haspopup":"menu","aria-expanded":c,"data-active":c,"aria-controls":c?f:void 0,onClick:e=>{t?.(e),d(!c)},onKeyDown:e=>{o?.(e),"ArrowDown"!==e.key||c||(e.preventDefault(),d(!0))},className:et("data-[active=true]:bg-btn-active data-[active=true]:text-alt",n),...s,children:a})});Fr.displayName="Menu.Trigger";const Gr=({container:e,forceMount:r,children:o})=>{const{open:a}=C(),[i,s]=t.useState(!1);return t.useEffect(()=>{s(!0)},[]),i&&(r||a)?n.createPortal(o,e??document.body):null};Gr.displayName="Menu.Portal";const $r=t.forwardRef(({forceMount:e,align:r="start",loop:o=!0,onEscapeKeyDown:n,onPointerDownOutside:a,onInteractOutside:s,className:l,children:c,...d},u)=>{const{open:f,setOpen:m,active:b,setActive:p,getItems:g,isItemDisabled:h,menuId:v,triggerRef:x}=C(),w=t.useRef(null),y=rt(u,w),k=vt({enabled:f,triggerRef:x,contentRef:w,align:r});t.useEffect(()=>{if(f&&w.current){w.current.focus();const e=g().find(e=>!h(e));e&&p(e)}},[f,g,h,p]);const{handleKeyDown:I}=wt({getItems:g,isItemDisabled:h,active:b,setActive:p,loop:o,orientation:"vertical",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),N=t.useCallback(e=>{if("Tab"!==e.key)return"Escape"===e.key?(e.preventDefault(),n?.(e),void m(!1)):void I(e);m(!1)},[I,m,n]);return pt({enabled:f,contentRef:w,excludeRefs:x?[x]:void 0,onPointerDownOutside:a,onInteractOutside:s,onClose:()=>m(!1)}),kt({containerRef:w,activeId:b,orientation:"vertical"}),e||f?i("div",{ref:y,id:v,role:"menu","aria-orientation":"vertical","aria-activedescendant":b,tabIndex:-1,"data-state":f?"open":"closed",className:et("fixed z-40 flex flex-col items-start w-fit py-2.5 mt-2.5 overflow-hidden","rounded-sm border border-bdr-subtle bg-surface-neutral shadow-lg outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",!k&&"opacity-0 pointer-events-none",l),style:{...k},onKeyDown:N,...d,children:c}):null});$r.displayName="Menu.Content";const Wr=it("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:"hover:bg-surface-neutral-hover"},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""}},compoundVariants:[{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1}}),Br=t.forwardRef(({id:e,asChild:o=!1,disabled:n=!1,onSelect:a,className:s,children:l,onClick:c,onPointerMove:d,onPointerLeave:u,onFocus:f,...m},b)=>{const p=v(e,e?void 0:"menu-item"),{active:g,setActive:h,setOpen:x,registerItem:w,unregisterItem:y,getItems:k,isItemDisabled:I}=C(),N=g===p,R=t.useRef(null),M=rt(b,R);t.useEffect(()=>(w(p,n),()=>y(p)),[p,n,w,y]);const D=t.useCallback(e=>{if(c?.(e),n)return;const t=new Event("select",{bubbles:!0,cancelable:!0});a?.(t),t.defaultPrevented||x(!1)},[n,a,x,c]),S=t.useCallback(e=>{d?.(e),N||n||h(p)},[N,h,p,n,d]),E=t.useCallback(e=>{u?.(e),document.activeElement!==R.current&&h(void 0)},[h,u,R]),z=t.useCallback(e=>{f?.(e),n||h(p)},[f,n,h,p]),{tabIndex:P}=yt({id:p,active:g,disabled:n,getItems:k,isItemDisabled:I});bt({ref:R,isActive:N,disabled:n});return i(o?r.Slot:"div",{ref:M,id:p,role:"menuitem",tabIndex:P,"aria-disabled":n||void 0,"data-active":N||void 0,"data-disabled":n||void 0,"data-tone":N?"inverse":void 0,className:et(Wr({active:N,disabled:n}),s),onClick:D,onPointerMove:S,onPointerLeave:E,onFocus:z,...m,children:l})});Br.displayName="Menu.Item";const Kr=t.forwardRef(({className:e,children:t,...r},o)=>i("div",{ref:o,className:et("px-3 py-1.5 text-xs font-semibold text-subtle",e),...r,children:t}));Kr.displayName="Menu.Label";const _r=t.forwardRef(({className:e,...t},r)=>i("div",{ref:r,role:"separator","aria-orientation":"horizontal",className:et("my-1 h-px bg-bdr-subtle",e),...t}));_r.displayName="Menu.Separator";const qr=t.createContext(void 0),Hr=t.forwardRef(({value:e,defaultValue:r,onValueChange:o,closeOnSelect:n=!1,className:a,children:s,...l},c)=>{const[d,u]=gt(e,r,void 0),f=t.useCallback(e=>{u(e),o?.(e)},[u,o]),m=t.useMemo(()=>({value:d,setValue:f,closeOnSelect:n}),[d,f,n]);return i(qr.Provider,{value:m,children:i("div",{ref:c,role:"group",className:et("flex flex-col w-full",a),...l,children:s})})});Hr.displayName="Menu.RadioGroup";const Ur=it("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:""},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""},checked:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover"}},compoundVariants:[{active:!0,checked:!0,disabled:!1,class:"bg-surface-selected text-alt hover:bg-surface-selected-hover"},{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1,checked:!1}}),Xr=t.forwardRef(({id:e,value:o,asChild:n=!1,disabled:a=!1,onSelect:s,className:l,children:c,onClick:d,onPointerMove:u,onPointerLeave:f,onFocus:m,onKeyDown:b,...p},g)=>{const h=v(e,e?void 0:"menu-radio-item"),{active:x,setActive:w,setOpen:y,registerItem:k,unregisterItem:I,getItems:N,isItemDisabled:R}=C(),{value:M,setValue:D,closeOnSelect:S}=(()=>{const e=t.useContext(qr);if(!e)throw new Error("RadioGroup components must be used within a RadioGroup");return e})(),E=x===h,z=M===o,P=t.useRef(null),A=rt(g,P);t.useEffect(()=>(k(h,a),()=>I(h)),[h,a,k,I]);const O=t.useCallback(e=>{if(d?.(e),a)return;D(o);const t=new Event("select",{bubbles:!0,cancelable:!0});s?.(t),S&&y(!1)},[a,o,D,s,d,S,y]),L=t.useCallback(e=>{if(b?.(e),(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),!a)){D(o);const e=new Event("select",{bubbles:!0,cancelable:!0});s?.(e),S&&y(!1)}},[a,o,D,s,b,S,y]),T=t.useCallback(e=>{u?.(e),E||a||w(h)},[E,w,h,a,u]),V=t.useCallback(e=>{f?.(e),document.activeElement!==P.current&&w(void 0)},[w,f,P]),j=t.useCallback(e=>{m?.(e),a||w(h)},[m,a,w,h]),{tabIndex:F}=yt({id:h,active:x,disabled:a,getItems:N,isItemDisabled:R});bt({ref:P,isActive:E,disabled:a});return i(n?r.Slot:"div",{ref:A,id:h,role:"menuitemradio",tabIndex:F,"aria-checked":z,"aria-disabled":a||void 0,"data-active":E||void 0,"data-disabled":a||void 0,"data-state":z?"checked":"unchecked","data-tone":E?"inverse":void 0,className:et("group",Ur({active:E,disabled:a,checked:z}),l),onClick:O,onKeyDown:L,onPointerMove:T,onPointerLeave:V,onFocus:j,...p,children:c})});Xr.displayName="Menu.RadioItem";const Yr=t.forwardRef(({forceMount:r,className:o,children:n,...a},s)=>{if(!t.useContext(qr))return null;const l=i(e.Fragment,{children:[i(Lt,{strokeWidth:1.5,className:"size-3.5 group-data-[state=checked]:hidden"}),i(Ot,{strokeWidth:1.5,className:"size-3.5 group-data-[state=unchecked]:hidden [&>circle:last-child]:scale-[3.75] [&>circle:last-child]:origin-center [&>circle:last-child]:fill-current"})]});return i("span",{ref:s,"data-indicator":!0,className:et("inline-flex items-center justify-center",o),...a,children:n??l})});Yr.displayName="Menu.ItemIndicator";const Zr=Object.assign(jr,{Root:jr,Trigger:Fr,Portal:Gr,Content:$r,Item:Br,Label:Kr,Separator:_r,RadioGroup:Hr,RadioItem:Xr,ItemIndicator:Yr}),Jr=t.createContext(void 0);function Qr(){const e=t.useContext(Jr);if(!e)throw new Error("Menubar menu item components must be used within Menubar.Content");return e}const eo=({defaultActive:e,onActiveChange:r,id:o,children:n})=>{const a=v(o,"menubar"),s=t.useRef(null),[l,c]=t.useState(e),d=t.useCallback(e=>{c(e),r?.(e)},[r]),{registerItem:u,unregisterItem:f,getItems:m,isItemDisabled:b}=xt(),[p,g]=t.useState(void 0),h=t.useMemo(()=>({active:l,setActive:d,registerItem:u,unregisterItem:f,getItems:m,isItemDisabled:b,openMenuId:p,setOpenMenuId:g,menubarId:a,menubarRef:s}),[l,d,u,f,m,b,p,a]);return i(S,{value:h,children:n})};eo.displayName="Menubar.Root";const to=t.forwardRef(({"aria-label":e,loop:r=!0,className:o,children:n,onKeyDown:a,onBlur:s,...l},c)=>{const{active:d,setActive:u,getItems:f,isItemDisabled:m,menubarId:b,menubarRef:p,setOpenMenuId:g,openMenuId:h}=E(),v=rt(c,p),{handleKeyDown:x}=wt({getItems:f,isItemDisabled:m,active:d,setActive:u,loop:r,orientation:"horizontal",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),w=t.useCallback(e=>{a?.(e);if(("ArrowDown"===e.key||"Enter"===e.key||" "===e.key)&&d){const t=document.getElementById(d);if(t&&"menu"===t.getAttribute("aria-haspopup"))return e.preventDefault(),void g(d)}if("ArrowUp"===e.key&&d){const t=document.getElementById(d);if(t&&"menu"===t.getAttribute("aria-haspopup"))return e.preventDefault(),void g(d)}x(e)},[a,x,d,g]),y=t.useCallback(e=>{s?.(e);const t=e.relatedTarget;p?.current&&t instanceof Node&&p.current.contains(t)||h||u(void 0)},[s,u,p,h]);return kt({containerRef:p,activeId:d,orientation:"horizontal"}),i("div",{ref:v,id:b,role:"menubar","aria-label":e,"aria-orientation":"horizontal",tabIndex:-1,className:et("flex items-center gap-1.5 p-1.5",o),onKeyDown:w,onBlur:y,...l,children:n})});to.displayName="Menubar.Nav";const ro=t.forwardRef(({id:e,disabled:o=!1,onSelect:n,asChild:a,className:s,children:l,onClick:c,onPointerMove:d,onPointerDown:u,onPointerLeave:f,onFocus:m,...b},p)=>{const g=v(e,"menubar-button"),{active:h,setActive:x,registerItem:w,unregisterItem:y,openMenuId:k,getItems:I,isItemDisabled:C}=E(),N=h===g,R=t.useRef(null),M=rt(p,R);t.useEffect(()=>(w(g,o),()=>y(g)),[g,o,w,y]);const D=t.useCallback(e=>{u?.(e),o||x(g)},[o,g,u,x]),S=t.useCallback(e=>{if(c?.(e),o)return;N||x(g);const t=new Event("select",{bubbles:!0,cancelable:!0});n?.(t)},[o,N,c,x,g,n]),z=t.useCallback(e=>{d?.(e),!o&&k&&void 0!==h&&x(g)},[o,k,x,h,g,d]),P=t.useCallback(e=>{f?.(e),k&&k===g||document.activeElement===R.current||x(void 0)},[k,g,h,x,f,R]),A=t.useCallback(e=>{m?.(e),o||x(g)},[m,o,x,g]),{tabIndex:O}=yt({id:g,active:h,disabled:o,getItems:I,isItemDisabled:C});bt({ref:R,isActive:N,disabled:o});return i(a?r.Slot:"button",{ref:M,id:g,type:a?void 0:"button",role:"menuitem",tabIndex:O,"aria-disabled":o,"data-disabled":o||void 0,"data-tone":N?"inverse":void 0,className:et("group px-4.5 py-2.5 rounded-sm text-sm cursor-pointer outline-none","focus-visible:ring-3 focus-visible:ring-ring","focus-visible:ring-offset-3 focus-visible:ring-offset-ring-offset",s),onClick:S,onPointerDown:D,onPointerMove:z,onPointerLeave:P,onFocus:A,...b,children:l})});ro.displayName="Menubar.Button";const oo=t.forwardRef(({className:e,...r},o)=>i("div",void 0!==t.useContext(Jr)?{ref:o,role:"separator","aria-orientation":"horizontal",className:et("my-1 h-px w-full bg-bdr-subtle",e),...r}:{ref:o,role:"separator","aria-orientation":"vertical",className:et("mx-1 w-px h-4 bg-bdr-subtle",e),...r}));oo.displayName="Menubar.Separator";const no=({id:e,disabled:r=!1,children:o})=>{const n=v(e,"menubar-menu"),a=`${n}-content`,s=t.useRef(null),l=E(),{registerItem:c,unregisterItem:d,openMenuId:u,setOpenMenuId:f}=l,[m,b]=t.useState(!1);t.useEffect(()=>(c(n,r),()=>d(n)),[n,r,c,d]),t.useEffect(()=>{u!==n||m?u!==n&&m&&b(!1):b(!0)},[u,n,m]);const p=t.useCallback(e=>{b(e),f(e?n:void 0)},[n,f]),g=t.useMemo(()=>({menuId:n,contentId:a,open:m,setOpen:p,menubarContext:l,triggerRef:s}),[n,a,m,p,l]);return i(R,{value:g,children:o})};no.displayName="Menubar.Menu";const ao=t.forwardRef(({asChild:e,className:o,children:n,onClick:a,onKeyDown:s,onPointerMove:l,onPointerDown:c,onPointerLeave:d,onFocus:u,...f},m)=>{const{menuId:b,contentId:p,open:g,setOpen:h,triggerRef:v,menubarContext:x}=M(),{active:w,setActive:y,openMenuId:k,isItemDisabled:I,getItems:C}=x,N=rt(m,v),R=w===b,D=I(b),S=t.useCallback(e=>{a?.(e),D||h(!g)},[D,g,h,a]),E=t.useCallback(e=>{s?.(e),D||("ArrowDown"!==e.key||g)&&(" "!==e.key&&"Enter"!==e.key||g)||(e.preventDefault(),h(!0))},[D,g,h,s]),z=t.useCallback(e=>{c?.(e),D||y(b)},[D,b,c,y]),P=t.useCallback(e=>{l?.(e),D||void 0!==w&&(y(b),k&&k!==b&&h(!0))},[D,k,b,w,y,h,l]),A=t.useCallback(e=>{d?.(e),g||document.activeElement===v?.current||y(void 0)},[g,y,d,v]),O=t.useCallback(e=>{u?.(e),D||y(b)},[u,D,y,b]),{tabIndex:L}=yt({id:b,active:w,disabled:D,getItems:C,isItemDisabled:I});bt({ref:v,isActive:R,disabled:D});return i(e?r.Slot:"button",{ref:N,id:b,type:e?void 0:"button",role:"menuitem",tabIndex:L,"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?p:void 0,"aria-disabled":D,"data-active":g,"data-disabled":D||void 0,"data-state":g?"open":"closed","data-tone":R?"inverse":void 0,className:et("group px-4.5 py-2.5 rounded-sm text-sm cursor-pointer outline-none","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring focus-visible:ring-offset-3 focus-visible:ring-offset-ring-offset data-[tone=inverse]:focus-visible:ring-ring-alt data-[tone=inverse]:focus-visible:ring-offset-ring-offset-alt",g&&"bg-btn-active text-alt",D&&"opacity-30 cursor-not-allowed pointer-events-none",o),onClick:S,onKeyDown:E,onPointerDown:z,onPointerMove:P,onPointerLeave:A,onFocus:O,...f,children:n})});ao.displayName="Menubar.Trigger";const io=({container:r,forceMount:o=!1,children:a})=>{const{open:s}=M(),[l,c]=t.useState(!1);if(t.useEffect(()=>{c(!0)},[]),!l)return null;if(!(o||s))return null;const d=r??document.body;return n.createPortal(i(e.Fragment,{children:a}),d)};io.displayName="Menubar.Portal";const so=t.forwardRef(({align:e="start",loop:r=!0,forceMount:o=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onInteractOutside:s,className:l,children:c,onKeyDown:d,...u},f)=>{const{menuId:m,contentId:b,open:p,setOpen:g,triggerRef:h,menubarContext:v}=M(),{getItems:x,setActive:w}=v,y=t.useRef(null),k=rt(f,y),{registerItem:I,unregisterItem:C,getItems:N,isItemDisabled:R}=xt(),[D,S]=t.useState(void 0),E=vt({enabled:p,triggerRef:h,contentRef:y,align:e});if(!p&&!o)return null;const{handleKeyDown:z}=wt({getItems:N,isItemDisabled:R,active:D,setActive:S,loop:r,orientation:"vertical",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),P=t.useCallback(e=>{if(d?.(e),"Escape"===e.key)return e.preventDefault(),e.stopPropagation(),g(!1),n?.(e),void h?.current?.focus();if("Tab"!==e.key){if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const t=x(),r=t.indexOf(m);if(-1===r)return;const o="ArrowRight"===e.key?1:-1;let n=(r+o+t.length)%t.length,a=0;for(;a<t.length&&v.isItemDisabled(t[n]);)n=(n+o+t.length)%t.length,a+=1;const i=t[n];if(!i||v.isItemDisabled(i))return;w(i);const s=document.getElementById(i);return s?.focus(),void(s&&"menu"===s.getAttribute("aria-haspopup")?v.setOpenMenuId(i):g(!1))}z(e)}else g(!1)},[d,g,n,m,x,w,v,z,h]);t.useEffect(()=>{if(p&&null!==E){const e=N(),t=e.length>0?e[0]:void 0,r=e.find(e=>!R(e))??t;r&&S(r)}else p||S(void 0)},[p,E,N,R]),pt({enabled:p,contentRef:y,excludeRefs:[h],onPointerDownOutside:a,onInteractOutside:s,onClose:()=>g(!1)});const A=t.useMemo(()=>({registerItem:I,unregisterItem:C,getItems:N,isItemDisabled:R,active:D,setActive:S}),[I,C,N,R,D,S]),O=null!==E;return i(Jr.Provider,{value:A,children:i("div",{ref:k,id:b,role:"menu","aria-orientation":"vertical","aria-labelledby":m,tabIndex:-1,"data-state":p?"open":"closed","data-align":e,style:{position:"fixed",top:E?`${E.top}px`:"0",left:void 0!==E?.left?`${E.left}px`:void 0,right:void 0!==E?.right?`${E.right}px`:void 0,zIndex:9999,visibility:O?"visible":"hidden"},className:et("flex flex-col items-start w-fit py-2.5 mt-2.5 overflow-hidden","rounded-sm border border-bdr-subtle bg-surface-neutral shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",l),onKeyDown:P,...u,children:c})})});so.displayName="Menubar.Content";const lo=it("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:"hover:bg-surface-neutral-hover"},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""}},compoundVariants:[{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1}}),co=t.forwardRef(({id:e,disabled:o=!1,onSelect:n,asChild:a,className:s,children:l,onClick:c,onPointerMove:d,onPointerLeave:u,onFocus:f,...m},b)=>{const p=v(e,"menubar-item"),{registerItem:g,unregisterItem:h,active:x,setActive:w,getItems:y,isItemDisabled:k}=Qr(),{setOpen:I,triggerRef:C}=M(),N=x===p,R=t.useRef(null),D=rt(b,R);t.useEffect(()=>(g(p,o),()=>h(p)),[p,o,g,h]);const S=t.useCallback(e=>{if(c?.(e),o)return;const t=new Event("select",{bubbles:!0,cancelable:!0});n?.(t),I(!1),C?.current?.focus()},[o,c,n,I,C]),E=t.useCallback(e=>{d?.(e),o||w(p)},[o,p,w,d]),z=t.useCallback(e=>{u?.(e),document.activeElement!==R.current&&w(void 0)},[w,u,R]),P=t.useCallback(e=>{f?.(e),o||w(p)},[f,o,w,p]),{tabIndex:A}=yt({id:p,active:x,disabled:o,getItems:y,isItemDisabled:k});bt({ref:R,isActive:N,disabled:o});return i(a?r.Slot:"div",{ref:D,id:p,role:"menuitem",tabIndex:A,"aria-disabled":o,"data-active":N||void 0,"data-disabled":o||void 0,"data-tone":N?"inverse":void 0,className:et(lo({active:N,disabled:o}),s),onClick:S,onPointerMove:E,onPointerLeave:z,onFocus:P,...m,children:l})});co.displayName="Menubar.Item";const uo=t.forwardRef(({className:e,children:t,...r},o)=>i("div",{ref:o,role:"none",className:et("px-3 py-1.5 text-xs font-semibold text-subtle",e),...r,children:t}));uo.displayName="Menubar.Label";const fo=t.createContext(void 0),mo=t.forwardRef(({value:e,defaultValue:r,onValueChange:o,closeOnSelect:n=!1,className:a,children:s,...l},c)=>{const[d,u]=t.useState(e??r);t.useEffect(()=>{void 0!==e&&u(e)},[e]);const f=t.useCallback(t=>{void 0===e&&u(t),o?.(t)},[e,o]),m=t.useMemo(()=>({value:d,setValue:f,closeOnSelect:n}),[d,f,n]);return i(fo.Provider,{value:m,children:i("div",{ref:c,role:"group",className:et("flex flex-col w-full",a),...l,children:s})})});mo.displayName="Menubar.RadioGroup";const bo=it("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:""},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""},checked:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover"}},compoundVariants:[{active:!0,checked:!0,disabled:!1,class:"bg-surface-selected text-alt hover:bg-surface-selected-hover"},{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1,checked:!1}}),po=t.forwardRef(({id:e,value:o,disabled:n=!1,onSelect:a,asChild:s,className:l,children:c,onClick:d,onPointerMove:u,onPointerLeave:f,onFocus:m,onKeyDown:b,...p},g)=>{const h=v(e,"menubar-radio-item"),{registerItem:x,unregisterItem:w,active:y,setActive:k,getItems:I,isItemDisabled:C}=Qr(),{setOpen:N,triggerRef:R}=M(),{value:D,setValue:S,closeOnSelect:E}=(()=>{const e=t.useContext(fo);if(!e)throw new Error("RadioGroup components must be used within a RadioGroup");return e})(),z=y===h,P=D===o,A=t.useRef(null),O=rt(g,A);t.useEffect(()=>(x(h,n),()=>w(h)),[h,n,x,w]);const L=t.useCallback(e=>{if(d?.(e),n)return;S(o);const t=new Event("select",{bubbles:!0,cancelable:!0});a?.(t),E&&(N(!1),R?.current?.focus())},[n,o,S,d,a,E,N,R]),T=t.useCallback(e=>{if(b?.(e),(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),!n)){S(o);const e=new Event("select",{bubbles:!0,cancelable:!0});a?.(e),E&&(N(!1),R?.current?.focus())}},[n,o,S,b,a,E,N,R]),V=t.useCallback(e=>{u?.(e),n||k(h)},[n,h,k,u]),j=t.useCallback(e=>{f?.(e),document.activeElement!==A.current&&k(void 0)},[k,f,A]),F=t.useCallback(e=>{m?.(e),n||k(h)},[m,n,k,h]),{tabIndex:G}=yt({id:h,active:y,disabled:n,getItems:I,isItemDisabled:C});bt({ref:A,isActive:z,disabled:n});return i(s?r.Slot:"div",{ref:O,id:h,role:"menuitemradio",tabIndex:G,"aria-checked":P,"aria-disabled":n,"data-active":z||void 0,"data-disabled":n||void 0,"data-state":P?"checked":"unchecked","data-tone":z?"inverse":void 0,className:et("group",bo({active:z,disabled:n,checked:P}),l),onClick:L,onKeyDown:T,onPointerMove:V,onPointerLeave:j,onFocus:F,...p,children:c})});po.displayName="Menubar.RadioItem";const go=t.forwardRef(({forceMount:r,className:o,children:n,...a},s)=>{if(!t.useContext(fo))return null;const l=i(e.Fragment,{children:[i(Lt,{strokeWidth:1.5,className:"size-3.5 group-data-[state=checked]:hidden"}),i(Ot,{strokeWidth:1.5,className:"size-3.5 group-data-[state=unchecked]:hidden [&>circle:last-child]:scale-[3.75] [&>circle:last-child]:origin-center [&>circle:last-child]:fill-current"})]});return i("span",{ref:s,"data-indicator":!0,className:et("inline-flex items-center justify-center",o),...a,children:n??l})});go.displayName="Menubar.ItemIndicator";const ho=Object.assign(eo,{Root:eo,Nav:to,Content:so,Button:ro,Separator:oo,Menu:no,Trigger:ao,Portal:io,Item:co,Label:uo,RadioGroup:mo,RadioItem:po,ItemIndicator:go}),vo=({id:e,value:r,defaultValue:o="",onChange:n,placeholder:a="Search",clearLabel:s="Clear",disabled:l,readOnly:c,children:d,className:u,...f})=>{const m=v(ot(e)),[b,p]=t.useState(m),g=t.useRef(null),[h,x]=gt(r,o,n),w=t.useMemo(()=>({id:b,setId:p,value:h,setValue:x,disabled:l,readOnly:c,placeholder:a,clearLabel:s,inputRef:g}),[b,p,h,x,l,c,a,s,g]);return i(P,{value:w,children:i("div",{className:et("relative flex gap-2.5 items-center rounded-sm overflow-hidden","h-11.5 px-4.5 py-3","border border-bdr-subtle focus-within:border-bdr-strong","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",l&&"pointer-events-none select-none opacity-30",u),...f,children:d})})};vo.displayName="SearchFieldRoot";const xo=({className:e})=>i(Gt,{className:et("flex items-center justify-center shrink-0 size-5.5 text-subtle",e),strokeWidth:1.5});xo.displayName="SearchFieldIcon";const wo=t.forwardRef(({id:e,className:r,...o},n)=>{const{id:a,setId:s,value:l,disabled:c,readOnly:d,placeholder:u,setValue:f,inputRef:m}=A(),b=ot(e);t.useEffect(()=>{b&&s(b)},[b,s]);return i("input",{ref:rt(n,m),id:a,className:et("h-5.5 w-full text-base border-0","text-main bg-surface-neutral","placeholder:text-subtle","focus:outline-none","enabled:read-only:bg-surface-primary",r),value:l,onChange:e=>{f(e.currentTarget.value)},readOnly:d,disabled:c,placeholder:u,"aria-label":"Search","aria-disabled":c,...o})});wo.displayName="SearchFieldInput";const yo=({className:e,...t})=>{const{value:r,disabled:o,readOnly:n,clearLabel:a,setValue:s,inputRef:l}=A();if(!r||o||n)return null;return i(_t,{className:et("flex items-center justify-center shrink-0 size-7 -mx-1.5 text-subtle",e),icon:$t,title:a,onClick:()=>{s(""),l.current?.focus()},disabled:o,iconSize:28,iconStrokeWidth:1.25,...t})};yo.displayName="SearchFieldClear";const ko=Object.assign(vo,{Root:vo,Icon:xo,Input:wo,Clear:yo}),Io=({className:e,selected:t,children:r,label:o,description:n,metadata:a,icon:s,readOnly:l,checked:c,defaultChecked:d,onCheckedChange:u,...f})=>i(zr,{className:et(!t&&"hover:bg-surface-neutral-hover",e),selected:t,role:"row","aria-selected":t,...f,children:[i(zr.Left,{children:i(Bt,{checked:c,defaultChecked:d,onCheckedChange:u,readOnly:l})}),i(zr.DefaultContent,{label:o,description:n,metadata:a,icon:s}),i(zr.Right,{children:r})]});Io.displayName="SelectableListItem";const Co=({className:e,label:t,decorative:r=!1,...o})=>{const n=r?"true":void 0;return t?i("div",{role:"separator","aria-orientation":"horizontal","aria-hidden":n,className:et("inline-flex w-full gap-2.5",e),...o,children:[i("span",{className:"min-w-0 truncate text-subtle uppercase",children:t}),i("span",{className:"min-w-6 flex-1 border-b-1 border-bdr-subtle"})]}):i("hr",{"aria-hidden":n,className:et("w-full border-bdr-subtle",e)})};Co.displayName="Separator";const No=t.forwardRef(({pressed:e,defaultPressed:t=!1,onPressedChange:r,...o},n)=>{const[a,s]=gt(e,t,r);return i(mt,{ref:n,"aria-pressed":a,"data-state":a?"on":"off","data-active":a,onClick:()=>s(!a),...o})});No.displayName="Toggle";const Ro=t.forwardRef((e,r)=>{const{type:o,value:n,defaultValue:a,onValueChange:s,disabled:l,orientation:c="horizontal",children:d,className:u,...f}=e,m=v(void 0,"toggle-group"),b=rt(r,t.useRef(null)),{registerItem:p,unregisterItem:g,getItems:h,isItemDisabled:x}=xt();if("single"===o){const[r,v]=gt(n,a??"",s),[w,y]=t.useState(r||void 0),k=e.loop??!1;Ct(r,y);const I=t.useCallback(e=>{v(r===e?"":e),y(e)},[r,v]),{handleKeyDown:C}=wt({getItems:h,isItemDisabled:x,active:w,setActive:y,loop:k,orientation:c,onSelect:e=>{I(e)}}),N=t.useMemo(()=>({selectionMode:o,value:r,onValueChange:I,disabled:l,registerItem:p,unregisterItem:g,getItems:h,isItemDisabled:x,orientation:c,active:w,setActive:y}),[o,r,I,l,p,g,h,x,c,w,y]);return i(L,{value:N,children:i("div",{ref:b,role:"radiogroup",id:m,"aria-orientation":c,"data-orientation":c,className:et("inline-flex gap-2","vertical"===c&&"flex-col",u),onKeyDown:C,...f,children:d})})}const[w,y]=gt(n,a??[],s),[k,I]=t.useState(()=>w.at(0)),C=t.useCallback(e=>{const t=w.includes(e)?w.filter(t=>t!==e):[...w,e];y(t)},[w,y]),{handleKeyDown:N}=wt({getItems:h,isItemDisabled:x,active:k,setActive:I,loop:!1,orientation:c,onSelect:e=>{C(e)}}),R=t.useMemo(()=>({selectionMode:o,value:w,onValueChange:C,disabled:l,registerItem:p,unregisterItem:g,getItems:h,isItemDisabled:x,orientation:c,active:k,setActive:I}),[o,w,C,l,p,g,h,x,c,k,I]);return i(L,{value:R,children:i("div",{ref:b,role:"group",id:m,"data-orientation":c,className:et("inline-flex gap-2","vertical"===c&&"flex-col",u),onKeyDown:N,...f,children:d})})});Ro.displayName="ToggleGroup.Root";const Mo=t.forwardRef(({value:e,disabled:o,asChild:n,...a},s)=>{const l=T(),{selectionMode:c,value:d,onValueChange:u,disabled:f,registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:g,active:h,setActive:v}=l,x=t.useRef(null),w=rt(s,x),y=o??f??!1;t.useEffect(()=>(m(e,y),()=>b(e)),[e,y,m,b]);const k="single"===c?d===e:d.includes(e),I=t.useCallback(()=>{y||(u(e),v?.(e))},[y,u,e,v]),C=n?r.Slot:mt,{tabIndex:N}=yt({id:e,active:h,disabled:y,getItems:p,isItemDisabled:g});return t.useEffect(()=>{h===e&&x.current&&document.activeElement!==x.current&&x.current.focus()},[h,e]),i(C,{ref:w,..."single"===c?{"aria-pressed":k}:{"aria-checked":k},"data-state":k?"on":"off","data-active":k||void 0,disabled:y,tabIndex:N,onClick:I,...a})});Mo.displayName="ToggleGroup.Item";const Do=Object.assign(Ro,{Root:Ro,Item:Mo}),So=t.createContext(void 0);const Eo=t.forwardRef((e,r)=>{const{type:o,value:n,defaultValue:a,onValueChange:s,disabled:l,children:c,className:d,...u}=e,{orientation:f}=Oo(),m=v(void 0,"toolbar-toggle-group"),b=rt(r,t.useRef(null)),[p]=t.useState(()=>new Map),g=t.useCallback((e,t)=>{p.set(e,t)},[p]),h=t.useCallback(e=>{p.delete(e)},[p]);if("single"===o){const[e,r]=gt(n,a??"",s),v=t.useCallback(t=>{r(e===t?"":t)},[e,r]),x=t.useMemo(()=>({selectionMode:o,value:e,onValueChange:v,disabled:l,orientation:f,valueToId:p,registerValueId:g,unregisterValue:h}),[o,e,v,l,f,p,g,h]);return i(So.Provider,{value:x,children:i("div",{ref:b,role:"radiogroup",id:m,"aria-orientation":f,"data-orientation":f,className:et("inline-flex gap-2","vertical"===f&&"flex-col",d),...u,children:c})})}const[x,w]=gt(n,a??[],s),y=t.useCallback(e=>{const t=x.includes(e)?x.filter(t=>t!==e):[...x,e];w(t)},[x,w]),k=t.useMemo(()=>({selectionMode:o,value:x,onValueChange:y,disabled:l,orientation:f,valueToId:p,registerValueId:g,unregisterValue:h}),[o,x,y,l,f,p,g,h]);return i(So.Provider,{value:k,children:i("div",{ref:b,role:"group",id:m,"data-orientation":f,className:et("inline-flex gap-2","vertical"===f&&"flex-col",d),...u,children:c})})});Eo.displayName="Toolbar.ToggleGroup";const zo=t.forwardRef(({value:e,disabled:o,asChild:n,className:a,...s},l)=>{const c=function(){const e=t.useContext(So);if(!e)throw new Error("useToolbarToggleGroup must be used within a ToolbarToggleGroup");return e}(),d=Oo(),{selectionMode:u,value:f,onValueChange:m,disabled:b,registerValueId:p,unregisterValue:g}=c,{active:h,setActive:x,registerItem:w,unregisterItem:y,getItems:k,isItemDisabled:I}=d,C=v(void 0,"toolbar-toggle-item"),N=t.useRef(null),R=rt(l,N),M=o??b??!1;t.useEffect(()=>(w(C,M),()=>y(C)),[C,M,w,y]),t.useEffect(()=>(p(e,C),()=>g(e)),[e,C,p,g]);const D="single"===u?f===e:f.includes(e),S=h===C,E=t.useCallback(()=>{M||(m(e),x(C))},[M,m,e,x,C]),z=t.useCallback(()=>{M||x(C)},[M,x,C]);bt({ref:N,isActive:S,disabled:M});const{tabIndex:P}=yt({id:C,active:h,disabled:M,getItems:k,isItemDisabled:I});return i(n?r.Slot:mt,{ref:R,id:C,..."single"===u?{"aria-pressed":D}:{"aria-checked":D},"data-state":D?"on":"off","data-active":D||void 0,disabled:M,tabIndex:P,onClick:E,onFocus:z,className:a,...s})});zo.displayName="Toolbar.ToggleItem";const Po=Object.assign(Eo,{Root:Eo,Item:zo}),Ao=t.createContext(void 0);function Oo(){const e=t.useContext(Ao);if(!e)throw new Error("Toolbar components must be used within Toolbar.Root");return e}const Lo=({defaultActive:e,onActiveChange:r,id:o,orientation:n="horizontal",loop:a=!0,children:s})=>{const l=v(o,"toolbar"),c=t.useRef(null),[d,u]=t.useState(e),f=t.useCallback(e=>{u(e),r?.(e)},[r]),{registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:g}=xt(),h=t.useMemo(()=>({toolbarId:l,toolbarRef:c,active:d,setActive:f,registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:g,orientation:n,loop:a}),[l,d,f,m,b,p,g,n,a]);return i(Ao.Provider,{value:h,children:s})};Lo.displayName="Toolbar.Root";const To=t.forwardRef(({"aria-label":e,className:r,children:o,onKeyDown:n,onBlur:a,...s},l)=>{const{active:c,setActive:d,getItems:u,isItemDisabled:f,toolbarId:m,toolbarRef:b,orientation:p,loop:g}=Oo(),h=rt(l,b),{handleKeyDown:v}=wt({getItems:u,isItemDisabled:f,active:c,setActive:d,loop:g,orientation:p,onSelect:e=>{const t=document.getElementById(e);if(t)if(t instanceof HTMLButtonElement)t.click();else{const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}}}),x=t.useCallback(e=>{n?.(e),v(e)},[n,v]),w=t.useCallback(e=>{a?.(e);const t=e.relatedTarget;b.current&&t instanceof Node&&b.current.contains(t)||d(void 0)},[a,d,b]);return kt({containerRef:b,activeId:c,orientation:p}),i("div",{ref:h,id:m,role:"toolbar","aria-label":e,"aria-orientation":p,tabIndex:-1,className:et("flex items-center gap-1.5 p-2 transition-highlight","focus-within:ring-inset focus-within:ring-2 focus-within:ring-ring/25","vertical"===p&&"flex-col",r),onKeyDown:x,onBlur:w,...s,children:o})});To.displayName="Toolbar.Container";const Vo=t.forwardRef(({id:e,disabled:o=!1,asChild:n,children:a,onPointerMove:s,onPointerDown:l,onFocus:c,...d},u)=>{const f=v(e,"toolbar-item"),{active:m,setActive:b,registerItem:p,unregisterItem:g,getItems:h,isItemDisabled:x}=Oo(),w=m===f,y=t.useRef(null),k=rt(u,y);t.useEffect(()=>(p(f,o),()=>g(f)),[f,o,p,g]);const I=t.useCallback(e=>{l?.(e),o||b(f)},[o,f,l,b]),C=t.useCallback(e=>{s?.(e)},[s]),N=t.useCallback(e=>{c?.(e),o||b(f)},[c,o,b,f]),{tabIndex:R}=yt({id:f,active:m,disabled:o,getItems:h,isItemDisabled:x});bt({ref:y,isActive:w,disabled:o});return i(n?r.Slot:"div",{ref:k,id:f,tabIndex:R,"aria-disabled":o,"data-disabled":o||void 0,onPointerDown:I,onPointerMove:C,onFocus:N,...d,children:a})});Vo.displayName="Toolbar.Item";const jo=t.forwardRef(({className:e,...t},r)=>{const{orientation:o}=Oo();return i("div","vertical"===o?{ref:r,role:"separator","aria-orientation":"horizontal",className:et("my-1 h-px w-full bg-bdr-subtle",e),...t}:{ref:r,role:"separator","aria-orientation":"vertical",className:et("mx-1 w-px h-4 bg-bdr-subtle",e),...t})});jo.displayName="Toolbar.Separator";const Fo=Object.assign(Lo,{Root:Lo,Container:To,Item:Vo,Separator:jo,ToggleGroup:Po,ToggleItem:zo}),Go={top:"bottom",bottom:"top",left:"right",right:"left"};function $o({children:e,asChild:t,triggerRef:o,isOpen:n,onMouseEnter:a,onMouseLeave:s,onFocus:l,onBlur:c}){return i(t?r.Root:"div",{ref:o,className:t?void 0:"inline-flex",onMouseEnter:a,onMouseLeave:s,onFocus:l,onBlur:c,"aria-describedby":n?"tooltip":void 0,role:t?void 0:"button",tabIndex:t?void 0:0,children:e})}function Wo({children:e,actualSide:t,className:r,position:o,tooltipRef:n}){return i("div",{ref:n,role:"tooltip",className:et("fixed z-50 pointer-events-none select-none",!o.transformOrigin&&"opacity-0"),style:{top:`${o.top}px`,left:`${o.left}px`,transformOrigin:o.transformOrigin},children:i("div",{className:et("relative w-fit rounded-xs px-2 py-1 text-xs","bg-tooltip text-tooltip-foreground shadow-md","animate-in fade-in-0 zoom-in-95","top"===t&&"slide-in-from-top-2","bottom"===t&&"slide-in-from-bottom-2","left"===t&&"slide-in-from-left-2","right"===t&&"slide-in-from-right-2",r),children:[e,i("div",{className:et("absolute size-2 rotate-45","top"===t&&"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2","bottom"===t&&"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2","left"===t&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2","right"===t&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),style:{backgroundColor:"inherit"}})]})})}exports.Avatar=ut,exports.AvatarProvider=l,exports.Button=mt,exports.Checkbox=Bt,exports.Combobox=ar,exports.ComboboxProvider=u,exports.Dialog=xr,exports.DialogProvider=b,exports.IconButton=_t,exports.IdProvider=h,exports.Input=kr,exports.Link=Cr,exports.ListItem=zr,exports.Listbox=Vr,exports.ListboxProvider=w,exports.Menu=Zr,exports.MenuProvider=I,exports.Menubar=ho,exports.MenubarMenuContext=N,exports.MenubarMenuProvider=R,exports.MenubarProvider=S,exports.SearchField=ko,exports.SearchFieldProvider=P,exports.SelectableListItem=Io,exports.Separator=Co,exports.Toggle=No,exports.ToggleGroup=Do,exports.ToggleGroupProvider=L,exports.Toolbar=Fo,exports.Tooltip=function({className:r,children:o,value:n,side:a="bottom",asChild:s=!0,delay:l=0}){const[c,d]=t.useState(!1),u=t.useRef(null),f=t.useRef(null),m=t.useRef(),b=null!=n&&""!==n,p=function(e,r,o,n){const[a,i]=t.useState({top:0,left:0,transformOrigin:"",actualSide:r});return t.useEffect(()=>{if(!e||!o.current||!n.current)return;const t=o.current.getBoundingClientRect(),a=n.current.getBoundingClientRect(),s=e=>{let r=0,o=0,n="";switch(e){case"top":r=t.top+window.scrollY-a.height-8,o=t.left+window.scrollX+(t.width-a.width)/2,n="bottom center";break;case"bottom":r=t.bottom+window.scrollY+8,o=t.left+window.scrollX+(t.width-a.width)/2,n="top center";break;case"left":r=t.top+window.scrollY+(t.height-a.height)/2,o=t.left+window.scrollX-a.width-8,n="center right";break;case"right":r=t.top+window.scrollY+(t.height-a.height)/2,o=t.right+window.scrollX+8,n="center left"}return{top:r,left:o,transformOrigin:n,actualSide:e}},l=({top:e,left:t})=>{const r=window.scrollY+8,o=window.scrollY+window.innerHeight-a.height-8,n=window.scrollX+8,i=window.scrollX+window.innerWidth-a.width-8;return e>=r&&e<=o&&t>=n&&t<=i};let c=s(r);if(!l(c)){const e=s(Go[r]);l(e)&&(c=e)}i(c)},[e,r]),a}(c&&b,a,u,f);t.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const g=t.useCallback(()=>{b&&(m.current&&clearTimeout(m.current),l>0?m.current=window.setTimeout(()=>d(!0),l):d(!0))},[l,b]),h=t.useCallback(()=>{m.current&&clearTimeout(m.current),d(!1)},[]),v=t.useCallback(()=>{b&&d(!0)},[b]),x=t.useCallback(()=>d(!1),[]);return i(e.Fragment,{children:[i($o,{asChild:s,triggerRef:u,isOpen:c,onMouseEnter:g,onMouseLeave:h,onFocus:v,onBlur:x,children:o}),c&&b&&t.createPortal(i(Wo,{actualSide:p.actualSide,className:r,position:p,tooltipRef:f,children:n}),document.body)]})},exports.cn=et,exports.generateAriaId=V,exports.generateAriaIds=function(e,t){return t.reduce((t,r)=>(t[r]=V(e,r),t),{})},exports.generateItemId=j,exports.getActiveDescendantId=function(e,t,r){if(r)return j(e,t,r)},exports.setRef=tt,exports.unwrap=ot,exports.useActiveItemFocus=bt,exports.useAvatar=c,exports.useClickOutside=pt,exports.useCombobox=f,exports.useComposedRefs=rt,exports.useControlledState=gt,exports.useControlledStateWithNull=ht,exports.useDialog=p,exports.useFloatingPosition=vt,exports.useItemRegistry=xt,exports.useKeyboardNavigation=wt,exports.useListbox=y,exports.useMenu=C,exports.useMenubar=E,exports.useMenubarMenu=M,exports.useMenubarMenuOptional=function(){return t.useContext(N)},exports.useMenubarOptional=()=>t.useContext(D),exports.usePrefixedId=v,exports.useRovingTabIndex=yt,exports.useScrollActiveIntoView=kt,exports.useScrollLock=It,exports.useSearchField=A,exports.useSyncValue=Ct,exports.useToggleGroup=T,exports.useToolbar=Oo,exports.useToolbarOptional=function(){return t.useContext(Ao)};
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("preact"),t=require("react"),r=require("@radix-ui/react-slot"),o=require("focus-trap-react"),n=require("react-dom");var a=0;function i(t,r,o,n,i,s){r||(r={});var l,c,d=r;if("ref"in d)for(c in d={},r)"ref"==c?l=r[c]:d[c]=r[c];var u={type:t,props:d,key:o,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--a,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof t&&(l=t.defaultProps))for(c in l)void 0===d[c]&&(d[c]=l[c]);return e.options.vnode&&e.options.vnode(u),u}const s=t.createContext(void 0),l=({value:e,children:t})=>i(s.Provider,{value:e,children:t});l.displayName="AvatarProvider";const c=()=>{const e=t.useContext(s);if(!e)throw new Error("useAvatar must be used within an Avatar");return e},d=t.createContext(void 0),u=({value:e,children:t})=>i(d.Provider,{value:e,children:t});u.displayName="ComboboxProvider";const f=()=>{const e=t.useContext(d);if(!e)throw new Error("useCombobox must be used within a ComboboxProvider");return e},m=t.createContext(void 0),b=({value:e,children:t})=>i(m.Provider,{value:e,children:t});b.displayName="DialogProvider";const p=()=>{const e=t.useContext(m);if(!e)throw new Error("useDialog must be used within a DialogProvider");return e},h=t.createContext(void 0),g=({children:e,prefix:t})=>i(h.Provider,{value:{prefix:t},children:e});g.displayName="IdProvider";const v=(e,r)=>{const o=t.useId(),n=e??o,a=t.useContext(h);return[a?.prefix,r,n].filter(Boolean).join("-")},x=t.createContext(void 0),w=({value:e,children:t})=>i(x.Provider,{value:e,children:t});w.displayName="ListboxProvider";const y=()=>{const e=t.useContext(x);if(!e)throw new Error("useListbox must be used within a Listbox");return e},k=t.createContext(void 0),I=({value:e,children:t})=>i(k.Provider,{value:e,children:t}),C=()=>{const e=t.useContext(k);if(!e)throw new Error("useMenu must be used within a MenuProvider");return e},N=t.createContext(void 0),R=N.Provider;function M(){const e=t.useContext(N);if(!e)throw new Error("useMenubarMenu must be used within a Menubar.Menu component");return e}const S=t.createContext(void 0),D=({value:e,children:t})=>i(S.Provider,{value:e,children:t});D.displayName="MenubarProvider";const E=()=>{const e=t.useContext(S);if(!e)throw new Error("useMenubar must be used within a MenubarProvider");return e},P=t.createContext(void 0),z=({value:e,children:t})=>i(P.Provider,{value:e,children:t});z.displayName="SearchFieldProvider";const A=()=>{const e=t.useContext(P);if(!e)throw new Error("useSearchField must be used within a SearchFieldProvider");return e},O=t.createContext(void 0),L=({value:e,children:t})=>i(O.Provider,{value:e,children:t}),T=()=>{const e=t.useContext(O);if(!e)throw new Error("useToggleGroup must be used within a ToggleGroupProvider");return e},V=t.createContext(void 0),j=({value:e,children:t})=>i(V.Provider,{value:e,children:t}),F=()=>{const e=t.useContext(V);if(!e)throw new Error("useTreeList must be used within a TreeListProvider");return e};function $(e,t){return`${e}-${t}`}function G(e,t,r){return`${e}-${t}-item-${r}`}function B(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=B(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function W(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=B(e))&&(o&&(o+=" "),o+=t);return o}const K=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),_="-",q=[],H=e=>{const t=Y(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return X(e);const r=e.split(_),o=""===r[0]&&r.length>1?1:0;return U(r,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=o[e],n=r[e];return t?n?((e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r})(n,t):t:n||q}return r[e]||q}}},U=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const o=e[t],n=r.nextPart.get(o);if(n){const r=U(e,t+1,n);if(r)return r}const a=r.validators;if(null===a)return;const i=0===t?e.join(_):e.slice(t).join(_),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(i))return e.classGroupId}},X=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?"arbitrary.."+o:void 0})(),Y=e=>{const{theme:t,classGroups:r}=e;return Z(r,t)},Z=(e,t)=>{const r=K();for(const o in e){const n=e[o];J(n,r,o,t)}return r},J=(e,t,r,o)=>{const n=e.length;for(let a=0;a<n;a++){const n=e[a];Q(n,t,r,o)}},Q=(e,t,r,o)=>{"string"!=typeof e?"function"!=typeof e?re(e,t,r,o):te(e,t,r,o):ee(e,t,r)},ee=(e,t,r)=>{(""===e?t:oe(t,e)).classGroupId=r},te=(e,t,r,o)=>{ne(e)?J(e(o),t,r,o):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},re=(e,t,r,o)=>{const n=Object.entries(e),a=n.length;for(let i=0;i<a;i++){const[e,a]=n[i];J(a,oe(t,e),r,o)}},oe=(e,t)=>{let r=e;const o=t.split(_),n=o.length;for(let a=0;a<n;a++){const e=o[a];let t=r.nextPart.get(e);t||(t=K(),r.nextPart.set(e,t)),r=t}return r},ne=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,ae=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const n=(n,a)=>{r[n]=a,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=o[e])?(n(e,t),t):void 0},set(e,t){e in r?r[e]=t:n(e,t)}}},ie=[],se=(e,t,r,o,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:n}),le=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=e=>{const t=[];let r,o=0,n=0,a=0;const i=e.length;for(let d=0;d<i;d++){const i=e[d];if(0===o&&0===n){if(":"===i){t.push(e.slice(a,d)),a=d+1;continue}if("/"===i){r=d;continue}}"["===i?o++:"]"===i?o--:"("===i?n++:")"===i&&n--}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 se(t,c,l,r&&r>a?r-a:void 0)};if(t){const e=t+":",r=o;o=t=>t.startsWith(e)?r(t.slice(e.length)):se(ie,!1,t,void 0,!0)}if(r){const e=o;o=t=>r({className:t,parseClassName:e})}return o},ce=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let o=[];for(let n=0;n<e.length;n++){const a=e[n],i="["===a[0],s=t.has(a);i||s?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},de=/\s+/,ue=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=ue(e[o]))&&(r&&(r+=" "),r+=t);return r},fe=[],me=e=>{const t=t=>t[e]||fe;return t.isThemeGetter=!0,t},be=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,he=/^\d+\/\d+$/,ge=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ve=/\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$/,xe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,we=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ke=e=>he.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Ce=e=>!!e&&Number.isInteger(Number(e)),Ne=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),Re=e=>ge.test(e),Me=()=>!0,Se=e=>ve.test(e)&&!xe.test(e),De=()=>!1,Ee=e=>we.test(e),Pe=e=>ye.test(e),ze=e=>!Oe(e)&&!$e(e),Ae=e=>He(e,Ze,De),Oe=e=>be.test(e),Le=e=>He(e,Je,Se),Te=e=>He(e,Qe,Ie),Ve=e=>He(e,Xe,De),je=e=>He(e,Ye,Pe),Fe=e=>He(e,tt,Ee),$e=e=>pe.test(e),Ge=e=>Ue(e,Je),Be=e=>Ue(e,et),We=e=>Ue(e,Xe),Ke=e=>Ue(e,Ze),_e=e=>Ue(e,Ye),qe=e=>Ue(e,tt,!0),He=(e,t,r)=>{const o=be.exec(e);return!!o&&(o[1]?t(o[1]):r(o[2]))},Ue=(e,t,r=!1)=>{const o=pe.exec(e);return!!o&&(o[1]?t(o[1]):r)},Xe=e=>"position"===e||"percentage"===e,Ye=e=>"image"===e||"url"===e,Ze=e=>"length"===e||"size"===e||"bg-size"===e,Je=e=>"length"===e,Qe=e=>"number"===e,et=e=>"family-name"===e,tt=e=>"shadow"===e,rt=((e,...t)=>{let r,o,n,a;const i=e=>{const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:a}=t,i=[],s=e.trim().split(de);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:m}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let b=!!m,p=o(b?f.substring(0,m):f);if(!p){if(!b){l=e+(l.length>0?" "+l:l);continue}if(p=o(f),!p){l=e+(l.length>0?" "+l:l);continue}b=!1}const h=0===d.length?"":1===d.length?d[0]:a(d).join(":"),g=u?h+"!":h,v=g+p;if(i.indexOf(v)>-1)continue;i.push(v);const x=n(p,b);for(let r=0;r<x.length;++r){const e=x[r];i.push(g+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return n(e,a),a};return a=s=>{const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:ae(e.cacheSize),parseClassName:le(e),sortModifiers:ce(e),...H(e)}))(l),o=r.cache.get,n=r.cache.set,a=i,i(s)},(...e)=>a(((...e)=>{let t,r,o=0,n="";for(;o<e.length;)(t=e[o++])&&(r=ue(t))&&(n&&(n+=" "),n+=r);return n})(...e))})(()=>{const e=me("color"),t=me("font"),r=me("text"),o=me("font-weight"),n=me("tracking"),a=me("leading"),i=me("breakpoint"),s=me("container"),l=me("spacing"),c=me("radius"),d=me("shadow"),u=me("inset-shadow"),f=me("text-shadow"),m=me("drop-shadow"),b=me("blur"),p=me("perspective"),h=me("aspect"),g=me("ease"),v=me("animate"),x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",$e,Oe],w=()=>[$e,Oe,l],y=()=>[ke,"full","auto",...w()],k=()=>[Ce,"none","subgrid",$e,Oe],I=()=>["auto",{span:["full",Ce,$e,Oe]},Ce,$e,Oe],C=()=>[Ce,"auto",$e,Oe],N=()=>["auto","min","max","fr",$e,Oe],R=()=>["auto",...w()],M=()=>[ke,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],S=()=>[e,$e,Oe],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",We,Ve,{position:[$e,Oe]}],E=()=>["auto","cover","contain",Ke,Ae,{size:[$e,Oe]}],P=()=>[Ne,Ge,Le],z=()=>["","none","full",c,$e,Oe],A=()=>["",Ie,Ge,Le],O=()=>[Ie,Ne,We,Ve],L=()=>["","none",b,$e,Oe],T=()=>["none",Ie,$e,Oe],V=()=>["none",Ie,$e,Oe],j=()=>[Ie,$e,Oe],F=()=>[ke,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Re],breakpoint:[Re],color:[Me],container:[Re],"drop-shadow":[Re],ease:["in","out","in-out"],font:[ze],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Re],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Re],shadow:[Re],spacing:["px",Ie],text:[Re],"text-shadow":[Re],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ke,Oe,$e,h]}],container:["container"],columns:[{columns:[Ie,Oe,$e,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:x()}],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:y()}],"inset-x":[{"inset-x":y()}],"inset-y":[{"inset-y":y()}],start:[{start:y()}],end:[{end:y()}],top:[{top:y()}],right:[{right:y()}],bottom:[{bottom:y()}],left:[{left:y()}],visibility:["visible","invisible","collapse"],z:[{z:[Ce,"auto",$e,Oe]}],basis:[{basis:[ke,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,ke,"auto","initial","none",Oe]}],grow:[{grow:["",Ie,$e,Oe]}],shrink:[{shrink:["",Ie,$e,Oe]}],order:[{order:[Ce,"first","last","none",$e,Oe]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],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:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],w:[{w:[s,"screen",...M()]}],"min-w":[{"min-w":[s,"screen","none",...M()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",r,Ge,Le]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,$e,Te]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ne,Oe]}],"font-family":[{font:[Be,Oe,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:[n,$e,Oe]}],"line-clamp":[{"line-clamp":[Ie,"none",$e,Te]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",$e,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",$e,Le]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[Ie,"auto",$e,Oe]}],"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",$e,Oe]}],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",$e,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ce,$e,Oe],radial:["",$e,Oe],conic:[Ce,$e,Oe]},_e,je]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"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:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,$e,Oe]}],"outline-w":[{outline:["",Ie,Ge,Le]}],"outline-color":[{outline:S()}],shadow:[{shadow:["","none",d,qe,Fe]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":["none",u,qe,Fe]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[Ie,Le]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":["none",f,qe,Fe]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[Ie,$e,Oe]}],"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":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[$e,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"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":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Oe]}],filter:[{filter:["","none",$e,Oe]}],blur:[{blur:L()}],brightness:[{brightness:[Ie,$e,Oe]}],contrast:[{contrast:[Ie,$e,Oe]}],"drop-shadow":[{"drop-shadow":["","none",m,qe,Fe]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:["",Ie,$e,Oe]}],"hue-rotate":[{"hue-rotate":[Ie,$e,Oe]}],invert:[{invert:["",Ie,$e,Oe]}],saturate:[{saturate:[Ie,$e,Oe]}],sepia:[{sepia:["",Ie,$e,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Oe]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,$e,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,$e,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,$e,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,$e,Oe]}],"backdrop-invert":[{"backdrop-invert":["",Ie,$e,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,$e,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,$e,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,$e,Oe]}],"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",$e,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",$e,Oe]}],ease:[{ease:["linear","initial",g,$e,Oe]}],delay:[{delay:[Ie,$e,Oe]}],animate:[{animate:["none",v,$e,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,$e,Oe]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:T()}],"rotate-x":[{"rotate-x":T()}],"rotate-y":[{"rotate-y":T()}],"rotate-z":[{"rotate-z":T()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[$e,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"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:S()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:S()}],"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",$e,Oe]}],"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",$e,Oe]}],fill:[{fill:["none",...S()]}],"stroke-w":[{stroke:[Ie,Ge,Le,Te]}],stroke:[{stroke:["none",...S()]}],"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 ot(...e){return rt(W(e))}function nt(e,t){if(e)if("function"==typeof e)e(t);else try{e.current=t}catch{}}function at(...e){return t.useCallback(t=>{e.forEach(e=>nt(e,t))},e)}function it(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 st=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,lt=W,ct=(e,t)=>r=>{var o;if(null==(null==t?void 0:t.variants))return lt(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:n,defaultVariants:a}=t,i=Object.keys(n).map(e=>{const t=null==r?void 0:r[e],o=null==a?void 0:a[e];if(null===t)return null;const i=st(t)||st(o);return n[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,o]=t;return void 0===o||(e[r]=o),e},{}),l=null==t||null===(o=t.compoundVariants)||void 0===o?void 0:o.reduce((e,t)=>{let{class:r,className:o,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,o]:e},[]);return lt(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},dt=ct("relative flex shrink-0 overflow-hidden",{variants:{size:{sm:"w-6 h-6 text-xs",md:"w-8 h-8 text-sm",lg:"w-12 h-12 text-base"},shape:{circle:"rounded-full",square:"rounded-md"}},defaultVariants:{size:"md",shape:"circle"}}),ut=t.forwardRef(({children:e,className:r,size:o,shape:n,...a},s)=>{const[c,d]=t.useState("idle"),u=t.useCallback(e=>{d(e)},[]),f=t.useMemo(()=>({imageLoadingStatus:c,onImageLoadingStatusChange:u}),[c,u]);return i(l,{value:f,children:i("span",{ref:s,className:ot(dt({size:o,shape:n}),r),...a,children:e})})});ut.displayName="AvatarRoot";const ft=t.forwardRef(({src:e,alt:r,className:o,onLoadingStatusChange:n,...a},s)=>{const{imageLoadingStatus:l,onImageLoadingStatusChange:d}=c(),[u,f]=t.useState(!1);return t.useEffect(()=>{if(f(!1),!e)return;d("loading"),n?.("loading");const t=new Image,r=()=>{d("loaded"),n?.("loaded")},o=()=>{f(!0),d("error"),n?.("error")};return t.addEventListener("load",r),t.addEventListener("error",o),t.src=e,()=>{t.removeEventListener("load",r),t.removeEventListener("error",o)}},[e,d,n]),!e||u||"error"===l?null:i("img",{ref:s,src:e,alt:r,className:ot("aspect-square h-full w-full object-cover",o),...a})});ft.displayName="AvatarImage";const mt=t.forwardRef(({children:e,className:r,delayMs:o=0,...n},a)=>{const{imageLoadingStatus:s}=c(),[l,d]=t.useState(0===o);t.useEffect(()=>{if(0===o)return;const e=setTimeout(()=>{d(!0)},o);return()=>{clearTimeout(e)}},[o]);return l&&("idle"===s||"error"===s)?i("span",{ref:a,className:ot("flex h-full w-full items-center justify-center","bg-surface-secondary text-alt font-medium uppercase cursor-default",r),...n,children:e}):null});mt.displayName="AvatarFallback";const bt=Object.assign(ut,{Root:ut,Image:ft,Fallback:mt}),pt=ct(["inline-flex items-center justify-center","text-main font-semibold","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","active:bg-btn-active active:text-alt data-[active=true]:bg-btn-active data-[active=true]:text-alt","disabled:select-none disabled:pointer-events-none disabled:opacity-30","overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer"],{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:"bg-btn-primary hover:bg-btn-primary-hover border border-bdr-strong"},size:{sm:"h-9 px-3.5 gap-2 text-sm",md:"h-10 px-3.5 gap-2.5 text-base",lg:"h-11.5 px-4 gap-3 text-lg"}},defaultVariants:{variant:"text",size:"md"}}),ht=t.forwardRef(({className:e,variant:t="text",size:r="md",iconSize:o,iconStrokeWidth:n=1.5,startIcon:a,label:s,endIcon:l,title:c,children:d,disabled:u,...f},m)=>{const b=a,p=l,h=o??(e=>{switch(e){case"sm":return 14;case"md":return 20;case"lg":return 24}})(r??"md");return i("button",{ref:m,type:"button",className:ot(pt({variant:t,size:r}),e),title:c,"aria-label":c??s,"aria-disabled":u,"data-disabled":u?"":void 0,disabled:u,...f,children:[b&&i(b,{size:h,strokeWidth:n}),d,s,p&&i(p,{size:h,strokeWidth:n})]})});function gt({ref:e,isActive:r,disabled:o,focusMode:n="roving-tabindex",checkFocusWithin:a}){t.useEffect(()=>{if(e?.current&&"activedescendant"!==n&&!o&&r&&document.activeElement!==e.current){if(a?.enabled){const t=e.current.closest(`[role="${a.containerRole}"]`),r=t?.contains(document.activeElement);if(!r)return}"function"==typeof e.current.focus&&e.current.focus()}},[r,o,n,a,e])}function vt({enabled:e,contentRef:r,excludeRefs:o=[],onPointerDownOutside:n,onInteractOutside:a,onClose:i}){const s=t.useCallback(e=>{const t=e.target;if(t instanceof Node&&!r.current?.contains(t)){for(const e of o)if(e?.current?.contains(t))return;n?.(e),a?.(e),e.defaultPrevented||i?.()}},[r,o,n,a,i]);t.useEffect(()=>{if(e)return document.addEventListener("pointerdown",s),()=>{document.removeEventListener("pointerdown",s)}},[e,s])}function xt(e,r,o){const[n,a]=t.useState(r),i=void 0!==e;return[i?e:n,t.useCallback(e=>{i||a(e),o?.(e)},[i,o])]}function wt(e,r,o){const n=null===e?void 0:e,a=t.useCallback(e=>{o?.(e??null)},[o]),[i,s]=xt(n,r,a);return[i,t.useCallback(e=>{s(e??void 0)},[s])]}ht.displayName="Button";function yt({enabled:e,triggerRef:r,contentRef:o,align:n="start"}){const[a,i]=t.useState(null);return t.useEffect(()=>{if(!e||!r?.current||!o?.current)return;const t=()=>{if(!r.current||!o.current)return;const e=r.current.getBoundingClientRect(),t=o.current.getBoundingClientRect(),a=window.innerWidth,s=window.innerHeight;let l,c,d=e.bottom;if(d+t.height>s-10){const r=e.top-t.height;r>=10&&(d=r)}"start"===n?(l=e.left,l+t.width>a-10&&(l=void 0,c=a-e.right)):(c=a-e.right,e.right-t.width<10&&(c=void 0,l=e.left)),i({top:d,left:l,right:c})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e,n,r]),a}function kt(){const e=t.useRef(new Map);return{registerItem:t.useCallback((t,r=!1)=>{e.current.set(t,{disabled:r})},[]),unregisterItem:t.useCallback(t=>{e.current.delete(t)},[]),getItems:t.useCallback(()=>Array.from(e.current.keys()),[]),isItemDisabled:t.useCallback(t=>e.current.get(t)?.disabled??!1,[])}}function It(e){const{getItems:r,isItemDisabled:o,active:n,setActive:a,loop:i=!1,orientation:s="vertical",onSelect:l,onEscape:c}=e,d=t.useCallback(e=>{const t=r();if(!t.length)return;const s=n?t.indexOf(n):-1;let l,c=0;const d=t.length;for(l=-1===s?e>0?0:t.length-1:s+e;c<d;){if(i)l<0?l=t.length-1:l>=t.length&&(l=0);else if(l<0||l>=t.length)return;if(!o(t[l]))return void a(t[l]);l+=e,c++}},[r,n,a,i,o]),u=t.useCallback(e=>{const t=r();if(!t.length)return;const i="vertical"===s,u=i?"ArrowDown":"ArrowRight",f=i?"ArrowUp":"ArrowLeft";switch(e.key){case u:e.preventDefault(),d(1);break;case f:e.preventDefault(),d(-1);break;case"Home":e.preventDefault();{const e=t.find(e=>!o(e));e&&a(e)}break;case"End":e.preventDefault();{const e=[...t].reverse().find(e=>!o(e));e&&a(e)}break;case"Enter":case" ":e.preventDefault(),n&&!o(n)&&l?.(n);break;case"Escape":e.preventDefault(),c?.()}},[r,n,d,a,o,s,l,c]);return{moveActive:d,handleKeyDown:u}}function Ct({id:e,active:r,disabled:o,getItems:n,isItemDisabled:a,focusMode:i="roving-tabindex"}){return t.useMemo(()=>{if("activedescendant"===i)return{isFocusable:!1,tabIndex:-1};if(o)return{isFocusable:!1,tabIndex:-1};const t=n(),s=t.length>0?t[0]:void 0,l=(r??t.find(e=>!a(e))??s??e)===e;return{isFocusable:l,tabIndex:l?0:-1}},[e,r,o,n,a,i])}function Nt({containerRef:e,activeId:r,orientation:o="vertical",buildElementId:n}){t.useEffect(()=>{if(!r||!e?.current)return;const t=n?n(r):r,a=e.current.querySelector(`#${t}`);a&&a.scrollIntoView({block:"nearest",inline:"horizontal"===o?"nearest":void 0,behavior:"auto"})},[r,e,o,n])}const Rt=(e,r)=>{t.useEffect(()=>{if(!e)return;const t=r??document.body,o=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=o}},[e,r])},Mt=(e,r)=>{t.useEffect(()=>{const t=it(e);t&&r(t)},[e,r])},St=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Dt=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Et=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var Pt={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 zt=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:s,...l},c)=>t.createElement("svg",{ref:c,...Pt,width:r,height:r,stroke:e,strokeWidth:n?24*Number(o)/Number(r):o,className:Dt("lucide",a),...!i&&!Et(l)&&{"aria-hidden":"true"},...l},[...s.map(([e,r])=>t.createElement(e,r)),...Array.isArray(i)?i:[i]])),At=(e,r)=>{const o=t.forwardRef(({className:o,...n},a)=>{return t.createElement(zt,{ref:a,iconNode:r,className:Dt(`lucide-${i=St(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...n});var i});return o.displayName=St(e),o},Ot=At("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Lt=At("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Tt=At("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Vt=At("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),jt=At("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),Ft=At("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),$t=At("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"}]]),Gt=At("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Bt=At("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"}]]),Wt=At("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Kt=At("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{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 2z",key:"1fd625"}]]),_t=At("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),qt=At("square-check",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Ht=At("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Ut=At("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Xt=ct(["inline-block","flex-shrink-0 flex items-center justify-center","h-3.5 w-3.5","border-[1.5px] rounded-xs","bg-transparent","transition-highlight"],{variants:{editable:{true:[],false:"opacity-30"},state:{default:["border-main","peer-checked:bg-main peer-checked:border-main","peer-indeterminate:bg-main peer-indeterminate:border-main","group-data-[tone=inverse]:border-alt","group-data-[tone=inverse]:peer-checked:bg-alt","group-data-[tone=inverse]:peer-checked:border-alt","group-data-[tone=inverse]:peer-indeterminate:bg-alt","group-data-[tone=inverse]:peer-indeterminate:border-alt"],error:["border-error","peer-checked:bg-error peer-checked:border-error","peer-indeterminate:bg-error peer-indeterminate:border-error"]}},defaultVariants:{state:"default",editable:!0}}),Yt=t.forwardRef(({id:e,className:t,name:r,label:o,defaultChecked:n=!1,checked:a,align:s="left",error:l,disabled:c,readOnly:d,required:u,value:f="on",onCheckedChange:m,errorMessage:b,...p},h)=>{const g=v(it(e)),x=l?"error":"default",w=!c&&!d,[y,k]=xt(a,n,m),I="indeterminate"===y,C=!0===y;return i("div",{className:"flex flex-col gap-1 w-fit",children:[i("label",{htmlFor:g,className:ot("relative flex items-center select-none gap-2 my-0.75 rounded-xs leading-4 transition-highlight","right"===s&&"flex-row-reverse justify-end",w&&["cursor-pointer","focus-within:outline-none focus-within:ring-3 focus-within:ring-ring focus-within:ring-offset-3 focus-within:ring-offset-ring-offset"],l&&w&&"focus-within:ring-error",t),children:[i("input",{ref:e=>{"function"==typeof h?h(e):h&&(h.current=e),e&&(e.indeterminate=I)},...p,id:g,type:"checkbox",className:"peer sr-only",checked:C,disabled:d??c,required:u,name:r,value:f,"aria-checked":I?"mixed":C,"aria-disabled":c,"aria-invalid":l,"aria-readonly":d,"data-state":I?"indeterminate":C?"checked":"unchecked","data-disabled":c?"":void 0,onChange:e=>{if(!w)return;let t;t=!I&&e.currentTarget.checked,k(t)}}),i("span",{className:ot(Xt({state:x,editable:w})),"aria-hidden":"true",children:I?i(Wt,{size:10,className:ot("text-rev",!l&&"group-data-[tone=inverse]:text-alt-rev"),strokeWidth:4}):C?i(Lt,{size:10,className:ot("text-rev",!l&&"group-data-[tone=inverse]:text-alt-rev"),strokeWidth:4}):null}),o&&i("span",{className:ot("text-main group-data-[tone=inverse]:text-alt",c&&"opacity-30"),children:o})]}),"error"===x&&b&&i("div",{className:ot("flex items-center gap-2 text-error leading-5",c&&"opacity-30"),children:[i(Kt,{size:14,strokeWidth:2.5}),b]})]})});Yt.displayName="Checkbox";const Zt=ct(["p-0"],{variants:{size:{sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11.5 w-11.5"},shape:{square:"rounded-sm",round:"rounded-full"}},defaultVariants:{size:"md",shape:"square"}}),Jt=t.forwardRef(({className:e,variant:t="text",size:r="md",shape:o="square",icon:n,...a},s)=>i(ht,{ref:s,className:ot(Zt({size:r,shape:o}),e),variant:t,size:r,startIcon:n,label:"",...a}));function Qt(e,t,r="any"){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const o="any"===r?[...e].sort():e,n="any"===r?[...t].sort():t;for(let a=0;a<o.length;a+=1)if(o[a]!==n[a])return!1;return!0}Jt.displayName="IconButton";const er=[],tr=e=>t=>Qt(t,e)?t:e,rr=({children:e,open:r,defaultOpen:o=!1,onOpenChange:n,closeOnBlur:a=!0,value:s,defaultValue:l="",onChange:c,disabled:d=!1,error:f=!1,selectionMode:m="single",selection:b,defaultSelection:p=er,onSelectionChange:h,active:g,defaultActive:x,setActive:w})=>{const y=v(),[k,I]=xt(r,o,n),[C,N]=xt(s,l,c),R="single"!==m,M="staged"===m,[S,D]=t.useState(()=>new Set(p)),E=void 0!==b,P=t.useMemo(()=>E?new Set(b):S,[E,b,S]),z=t.useMemo(()=>Array.from(P),[P]),[A,O]=t.useState(z);t.useEffect(()=>{O(M?tr(z):z)},[z,M]);const L=M?A:z,T=t.useMemo(()=>new Set(L),[L]),V=t.useMemo(()=>M&&!Qt(A,z),[M,A,z]),j=t.useCallback(()=>{M&&O(tr(z))},[M,z]),[F,$]=wt(g,x,w),{registerItem:G,unregisterItem:B,getItems:W,isItemDisabled:K}=kt(),_=t.useCallback(e=>{N(e),I(!0)},[N,I]),q=t.useCallback(e=>{I(e),e||j()},[I,j]),H=t.useCallback(e=>{const t=new Set(e);E||D(t),h?.(e),"single"===m&&I(!1)},[E,h,m,I]),U=t.useCallback(e=>{M?O(e):H(e)},[M,H]),X=t.useCallback(()=>{M&&(Qt(A,z)||H(A),I(!1))},[M,A,z,H,I]),{handleKeyDown:Y}=It({getItems:W,isItemDisabled:K,active:F,setActive:$,loop:!1,orientation:"vertical",onSelect:e=>{let t;t=R?L.includes(e)?L.filter(t=>t!==e):[...L,e]:[e],U(t)}}),Z=t.useCallback(e=>{if(!d){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key||k||(e.preventDefault(),I(!0)),"Escape"===e.key)return e.preventDefault(),void q(!1);Y(e)}},[d,k,I,q,Y]);t.useEffect(()=>{if(k&&void 0===F){const e=W();e.length>0&&$(e[0])}},[k,F,W,$]);const J=t.useMemo(()=>({open:k,setOpen:q,inputValue:C,setInputValue:_,baseId:y,active:F,disabled:d,error:f,closeOnBlur:a,keyHandler:Z,selection:T,appliedSelection:z,stagedSelection:A,stagingEnabled:M,hasStagedChanges:V,applyStagedSelection:X,resetStagedSelection:j}),[k,q,a,Z,C,_,F,y,d,f,T,z,A,M,V,X,j]);return i(u,{value:J,children:i(Kr.Root,{selectionMode:R?"multiple":"single",selection:L,onSelectionChange:U,disabled:d,active:F,focusMode:"activedescendant",baseId:y,setActive:$,keyHandler:Z,registerItem:G,unregisterItem:B,getItems:W,isItemDisabled:K,children:e})})};rr.displayName="Combobox.Root";const or=t.forwardRef(({className:e,children:r,...o},n)=>{const a=t.useRef(null),{setOpen:s,closeOnBlur:l}=f(),c=l?t.useCallback(e=>{const{relatedTarget:t}=e;t instanceof Node&&a.current?.contains(t)||s(!1)},[s]):void 0;return i("div",{ref:at(n,a),className:e,onBlur:c,...o,children:r})});or.displayName="Combobox.Content";const nr=ct(["flex gap-2.5 items-center","h-12 rounded-sm border bg-surface-neutral","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"],{variants:{error:{true:"border-error focus-within:border-error focus-within:ring-error",false:"border-bdr-subtle focus-within:border-bdr-strong"},open:{true:"border-bdr-strong",false:null},disabled:{true:"pointer-events-none select-none opacity-30",false:null}},defaultVariants:{error:!1,open:!1,disabled:!1}}),ar=({className:e,children:t,...r})=>{const{open:o,disabled:n,error:a}=f();return i("div",{className:ot(nr({error:a,open:o,disabled:n}),e),"data-open":o?"true":void 0,...r,children:t})};ar.displayName="Combobox.Control";const ir=t.forwardRef((e,r)=>{const o=t.useRef(null),{open:n,keyHandler:a,baseId:s,active:l,disabled:c,error:d}=f();return t.useEffect(()=>{n&&!c&&o.current?.focus()},[n,c]),i(Do.Input,{ref:at(r,o),id:`${s}-input`,onKeyDown:a,"aria-disabled":c,"aria-invalid":d??void 0,role:"combobox","aria-autocomplete":"list","aria-expanded":n,"aria-haspopup":"listbox","aria-controls":`${s}-listbox`,"aria-activedescendant":l?`${s}-listbox-option-${l}`:void 0,...e})});ir.displayName="Combobox.Input";const sr=({children:e,className:t,...r})=>{const{inputValue:o,setInputValue:n}=f();return i(Do.Root,{value:o,onChange:n,className:ot("w-full pr-0","border-0 focus-within:border-0 focus-within:ring-0",t),...r,children:e})};sr.displayName="Combobox.Search";const lr=({className:e,...t})=>i(Do.Icon,{className:e,...t});lr.displayName="Combobox.SearchIcon";const cr=({className:e,...t})=>{const{open:r,setOpen:o,disabled:n}=f();return i(Jt,{type:"button",variant:"text",size:"lg",icon:Tt,"aria-label":"Toggle",onClick:()=>{n||o(!r)},disabled:n,tabIndex:-1,className:ot("shrink-0 text-subtle transition-transform hover:bg-surface-neutral-hover",r&&"rotate-180",e),...t})};cr.displayName="Combobox.Toggle";const dr=({className:e,label:t="Apply",...r})=>{const{stagingEnabled:o,hasStagedChanges:n,applyStagedSelection:a}=f();return o&&n?i(ht,{className:ot("h-7 px-2.5 min-w-14 gap-2 text-xs",e),type:"button",label:t,variant:"outline",onClick:a,...r}):null};dr.displayName="Combobox.Apply";const ur=({children:e,className:t,...r})=>{const{open:o}=f();return o?i("div",{className:ot("absolute left-0 right-0 z-50 mt-1 rounded-sm bg-surface-neutral shadow-lg ring-1 ring-bdr-subtle",t),...r,children:e}):null};ur.displayName="Combobox.Popup";const fr=Object.assign(rr,{Root:rr,Content:or,Control:ar,Search:sr,Input:ir,SearchIcon:lr,Toggle:cr,Apply:dr,Popup:ur}),mr=({open:e,defaultOpen:r=!1,onOpenChange:o,children:n})=>{const[a,s]=xt(e,r,o),l=v(),c=v(),[d,u]=t.useState(l),[f,m]=t.useState(c),p=t.useMemo(()=>({open:a,setOpen:s,titleId:d,descriptionId:f,setTitleId:u,setDescriptionId:m}),[a,d,f]);return i(b,{value:p,children:n})};mr.displayName="Dialog.Root";const br=t.forwardRef(({asChild:e,children:t,onClick:o,...n},a)=>{const{setOpen:s}=p();return i(e?r.Slot:"button",{ref:a,type:e?void 0:"button",onClick:e=>{o?.(e),s(!0)},...n,children:t})});br.displayName="Dialog.Trigger";const pr=({children:e,container:r,forceMount:o})=>{const{open:a}=p(),[i,s]=t.useState(!1);return t.useEffect(()=>{s(!0)},[]),i&&(o||a)?n.createPortal(e,r??document.body):null};pr.displayName="Dialog.Portal";const hr=t.forwardRef(({className:e,forceMount:t,...r},o)=>{const{open:n}=p();return t||n?i("div",{ref:o,"data-state":n?"open":"closed",className:ot("fixed inset-0 z-30 bg-overlay backdrop-blur-xs","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}):null});hr.displayName="Dialog.Overlay";const gr=t.forwardRef(({children:e,className:r,forceMount:n,onEscapeKeyDown:a,onPointerDownOutside:s,onInteractOutside:l,onOpenAutoFocus:c,onCloseAutoFocus:d,...u},f)=>{const{open:m,setOpen:b,titleId:h,descriptionId:g}=p(),v=t.useRef(null),x=at(f,v);Rt(m);const w=t.useCallback(e=>{"Escape"===e.key&&(a?.(e),e.defaultPrevented||b(!1))},[a,b]);return t.useEffect(()=>{if(m)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[m,w]),vt({enabled:m,contentRef:v,onPointerDownOutside:s,onInteractOutside:l,onClose:()=>b(!1)}),n||m?i(o.FocusTrap,{active:m,focusTrapOptions:{initialFocus:!1,fallbackFocus:()=>v.current??document.body,escapeDeactivates:!1,clickOutsideDeactivates:!1,returnFocusOnDeactivate:!0,allowOutsideClick:!0,preventScroll:!1,onActivate:()=>{requestAnimationFrame(()=>{const e=new Event("openautofocus",{bubbles:!0,cancelable:!0});c?.(e),!e.defaultPrevented&&v.current&&v.current.focus()})},onDeactivate:()=>{requestAnimationFrame(()=>{const e=new Event("closeautofocus",{bubbles:!0,cancelable:!0});d?.(e)})}},children:i("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-4",children:i("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":h,"aria-describedby":g,"data-state":m?"open":"closed",tabIndex:-1,className:ot("relative rounded-lg shadow-xl bg-surface-neutral","flex flex-col max-w-lg w-full max-h-[90vh] gap-10 p-10","border border-bdr-subtle outline-none overflow-hidden","focus:outline-none focus:ring-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",r),...u,children:e})})}):null});gr.displayName="Dialog.Content";const vr=t.forwardRef(({className:e,children:t,...r},o)=>i("header",{ref:o,className:ot("relative grid gap-2.5 self-stretch",e),...r,children:t}));vr.displayName="Dialog.Header";const xr=t.forwardRef(({children:e,asChild:o,onClick:n,...a},s)=>{const{setOpen:l}=p(),c=t.useCallback(e=>{n?.(e),e.defaultPrevented||l(!1)},[n,l]);return i(o?r.Slot:"button",{ref:s,type:o?void 0:"button",onClick:c,...a,children:e})});xr.displayName="Dialog.Close";const wr=t.forwardRef(({children:e,className:t,asChild:o,id:n,...a},s)=>{const{titleId:l,setTitleId:c}=p(),d=o?r.Slot:"h2";return Mt(n,c),i(d,{ref:s,id:l,className:ot("text-2xl font-semibold",t),...a,children:e})});wr.displayName="Dialog.Title";const yr=t.forwardRef(({id:e,children:t,asChild:o,...n},a)=>{const{descriptionId:s,setDescriptionId:l}=p(),c=o?r.Slot:"p";return Mt(e,l),i(c,{ref:a,id:s,...n,children:t})});yr.displayName="Dialog.Description";const kr=t.forwardRef(({className:e,children:t,...r},o)=>i("div",{ref:o,className:ot("min-h-0 flex-1 overflow-y-auto",e),...r,children:t}));kr.displayName="Dialog.Body";const Ir=t.forwardRef(({className:e,children:t,...r},o)=>i("footer",{ref:o,className:ot("flex justify-end gap-2.5",e),...r,children:t}));Ir.displayName="Dialog.Footer";const Cr=t.forwardRef((e,t)=>i(xr,{asChild:!0,ref:t,...e,children:i(Jt,{"aria-label":"Close","data-area":"close",icon:Ut,size:"lg",iconSize:36,iconStrokeWidth:1,shape:"round",variant:"filled"})}));Cr.displayName="Dialog.DefaultClose";const Nr=t.forwardRef(({title:e,description:t,withClose:r,className:o,children:n,...a},s)=>i(vr,{ref:s,className:ot(r&&"grid-cols-[minmax(0,1fr)_auto]",o),...a,children:[i(wr,{className:ot(r&&"col-start-1 row-start-1 min-w-0"),children:e}),r&&i(Cr,{className:"col-start-2 row-start-1 row-span-2 self-start justify-self-end"}),t&&i(yr,{className:ot(r&&"row-start-2"),children:t}),n]}));Nr.displayName="Dialog.DefaultHeader";const Rr=Object.assign(mr,{Root:mr,Trigger:br,Portal:pr,Overlay:hr,Content:gr,Header:vr,Close:xr,Title:wr,Description:yr,Body:kr,Footer:Ir,DefaultClose:Cr,DefaultHeader:Nr}),Mr=ct(["relative flex rounded-sm overflow-hidden","h-12 border focus-within:border-bdr-solid","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"],{variants:{state:{default:"border-bdr-subtle focus-within:border-bdr-strong",error:"border-error focus-within:border-error focus-within:ring-error"},disabled:{true:"select-none"}},defaultVariants:{state:"default",disabled:!1}}),Sr=({children:e,error:t})=>i("div",{className:ot("flex items-center justify-center shrink-0 min-w-12 px-4","text-sm text-subtle bg-surface-primary","first:rounded-l-sm first:border-r first:border-bdr-subtle","last:rounded-r-sm last:border-l last:border-bdr-subtle",t&&"first:border-error last:border-error"),children:e}),Dr=t.forwardRef(({className:e,label:t,description:r,error:o,startAddon:n,endAddon:a,id:s,disabled:l,readOnly:c,...d},u)=>{const f=v(it(s)),m=o?"error":"default",b="error"===m;return i("div",{className:ot("w-full",l&&"opacity-30",e),children:[(!!t||!!r)&&i("div",{className:"mb-2",children:[t&&i("label",{htmlFor:f,className:"block text-base font-semibold text-main",children:i("div",{className:"flex items-center gap-2",children:[c&&i(Bt,{size:16,strokeWidth:2.5}),t]})}),r&&i("div",{className:"text-sm text-subtle",children:r})]}),i("div",{className:ot(Mr({state:m,disabled:l})),children:[n&&i(Sr,{error:b,children:n}),i("input",{ref:u,id:f,className:ot("flex-1 w-full px-4.5 text-base","text-main bg-surface-neutral placeholder:text-subtle","border-0 focus:outline-none","disabled:select-none enabled:read-only:bg-surface-primary",n&&"rounded-l-none",a&&"rounded-r-none"),disabled:l,readOnly:c,...d}),a&&i(Sr,{error:b,children:a})]}),o&&i("div",{className:"flex items-center gap-2 mt-2 leading-5 text-error",children:[i(Kt,{size:16,strokeWidth:2.5}),o]})]})});function Er(e,t,r=!1){return"function"==typeof e?e:!0===e||void 0===e&&r?t:void 0}Dr.displayName="Input";const Pr=t.forwardRef(({className:e,href:t,external:r="auto",newTab:o,leftIcon:n,rightIcon:a,children:s,rel:l,...c},d)=>{const u="auto"===r?function(e){try{if(e.startsWith("mailto:")||e.startsWith("tel:"))return!0;const t="undefined"!=typeof window?window.location:void 0;return!t||new URL(e,t.origin).origin!==t.origin}catch{return!0}}(t):r,f=o??u?"_blank":void 0,m=Er(n,Ot),b=Er(a,$t,u);return i("a",{ref:d,href:t,className:ot("inline-flex items-center align-baseline gap-1","text-sm font-normal underline underline-offset-3 decoration-1","visited:text-link-visited hover:text-main-hover","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-bdr-strong focus-visible:bg-main focus-visible:text-rev","transition-highlight",e),target:f,rel:o||u?"noopener noreferrer":"noreferrer",...c,children:[m&&i(m,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"}),s,b&&i(b,{className:"inline-block flex-none w-3.5 h-3.5",strokeWidth:1.5,"aria-hidden":"true"})]})});function zr(e,r){return t.Children.toArray(e).find(e=>function(e,r){return t.isValidElement(e)&&e.type===r}(e,r))}Pr.displayName="Link";const Ar=({children:e,className:t,...r})=>i("div",{className:ot("flex items-center gap-2.5 flex-shrink-0",t),...r,children:e}),Or=({className:e,children:t,...r})=>i("div",{className:ot("flex-1 min-w-0",e),...r,children:t});Or.displayName="ListItem.Content";const Lr=({className:e,label:t,description:r,metadata:o,icon:n})=>i(Or,{className:ot(n&&"grid grid-cols-[auto_1fr] gap-2.5 items-center",e),children:[n&&i("div",{className:"flex items-center justify-center flex-shrink-0 group-data-[tone=inverse]:text-alt",children:n}),i("div",{className:"min-w-0 text-left",children:[t&&i("h1",{className:"truncate font-semibold group-data-[tone=inverse]:text-alt",children:t}),r&&i("p",{className:"truncate text-sm text-subtle group-data-[tone=inverse]:text-alt",children:r}),o&&i("p",{className:"text-xs text-subtle group-data-[tone=inverse]:text-alt",children:o})]})]}),Tr=({children:e,className:t,...r})=>i("div",{className:ot("flex items-center gap-5 flex-shrink-0",t),...r,children:e});Tr.displayName="ListItem.Right";const Vr=({children:e,className:t,selected:r,...o})=>{const n=zr(e,Ar),a=zr(e,Or)??zr(e,Lr),s=zr(e,Tr);return i("div",{className:ot("group flex items-center px-2.5 py-1 gap-2.5",r&&"bg-surface-selected text-alt",t),"data-tone":r?"inverse":void 0,role:"listitem",...o,children:[n,a,s]})};Vr.displayName="ListItem";const jr=Object.assign(Vr,{Left:Ar,Content:Or,DefaultContent:Lr,Right:Tr}),Fr=[],$r=({baseId:e,selection:r,defaultSelection:o=Fr,onSelectionChange:n,active:a,defaultActive:s,setActive:l,selectionMode:c="single",focusMode:d="roving-tabindex",disabled:u,children:f,keyHandler:m,registerItem:b,unregisterItem:p,getItems:h,isItemDisabled:g})=>{const x=e??v(),[y,k]=t.useState(()=>new Set(o)),I=void 0!==r,C=t.useMemo(()=>I?new Set(r):y,[I,r,y]),[N,R]=wt(a,s,l),M=kt(),S=b??M.registerItem,D=p??M.unregisterItem,E=h??M.getItems,P=g??M.isItemDisabled;t.useEffect(()=>{if(void 0===N&&!u){const e=E();if(0===e.length)return;const t=e.find(e=>C.has(e)&&!P(e));if(t)return void R(t);const r=e.find(e=>!P(e));r&&R(r)}},[N,u,E,P,C,R]);const z=t.useCallback(e=>{const t=C.has(e),r=new Set(C);"single"===c?(r.clear(),t||r.add(e)):t?r.delete(e):r.add(e),I||k(r),n?.(Array.from(r)),R(e)},[C,c,I,n,R]),A=t.useMemo(()=>({active:N,selection:C,selectionMode:c,focusMode:d,disabled:u,setActive:R,toggleValue:z,baseId:x,keyHandler:m,registerItem:S,unregisterItem:D,getItems:E,isItemDisabled:P}),[N,C,c,d,u,R,z,x,m,S,D,E,P]);return i(w,{value:A,children:f})};$r.displayName="ListboxRoot";const Gr=t.forwardRef(({className:e,label:r,children:o,...n},a)=>{const s=t.useRef(null),{active:l,disabled:c,setActive:d,toggleValue:u,baseId:f,selectionMode:m,keyHandler:b,focusMode:p="roving-tabindex",getItems:h,isItemDisabled:g}=y(),{handleKeyDown:v}=It({getItems:h,isItemDisabled:g,active:l,setActive:d,loop:!1,orientation:"vertical",onSelect:e=>{u(e)}}),x=b??v,w=t.useCallback(()=>{if("activedescendant"===p&&!l&&!c){const e=h().find(e=>!g(e));e&&d(e)}},[p,l,c,d,h,g]),k=t.useCallback(()=>{if("roving-tabindex"===p){const e=s.current?.contains(document.activeElement);e||d(void 0)}},[p,d]);return Nt({containerRef:s,activeId:l??void 0,orientation:"vertical",buildElementId:e=>`${f}-listbox-option-${e}`}),i("div",{ref:at(a,s),id:`${f}-listbox`,className:ot("flex flex-col items-start grow shrink-0 basis-0","max-h-100 overflow-y-auto","outline-none","transition-highlight",c&&"pointer-events-none select-none opacity-30",e),role:"listbox","aria-disabled":c,"aria-label":r,"aria-multiselectable":"multiple"===m||void 0,"aria-activedescendant":"activedescendant"===p&&l?`${f}-listbox-option-${l}`:void 0,tabIndex:"activedescendant"!==p||c?void 0:0,onFocus:"activedescendant"===p?w:void 0,onPointerLeave:"roving-tabindex"===p?k:void 0,onKeyDown:x,...n,children:o})});Gr.displayName="ListboxContent";const Br=ct("group flex w-full items-center px-4.5 py-1 gap-x-2.5 cursor-pointer outline-none transition-highlight",{variants:{selected:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover data-[active=true]:bg-surface-neutral-hover"},disabled:{true:"opacity-30 cursor-not-allowed pointer-events-none",false:""},focusMode:{"roving-tabindex":["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"],activedescendant:""}},defaultVariants:{selected:!1,disabled:!1,focusMode:"roving-tabindex"}}),Wr=({value:e,disabled:r=!1,children:o,className:n,...a})=>{const s=y(),{disabled:l,toggleValue:c,baseId:d,active:u,setActive:f,focusMode:m="roving-tabindex",registerItem:b,unregisterItem:p,getItems:h,isItemDisabled:g}=s,v=s.selection.has(e),x=u===e,w=r||!!l,k=t.useRef(null);t.useEffect(()=>(b(e,w),()=>p(e)),[e,w,b,p]);const{tabIndex:I}=Ct({id:e,active:u,disabled:w,getItems:h,isItemDisabled:g,focusMode:m});gt({ref:k,isActive:x,disabled:w,focusMode:m,checkFocusWithin:{enabled:!0,containerRole:"listbox"}});const C=t.useCallback(()=>{w||c(e)},[w,c,e]),N=t.useCallback(()=>{x||w||f(e)},[x,f,e,w]),R=t.useCallback(()=>{w||f(e)},[w,f,e]);return i("div",{ref:k,id:`${d}-listbox-option-${e}`,className:ot(Br({selected:v,disabled:w,focusMode:m}),n),role:"option","aria-selected":v,"aria-disabled":w||void 0,tabIndex:"roving-tabindex"===m?I:void 0,"data-value":e,"data-active":x||void 0,"data-tone":v?"inverse":void 0,onClick:C,onPointerMove:"roving-tabindex"===m?N:void 0,onFocus:"roving-tabindex"===m?R:void 0,...a,children:o})};Wr.displayName="ListboxItem";const Kr=Object.assign($r,{Root:$r,Content:Gr,Item:Wr}),_r=({open:e,defaultOpen:r=!1,onOpenChange:o,children:n})=>{const a=t.useRef(null),s=v(void 0,"menu-trigger"),l=v(void 0,"menu"),[c,d]=xt(e,r,o),[u,f]=t.useState(void 0),{registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:h}=kt(),g=t.useMemo(()=>({open:c,setOpen:d,active:u,setActive:f,registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:h,triggerId:s,menuId:l,triggerRef:a}),[c,u,m,b,p,h,s,l]),[x,w]=t.useState(!1);return t.useEffect(()=>{c?w(!0):x&&a.current&&a.current.focus()},[c,x,a]),i(I,{value:g,children:n})};_r.displayName="Menu.Root";const qr=t.forwardRef(({asChild:e,onClick:t,onKeyDown:o,className:n,children:a,...s},l)=>{const{open:c,setOpen:d,triggerId:u,menuId:f,triggerRef:m}=C();return i(e?r.Slot:"button",{ref:at(l,m),id:u,type:e?void 0:"button","aria-haspopup":"menu","aria-expanded":c,"data-active":c,"aria-controls":c?f:void 0,onClick:e=>{t?.(e),d(!c)},onKeyDown:e=>{o?.(e),"ArrowDown"!==e.key||c||(e.preventDefault(),d(!0))},className:ot("data-[active=true]:bg-btn-active data-[active=true]:text-alt",n),...s,children:a})});qr.displayName="Menu.Trigger";const Hr=({container:e,forceMount:r,children:o})=>{const{open:a}=C(),[i,s]=t.useState(!1);return t.useEffect(()=>{s(!0)},[]),i&&(r||a)?n.createPortal(o,e??document.body):null};Hr.displayName="Menu.Portal";const Ur=t.forwardRef(({forceMount:e,align:r="start",loop:o=!0,onEscapeKeyDown:n,onPointerDownOutside:a,onInteractOutside:s,className:l,children:c,...d},u)=>{const{open:f,setOpen:m,active:b,setActive:p,getItems:h,isItemDisabled:g,menuId:v,triggerRef:x}=C(),w=t.useRef(null),y=at(u,w),k=yt({enabled:f,triggerRef:x,contentRef:w,align:r});t.useEffect(()=>{if(f&&w.current){w.current.focus();const e=h().find(e=>!g(e));e&&p(e)}},[f,h,g,p]);const{handleKeyDown:I}=It({getItems:h,isItemDisabled:g,active:b,setActive:p,loop:o,orientation:"vertical",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),N=t.useCallback(e=>{if("Tab"!==e.key)return"Escape"===e.key?(e.preventDefault(),n?.(e),void m(!1)):void I(e);m(!1)},[I,m,n]);return vt({enabled:f,contentRef:w,excludeRefs:x?[x]:void 0,onPointerDownOutside:a,onInteractOutside:s,onClose:()=>m(!1)}),Nt({containerRef:w,activeId:b,orientation:"vertical"}),e||f?i("div",{ref:y,id:v,role:"menu","aria-orientation":"vertical","aria-activedescendant":b,tabIndex:-1,"data-state":f?"open":"closed",className:ot("fixed z-40 flex flex-col items-start w-fit py-2.5 mt-2.5 overflow-hidden","rounded-sm border border-bdr-subtle bg-surface-neutral shadow-lg outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",!k&&"opacity-0 pointer-events-none",l),style:{...k},onKeyDown:N,...d,children:c}):null});Ur.displayName="Menu.Content";const Xr=ct("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:"hover:bg-surface-neutral-hover"},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""}},compoundVariants:[{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1}}),Yr=t.forwardRef(({id:e,asChild:o=!1,disabled:n=!1,onSelect:a,className:s,children:l,onClick:c,onPointerMove:d,onPointerLeave:u,onFocus:f,...m},b)=>{const p=v(e,e?void 0:"menu-item"),{active:h,setActive:g,setOpen:x,registerItem:w,unregisterItem:y,getItems:k,isItemDisabled:I}=C(),N=h===p,R=t.useRef(null),M=at(b,R);t.useEffect(()=>(w(p,n),()=>y(p)),[p,n,w,y]);const S=t.useCallback(e=>{if(c?.(e),n)return;const t=new Event("select",{bubbles:!0,cancelable:!0});a?.(t),t.defaultPrevented||x(!1)},[n,a,x,c]),D=t.useCallback(e=>{d?.(e),N||n||g(p)},[N,g,p,n,d]),E=t.useCallback(e=>{u?.(e),document.activeElement!==R.current&&g(void 0)},[g,u,R]),P=t.useCallback(e=>{f?.(e),n||g(p)},[f,n,g,p]),{tabIndex:z}=Ct({id:p,active:h,disabled:n,getItems:k,isItemDisabled:I});gt({ref:R,isActive:N,disabled:n});return i(o?r.Slot:"div",{ref:M,id:p,role:"menuitem",tabIndex:z,"aria-disabled":n||void 0,"data-active":N||void 0,"data-disabled":n||void 0,"data-tone":N?"inverse":void 0,className:ot(Xr({active:N,disabled:n}),s),onClick:S,onPointerMove:D,onPointerLeave:E,onFocus:P,...m,children:l})});Yr.displayName="Menu.Item";const Zr=t.forwardRef(({className:e,children:t,...r},o)=>i("div",{ref:o,className:ot("px-3 py-1.5 text-xs font-semibold text-subtle",e),...r,children:t}));Zr.displayName="Menu.Label";const Jr=t.forwardRef(({className:e,...t},r)=>i("div",{ref:r,role:"separator","aria-orientation":"horizontal",className:ot("my-1 h-px bg-bdr-subtle",e),...t}));Jr.displayName="Menu.Separator";const Qr=t.createContext(void 0),eo=t.forwardRef(({value:e,defaultValue:r,onValueChange:o,closeOnSelect:n=!1,className:a,children:s,...l},c)=>{const[d,u]=xt(e,r,void 0),f=t.useCallback(e=>{u(e),o?.(e)},[u,o]),m=t.useMemo(()=>({value:d,setValue:f,closeOnSelect:n}),[d,f,n]);return i(Qr.Provider,{value:m,children:i("div",{ref:c,role:"group",className:ot("flex flex-col w-full",a),...l,children:s})})});eo.displayName="Menu.RadioGroup";const to=ct("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:""},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""},checked:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover"}},compoundVariants:[{active:!0,checked:!0,disabled:!1,class:"bg-surface-selected text-alt hover:bg-surface-selected-hover"},{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1,checked:!1}}),ro=t.forwardRef(({id:e,value:o,asChild:n=!1,disabled:a=!1,onSelect:s,className:l,children:c,onClick:d,onPointerMove:u,onPointerLeave:f,onFocus:m,onKeyDown:b,...p},h)=>{const g=v(e,e?void 0:"menu-radio-item"),{active:x,setActive:w,setOpen:y,registerItem:k,unregisterItem:I,getItems:N,isItemDisabled:R}=C(),{value:M,setValue:S,closeOnSelect:D}=(()=>{const e=t.useContext(Qr);if(!e)throw new Error("RadioGroup components must be used within a RadioGroup");return e})(),E=x===g,P=M===o,z=t.useRef(null),A=at(h,z);t.useEffect(()=>(k(g,a),()=>I(g)),[g,a,k,I]);const O=t.useCallback(e=>{if(d?.(e),a)return;S(o);const t=new Event("select",{bubbles:!0,cancelable:!0});s?.(t),D&&y(!1)},[a,o,S,s,d,D,y]),L=t.useCallback(e=>{if(b?.(e),(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),!a)){S(o);const e=new Event("select",{bubbles:!0,cancelable:!0});s?.(e),D&&y(!1)}},[a,o,S,s,b,D,y]),T=t.useCallback(e=>{u?.(e),E||a||w(g)},[E,w,g,a,u]),V=t.useCallback(e=>{f?.(e),document.activeElement!==z.current&&w(void 0)},[w,f,z]),j=t.useCallback(e=>{m?.(e),a||w(g)},[m,a,w,g]),{tabIndex:F}=Ct({id:g,active:x,disabled:a,getItems:N,isItemDisabled:R});gt({ref:z,isActive:E,disabled:a});return i(n?r.Slot:"div",{ref:A,id:g,role:"menuitemradio",tabIndex:F,"aria-checked":P,"aria-disabled":a||void 0,"data-active":E||void 0,"data-disabled":a||void 0,"data-state":P?"checked":"unchecked","data-tone":E?"inverse":void 0,className:ot("group",to({active:E,disabled:a,checked:P}),l),onClick:O,onKeyDown:L,onPointerMove:T,onPointerLeave:V,onFocus:j,...p,children:c})});ro.displayName="Menu.RadioItem";const oo=t.forwardRef(({forceMount:r,className:o,children:n,...a},s)=>{if(!t.useContext(Qr))return null;const l=i(e.Fragment,{children:[i(Ft,{strokeWidth:1.5,className:"size-3.5 group-data-[state=checked]:hidden"}),i(jt,{strokeWidth:1.5,className:"size-3.5 group-data-[state=unchecked]:hidden [&>circle:last-child]:scale-[3.75] [&>circle:last-child]:origin-center [&>circle:last-child]:fill-current"})]});return i("span",{ref:s,"data-indicator":!0,className:ot("inline-flex items-center justify-center",o),...a,children:n??l})});oo.displayName="Menu.ItemIndicator";const no=Object.assign(_r,{Root:_r,Trigger:qr,Portal:Hr,Content:Ur,Item:Yr,Label:Zr,Separator:Jr,RadioGroup:eo,RadioItem:ro,ItemIndicator:oo}),ao=t.createContext(void 0);function io(){const e=t.useContext(ao);if(!e)throw new Error("Menubar menu item components must be used within Menubar.Content");return e}const so=({defaultActive:e,onActiveChange:r,id:o,children:n})=>{const a=v(o,"menubar"),s=t.useRef(null),[l,c]=t.useState(e),d=t.useCallback(e=>{c(e),r?.(e)},[r]),{registerItem:u,unregisterItem:f,getItems:m,isItemDisabled:b}=kt(),[p,h]=t.useState(void 0),g=t.useMemo(()=>({active:l,setActive:d,registerItem:u,unregisterItem:f,getItems:m,isItemDisabled:b,openMenuId:p,setOpenMenuId:h,menubarId:a,menubarRef:s}),[l,d,u,f,m,b,p,a]);return i(D,{value:g,children:n})};so.displayName="Menubar.Root";const lo=t.forwardRef(({"aria-label":e,loop:r=!0,className:o,children:n,onKeyDown:a,onBlur:s,...l},c)=>{const{active:d,setActive:u,getItems:f,isItemDisabled:m,menubarId:b,menubarRef:p,setOpenMenuId:h,openMenuId:g}=E(),v=at(c,p),{handleKeyDown:x}=It({getItems:f,isItemDisabled:m,active:d,setActive:u,loop:r,orientation:"horizontal",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),w=t.useCallback(e=>{a?.(e);if(("ArrowDown"===e.key||"Enter"===e.key||" "===e.key)&&d){const t=document.getElementById(d);if(t&&"menu"===t.getAttribute("aria-haspopup"))return e.preventDefault(),void h(d)}if("ArrowUp"===e.key&&d){const t=document.getElementById(d);if(t&&"menu"===t.getAttribute("aria-haspopup"))return e.preventDefault(),void h(d)}x(e)},[a,x,d,h]),y=t.useCallback(e=>{s?.(e);const t=e.relatedTarget;p?.current&&t instanceof Node&&p.current.contains(t)||g||u(void 0)},[s,u,p,g]);return Nt({containerRef:p,activeId:d,orientation:"horizontal"}),i("div",{ref:v,id:b,role:"menubar","aria-label":e,"aria-orientation":"horizontal",tabIndex:-1,className:ot("flex items-center gap-1.5 p-1.5",o),onKeyDown:w,onBlur:y,...l,children:n})});lo.displayName="Menubar.Nav";const co=t.forwardRef(({id:e,disabled:o=!1,onSelect:n,asChild:a,className:s,children:l,onClick:c,onPointerMove:d,onPointerDown:u,onPointerLeave:f,onFocus:m,...b},p)=>{const h=v(e,"menubar-button"),{active:g,setActive:x,registerItem:w,unregisterItem:y,openMenuId:k,getItems:I,isItemDisabled:C}=E(),N=g===h,R=t.useRef(null),M=at(p,R);t.useEffect(()=>(w(h,o),()=>y(h)),[h,o,w,y]);const S=t.useCallback(e=>{u?.(e),o||x(h)},[o,h,u,x]),D=t.useCallback(e=>{if(c?.(e),o)return;N||x(h);const t=new Event("select",{bubbles:!0,cancelable:!0});n?.(t)},[o,N,c,x,h,n]),P=t.useCallback(e=>{d?.(e),!o&&k&&void 0!==g&&x(h)},[o,k,x,g,h,d]),z=t.useCallback(e=>{f?.(e),k&&k===h||document.activeElement===R.current||x(void 0)},[k,h,g,x,f,R]),A=t.useCallback(e=>{m?.(e),o||x(h)},[m,o,x,h]),{tabIndex:O}=Ct({id:h,active:g,disabled:o,getItems:I,isItemDisabled:C});gt({ref:R,isActive:N,disabled:o});return i(a?r.Slot:"button",{ref:M,id:h,type:a?void 0:"button",role:"menuitem",tabIndex:O,"aria-disabled":o,"data-disabled":o||void 0,"data-tone":N?"inverse":void 0,className:ot("group px-4.5 py-2.5 rounded-sm text-sm cursor-pointer outline-none","focus-visible:ring-3 focus-visible:ring-ring","focus-visible:ring-offset-3 focus-visible:ring-offset-ring-offset",s),onClick:D,onPointerDown:S,onPointerMove:P,onPointerLeave:z,onFocus:A,...b,children:l})});co.displayName="Menubar.Button";const uo=t.forwardRef(({className:e,...r},o)=>i("div",void 0!==t.useContext(ao)?{ref:o,role:"separator","aria-orientation":"horizontal",className:ot("my-1 h-px w-full bg-bdr-subtle",e),...r}:{ref:o,role:"separator","aria-orientation":"vertical",className:ot("mx-1 w-px h-4 bg-bdr-subtle",e),...r}));uo.displayName="Menubar.Separator";const fo=({id:e,disabled:r=!1,children:o})=>{const n=v(e,"menubar-menu"),a=`${n}-content`,s=t.useRef(null),l=E(),{registerItem:c,unregisterItem:d,openMenuId:u,setOpenMenuId:f}=l,[m,b]=t.useState(!1);t.useEffect(()=>(c(n,r),()=>d(n)),[n,r,c,d]),t.useEffect(()=>{u!==n||m?u!==n&&m&&b(!1):b(!0)},[u,n,m]);const p=t.useCallback(e=>{b(e),f(e?n:void 0)},[n,f]),h=t.useMemo(()=>({menuId:n,contentId:a,open:m,setOpen:p,menubarContext:l,triggerRef:s}),[n,a,m,p,l]);return i(R,{value:h,children:o})};fo.displayName="Menubar.Menu";const mo=t.forwardRef(({asChild:e,className:o,children:n,onClick:a,onKeyDown:s,onPointerMove:l,onPointerDown:c,onPointerLeave:d,onFocus:u,...f},m)=>{const{menuId:b,contentId:p,open:h,setOpen:g,triggerRef:v,menubarContext:x}=M(),{active:w,setActive:y,openMenuId:k,isItemDisabled:I,getItems:C}=x,N=at(m,v),R=w===b,S=I(b),D=t.useCallback(e=>{a?.(e),S||g(!h)},[S,h,g,a]),E=t.useCallback(e=>{s?.(e),S||("ArrowDown"!==e.key||h)&&(" "!==e.key&&"Enter"!==e.key||h)||(e.preventDefault(),g(!0))},[S,h,g,s]),P=t.useCallback(e=>{c?.(e),S||y(b)},[S,b,c,y]),z=t.useCallback(e=>{l?.(e),S||void 0!==w&&(y(b),k&&k!==b&&g(!0))},[S,k,b,w,y,g,l]),A=t.useCallback(e=>{d?.(e),h||document.activeElement===v?.current||y(void 0)},[h,y,d,v]),O=t.useCallback(e=>{u?.(e),S||y(b)},[u,S,y,b]),{tabIndex:L}=Ct({id:b,active:w,disabled:S,getItems:C,isItemDisabled:I});gt({ref:v,isActive:R,disabled:S});return i(e?r.Slot:"button",{ref:N,id:b,type:e?void 0:"button",role:"menuitem",tabIndex:L,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?p:void 0,"aria-disabled":S,"data-active":h,"data-disabled":S||void 0,"data-state":h?"open":"closed","data-tone":R?"inverse":void 0,className:ot("group px-4.5 py-2.5 rounded-sm text-sm cursor-pointer outline-none","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring focus-visible:ring-offset-3 focus-visible:ring-offset-ring-offset data-[tone=inverse]:focus-visible:ring-ring-alt data-[tone=inverse]:focus-visible:ring-offset-ring-offset-alt",h&&"bg-btn-active text-alt",S&&"opacity-30 cursor-not-allowed pointer-events-none",o),onClick:D,onKeyDown:E,onPointerDown:P,onPointerMove:z,onPointerLeave:A,onFocus:O,...f,children:n})});mo.displayName="Menubar.Trigger";const bo=({container:r,forceMount:o=!1,children:a})=>{const{open:s}=M(),[l,c]=t.useState(!1);if(t.useEffect(()=>{c(!0)},[]),!l)return null;if(!(o||s))return null;const d=r??document.body;return n.createPortal(i(e.Fragment,{children:a}),d)};bo.displayName="Menubar.Portal";const po=t.forwardRef(({align:e="start",loop:r=!0,forceMount:o=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onInteractOutside:s,className:l,children:c,onKeyDown:d,...u},f)=>{const{menuId:m,contentId:b,open:p,setOpen:h,triggerRef:g,menubarContext:v}=M(),{getItems:x,setActive:w}=v,y=t.useRef(null),k=at(f,y),{registerItem:I,unregisterItem:C,getItems:N,isItemDisabled:R}=kt(),[S,D]=t.useState(void 0),E=yt({enabled:p,triggerRef:g,contentRef:y,align:e});if(!p&&!o)return null;const{handleKeyDown:P}=It({getItems:N,isItemDisabled:R,active:S,setActive:D,loop:r,orientation:"vertical",onSelect:e=>{const t=document.getElementById(e);t&&t.click()}}),z=t.useCallback(e=>{if(d?.(e),"Escape"===e.key)return e.preventDefault(),e.stopPropagation(),h(!1),n?.(e),void g?.current?.focus();if("Tab"!==e.key){if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const t=x(),r=t.indexOf(m);if(-1===r)return;const o="ArrowRight"===e.key?1:-1;let n=(r+o+t.length)%t.length,a=0;for(;a<t.length&&v.isItemDisabled(t[n]);)n=(n+o+t.length)%t.length,a+=1;const i=t[n];if(!i||v.isItemDisabled(i))return;w(i);const s=document.getElementById(i);return s?.focus(),void(s&&"menu"===s.getAttribute("aria-haspopup")?v.setOpenMenuId(i):h(!1))}P(e)}else h(!1)},[d,h,n,m,x,w,v,P,g]);t.useEffect(()=>{if(p&&null!==E){const e=N(),t=e.length>0?e[0]:void 0,r=e.find(e=>!R(e))??t;r&&D(r)}else p||D(void 0)},[p,E,N,R]),vt({enabled:p,contentRef:y,excludeRefs:[g],onPointerDownOutside:a,onInteractOutside:s,onClose:()=>h(!1)});const A=t.useMemo(()=>({registerItem:I,unregisterItem:C,getItems:N,isItemDisabled:R,active:S,setActive:D}),[I,C,N,R,S,D]),O=null!==E;return i(ao.Provider,{value:A,children:i("div",{ref:k,id:b,role:"menu","aria-orientation":"vertical","aria-labelledby":m,tabIndex:-1,"data-state":p?"open":"closed","data-align":e,style:{position:"fixed",top:E?`${E.top}px`:"0",left:void 0!==E?.left?`${E.left}px`:void 0,right:void 0!==E?.right?`${E.right}px`:void 0,zIndex:9999,visibility:O?"visible":"hidden"},className:ot("flex flex-col items-start w-fit py-2.5 mt-2.5 overflow-hidden","rounded-sm border border-bdr-subtle bg-surface-neutral shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",l),onKeyDown:z,...u,children:c})})});po.displayName="Menubar.Content";const ho=ct("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:"hover:bg-surface-neutral-hover"},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""}},compoundVariants:[{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1}}),go=t.forwardRef(({id:e,disabled:o=!1,onSelect:n,asChild:a,className:s,children:l,onClick:c,onPointerMove:d,onPointerLeave:u,onFocus:f,...m},b)=>{const p=v(e,"menubar-item"),{registerItem:h,unregisterItem:g,active:x,setActive:w,getItems:y,isItemDisabled:k}=io(),{setOpen:I,triggerRef:C}=M(),N=x===p,R=t.useRef(null),S=at(b,R);t.useEffect(()=>(h(p,o),()=>g(p)),[p,o,h,g]);const D=t.useCallback(e=>{if(c?.(e),o)return;const t=new Event("select",{bubbles:!0,cancelable:!0});n?.(t),I(!1),C?.current?.focus()},[o,c,n,I,C]),E=t.useCallback(e=>{d?.(e),o||w(p)},[o,p,w,d]),P=t.useCallback(e=>{u?.(e),document.activeElement!==R.current&&w(void 0)},[w,u,R]),z=t.useCallback(e=>{f?.(e),o||w(p)},[f,o,w,p]),{tabIndex:A}=Ct({id:p,active:x,disabled:o,getItems:y,isItemDisabled:k});gt({ref:R,isActive:N,disabled:o});return i(a?r.Slot:"div",{ref:S,id:p,role:"menuitem",tabIndex:A,"aria-disabled":o,"data-active":N||void 0,"data-disabled":o||void 0,"data-tone":N?"inverse":void 0,className:ot(ho({active:N,disabled:o}),s),onClick:D,onPointerMove:E,onPointerLeave:P,onFocus:z,...m,children:l})});go.displayName="Menubar.Item";const vo=t.forwardRef(({className:e,children:t,...r},o)=>i("div",{ref:o,role:"none",className:ot("px-3 py-1.5 text-xs font-semibold text-subtle",e),...r,children:t}));vo.displayName="Menubar.Label";const xo=t.createContext(void 0),wo=t.forwardRef(({value:e,defaultValue:r,onValueChange:o,closeOnSelect:n=!1,className:a,children:s,...l},c)=>{const[d,u]=t.useState(e??r);t.useEffect(()=>{void 0!==e&&u(e)},[e]);const f=t.useCallback(t=>{void 0===e&&u(t),o?.(t)},[e,o]),m=t.useMemo(()=>({value:d,setValue:f,closeOnSelect:n}),[d,f,n]);return i(xo.Provider,{value:m,children:i("div",{ref:c,role:"group",className:ot("flex flex-col w-full",a),...l,children:s})})});wo.displayName="Menubar.RadioGroup";const yo=ct("flex w-full items-center px-4.5 py-2.5 gap-x-1.25 cursor-pointer text-sm outline-none transition-highlight",{variants:{active:{true:"bg-surface-neutral-hover",false:""},disabled:{true:"hover:bg-transparent opacity-30 select-none pointer-events-none",false:""},checked:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover"}},compoundVariants:[{active:!0,checked:!0,disabled:!1,class:"bg-surface-selected text-alt hover:bg-surface-selected-hover"},{active:!0,disabled:!1,class:["focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring-offset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"]}],defaultVariants:{active:!1,disabled:!1,checked:!1}}),ko=t.forwardRef(({id:e,value:o,disabled:n=!1,onSelect:a,asChild:s,className:l,children:c,onClick:d,onPointerMove:u,onPointerLeave:f,onFocus:m,onKeyDown:b,...p},h)=>{const g=v(e,"menubar-radio-item"),{registerItem:x,unregisterItem:w,active:y,setActive:k,getItems:I,isItemDisabled:C}=io(),{setOpen:N,triggerRef:R}=M(),{value:S,setValue:D,closeOnSelect:E}=(()=>{const e=t.useContext(xo);if(!e)throw new Error("RadioGroup components must be used within a RadioGroup");return e})(),P=y===g,z=S===o,A=t.useRef(null),O=at(h,A);t.useEffect(()=>(x(g,n),()=>w(g)),[g,n,x,w]);const L=t.useCallback(e=>{if(d?.(e),n)return;D(o);const t=new Event("select",{bubbles:!0,cancelable:!0});a?.(t),E&&(N(!1),R?.current?.focus())},[n,o,D,d,a,E,N,R]),T=t.useCallback(e=>{if(b?.(e),(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),!n)){D(o);const e=new Event("select",{bubbles:!0,cancelable:!0});a?.(e),E&&(N(!1),R?.current?.focus())}},[n,o,D,b,a,E,N,R]),V=t.useCallback(e=>{u?.(e),n||k(g)},[n,g,k,u]),j=t.useCallback(e=>{f?.(e),document.activeElement!==A.current&&k(void 0)},[k,f,A]),F=t.useCallback(e=>{m?.(e),n||k(g)},[m,n,k,g]),{tabIndex:$}=Ct({id:g,active:y,disabled:n,getItems:I,isItemDisabled:C});gt({ref:A,isActive:P,disabled:n});return i(s?r.Slot:"div",{ref:O,id:g,role:"menuitemradio",tabIndex:$,"aria-checked":z,"aria-disabled":n,"data-active":P||void 0,"data-disabled":n||void 0,"data-state":z?"checked":"unchecked","data-tone":P?"inverse":void 0,className:ot("group",yo({active:P,disabled:n,checked:z}),l),onClick:L,onKeyDown:T,onPointerMove:V,onPointerLeave:j,onFocus:F,...p,children:c})});ko.displayName="Menubar.RadioItem";const Io=t.forwardRef(({forceMount:r,className:o,children:n,...a},s)=>{if(!t.useContext(xo))return null;const l=i(e.Fragment,{children:[i(Ft,{strokeWidth:1.5,className:"size-3.5 group-data-[state=checked]:hidden"}),i(jt,{strokeWidth:1.5,className:"size-3.5 group-data-[state=unchecked]:hidden [&>circle:last-child]:scale-[3.75] [&>circle:last-child]:origin-center [&>circle:last-child]:fill-current"})]});return i("span",{ref:s,"data-indicator":!0,className:ot("inline-flex items-center justify-center",o),...a,children:n??l})});Io.displayName="Menubar.ItemIndicator";const Co=Object.assign(so,{Root:so,Nav:lo,Content:po,Button:co,Separator:uo,Menu:fo,Trigger:mo,Portal:bo,Item:go,Label:vo,RadioGroup:wo,RadioItem:ko,ItemIndicator:Io}),No=({id:e,value:r,defaultValue:o="",onChange:n,placeholder:a="Search",clearLabel:s="Clear",disabled:l,readOnly:c,children:d,className:u,...f})=>{const m=v(it(e)),[b,p]=t.useState(m),h=t.useRef(null),[g,x]=xt(r,o,n),w=t.useMemo(()=>({id:b,setId:p,value:g,setValue:x,disabled:l,readOnly:c,placeholder:a,clearLabel:s,inputRef:h}),[b,p,g,x,l,c,a,s,h]);return i(z,{value:w,children:i("div",{className:ot("relative flex gap-2.5 items-center rounded-sm overflow-hidden","h-11.5 px-4.5 py-3","border border-bdr-subtle focus-within:border-bdr-strong","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",l&&"pointer-events-none select-none opacity-30",u),...f,children:d})})};No.displayName="SearchFieldRoot";const Ro=({className:e})=>i(_t,{className:ot("flex items-center justify-center shrink-0 size-5.5 text-subtle",e),strokeWidth:1.5});Ro.displayName="SearchFieldIcon";const Mo=t.forwardRef(({id:e,className:r,...o},n)=>{const{id:a,setId:s,value:l,disabled:c,readOnly:d,placeholder:u,setValue:f,inputRef:m}=A(),b=it(e);t.useEffect(()=>{b&&s(b)},[b,s]);return i("input",{ref:at(n,m),id:a,className:ot("h-5.5 w-full text-base border-0","text-main bg-surface-neutral","placeholder:text-subtle","focus:outline-none","enabled:read-only:bg-surface-primary",r),value:l,onChange:e=>{f(e.currentTarget.value)},readOnly:d,disabled:c,placeholder:u,"aria-label":"Search","aria-disabled":c,...o})});Mo.displayName="SearchFieldInput";const So=({className:e,...t})=>{const{value:r,disabled:o,readOnly:n,clearLabel:a,setValue:s,inputRef:l}=A();if(!r||o||n)return null;return i(Jt,{className:ot("flex items-center justify-center shrink-0 size-7 -mx-1.5 text-subtle",e),icon:Ut,title:a,onClick:()=>{s(""),l.current?.focus()},disabled:o,iconSize:28,iconStrokeWidth:1.25,...t})};So.displayName="SearchFieldClear";const Do=Object.assign(No,{Root:No,Icon:Ro,Input:Mo,Clear:So}),Eo=({className:e,selected:t,children:r,label:o,description:n,metadata:a,icon:s,readOnly:l,checked:c,defaultChecked:d,onCheckedChange:u,...f})=>i(jr,{className:ot(!t&&"hover:bg-surface-neutral-hover",e),selected:t,role:"row","aria-selected":t,...f,children:[i(jr.Left,{children:i(Yt,{checked:c,defaultChecked:d,onCheckedChange:u,readOnly:l})}),i(jr.DefaultContent,{label:o,description:n,metadata:a,icon:s}),i(jr.Right,{children:r})]});Eo.displayName="SelectableListItem";const Po=({className:e,label:t,decorative:r=!1,...o})=>{const n=r?"true":void 0;return t?i("div",{role:"separator","aria-orientation":"horizontal","aria-hidden":n,className:ot("inline-flex w-full gap-2.5",e),...o,children:[i("span",{className:"min-w-0 truncate text-subtle uppercase",children:t}),i("span",{className:"min-w-6 flex-1 border-b-1 border-bdr-subtle"})]}):i("hr",{"aria-hidden":n,className:ot("w-full border-bdr-subtle",e)})};Po.displayName="Separator";const zo=t.forwardRef(({pressed:e,defaultPressed:t=!1,onPressedChange:r,...o},n)=>{const[a,s]=xt(e,t,r);return i(ht,{ref:n,"aria-pressed":a,"data-state":a?"on":"off","data-active":a,onClick:()=>s(!a),...o})});zo.displayName="Toggle";const Ao=t.forwardRef((e,r)=>{const{type:o,value:n,defaultValue:a,onValueChange:s,disabled:l,orientation:c="horizontal",children:d,className:u,...f}=e,m=v(void 0,"toggle-group"),b=at(r,t.useRef(null)),{registerItem:p,unregisterItem:h,getItems:g,isItemDisabled:x}=kt();if("single"===o){const[r,v]=xt(n,a??"",s),[w,y]=t.useState(r||void 0),k=e.loop??!1;Mt(r,y);const I=t.useCallback(e=>{v(r===e?"":e),y(e)},[r,v]),{handleKeyDown:C}=It({getItems:g,isItemDisabled:x,active:w,setActive:y,loop:k,orientation:c,onSelect:e=>{I(e)}}),N=t.useMemo(()=>({selectionMode:o,value:r,onValueChange:I,disabled:l,registerItem:p,unregisterItem:h,getItems:g,isItemDisabled:x,orientation:c,active:w,setActive:y}),[o,r,I,l,p,h,g,x,c,w,y]);return i(L,{value:N,children:i("div",{ref:b,role:"radiogroup",id:m,"aria-orientation":c,"data-orientation":c,className:ot("inline-flex gap-2","vertical"===c&&"flex-col",u),onKeyDown:C,...f,children:d})})}const[w,y]=xt(n,a??[],s),[k,I]=t.useState(()=>w.at(0)),C=t.useCallback(e=>{const t=w.includes(e)?w.filter(t=>t!==e):[...w,e];y(t)},[w,y]),{handleKeyDown:N}=It({getItems:g,isItemDisabled:x,active:k,setActive:I,loop:!1,orientation:c,onSelect:e=>{C(e)}}),R=t.useMemo(()=>({selectionMode:o,value:w,onValueChange:C,disabled:l,registerItem:p,unregisterItem:h,getItems:g,isItemDisabled:x,orientation:c,active:k,setActive:I}),[o,w,C,l,p,h,g,x,c,k,I]);return i(L,{value:R,children:i("div",{ref:b,role:"group",id:m,"data-orientation":c,className:ot("inline-flex gap-2","vertical"===c&&"flex-col",u),onKeyDown:N,...f,children:d})})});Ao.displayName="ToggleGroup.Root";const Oo=t.forwardRef(({value:e,disabled:o,asChild:n,...a},s)=>{const l=T(),{selectionMode:c,value:d,onValueChange:u,disabled:f,registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:h,active:g,setActive:v}=l,x=t.useRef(null),w=at(s,x),y=o??f??!1;t.useEffect(()=>(m(e,y),()=>b(e)),[e,y,m,b]);const k="single"===c?d===e:d.includes(e),I=t.useCallback(()=>{y||(u(e),v?.(e))},[y,u,e,v]),C=n?r.Slot:ht,{tabIndex:N}=Ct({id:e,active:g,disabled:y,getItems:p,isItemDisabled:h});return t.useEffect(()=>{g===e&&x.current&&document.activeElement!==x.current&&x.current.focus()},[g,e]),i(C,{ref:w,..."single"===c?{"aria-pressed":k}:{"aria-checked":k},"data-state":k?"on":"off","data-active":k||void 0,disabled:y,tabIndex:N,onClick:I,...a})});Oo.displayName="ToggleGroup.Item";const Lo=Object.assign(Ao,{Root:Ao,Item:Oo}),To=t.createContext(void 0);const Vo=t.forwardRef((e,r)=>{const{type:o,value:n,defaultValue:a,onValueChange:s,disabled:l,children:c,className:d,...u}=e,{orientation:f}=Go(),m=v(void 0,"toolbar-toggle-group"),b=at(r,t.useRef(null)),[p]=t.useState(()=>new Map),h=t.useCallback((e,t)=>{p.set(e,t)},[p]),g=t.useCallback(e=>{p.delete(e)},[p]);if("single"===o){const[e,r]=xt(n,a??"",s),v=t.useCallback(t=>{r(e===t?"":t)},[e,r]),x=t.useMemo(()=>({selectionMode:o,value:e,onValueChange:v,disabled:l,orientation:f,valueToId:p,registerValueId:h,unregisterValue:g}),[o,e,v,l,f,p,h,g]);return i(To.Provider,{value:x,children:i("div",{ref:b,role:"radiogroup",id:m,"aria-orientation":f,"data-orientation":f,className:ot("inline-flex gap-2","vertical"===f&&"flex-col",d),...u,children:c})})}const[x,w]=xt(n,a??[],s),y=t.useCallback(e=>{const t=x.includes(e)?x.filter(t=>t!==e):[...x,e];w(t)},[x,w]),k=t.useMemo(()=>({selectionMode:o,value:x,onValueChange:y,disabled:l,orientation:f,valueToId:p,registerValueId:h,unregisterValue:g}),[o,x,y,l,f,p,h,g]);return i(To.Provider,{value:k,children:i("div",{ref:b,role:"group",id:m,"data-orientation":f,className:ot("inline-flex gap-2","vertical"===f&&"flex-col",d),...u,children:c})})});Vo.displayName="Toolbar.ToggleGroup";const jo=t.forwardRef(({value:e,disabled:o,asChild:n,className:a,...s},l)=>{const c=function(){const e=t.useContext(To);if(!e)throw new Error("useToolbarToggleGroup must be used within a ToolbarToggleGroup");return e}(),d=Go(),{selectionMode:u,value:f,onValueChange:m,disabled:b,registerValueId:p,unregisterValue:h}=c,{active:g,setActive:x,registerItem:w,unregisterItem:y,getItems:k,isItemDisabled:I}=d,C=v(void 0,"toolbar-toggle-item"),N=t.useRef(null),R=at(l,N),M=o??b??!1;t.useEffect(()=>(w(C,M),()=>y(C)),[C,M,w,y]),t.useEffect(()=>(p(e,C),()=>h(e)),[e,C,p,h]);const S="single"===u?f===e:f.includes(e),D=g===C,E=t.useCallback(()=>{M||(m(e),x(C))},[M,m,e,x,C]),P=t.useCallback(()=>{M||x(C)},[M,x,C]);gt({ref:N,isActive:D,disabled:M});const{tabIndex:z}=Ct({id:C,active:g,disabled:M,getItems:k,isItemDisabled:I});return i(n?r.Slot:ht,{ref:R,id:C,..."single"===u?{"aria-pressed":S}:{"aria-checked":S},"data-state":S?"on":"off","data-active":S||void 0,disabled:M,tabIndex:z,onClick:E,onFocus:P,className:a,...s})});jo.displayName="Toolbar.ToggleItem";const Fo=Object.assign(Vo,{Root:Vo,Item:jo}),$o=t.createContext(void 0);function Go(){const e=t.useContext($o);if(!e)throw new Error("Toolbar components must be used within Toolbar.Root");return e}const Bo=({defaultActive:e,onActiveChange:r,id:o,orientation:n="horizontal",loop:a=!0,children:s})=>{const l=v(o,"toolbar"),c=t.useRef(null),[d,u]=t.useState(e),f=t.useCallback(e=>{u(e),r?.(e)},[r]),{registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:h}=kt(),g=t.useMemo(()=>({toolbarId:l,toolbarRef:c,active:d,setActive:f,registerItem:m,unregisterItem:b,getItems:p,isItemDisabled:h,orientation:n,loop:a}),[l,d,f,m,b,p,h,n,a]);return i($o.Provider,{value:g,children:s})};Bo.displayName="Toolbar.Root";const Wo=t.forwardRef(({"aria-label":e,className:r,children:o,onKeyDown:n,onBlur:a,...s},l)=>{const{active:c,setActive:d,getItems:u,isItemDisabled:f,toolbarId:m,toolbarRef:b,orientation:p,loop:h}=Go(),g=at(l,b),{handleKeyDown:v}=It({getItems:u,isItemDisabled:f,active:c,setActive:d,loop:h,orientation:p,onSelect:e=>{const t=document.getElementById(e);if(t)if(t instanceof HTMLButtonElement)t.click();else{const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}}}),x=t.useCallback(e=>{n?.(e),v(e)},[n,v]),w=t.useCallback(e=>{a?.(e);const t=e.relatedTarget;b.current&&t instanceof Node&&b.current.contains(t)||d(void 0)},[a,d,b]);return Nt({containerRef:b,activeId:c,orientation:p}),i("div",{ref:g,id:m,role:"toolbar","aria-label":e,"aria-orientation":p,tabIndex:-1,className:ot("flex items-center gap-1.5 p-2 transition-highlight","focus-within:ring-inset focus-within:ring-2 focus-within:ring-ring/25","vertical"===p&&"flex-col",r),onKeyDown:x,onBlur:w,...s,children:o})});Wo.displayName="Toolbar.Container";const Ko=t.forwardRef(({id:e,disabled:o=!1,asChild:n,children:a,onPointerMove:s,onPointerDown:l,onFocus:c,...d},u)=>{const f=v(e,"toolbar-item"),{active:m,setActive:b,registerItem:p,unregisterItem:h,getItems:g,isItemDisabled:x}=Go(),w=m===f,y=t.useRef(null),k=at(u,y);t.useEffect(()=>(p(f,o),()=>h(f)),[f,o,p,h]);const I=t.useCallback(e=>{l?.(e),o||b(f)},[o,f,l,b]),C=t.useCallback(e=>{s?.(e)},[s]),N=t.useCallback(e=>{c?.(e),o||b(f)},[c,o,b,f]),{tabIndex:R}=Ct({id:f,active:m,disabled:o,getItems:g,isItemDisabled:x});gt({ref:y,isActive:w,disabled:o});return i(n?r.Slot:"div",{ref:k,id:f,tabIndex:R,"aria-disabled":o,"data-disabled":o||void 0,onPointerDown:I,onPointerMove:C,onFocus:N,...d,children:a})});Ko.displayName="Toolbar.Item";const _o=t.forwardRef(({className:e,...t},r)=>{const{orientation:o}=Go();return i("div","vertical"===o?{ref:r,role:"separator","aria-orientation":"horizontal",className:ot("my-1 h-px w-full bg-bdr-subtle",e),...t}:{ref:r,role:"separator","aria-orientation":"vertical",className:ot("mx-1 w-px h-4 bg-bdr-subtle",e),...t})});_o.displayName="Toolbar.Separator";const qo=Object.assign(Bo,{Root:Bo,Container:Wo,Item:Ko,Separator:_o,ToggleGroup:Fo,ToggleItem:jo}),Ho={top:"bottom",bottom:"top",left:"right",right:"left"};function Uo({children:e,asChild:t,triggerRef:o,isOpen:n,onMouseEnter:a,onMouseLeave:s,onFocus:l,onBlur:c}){return i(t?r.Root:"div",{ref:o,className:t?void 0:"inline-flex",onMouseEnter:a,onMouseLeave:s,onFocus:l,onBlur:c,"aria-describedby":n?"tooltip":void 0,role:t?void 0:"button",tabIndex:t?void 0:0,children:e})}function Xo({children:e,actualSide:t,className:r,position:o,tooltipRef:n}){return i("div",{ref:n,role:"tooltip",className:ot("fixed z-50 pointer-events-none select-none",!o.transformOrigin&&"opacity-0"),style:{top:`${o.top}px`,left:`${o.left}px`,transformOrigin:o.transformOrigin},children:i("div",{className:ot("relative w-fit rounded-xs px-2 py-1 text-xs","bg-tooltip text-tooltip-foreground shadow-md","animate-in fade-in-0 zoom-in-95","top"===t&&"slide-in-from-top-2","bottom"===t&&"slide-in-from-bottom-2","left"===t&&"slide-in-from-left-2","right"===t&&"slide-in-from-right-2",r),children:[e,i("div",{className:ot("absolute size-2 rotate-45","top"===t&&"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2","bottom"===t&&"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2","left"===t&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2","right"===t&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),style:{backgroundColor:"inherit"}})]})})}const Yo="__loading__",Zo=e=>Math.max(0,10+20*(e-1));function Jo(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const e=Jo(r.children,t);if(e)return e}}}function Qo(e,t,r,o){return null==t?e.concat(r.map(e=>({...e,hasMoreChildren:o}))):e.map(e=>{if(e.id===t){const n=[...e.children??[],...r].map(r=>({...r,parentId:t,path:[...e.path,e.id]}));return{...e,children:n,hasMoreChildren:o}}return e.children?{...e,children:Qo(e.children,t,r,o)}:e})}const en=({children:r,load:o=!0})=>{const{items:n,loadMore:a}=F();return t.useEffect(()=>{o&&0===n.length&&a()},[o,n.length,a]),i(e.Fragment,{children:r})};en.displayName="TreeList.Content";const tn=({children:e,className:t,...r})=>{const{baseId:o}=F();return i("div",{id:`${o}-scroll-root`,className:ot("h-full relative overflow-y-auto",t),...r,children:e})};tn.displayName="TreeList.Container";const rn=({children:e,className:t,...r})=>i("div",{className:ot("flex items-center gap-2.5",t),...r,children:e});rn.displayName="TreeList.RowLeft";const on=({children:e,className:t,...r})=>i("div",{className:ot("flex items-center gap-2.5",t),...r,children:e});on.displayName="TreeList.RowRight";const nn=({level:e=0,className:t})=>{if(0!==e)return i("div",{style:{"--level-indent":`${Zo(e)}px`},className:ot("pl-[var(--level-indent)]",t)})};nn.displayName="TreeList.RowLevelSpacer";const an=({data:e})=>{if(!e.hasChildren)return i("span",{className:"h-5 w-5 flex-shrink-0"});const{expanded:t,toggleExpanded:r,selection:o}=F(),n=t?.has(e.id),a=o?.has(e.id);return i(Jt,{icon:Vt,variant:"text",title:"Text variant",tabIndex:-1,className:ot("w-5 h-5 transition-transform duration-150",a?"bg-surface-selected text-alt hover:bg-surface-selected-hover group-hover:bg-surface-selected-hover":"group-hover:bg-surface-neutral-hover group-data-[active=true]:bg-surface-neutral-hover",n&&"rotate-90"),onClick:t=>{r(e.id),t.stopPropagation()}})};an.displayName="TreeList.RowExpandControl";const sn=({className:e,children:t,...r})=>i("div",{className:ot("flex-1 min-w-0",e),...r,children:t});sn.displayName="TreeList.RowContent";const ln=({data:e,className:t})=>{const{selection:r,isItemSelectable:o}=F(),n=r?.has(e.id);return fn(e)||!o(e)?i("span",{className:ot("w-3.5",t)}):i("div",{className:ot("flex items-center w-3.5",t),children:i(n?qt:Ht,{})})};ln.displayName="TreeList.RowSelectionControl";const cn=({item:e,children:t,className:r})=>{const{selection:o,selectionMode:n,expanded:a,toggleSelection:s,active:l,baseId:c,isFocused:d}=F(),u=a?.has(e.id),f=o?.has(e.id),m=d&&l===e.id;return i("div",{id:`${c}-item-${e.id}`,role:"treeitem","aria-expanded":e.hasChildren?u:void 0,"aria-selected":!!f||"multiple"!==n&&void 0,"aria-level":e.path.length,"data-tone":f?"inverse":void 0,"data-active":m||void 0,onClick:()=>s?.(e.id),className:ot("group flex gap-2.5 items-center px-2.5 py-1 hover:bg-surface-primary-hover focus-within:outline-none cursor-pointer",f?"bg-surface-selected text-alt hover:bg-surface-selected-hover":"hover:bg-surface-neutral-hover data-[active=true]:bg-surface-neutral-hover",r),tabIndex:void 0,children:t})};cn.displayName="TreeList.Row";const dn=({item:e,children:r,intersectionProps:o})=>{const n=t.useRef(null),{loadMore:a,baseId:s}=F();t.useEffect(()=>{if(!n.current)return;const t=new IntersectionObserver(t=>{for(const r of t)r.isIntersecting&&a(e.path[e.path.length-1])},o??{root:document.querySelector(`#${s}-scroll-root`),rootMargin:"120px"});return t.observe(n.current),()=>t.disconnect()},[e,a,s,o]);const l=e.path.length;return i("div",{ref:n,className:"flex items-center gap-2 py-1 px-2 text-sm",children:[l>0&&i("span",{className:"spacer",style:{paddingLeft:Zo(l)}}),i(Gt,{size:14,className:"animate-spin"}),r??i("span",{children:"Loading..."})]})};dn.displayName="TreeList.LoadingRow";const un=({className:e,items:r,setItems:o,fetchChildren:n,selection:a,expanded:s,onSelectionChange:l,onExpandedChange:c,active:d,defaultActive:u,setActive:f,selectionMode:m="single",isItemSelectable:b=()=>!0,children:p,...h})=>{const g=v(void 0,"tree-list"),[x,w]=xt(a,new Set,l),[y,k]=xt(s,new Set,c),[I,C]=xt(r,[],o),[N,R]=wt(d,u,f),[M,S]=t.useState(!1),D=t.useRef(null),[E,P]=t.useState(!1),z=t.useCallback(async e=>{const t=e??void 0,r=t?Jo(I,t):void 0,o=r?r.children?r.children.length:0:(a=I,a.filter(e=>0===e.path.length)).length;var a;const{items:i,total:s}=await n(r,o),l=o+i.length<s,c=Qo(I,t,i,l);e||P(l),C(c)},[n,I,C,P]),A=t.useMemo(()=>function(e,t,r,o){const n=[],a=(e,r)=>{for(const o of e){const e=[...r,o.id];n.push(o);const i=Array.isArray(o.children)&&o.children.length>0;t.has(o.id)&&i&&(a(o.children??[],e),o.hasMoreChildren&&n.push({id:`${o.id}${Yo}`,path:e}))}};return a(e,[]),o&&n.push({id:`${r}${Yo}`,path:[]}),n}(I,y,g,E),[I,y,g,E]),O=t.useCallback(e=>{const t=A.find(t=>t.id===e);if(R(e),!t||!b(t))return;const r=x.has(e),o=new Set("multiple"===m?x:[]);r?o.delete(e):o.add(e),w(o)},[x,m,A,b]),L=t.useCallback(e=>{const t=y.has(e),r=new Set(y);if(t)r.delete(e);else{r.add(e);const t=A.find(t=>t.id===e);!t||t.children&&0!==t.children.length||z(e)}k(r)},[A,z,y,k]),T=t.useCallback(()=>A.filter(e=>!fn(e)).map(e=>e.id),[A]),V=t.useCallback(e=>!1,[]),{handleKeyDown:F,moveActive:$}=It({getItems:T,isItemDisabled:V,active:N,setActive:R,loop:!1,orientation:"vertical",onSelect:e=>{O(e)}}),G=t.useCallback(e=>{if("ArrowRight"===e.key){const e=N?A.find(e=>e.id===N):null;if(e){if(e.hasChildren){y.has(e.id)?$(1):L(e.id)}}return}if("ArrowLeft"===e.key){const e=N?A.find(e=>e.id===N):null;if(e){const t=e.hasChildren,r=y.has(e.id);if(t&&r)L(e.id);else{const t=e.path[e.path.length-1];t&&R(t)}}return}F(e)},[N,A,y,F,$,L]);t.useEffect(()=>{if(!N||!D.current)return;const e=document.getElementById(`${g}-item-${N}`);e&&e.scrollIntoView({block:"nearest",behavior:"auto"})},[N]);const B=t.useMemo(()=>({baseId:g,items:A,active:N,loadMore:z,selection:x,expanded:y,toggleSelection:O,toggleExpanded:L,selectionMode:m,isFocused:M,isItemSelectable:b}),[g,A,z,x,y,N,O,L,m,M,b]);return i(j,{value:B,children:i("div",{id:g,ref:D,className:ot(e,"focus-within:outline-none focus-within:ring-1 focus-within:ring-bdr-strong focus-within:ring-offset-1 focus-within:ring-offset-surface-neutral"),role:"tree","aria-activedescendant":N?`${g}-item-${N}`:void 0,"aria-multiselectable":"multiple"===m||void 0,tabIndex:0,onKeyDown:G,onFocus:()=>S(!0),onBlur:()=>S(!1),...h,children:p})})};function fn(e){return e.id.endsWith(Yo)}const mn=Object.assign(un,{Root:un,Container:tn,Content:en,Row:cn,LoadingRow:dn,RowLeft:rn,RowRight:on,RowLevelSpacer:nn,RowExpandControl:an,RowContent:sn,RowSelectionControl:ln});exports.Avatar=bt,exports.AvatarProvider=l,exports.Button=ht,exports.Checkbox=Yt,exports.Combobox=fr,exports.ComboboxProvider=u,exports.Dialog=Rr,exports.DialogProvider=b,exports.IconButton=Jt,exports.IdProvider=g,exports.Input=Dr,exports.Link=Pr,exports.ListItem=jr,exports.Listbox=Kr,exports.ListboxProvider=w,exports.Menu=no,exports.MenuProvider=I,exports.Menubar=Co,exports.MenubarMenuContext=N,exports.MenubarMenuProvider=R,exports.MenubarProvider=D,exports.SearchField=Do,exports.SearchFieldProvider=z,exports.SelectableListItem=Eo,exports.Separator=Po,exports.Toggle=zo,exports.ToggleGroup=Lo,exports.ToggleGroupProvider=L,exports.Toolbar=qo,exports.Tooltip=function({className:r,children:o,value:n,side:a="bottom",asChild:s=!0,delay:l=0}){const[c,d]=t.useState(!1),u=t.useRef(null),f=t.useRef(null),m=t.useRef(),b=null==n||""===n,p=c&&!b,h=function(e,r,o,n){const[a,i]=t.useState({top:0,left:0,transformOrigin:"",actualSide:r});return t.useEffect(()=>{if(!e||!o.current||!n.current)return;const t=o.current.getBoundingClientRect(),a=n.current.getBoundingClientRect(),s=e=>{let r=0,o=0,n="";switch(e){case"top":r=t.top+window.scrollY-a.height-8,o=t.left+window.scrollX+(t.width-a.width)/2,n="bottom center";break;case"bottom":r=t.bottom+window.scrollY+8,o=t.left+window.scrollX+(t.width-a.width)/2,n="top center";break;case"left":r=t.top+window.scrollY+(t.height-a.height)/2,o=t.left+window.scrollX-a.width-8,n="center right";break;case"right":r=t.top+window.scrollY+(t.height-a.height)/2,o=t.right+window.scrollX+8,n="center left"}return{top:r,left:o,transformOrigin:n,actualSide:e}},l=({top:e,left:t})=>{const r=window.scrollY+8,o=window.scrollY+window.innerHeight-a.height-8,n=window.scrollX+8,i=window.scrollX+window.innerWidth-a.width-8;return e>=r&&e<=o&&t>=n&&t<=i};let c=s(r);if(!l(c)){const e=s(Ho[r]);l(e)&&(c=e)}i(c)},[e,r]),a}(p,a,u,f);t.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const g=t.useCallback(()=>{b||(m.current&&clearTimeout(m.current),l>0?m.current=window.setTimeout(()=>d(!0),l):d(!0))},[l,b]),v=t.useCallback(()=>{m.current&&clearTimeout(m.current),d(!1)},[]),x=t.useCallback(()=>{b||d(!0)},[b]),w=t.useCallback(()=>d(!1),[]);return i(e.Fragment,{children:[i(Uo,{asChild:s,triggerRef:u,isOpen:c,onMouseEnter:g,onMouseLeave:v,onFocus:x,onBlur:w,children:o}),p&&t.createPortal(i(Xo,{actualSide:h.actualSide,className:r,position:h,tooltipRef:f,children:n}),document.body)]})},exports.TreeList=mn,exports.TreeListProvider=j,exports.cn=ot,exports.generateAriaId=$,exports.generateAriaIds=function(e,t){return t.reduce((t,r)=>(t[r]=$(e,r),t),{})},exports.generateItemId=G,exports.getActiveDescendantId=function(e,t,r){if(r)return G(e,t,r)},exports.isLoadingPlaceholder=fn,exports.setRef=nt,exports.unwrap=it,exports.useActiveItemFocus=gt,exports.useAvatar=c,exports.useClickOutside=vt,exports.useCombobox=f,exports.useComposedRefs=at,exports.useControlledState=xt,exports.useControlledStateWithNull=wt,exports.useDialog=p,exports.useFloatingPosition=yt,exports.useItemRegistry=kt,exports.useKeyboardNavigation=It,exports.useListbox=y,exports.useMenu=C,exports.useMenubar=E,exports.useMenubarMenu=M,exports.useMenubarMenuOptional=function(){return t.useContext(N)},exports.useMenubarOptional=()=>t.useContext(S),exports.usePrefixedId=v,exports.useRovingTabIndex=Ct,exports.useScrollActiveIntoView=Nt,exports.useScrollLock=Rt,exports.useSearchField=A,exports.useSyncValue=Mt,exports.useToggleGroup=T,exports.useToolbar=Go,exports.useToolbarOptional=function(){return t.useContext($o)},exports.useTreeList=F;
|