@bazza-ui/react 0.1.0-canary.12 → 0.1.0-canary.14

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.
Files changed (57) hide show
  1. package/dist/{ListboxStore-nmorsoqX.d.cts → ListboxStore-DCGGpiBg.d.cts} +1 -1
  2. package/dist/{ListboxStore-BYBpGrOz.d.ts → ListboxStore-DZ73dOaC.d.ts} +1 -1
  3. package/dist/chunk-NNGWBSWK.js +2 -0
  4. package/dist/chunk-NNGWBSWK.js.map +1 -0
  5. package/dist/chunk-Z2RGBRJP.cjs +2 -0
  6. package/dist/{chunk-EYMK7XHC.cjs.map → chunk-Z2RGBRJP.cjs.map} +1 -1
  7. package/dist/combobox/index.cjs +1 -1
  8. package/dist/combobox/index.d.cts +8 -8
  9. package/dist/combobox/index.d.ts +8 -8
  10. package/dist/combobox/index.js +1 -1
  11. package/dist/command-menu/index.cjs +1 -1
  12. package/dist/command-menu/index.cjs.map +1 -1
  13. package/dist/command-menu/index.d.cts +9 -9
  14. package/dist/command-menu/index.d.ts +9 -9
  15. package/dist/command-menu/index.js +1 -1
  16. package/dist/command-menu/index.js.map +1 -1
  17. package/dist/context-menu/index.cjs +1 -1
  18. package/dist/context-menu/index.cjs.map +1 -1
  19. package/dist/context-menu/index.d.cts +39 -15
  20. package/dist/context-menu/index.d.ts +39 -15
  21. package/dist/context-menu/index.js +1 -1
  22. package/dist/context-menu/index.js.map +1 -1
  23. package/dist/dropdown-menu/index.cjs +1 -1
  24. package/dist/dropdown-menu/index.cjs.map +1 -1
  25. package/dist/dropdown-menu/index.d.cts +39 -15
  26. package/dist/dropdown-menu/index.d.ts +39 -15
  27. package/dist/dropdown-menu/index.js +1 -1
  28. package/dist/dropdown-menu/index.js.map +1 -1
  29. package/dist/{events-DOGItflK.d.ts → events-D6K5-_aP.d.ts} +71 -3
  30. package/dist/{events-DPsuhBln.d.cts → events-DuKEM5sQ.d.cts} +71 -3
  31. package/dist/internal/listbox/index.d.cts +4 -4
  32. package/dist/internal/listbox/index.d.ts +4 -4
  33. package/dist/internal/popup-menu/index.cjs +1 -1
  34. package/dist/internal/popup-menu/index.cjs.map +1 -1
  35. package/dist/internal/popup-menu/index.d.cts +9 -9
  36. package/dist/internal/popup-menu/index.d.ts +9 -9
  37. package/dist/internal/popup-menu/index.js +1 -1
  38. package/dist/loaders/index.d.cts +1 -1
  39. package/dist/loaders/index.d.ts +1 -1
  40. package/dist/{resolve-Dk_fAKb2.d.cts → resolve-C5shwZ1S.d.cts} +1 -1
  41. package/dist/{resolve-BYm41YfG.d.ts → resolve-DA6nHdAi.d.ts} +1 -1
  42. package/dist/{scroll-arrow-CNd0tgME.d.ts → scroll-arrow-CxHg9cFW.d.ts} +2 -2
  43. package/dist/{scroll-arrow-B81wZTZ2.d.cts → scroll-arrow-rsrV6nun.d.cts} +2 -2
  44. package/dist/select/index.cjs +1 -1
  45. package/dist/select/index.d.cts +8 -8
  46. package/dist/select/index.d.ts +8 -8
  47. package/dist/select/index.js +1 -1
  48. package/dist/{separator-De8l8DKO.d.ts → separator-DaXKN0QW.d.ts} +2 -2
  49. package/dist/{separator-BiySI623.d.cts → separator-DzfgGPjS.d.cts} +2 -2
  50. package/dist/{surface-context-ClmxshBW.d.ts → surface-context-BMizU8oI.d.ts} +1 -1
  51. package/dist/{surface-context-DF-L-30G.d.cts → surface-context-r2eYfQth.d.cts} +1 -1
  52. package/dist/{type-guards-BC2B6bVi.d.cts → type-guards-BO8iCz9M.d.cts} +5 -4
  53. package/dist/{type-guards-ybcHBB3C.d.ts → type-guards-BOg6-eFO.d.ts} +5 -4
  54. package/package.json +3 -3
  55. package/dist/chunk-65TSJ7MA.js +0 -2
  56. package/dist/chunk-65TSJ7MA.js.map +0 -1
  57. package/dist/chunk-EYMK7XHC.cjs +0 -2
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk5T5B5SPRcjs = require('../chunk-5T5B5SPR.cjs');var _chunkEYMK7XHCcjs = require('../chunk-EYMK7XHC.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var zo={};_chunkM4G6J7DPcjs.a.call(void 0, zo,{Arrow:()=>_chunkEYMK7XHCcjs.s,Backdrop:()=>_chunkEYMK7XHCcjs.t,Clear:()=>Me,Empty:()=>_chunkEYMK7XHCcjs.U,Group:()=>_chunkEYMK7XHCcjs.pa,GroupLabel:()=>_chunkEYMK7XHCcjs.W,Icon:()=>_chunkEYMK7XHCcjs.T,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>_chunkEYMK7XHCcjs.ba,Popup:()=>_chunkEYMK7XHCcjs.J,Portal:()=>_chunkEYMK7XHCcjs.K,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>_chunkEYMK7XHCcjs.ea,ScrollUpArrow:()=>_chunkEYMK7XHCcjs.da,Separator:()=>_chunkEYMK7XHCcjs.sa,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});var _userender = require('@base-ui/react/use-render');var _react = require('react'); var _ = _interopRequireWildcard(_react); var xe = _interopRequireWildcard(_react); var ne = _interopRequireWildcard(_react); var Ce = _interopRequireWildcard(_react); var se = _interopRequireWildcard(_react); var T = _interopRequireWildcard(_react); var re = _interopRequireWildcard(_react); var E = _interopRequireWildcard(_react); var le = _interopRequireWildcard(_react); var Ie = _interopRequireWildcard(_react); var Y = _interopRequireWildcard(_react); var U = _interopRequireWildcard(_react); var h = _interopRequireWildcard(_react); var Z = _interopRequireWildcard(_react);var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=_chunkEYMK7XHCcjs.w.call(void 0, ),b=_nullishCoalesce(u, () => (m.disabled)),I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{_optionalChain([a, 'optionalCall', _2 => _2(R)]),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),_optionalChain([t, 'optionalCall', _3 => _3(R)])},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=_userender.useRender.call(void 0, {render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!_chunkEYMK7XHCcjs.Q.call(void 0, e.value),u=se.useCallback(c=>{let a=_chunkEYMK7XHCcjs.S.call(void 0, c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=_chunk5T5B5SPRcjs.f.call(void 0, e.items,a);if(typeof P=="string")return P;let m=_chunkEYMK7XHCcjs.R.call(void 0, c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:_chunkEYMK7XHCcjs.R.call(void 0, P,e.itemToStringLabel)||_chunkEYMK7XHCcjs.S.call(void 0, P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:_chunkEYMK7XHCcjs.R.call(void 0, c,e.itemToStringLabel)||_chunkEYMK7XHCcjs.S.call(void 0, c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=_optionalChain([r, 'optionalAccess', _4 => _4.contains, 'call', _5 => _5(O)]),z=_optionalChain([v, 'optionalAccess', _6 => _6.contains, 'call', _7 => _7(O)]),ee=_optionalChain([y, 'optionalAccess', _8 => _8.contains, 'call', _9 => _9(O)]);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(_optionalChain([t, 'optionalCall', _10 => _10(n)]),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=_nullishCoalesce(a(e.value), () => (_chunkEYMK7XHCcjs.R.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{_optionalChain([P, 'optionalCall', _11 => _11(n)]),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=_optionalChain([document, 'access', _12 => _12.getElementById, 'call', _13 => _13(e.listId), 'optionalAccess', _14 => _14.contains, 'call', _15 => _15(f)]),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?_chunkXMZZ62VJcjs.a.outsidePress:_chunkXMZZ62VJcjs.a.focusOut;R.current=null,e.closeCombobox(W,_nullishCoalesce(O, () => (void 0)))}})},[P,e]),A=T.useCallback(n=>{if(_optionalChain([m, 'optionalCall', _16 => _16(n)]),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=_nullishCoalesce(a(e.value), () => (_chunkEYMK7XHCcjs.R.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(_optionalChain([b, 'optionalCall', _17 => _17(n)]),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(_chunkXMZZ62VJcjs.a.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=_nullishCoalesce(a(e.value), () => (_chunkEYMK7XHCcjs.R.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=_chunkEYMK7XHCcjs.P.call(void 0, {store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=_chunkEYMK7XHCcjs.w.call(void 0, ),g=_chunkEYMK7XHCcjs.d.call(void 0, ),l=_chunkEYMK7XHCcjs.a.call(void 0, ),S=To(),R=(_nullishCoalesce(u, () => (d.disabled)))||g.disabled,L=_chunk5T5B5SPRcjs.f.call(void 0, d.items,""),w=_nullishCoalesce(_nullishCoalesce(i, () => ((typeof L=="string"?L:void 0))), () => (d.placeholder)),k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return _userender.useRender.call(void 0, {render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};var _jsxruntime = require('react/jsx-runtime');var Rt={open:x=>x?{[ge.open]:""}:null},ke= exports.ComboboxInputWrapper =re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=_chunkEYMK7XHCcjs.d.call(void 0, ),t=_chunkEYMK7XHCcjs.w.call(void 0, ),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=_userender.useRender.call(void 0, {render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return _jsxruntime.jsx.call(void 0, Le.Provider,{value:!0,children:d})});var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=_chunkEYMK7XHCcjs.w.call(void 0, ),S=E.useMemo(()=>_chunkEYMK7XHCcjs.S.call(void 0, o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>_chunk5T5B5SPRcjs.e.call(void 0, l.items,S),[l.items,S]),k=_optionalChain([w, 'optionalAccess', _18 => _18.label]),V=E.useMemo(()=>_chunkEYMK7XHCcjs.R.call(void 0, o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>_chunk5T5B5SPRcjs.g.call(void 0, u,[typeof k=="string"?k:V&&V!==S?V:void 0,..._nullishCoalesce(_optionalChain([w, 'optionalAccess', _19 => _19.keywords]), () => ([]))]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?_chunk5T5B5SPRcjs.c.call(void 0, l.values,o,l.isItemEqualToValue):l.value!==""&&_chunk5T5B5SPRcjs.b.call(void 0, l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=_chunkEYMK7XHCcjs.O.call(void 0, {id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?_chunk5T5B5SPRcjs.d.call(void 0, l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);_optionalChain([p, 'optionalCall', _20 => _20()])}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{_optionalChain([m, 'optionalCall', _21 => _21(M)]),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),_optionalChain([b, 'optionalCall', _22 => _22(M)])},[r.handlers,b]),z=E.useCallback(M=>{_optionalChain([I, 'optionalCall', _23 => _23(M)]),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=_userender.useRender.call(void 0, {render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?_jsxruntime.jsx.call(void 0, he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He= exports.ComboboxItemIndicator =Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=_userender.useRender.call(void 0, {render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=_chunkEYMK7XHCcjs.w.call(void 0, ),t=ue(),P=_chunkEYMK7XHCcjs.S.call(void 0, t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=_chunk5T5B5SPRcjs.f.call(void 0, a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),_userender.useRender.call(void 0, {render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});var _popover = require('@base-ui/react/popover');var Re={slot:"bazzaui-combobox-positioner"};function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=_chunkEYMK7XHCcjs.w.call(void 0, ),d=_nullishCoalesce(i, () => (I.layout)),g=d==="input-embedded",l=_nullishCoalesce(a, () => (I.inputWrapperRef.current))?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":_nullishCoalesce(p, () => ("start")),{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return _jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return _jsxruntime.jsx.call(void 0, fe.Provider,{value:v,children:_jsxruntime.jsx.call(void 0, "div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return _jsxruntime.jsx.call(void 0, fe.Provider,{value:A,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=_chunk5T5B5SPRcjs.a,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>_optionalChain([v, 'optionalCall', _24 => _24(C,G,be)]),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=_chunkEYMK7XHCcjs.q.call(void 0, {onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{_optionalChain([ye, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.close, 'call', _27 => _27()])},unmount:()=>{_optionalChain([ye, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.unmount, 'call', _30 => _30()])},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==_chunkXMZZ62VJcjs.a.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),_optionalChain([O, 'optionalCall', _31 => _31(C)])},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),_optionalChain([c, 'optionalCall', _32 => _32(C)])},[s,c]),[rt,at]=h.useState(_nullishCoalesce(P, () => ([]))),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),_optionalChain([m, 'optionalCall', _33 => _33(C)])},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),_optionalChain([S, 'optionalCall', _34 => _34(C)])},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=_nullishCoalesce(j, () => (!a)),Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=_chunkEYMK7XHCcjs.S.call(void 0, C,d);return _jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:"",form:L,required:w}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:J!=null?_chunkEYMK7XHCcjs.S.call(void 0, J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return _jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.v.Provider,{value:ut,children:_jsxruntime.jsxs.call(void 0, _chunkEYMK7XHCcjs.N,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}var Fo={slot:"bazzaui-combobox-surface"};var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=_chunkEYMK7XHCcjs.w.call(void 0, ),P=Z.useCallback(g=>{_optionalChain([c, 'optionalCall', _35 => _35(g)]);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=_nullishCoalesce(i, () => (!0));if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?_chunkEYMK7XHCcjs.S.call(void 0, l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=_nullishCoalesce(s, () => ((b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search))),d=Z.useCallback(g=>{t.onInputValueChange(g),_optionalChain([p, 'optionalCall', _36 => _36(g)])},[t,p]);return _jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.fa,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});exports.Combobox = zo; exports.ComboboxArrowDataAttributes = Bo; exports.ComboboxBackdropDataAttributes = Wo; exports.ComboboxClear = Me; exports.ComboboxEmptyDataAttributes = jo; exports.ComboboxGroupDataAttributes = Go; exports.ComboboxGroupLabelDataAttributes = No; exports.ComboboxIconDataAttributes = At; exports.ComboboxInput = we; exports.ComboboxInputDataAttributes = Q; exports.ComboboxInputWrapper = ke; exports.ComboboxInputWrapperDataAttributes = ge; exports.ComboboxItem = Te; exports.ComboboxItemDataAttributes = q; exports.ComboboxItemIndicator = He; exports.ComboboxItemIndicatorDataAttributes = Pe; exports.ComboboxItemLabel = Oe; exports.ComboboxListCssVars = _chunkEYMK7XHCcjs.aa; exports.ComboboxListDataAttributes = qo; exports.ComboboxPopupDataAttributes = Ko; exports.ComboboxPositioner = De; exports.ComboboxPositionerCssVars = _chunkEYMK7XHCcjs.L; exports.ComboboxPositionerDataAttributes = Re; exports.ComboboxRoot = Ae; exports.ComboboxScrollArrowDataAttributes = Ft; exports.ComboboxSeparatorDataAttributes = Uo; exports.ComboboxStore = _chunkXMZZ62VJcjs.y; exports.ComboboxSurface = Fe; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.useComboboxContext = _chunkEYMK7XHCcjs.w; exports.useComboboxItemContext = ue; exports.useComboboxPositionerContext = Ee; exports.useMaybeComboboxContext = _chunkEYMK7XHCcjs.x; exports.useMaybeComboboxItemContext = yt; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk5T5B5SPRcjs = require('../chunk-5T5B5SPR.cjs');var _chunkZ2RGBRJPcjs = require('../chunk-Z2RGBRJP.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var zo={};_chunkM4G6J7DPcjs.a.call(void 0, zo,{Arrow:()=>_chunkZ2RGBRJPcjs.s,Backdrop:()=>_chunkZ2RGBRJPcjs.t,Clear:()=>Me,Empty:()=>_chunkZ2RGBRJPcjs.V,Group:()=>_chunkZ2RGBRJPcjs.ra,GroupLabel:()=>_chunkZ2RGBRJPcjs.X,Icon:()=>_chunkZ2RGBRJPcjs.U,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>_chunkZ2RGBRJPcjs.ca,Popup:()=>_chunkZ2RGBRJPcjs.K,Portal:()=>_chunkZ2RGBRJPcjs.L,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>_chunkZ2RGBRJPcjs.fa,ScrollUpArrow:()=>_chunkZ2RGBRJPcjs.ea,Separator:()=>_chunkZ2RGBRJPcjs.ua,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});var _userender = require('@base-ui/react/use-render');var _react = require('react'); var _ = _interopRequireWildcard(_react); var xe = _interopRequireWildcard(_react); var ne = _interopRequireWildcard(_react); var Ce = _interopRequireWildcard(_react); var se = _interopRequireWildcard(_react); var T = _interopRequireWildcard(_react); var re = _interopRequireWildcard(_react); var E = _interopRequireWildcard(_react); var le = _interopRequireWildcard(_react); var Ie = _interopRequireWildcard(_react); var Y = _interopRequireWildcard(_react); var U = _interopRequireWildcard(_react); var h = _interopRequireWildcard(_react); var Z = _interopRequireWildcard(_react);var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=_chunkZ2RGBRJPcjs.w.call(void 0, ),b=_nullishCoalesce(u, () => (m.disabled)),I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{_optionalChain([a, 'optionalCall', _2 => _2(R)]),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),_optionalChain([t, 'optionalCall', _3 => _3(R)])},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=_userender.useRender.call(void 0, {render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!_chunkZ2RGBRJPcjs.R.call(void 0, e.value),u=se.useCallback(c=>{let a=_chunkZ2RGBRJPcjs.T.call(void 0, c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=_chunk5T5B5SPRcjs.f.call(void 0, e.items,a);if(typeof P=="string")return P;let m=_chunkZ2RGBRJPcjs.S.call(void 0, c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:_chunkZ2RGBRJPcjs.S.call(void 0, P,e.itemToStringLabel)||_chunkZ2RGBRJPcjs.T.call(void 0, P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:_chunkZ2RGBRJPcjs.S.call(void 0, c,e.itemToStringLabel)||_chunkZ2RGBRJPcjs.T.call(void 0, c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=_optionalChain([r, 'optionalAccess', _4 => _4.contains, 'call', _5 => _5(O)]),z=_optionalChain([v, 'optionalAccess', _6 => _6.contains, 'call', _7 => _7(O)]),ee=_optionalChain([y, 'optionalAccess', _8 => _8.contains, 'call', _9 => _9(O)]);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(_optionalChain([t, 'optionalCall', _10 => _10(n)]),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=_nullishCoalesce(a(e.value), () => (_chunkZ2RGBRJPcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{_optionalChain([P, 'optionalCall', _11 => _11(n)]),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=_optionalChain([document, 'access', _12 => _12.getElementById, 'call', _13 => _13(e.listId), 'optionalAccess', _14 => _14.contains, 'call', _15 => _15(f)]),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?_chunkXMZZ62VJcjs.a.outsidePress:_chunkXMZZ62VJcjs.a.focusOut;R.current=null,e.closeCombobox(W,_nullishCoalesce(O, () => (void 0)))}})},[P,e]),A=T.useCallback(n=>{if(_optionalChain([m, 'optionalCall', _16 => _16(n)]),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=_nullishCoalesce(a(e.value), () => (_chunkZ2RGBRJPcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(_optionalChain([b, 'optionalCall', _17 => _17(n)]),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(_chunkXMZZ62VJcjs.a.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=_nullishCoalesce(a(e.value), () => (_chunkZ2RGBRJPcjs.S.call(void 0, e.value,e.itemToStringLabel)));e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=_chunkZ2RGBRJPcjs.Q.call(void 0, {store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=_chunkZ2RGBRJPcjs.w.call(void 0, ),g=_chunkZ2RGBRJPcjs.d.call(void 0, ),l=_chunkZ2RGBRJPcjs.a.call(void 0, ),S=To(),R=(_nullishCoalesce(u, () => (d.disabled)))||g.disabled,L=_chunk5T5B5SPRcjs.f.call(void 0, d.items,""),w=_nullishCoalesce(_nullishCoalesce(i, () => ((typeof L=="string"?L:void 0))), () => (d.placeholder)),k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return _userender.useRender.call(void 0, {render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};var _jsxruntime = require('react/jsx-runtime');var Rt={open:x=>x?{[ge.open]:""}:null},ke= exports.ComboboxInputWrapper =re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=_chunkZ2RGBRJPcjs.d.call(void 0, ),t=_chunkZ2RGBRJPcjs.w.call(void 0, ),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=_userender.useRender.call(void 0, {render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return _jsxruntime.jsx.call(void 0, Le.Provider,{value:!0,children:d})});var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=_chunkZ2RGBRJPcjs.w.call(void 0, ),S=E.useMemo(()=>_chunkZ2RGBRJPcjs.T.call(void 0, o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>_chunk5T5B5SPRcjs.e.call(void 0, l.items,S),[l.items,S]),k=_optionalChain([w, 'optionalAccess', _18 => _18.label]),V=E.useMemo(()=>_chunkZ2RGBRJPcjs.S.call(void 0, o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>_chunk5T5B5SPRcjs.g.call(void 0, u,[typeof k=="string"?k:V&&V!==S?V:void 0,..._nullishCoalesce(_optionalChain([w, 'optionalAccess', _19 => _19.keywords]), () => ([]))]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?_chunk5T5B5SPRcjs.c.call(void 0, l.values,o,l.isItemEqualToValue):l.value!==""&&_chunk5T5B5SPRcjs.b.call(void 0, l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=_chunkZ2RGBRJPcjs.P.call(void 0, {id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?_chunk5T5B5SPRcjs.d.call(void 0, l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);_optionalChain([p, 'optionalCall', _20 => _20()])}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{_optionalChain([m, 'optionalCall', _21 => _21(M)]),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),_optionalChain([b, 'optionalCall', _22 => _22(M)])},[r.handlers,b]),z=E.useCallback(M=>{_optionalChain([I, 'optionalCall', _23 => _23(M)]),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=_userender.useRender.call(void 0, {render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?_jsxruntime.jsx.call(void 0, he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He= exports.ComboboxItemIndicator =Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=_userender.useRender.call(void 0, {render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=_chunkZ2RGBRJPcjs.w.call(void 0, ),t=ue(),P=_chunkZ2RGBRJPcjs.T.call(void 0, t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=_chunk5T5B5SPRcjs.f.call(void 0, a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),_userender.useRender.call(void 0, {render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});var _popover = require('@base-ui/react/popover');var Re={slot:"bazzaui-combobox-positioner"};function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=_chunkZ2RGBRJPcjs.w.call(void 0, ),d=_nullishCoalesce(i, () => (I.layout)),g=d==="input-embedded",l=_nullishCoalesce(a, () => (I.inputWrapperRef.current))?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":_nullishCoalesce(p, () => ("start")),{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return _jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return _jsxruntime.jsx.call(void 0, fe.Provider,{value:v,children:_jsxruntime.jsx.call(void 0, "div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return _jsxruntime.jsx.call(void 0, fe.Provider,{value:A,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=_chunk5T5B5SPRcjs.a,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>_optionalChain([v, 'optionalCall', _24 => _24(C,G,be)]),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=_chunkZ2RGBRJPcjs.q.call(void 0, {onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{_optionalChain([ye, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.close, 'call', _27 => _27()])},unmount:()=>{_optionalChain([ye, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.unmount, 'call', _30 => _30()])},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==_chunkXMZZ62VJcjs.a.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),_optionalChain([O, 'optionalCall', _31 => _31(C)])},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),_optionalChain([c, 'optionalCall', _32 => _32(C)])},[s,c]),[rt,at]=h.useState(_nullishCoalesce(P, () => ([]))),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),_optionalChain([m, 'optionalCall', _33 => _33(C)])},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),_optionalChain([S, 'optionalCall', _34 => _34(C)])},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=_nullishCoalesce(j, () => (!a)),Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=_chunkZ2RGBRJPcjs.T.call(void 0, C,d);return _jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:"",form:L,required:w}):_jsxruntime.jsx.call(void 0, "input",{type:"hidden",name:R,value:J!=null?_chunkZ2RGBRJPcjs.T.call(void 0, J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.v.Provider,{value:ut,children:_jsxruntime.jsxs.call(void 0, _chunkZ2RGBRJPcjs.O,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}var Fo={slot:"bazzaui-combobox-surface"};var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=_chunkZ2RGBRJPcjs.w.call(void 0, ),P=Z.useCallback(g=>{_optionalChain([c, 'optionalCall', _35 => _35(g)]);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=_nullishCoalesce(i, () => (!0));if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?_chunkZ2RGBRJPcjs.T.call(void 0, l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=_nullishCoalesce(s, () => ((b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search))),d=Z.useCallback(g=>{t.onInputValueChange(g),_optionalChain([p, 'optionalCall', _36 => _36(g)])},[t,p]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.ga,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});exports.Combobox = zo; exports.ComboboxArrowDataAttributes = Bo; exports.ComboboxBackdropDataAttributes = Wo; exports.ComboboxClear = Me; exports.ComboboxEmptyDataAttributes = jo; exports.ComboboxGroupDataAttributes = Go; exports.ComboboxGroupLabelDataAttributes = No; exports.ComboboxIconDataAttributes = At; exports.ComboboxInput = we; exports.ComboboxInputDataAttributes = Q; exports.ComboboxInputWrapper = ke; exports.ComboboxInputWrapperDataAttributes = ge; exports.ComboboxItem = Te; exports.ComboboxItemDataAttributes = q; exports.ComboboxItemIndicator = He; exports.ComboboxItemIndicatorDataAttributes = Pe; exports.ComboboxItemLabel = Oe; exports.ComboboxListCssVars = _chunkZ2RGBRJPcjs.ba; exports.ComboboxListDataAttributes = qo; exports.ComboboxPopupDataAttributes = Ko; exports.ComboboxPositioner = De; exports.ComboboxPositionerCssVars = _chunkZ2RGBRJPcjs.M; exports.ComboboxPositionerDataAttributes = Re; exports.ComboboxRoot = Ae; exports.ComboboxScrollArrowDataAttributes = Ft; exports.ComboboxSeparatorDataAttributes = Uo; exports.ComboboxStore = _chunkXMZZ62VJcjs.y; exports.ComboboxSurface = Fe; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.useComboboxContext = _chunkZ2RGBRJPcjs.w; exports.useComboboxItemContext = ue; exports.useComboboxPositionerContext = Ee; exports.useMaybeComboboxContext = _chunkZ2RGBRJPcjs.x; exports.useMaybeComboboxItemContext = yt; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,15 +1,15 @@
1
- import { V as VirtualItem } from '../ListboxStore-nmorsoqX.cjs';
2
- export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-nmorsoqX.cjs';
3
- import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-B81wZTZ2.cjs';
4
- export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-B81wZTZ2.cjs';
5
- import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-BiySI623.cjs';
6
- export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-BiySI623.cjs';
1
+ import { V as VirtualItem } from '../ListboxStore-DCGGpiBg.cjs';
2
+ export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-DCGGpiBg.cjs';
3
+ import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-rsrV6nun.cjs';
4
+ export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-rsrV6nun.cjs';
5
+ import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-DzfgGPjS.cjs';
6
+ export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-DzfgGPjS.cjs';
7
7
  import * as React from 'react';
8
8
  import { C as ComponentProps } from '../types-DT4FOOa2.cjs';
9
9
  import { PopoverPositionerProps, Popover, PopoverRootProps } from '@base-ui/react/popover';
10
10
  import { I as ItemEqualityComparer, a as Items } from '../items-B6HeFO_8.cjs';
11
- import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aP as inputChange, aQ as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-DPsuhBln.cjs';
12
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-DF-L-30G.cjs';
11
+ import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aV as inputChange, aW as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-DuKEM5sQ.cjs';
12
+ export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-r2eYfQth.cjs';
13
13
  export { c as commandScore, d as defaultFilter } from '../command-score-CTJ9NV6n.cjs';
14
14
  import '@base-ui/utils/store';
15
15
 
@@ -1,15 +1,15 @@
1
- import { V as VirtualItem } from '../ListboxStore-BYBpGrOz.js';
2
- export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-BYBpGrOz.js';
3
- import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-CNd0tgME.js';
4
- export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-CNd0tgME.js';
5
- import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-De8l8DKO.js';
6
- export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-De8l8DKO.js';
1
+ import { V as VirtualItem } from '../ListboxStore-DZ73dOaC.js';
2
+ export { F as ComboboxFilterFn, I as ComboboxItemRegistration, b as ComboboxStore, L as ComboboxStoreContext, a as ComboboxStoreState } from '../ListboxStore-DZ73dOaC.js';
3
+ import { P as PopupMenuDebugOptions, a as PopupMenuRootActions, b as PopupMenuArrow, c as PopupMenuBackdrop, d as PopupMenuPopup, e as PopupMenuPortal, f as PopupMenuScrollDownArrow, g as PopupMenuScrollUpArrow } from '../scroll-arrow-CxHg9cFW.js';
4
+ export { h as ComboboxArrowProps, i as ComboboxBackdropProps, p as ComboboxListCssVars, j as ComboboxPopupProps, k as ComboboxPortalProps, q as ComboboxPositionerCssVars, l as ComboboxScrollArrowProps, m as ComboboxScrollArrowState, n as ComboboxScrollDownArrowProps, o as ComboboxScrollUpArrowProps } from '../scroll-arrow-CxHg9cFW.js';
5
+ import { f as PopupMenuSurface, t as PopupMenuSurfaceProps, P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator } from '../separator-DaXKN0QW.js';
6
+ export { g as ComboboxEmptyProps, h as ComboboxEmptyState, i as ComboboxGroupLabelProps, j as ComboboxGroupLabelState, k as ComboboxGroupProps, l as ComboboxGroupState, m as ComboboxIconProps, n as ComboboxIconState, o as ComboboxListChildrenState, p as ComboboxListProps, q as ComboboxListState, r as ComboboxSeparatorProps, s as ComboboxSeparatorState, u as ComboboxSurfaceState } from '../separator-DaXKN0QW.js';
7
7
  import * as React from 'react';
8
8
  import { C as ComponentProps } from '../types-DT4FOOa2.js';
9
9
  import { PopoverPositionerProps, Popover, PopoverRootProps } from '@base-ui/react/popover';
10
10
  import { I as ItemEqualityComparer, a as Items } from '../items-B6HeFO_8.js';
11
- import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aP as inputChange, aQ as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-DOGItflK.js';
12
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-ClmxshBW.js';
11
+ import { C as ChangeEventDetails, t as triggerPress, e as escapeKey, o as outsidePress, f as focusOut, i as itemPress, aV as inputChange, aW as inputClear, l as listNavigation, g as imperativeAction, n as none, G as GenericEventDetails, p as pointer, k as keyboard } from '../events-D6K5-_aP.js';
12
+ export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-BMizU8oI.js';
13
13
  export { c as commandScore, d as defaultFilter } from '../command-score-CTJ9NV6n.js';
14
14
  import '@base-ui/utils/store';
15
15
 
@@ -1,2 +1,2 @@
1
- import{a as vo,b as Vo,c as Mo,d as Eo,e as Lo,f as te,g as wo}from"../chunk-KO3DXT3Y.js";import{J as io,K as po,L as Ct,N as mo,O as co,P as bo,Q as xo,R as N,S as F,T as fo,U as Co,W as go,a as ro,aa as gt,ba as ho,d as de,da as Po,ea as Io,fa as Ro,pa as So,q as ao,s as so,sa as yo,t as lo,v as uo,w as D,x as ft}from"../chunk-65TSJ7MA.js";import{a as oe,p as mt,q as ct,w as bt,x as dt,y as xt}from"../chunk-A4Z5BY7H.js";import{a as pt}from"../chunk-4C666HHU.js";var zo={};pt(zo,{Arrow:()=>so,Backdrop:()=>lo,Clear:()=>Me,Empty:()=>Co,Group:()=>So,GroupLabel:()=>go,Icon:()=>fo,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>ho,Popup:()=>io,Portal:()=>po,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>Io,ScrollUpArrow:()=>Po,Separator:()=>yo,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});import{useRender as ht}from"@base-ui/react/use-render";import*as _ from"react";var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=D(),b=u??m.disabled,I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{a?.(R),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),t?.(R)},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=ht({render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});import*as xe from"react";var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}import{useRender as Pt}from"@base-ui/react/use-render";import*as ne from"react";import*as Ce from"react";var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};import*as se from"react";function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!xo(e.value),u=se.useCallback(c=>{let a=F(c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=te(e.items,a);if(typeof P=="string")return P;let m=N(c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:N(P,e.itemToStringLabel)||F(P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:N(c,e.itemToStringLabel)||F(c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}import*as T from"react";function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=r?.contains(O),z=v?.contains(O),ee=y?.contains(O);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(t?.(n),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{P?.(n),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=document.getElementById(e.listId)?.contains(f),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?oe.outsidePress:oe.focusOut;R.current=null,e.closeCombobox(W,O??void 0)}})},[P,e]),A=T.useCallback(n=>{if(m?.(n),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(b?.(n),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(oe.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=bo({store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=D(),g=de(),l=ro(),S=To(),R=(u??d.disabled)||g.disabled,L=te(d.items,""),w=i??(typeof L=="string"?L:void 0)??d.placeholder,k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return Pt({render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});import{useRender as It}from"@base-ui/react/use-render";import*as re from"react";var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};import{jsx as St}from"react/jsx-runtime";var Rt={open:x=>x?{[ge.open]:""}:null},ke=re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=de(),t=D(),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=It({render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return St(Le.Provider,{value:!0,children:d})});import{useRender as vt}from"@base-ui/react/use-render";import*as E from"react";var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};import*as le from"react";var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}import{jsx as Et}from"react/jsx-runtime";var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=D(),S=E.useMemo(()=>F(o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>Lo(l.items,S),[l.items,S]),k=w?.label,V=E.useMemo(()=>N(o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>wo(u,[typeof k=="string"?k:V&&V!==S?V:void 0,...w?.keywords??[]]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?Mo(l.values,o,l.isItemEqualToValue):l.value!==""&&Vo(l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=co({id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?Eo(l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);p?.()}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{m?.(M),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),b?.(M)},[r.handlers,b]),z=E.useCallback(M=>{I?.(M),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=vt({render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?Et(he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);import{useRender as Lt}from"@base-ui/react/use-render";import*as Ie from"react";var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He=Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=Lt({render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});import{useRender as kt}from"@base-ui/react/use-render";import*as Y from"react";var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=D(),t=ue(),P=F(t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=te(a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),kt({render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});import{Popover as Ao}from"@base-ui/react/popover";import*as U from"react";var Re={slot:"bazzaui-combobox-positioner"};import{jsx as ie}from"react/jsx-runtime";function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=D(),d=i??I.layout,g=d==="input-embedded",l=a??I.inputWrapperRef.current?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":p??"start",{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return ie(fe.Provider,{value:v,children:ie("div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return ie(fe.Provider,{value:A,children:ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});import{Popover as Ht}from"@base-ui/react/popover";import*as h from"react";import{jsx as pe,jsxs as Ot}from"react/jsx-runtime";function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=vo,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>v?.(C,G,be),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=ao({onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{ye.current?.close()},unmount:()=>{ye.current?.unmount()},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==oe.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),O?.(C)},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),c?.(C)},[s,c]),[rt,at]=h.useState(P??[]),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),m?.(C)},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),S?.(C)},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=j??!a,Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=F(C,d);return pe("input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):pe("input",{type:"hidden",name:R,value:"",form:L,required:w}):pe("input",{type:"hidden",name:R,value:J!=null?F(J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return pe(uo.Provider,{value:ut,children:Ot(mo,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,pe(Ht.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}import*as Z from"react";var Fo={slot:"bazzaui-combobox-surface"};import{jsx as Dt}from"react/jsx-runtime";var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=D(),P=Z.useCallback(g=>{c?.(g);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=i??!0;if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?F(l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=s??(b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search),d=Z.useCallback(g=>{t.onInputValueChange(g),p?.(g)},[t,p]);return Dt(Ro,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});export{zo as Combobox,Bo as ComboboxArrowDataAttributes,Wo as ComboboxBackdropDataAttributes,Me as ComboboxClear,jo as ComboboxEmptyDataAttributes,Go as ComboboxGroupDataAttributes,No as ComboboxGroupLabelDataAttributes,At as ComboboxIconDataAttributes,we as ComboboxInput,Q as ComboboxInputDataAttributes,ke as ComboboxInputWrapper,ge as ComboboxInputWrapperDataAttributes,Te as ComboboxItem,q as ComboboxItemDataAttributes,He as ComboboxItemIndicator,Pe as ComboboxItemIndicatorDataAttributes,Oe as ComboboxItemLabel,gt as ComboboxListCssVars,qo as ComboboxListDataAttributes,Ko as ComboboxPopupDataAttributes,De as ComboboxPositioner,Ct as ComboboxPositionerCssVars,Re as ComboboxPositionerDataAttributes,Ae as ComboboxRoot,Ft as ComboboxScrollArrowDataAttributes,Uo as ComboboxSeparatorDataAttributes,xt as ComboboxStore,Fe as ComboboxSurface,bt as commandScore,dt as defaultFilter,D as useComboboxContext,ue as useComboboxItemContext,Ee as useComboboxPositionerContext,ft as useMaybeComboboxContext,yt as useMaybeComboboxItemContext,ct as useMaybeSurfaceContext,mt as useSurfaceContext};
1
+ import{a as vo,b as Vo,c as Mo,d as Eo,e as Lo,f as te,g as wo}from"../chunk-KO3DXT3Y.js";import{K as io,L as po,M as Ct,O as mo,P as co,Q as bo,R as xo,S as N,T as F,U as fo,V as Co,X as go,a as ro,ba as gt,ca as ho,d as de,ea as Po,fa as Io,ga as Ro,q as ao,ra as So,s as so,t as lo,ua as yo,v as uo,w as D,x as ft}from"../chunk-NNGWBSWK.js";import{a as oe,p as mt,q as ct,w as bt,x as dt,y as xt}from"../chunk-A4Z5BY7H.js";import{a as pt}from"../chunk-4C666HHU.js";var zo={};pt(zo,{Arrow:()=>so,Backdrop:()=>lo,Clear:()=>Me,Empty:()=>Co,Group:()=>So,GroupLabel:()=>go,Icon:()=>fo,Input:()=>we,InputWrapper:()=>ke,Item:()=>Te,ItemIndicator:()=>He,ItemLabel:()=>Oe,List:()=>ho,Popup:()=>io,Portal:()=>po,Positioner:()=>De,Root:()=>Ae,ScrollDownArrow:()=>Io,ScrollUpArrow:()=>Po,Separator:()=>yo,Surface:()=>Fe,useComboboxPositionerContext:()=>Ee});import{useRender as ht}from"@base-ui/react/use-render";import*as _ from"react";var ko={slot:"bazzaui-combobox-clear"};var Me=_.forwardRef(function(e,o){let{keepMounted:i=!1,disabled:u,render:s,className:p,style:c,onClick:a,onPointerDown:t,...P}=e,m=D(),b=u??m.disabled,I=m.multiple?m.values.length>0:m.value!=="",d=_.useCallback(R=>{a?.(R),!R.defaultPrevented&&(m.multiple?m.onValuesChange([]):m.onValueChange(""),m.onInputValueChange(""))},[a,m]),g=_.useCallback(R=>{R.preventDefault(),t?.(R)},[t]),l=_.useMemo(()=>({hasValue:I,disabled:b}),[I,b]),S=ht({render:s,ref:o,state:l,props:{...P,[ko.slot]:"",type:"button",tabIndex:-1,"aria-label":"Clear selection",disabled:b||!I,className:p,style:c,onClick:d,onPointerDown:g},enabled:i||I,defaultTagName:"button"});return!i&&!I?null:S});import*as xe from"react";var fe=xe.createContext(null);function Ee(){return xe.useContext(fe)}import{useRender as Pt}from"@base-ui/react/use-render";import*as ne from"react";import*as Ce from"react";var Le=Ce.createContext(!1);function To(){return Ce.useContext(Le)}var Q={slot:"bazzaui-combobox-input",open:"data-open",closed:"data-closed",disabled:"data-disabled",placeholder:"data-placeholder"};import*as se from"react";function Ho(x){let{comboboxContext:e,open:o}=x,i=e.multiple?e.values.length>0:!xo(e.value),u=se.useCallback(c=>{let a=F(c,e.itemToStringValue),t=e.itemTextRegistry.get(a);if(t!==void 0)return t;let P=te(e.items,a);if(typeof P=="string")return P;let m=N(c,e.itemToStringLabel);if(m&&m!==a)return m},[e.itemTextRegistry,e.items,e.itemToStringLabel,e.itemToStringValue]),s=se.useMemo(()=>{if(!i)return"";if(e.multiple){let t=e.values.map(P=>{let m=u(P);return m!==void 0?m:N(P,e.itemToStringLabel)||F(P,e.itemToStringValue)}).filter(Boolean);return t.length<=2?t.join(", "):`${t.length} selected`}let c=e.value;if(c==null)return"";let a=u(c);return a!==void 0?a:N(c,e.itemToStringLabel)||F(c,e.itemToStringValue)},[i,e.multiple,e.value,e.values,e.itemToStringLabel,e.itemToStringValue,u]),p=se.useMemo(()=>o?e.inputValue:s,[o,s,e.inputValue]);return{hasValue:i,displayValue:p,selectedLabel:s,getValueText:u}}import*as T from"react";function Oo(x){let{comboboxContext:e,store:o,focusOwnerStore:i,open:u,disabled:s,cursorBehavior:p,hasValue:c,getValueText:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}=x,I=T.useRef(!1),d=T.useRef(!1),g=T.useRef(!1),l=T.useRef(null),S=T.useRef(null),R=T.useRef(null);T.useEffect(()=>{if(!u)return;let n=f=>{let r=e.inputRef.current,v=e.inputWrapperRef.current,y=document.getElementById(e.listId),O=f.target,W=r?.contains(O),z=v?.contains(O),ee=y?.contains(O);!W&&!z&&!ee&&(R.current=f)};return document.addEventListener("pointerdown",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),R.current=null}},[u,e.inputRef,e.inputWrapperRef,e.listId]),T.useLayoutEffect(()=>{let n=e.inputRef.current;if(n&&u&&S.current){let{start:f,end:r}=S.current,v=n.selectionStart,y=n.value.length;v===y&&f!==y&&n.setSelectionRange(f,r),S.current=null}});let L=T.useRef(u);T.useLayoutEffect(()=>{if(u&&!L.current){if(I.current){I.current=!1,L.current=u;return}if(g.current){g.current=!1,d.current=!1,l.current=null,L.current=u;return}if(d.current&&p==="none"){let f=e.inputRef.current,r=l.current;f&&r!==null&&requestAnimationFrame(()=>{let v=f.value.length,y=Math.min(r,v);f.setSelectionRange(y,y)}),d.current=!1,l.current=null,L.current=u;return}c&&e.multiple&&e.onInputValueChange("");let n=e.inputRef.current;if(n){let f=n.value.length;p==="select-all"&&f>0?requestAnimationFrame(()=>{n.setSelectionRange(0,n.value.length)}):p==="end"&&f>0&&requestAnimationFrame(()=>{n.setSelectionRange(n.value.length,n.value.length)})}}L.current=u},[u,e,c,p]);let w=T.useCallback(n=>{let f=n.target,r=f.value,v=f.selectionStart,y=f.selectionEnd;v!==null&&y!==null&&(S.current={start:v,end:y}),e.onInputValueChange(r),e.setFilterActive(),o.setSearch(r),o.state.open||(I.current=!0,e.openCombobox())},[e,o]),k=T.useCallback(n=>{if(t?.(n),n.defaultPrevented)return;let f=o.state.open;if(f&&(g.current=!0),e.openOnFocus&&!s&&!f){if(c&&!e.multiple){let r=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(r)}e.openCombobox()}},[t,e,s,o,c,a]),V=T.useCallback(n=>{P?.(n),!n.defaultPrevented&&requestAnimationFrame(()=>{let f=document.activeElement,v=document.getElementById(e.listId)?.contains(f),y=f===e.inputRef.current;if(!v&&!y){g.current=!1;let O=R.current,W=O?oe.outsidePress:oe.focusOut;R.current=null,e.closeCombobox(W,O??void 0)}})},[P,e]),A=T.useCallback(n=>{if(m?.(n),n.defaultPrevented)return;let f=o.state.open;if(!s&&!f){let r=n.target;if(p==="none"){let v=r.selectionStart;l.current=v,d.current=!0}if(c&&!e.multiple){let v=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(v)}e.openCombobox()}else f&&(g.current=!0)},[m,e,s,o,p,c,a]),K=T.useCallback(n=>{if(b?.(n),!n.defaultPrevented){if(u&&n.key==="Escape"){n.preventDefault(),e.closeCombobox(oe.escapeKey);return}if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp"||n.key==="Enter")){if(n.preventDefault(),c&&!e.multiple){let f=a(e.value)??N(e.value,e.itemToStringLabel);e.onInputValueChange(f)}e.openCombobox();return}}},[u,e,b,c,a]),{handleKeyDown:j}=bo({store:o,surfaceId:"combobox-input",focusOwnerStore:i,depth:0,submenuContext:null,subpageContext:null,enabled:u,enableTypeToSearch:!1,onKeyDown:K,closeAll:e.closeCombobox,skipFocusOwnerCheck:!0});return{handleChange:w,handleFocus:k,handleBlur:V,handleClick:A,handleKeyDown:j,selectionRef:S}}var we=ne.forwardRef(function(e,o){let{placeholder:i,disabled:u,cursorBehavior:s="none",render:p,className:c,style:a,onFocus:t,onBlur:P,onClick:m,onKeyDown:b,...I}=e,d=D(),g=de(),l=ro(),S=To(),R=(u??d.disabled)||g.disabled,L=te(d.items,""),w=i??(typeof L=="string"?L:void 0)??d.placeholder,k=g.store.useState("open"),{hasValue:V,displayValue:A,getValueText:K}=Ho({comboboxContext:d,open:k}),{handleChange:j,handleFocus:n,handleBlur:f,handleClick:r,handleKeyDown:v}=Oo({comboboxContext:d,store:g.store,focusOwnerStore:l,open:k,disabled:R,cursorBehavior:s,hasValue:V,getValueText:K,onFocus:t,onBlur:P,onClick:m,onKeyDown:b}),y={[Q.slot]:""};k?y[Q.open]="":y[Q.closed]="",R&&(y[Q.disabled]=""),V||(y[Q.placeholder]=""),d.layout==="input-embedded"&&(y["data-input-embedded"]="");let O=ne.useCallback(M=>{d.setInputElement(M),typeof o=="function"?o(M):o&&(o.current=M)},[o,d]),W=ne.useMemo(()=>({open:k,disabled:R,placeholder:!V}),[k,R,V]),z=d.layout==="input-embedded"&&!S?{position:"relative",zIndex:1}:void 0;return Pt({render:p,ref:O,state:W,props:{...I,...y,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":d.listId,"aria-haspopup":"listbox",autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:R,placeholder:V?void 0:w,className:c,style:{...z,...a},value:A,onChange:j,onFocus:n,onBlur:f,onClick:r,onKeyDown:v},defaultTagName:"input"})});import{useRender as It}from"@base-ui/react/use-render";import*as re from"react";var ge={slot:"bazzaui-combobox-input-wrapper",open:"data-open"};import{jsx as St}from"react/jsx-runtime";var Rt={open:x=>x?{[ge.open]:""}:null},ke=re.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,{store:a}=de(),t=D(),P=a.useState("open"),m=re.useMemo(()=>({open:P}),[P]),b=t.layout==="input-embedded"?{position:"relative",zIndex:1}:{position:"relative"},I=re.useCallback(g=>{t.setInputWrapperElement(g),typeof o=="function"?o(g):o&&(o.current=g)},[o,t]),d=It({render:i,ref:I,state:m,stateAttributesMapping:Rt,props:{...c,[ge.slot]:"",className:u,style:{...b,...s},children:p},defaultTagName:"div"});return St(Le.Provider,{value:!0,children:d})});import{useRender as vt}from"@base-ui/react/use-render";import*as E from"react";var q={slot:"bazzaui-combobox-item",highlighted:"data-highlighted",disabled:"data-disabled",selected:"data-selected",first:"data-first",last:"data-last",firstInGroup:"data-first-in-group",lastInGroup:"data-last-in-group"};import*as le from"react";var he=le.createContext(null);function ue(){let x=le.useContext(he);if(!x)throw new Error("ComboboxItem child components must be used within a Combobox.Item");return x}function yt(){return le.useContext(he)}import{jsx as Et}from"react/jsx-runtime";var Vt={highlighted:x=>x?{[q.highlighted]:""}:null,disabled:x=>x?{[q.disabled]:""}:null,selected:x=>x?{[q.selected]:""}:null,first:x=>x?{[q.first]:""}:null,last:x=>x?{[q.last]:""}:null,firstInGroup:x=>x?{[q.firstInGroup]:""}:null,lastInGroup:x=>x?{[q.lastInGroup]:""}:null};function Mt(x,e){let{value:o,textValue:i,keywords:u,disabled:s=!1,onSelect:p,forceMount:c=!1,render:a,className:t,style:P,onClick:m,onPointerDown:b,onPointerMove:I,children:d,...g}=x,l=D(),S=E.useMemo(()=>F(o,l.itemToStringValue),[o,l.itemToStringValue]),R=E.useId(),L=o===null?`combobox-clear-${R}`:void 0,w=E.useMemo(()=>Lo(l.items,S),[l.items,S]),k=w?.label,V=E.useMemo(()=>N(o,l.itemToStringLabel),[o,l.itemToStringLabel]),A=E.useMemo(()=>{if(i!==void 0)return i;if(typeof k=="string")return k;if(V&&V!==S)return V},[i,k,V,S]),K=E.useMemo(()=>wo(u,[typeof k=="string"?k:V&&V!==S?V:void 0,...w?.keywords??[]]),[u,k,V,S,w]),j=E.useRef(A),n=l.multiple?Mo(l.values,o,l.isItemEqualToValue):l.value!==""&&Vo(l.value,o,l.isItemEqualToValue),f=l.closeOnSelect,r=co({id:L,value:S,keywords:K,disabled:s,forceMount:c,closeOnClick:f,children:d});E.useEffect(()=>{let M=()=>{if(!s){if(l.multiple)if(o==null)l.onValuesChange([]);else{let me=n?Eo(l.values,o,l.isItemEqualToValue):[...l.values,o];l.onValuesChange(me)}else l.onValueChange(o);p?.()}};return r.registerSelect(M)},[s,l,o,n,p,r]),E.useEffect(()=>{let M=j.current;if(M)return l.registerItemText(S,M)},[S,l]),E.useEffect(()=>{!A&&typeof d=="string"&&(j.current=d,l.registerItemText(S,d))},[d,A,S,l]);let v=E.useMemo(()=>({highlighted:r.isHighlighted,disabled:s,selected:n,first:r.positional.first,last:r.positional.last,firstInGroup:r.positional.firstInGroup,lastInGroup:r.positional.lastInGroup}),[r.isHighlighted,s,n,r.positional]),y=E.useMemo(()=>({id:r.id,value:o,textValue:A,highlighted:r.isHighlighted,disabled:s,selected:n}),[r.id,o,A,r.isHighlighted,s,n]),O=E.useCallback(M=>{m?.(M),M.defaultPrevented||r.handlers.onClick(M)},[m,r.handlers]),W=E.useCallback(M=>{r.handlers.onPointerDown(M),b?.(M)},[r.handlers,b]),z=E.useCallback(M=>{I?.(M),M.defaultPrevented||r.handlers.onPointerMove(M)},[I,r.handlers]),ee=vt({render:a,ref:[r.ref,r.rowRef,e],state:v,stateAttributesMapping:Vt,props:{...g,[q.slot]:"",id:r.id,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":s||void 0,className:t,style:P,onClick:O,onPointerMove:z,onPointerDown:W,children:d},enabled:r.isVisible,defaultTagName:"div"});return r.isVisible?Et(he.Provider,{value:y,children:ee}):null}var Te=E.forwardRef(Mt);import{useRender as Lt}from"@base-ui/react/use-render";import*as Ie from"react";var Pe={slot:"bazzaui-combobox-item-indicator",selected:"data-selected"};var wt={selected:x=>x?{[Pe.selected]:""}:null},He=Ie.forwardRef(function(e,o){let{keepMounted:i=!1,render:u,className:s,style:p,...c}=e,a=ue(),t=Ie.useMemo(()=>({selected:a.selected}),[a.selected]),P=Lt({render:u,ref:o,state:t,stateAttributesMapping:wt,props:{...c,[Pe.slot]:"","aria-hidden":!0,className:s,style:p},enabled:i||a.selected,defaultTagName:"span"});return!i&&!a.selected?null:P});import{useRender as kt}from"@base-ui/react/use-render";import*as Y from"react";var Do={slot:"bazzaui-combobox-item-label"};var Oe=Y.forwardRef(function(e,o){let{render:i,className:u,style:s,children:p,...c}=e,a=D(),t=ue(),P=F(t.value,a.itemToStringValue),m=Y.useMemo(()=>{if(p!==void 0)return p;let I=te(a.items,P);return I!==void 0?I:t.textValue!==void 0?t.textValue:P},[p,a.items,P,t.textValue]),b=Y.useMemo(()=>({value:P,selected:t.selected,highlighted:t.highlighted,disabled:t.disabled}),[P,t.selected,t.highlighted,t.disabled]);return Y.useEffect(()=>{if(typeof m=="string")return a.registerItemText(P,m)},[m,a,P]),kt({render:i,ref:o,state:b,props:{...c,[Do.slot]:"",className:u,style:s,children:m},defaultTagName:"span"})});import{Popover as Ao}from"@base-ui/react/popover";import*as U from"react";var Re={slot:"bazzaui-combobox-positioner"};import{jsx as ie}from"react/jsx-runtime";function Tt(x,e,o,i){let u=o+i*2;if(x==="top"){let c=-(e+i),a=e+i;return{width:u,marginBottom:c,paddingTop:i,paddingLeft:i,paddingRight:i,paddingBottom:a}}let s=-(e+i),p=e+i;return{width:u,marginTop:s,paddingTop:p,paddingLeft:i,paddingRight:i,paddingBottom:i}}var De=U.forwardRef(function(e,o){let{layout:i,popupPadding:u=8,side:s="bottom",align:p,sideOffset:c=4,anchor:a,className:t,style:P,children:m,...b}=e,I=D(),d=i??I.layout,g=d==="input-embedded",l=a??I.inputWrapperRef.current?I.inputWrapperRef:I.inputRef,S=g?0:c,R=g?"center":p??"start",{inputHeight:L,inputWidth:w}=I,k=w+u*2,V={...P,...g?{zIndex:0}:{}};if(g)return ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:V,"data-input-embedded":"",[Re.slot]:"",...b,render:(n,f)=>{let r=f.side,v={layout:d,side:r,align:f.align,inputHeight:I.inputHeight},y={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`,"--combobox-popup-padding":`${u}px`,"--combobox-popup-width":`${k}px`},O=Tt(r,L,w,u),W=U.Children.map(m,z=>U.isValidElement(z)?U.cloneElement(z,{style:{...O,...z.props.style},"data-side":r}):z);return ie(fe.Provider,{value:v,children:ie("div",{...n,style:{...n.style,...y},"data-side":r,children:W})})}});let A={layout:d,side:s,align:R,inputHeight:I.inputHeight},K={"--combobox-input-height":`${L}px`,"--combobox-input-width":`${w}px`},j={...V,...K};return ie(fe.Provider,{value:A,children:ie(Ao.Positioner,{ref:o,side:s,align:R,sideOffset:S,anchor:l,className:t,style:j,[Re.slot]:"",...b,children:m})})});import{Popover as Ht}from"@base-ui/react/popover";import*as h from"react";import{jsx as pe,jsxs as Ot}from"react/jsx-runtime";function Ae(x){let{open:e,onOpenChange:o,actionsRef:i,defaultOpen:u=!1,value:s,defaultValue:p,onValueChange:c,multiple:a=!1,values:t,defaultValues:P,onValuesChange:m,isItemEqualToValue:b=vo,itemToStringLabel:I,itemToStringValue:d,inputValue:g,defaultInputValue:l="",onInputValueChange:S,name:R,form:L,required:w,disabled:k=!1,placeholder:V="Search...",items:A,modal:K=!1,closeOnSelect:j,openOnFocus:n=!0,virtualized:f=!1,virtualItems:r,onHighlightChange:v,layout:y="floating",onOpenChangeComplete:O,debug:W,children:z,...ee}=x,M=h.useCallback((C,H,G,be)=>v?.(C,G,be),[v]),me=h.useId(),ce=h.useRef(null),Se=h.useRef(null),[ze,Be]=h.useState(0),[We,je]=h.useState(0),Ge=h.useCallback(C=>{if(ce.current=C,C&&!Se.current){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),Ne=h.useCallback(C=>{if(Se.current=C,C){let H=C.getBoundingClientRect();Be(H.height),je(H.width)}},[]),{store:B,focusOwnerStore:$o,openChainStore:Jo,registerSurface:Xo,closeAll:_o,virtualization:Qo,handleOpenChange:qe,disabled:$,setDisabled:Ke,menuTreeResolver:Yo}=ao({onOpenChange:o,defaultOpen:u,virtualized:f,items:r,onHighlightChange:M,disabled:k}),ye=h.useRef(null);h.useImperativeHandle(i,()=>({close:()=>{ye.current?.close()},unmount:()=>{ye.current?.unmount()},setDisabled:Ke}),[Ke]),B.useControlledProp("openProp",e);let Zo=B.useState("open"),Ue=h.useCallback((C,H,G)=>{$&&H!==oe.imperativeAction||!C&&ce.current&&document.activeElement===ce.current||qe(C,H,G)},[qe,$]),et=h.useCallback(C=>{!C&&B.context.clearSearchOnClose==="after-exit"&&(B.clearSearch(),B.setInputActive(!1)),C||B.clearHighlight(),O?.(C)},[B,O]),ot=h.useCallback((C,H)=>{Ue(C,H.reason,H.event)},[Ue]),[tt,nt]=h.useState(p!==void 0?p:null),J=s!==void 0?s:tt,$e=h.useCallback(C=>{s===void 0&&nt(C),c?.(C)},[s,c]),[rt,at]=h.useState(P??[]),ae=t!==void 0?t:rt,Je=h.useCallback(C=>{t===void 0&&at(C),m?.(C)},[t,m]),[ve,st]=h.useState(l),Xe=g!==void 0?g:ve,_e=h.useCallback(C=>{g===void 0&&st(C),S?.(C)},[g,S]),Qe=h.useRef(new Map),Ye=h.useCallback((C,H)=>(Qe.current.set(C,H),()=>{}),[]),Ze=j??!a,Ve=h.useRef({type:"active"}),[,lt]=h.useState({type:"active"}),X=h.useCallback(C=>{Ve.current=C,lt(C)},[]),eo=Ve.current,oo=h.useCallback(()=>{X({type:"active"})},[X]),to=h.useCallback(()=>{$||(!a&&J!=null?X({type:"showAll"}):X({type:"active"}),B.setOpen(!0))},[$,B,a,J,X]),no=h.useCallback((C,H)=>{let G=Ve.current,be=G.type==="active"?ve:G.type==="showAll"?"":G.search;X({type:"frozen",search:be}),B.setOpen(!1,C,H)},[B,X,ve]),ut=h.useMemo(()=>({multiple:a,value:J,values:ae,onValueChange:$e,onValuesChange:Je,isItemEqualToValue:b,itemToStringLabel:I,itemToStringValue:d,inputValue:Xe,onInputValueChange:_e,name:R,form:L,required:w,disabled:$,placeholder:V,items:A,itemTextRegistry:Qe.current,registerItemText:Ye,listId:me,inputRef:ce,setInputElement:Ge,inputWrapperRef:Se,setInputWrapperElement:Ne,closeOnSelect:Ze,openOnFocus:n,openCombobox:to,closeCombobox:no,filterMode:eo,setFilterActive:oo,inputHeight:ze,inputWidth:We,layout:y}),[a,J,ae,$e,Je,b,I,d,Xe,_e,R,L,w,$,V,A,Ye,me,Ge,Ne,Ze,n,to,no,eo,oo,ze,We,y]),it=h.useMemo(()=>R?a?ae.length>0?ae.map((C,H)=>{let G=F(C,d);return pe("input",{type:"hidden",name:R,value:G,form:L,required:w&&H===0},G)}):pe("input",{type:"hidden",name:R,value:"",form:L,required:w}):pe("input",{type:"hidden",name:R,value:J!=null?F(J,d):"",form:L,required:w}):null,[R,L,w,a,J,ae,d]);return pe(uo.Provider,{value:ut,children:Ot(mo,{menuTreeResolver:Yo,store:B,focusOwnerStore:$o,openChainStore:Jo,disabled:$,depth:0,closeAll:_o,registerSurface:Xo,virtualization:Qo,menuType:"dropdown",componentName:"combobox",debug:W,children:[it,pe(Ht.Root,{...ee,open:Zo,onOpenChange:ot,onOpenChangeComplete:et,modal:K,actionsRef:i?ye:void 0,children:z})]})})}import*as Z from"react";var Fo={slot:"bazzaui-combobox-surface"};import{jsx as Dt}from"react/jsx-runtime";var Fe=Z.forwardRef(function(e,o){let{autoHighlightFirst:i,clearSearchOnClose:u=!0,search:s,onSearchChange:p,onPointerMove:c,...a}=e,t=D(),P=Z.useCallback(g=>{c?.(g);let l=t.inputRef.current;l&&document.activeElement!==l&&l.focus()},[c,t.inputRef]),m=Z.useMemo(()=>{let g=i??!0;if(g==="selected"){let l=t.multiple?t.values[0]:t.value;return l!=null?F(l,t.itemToStringValue):!0}return g},[i,t.multiple,t.value,t.values,t.itemToStringValue]),{filterMode:b}=t,I=s??(b.type==="active"?t.inputValue:b.type==="showAll"?"":b.search),d=Z.useCallback(g=>{t.onInputValueChange(g),p?.(g)},[t,p]);return Dt(Ro,{ref:o,autoHighlightFirst:m,clearSearchOnClose:u,search:I,onSearchChange:d,onPointerMove:P,skipAutoFocus:!0,[Fo.slot]:"",...a})});var Bo=(p=>(p.slot="bazzaui-combobox-arrow",p.open="data-open",p.closed="data-closed",p.side="data-side",p.align="data-align",p.uncentered="data-uncentered",p))(Bo||{});var Wo=(s=>(s.slot="bazzaui-combobox-backdrop",s.open="data-open",s.closed="data-closed",s.startingStyle="data-starting-style",s.endingStyle="data-ending-style",s))(Wo||{});var jo=(e=>(e.slot="bazzaui-combobox-empty",e))(jo||{});var Go=(e=>(e.slot="bazzaui-combobox-group",e))(Go||{});var No=(e=>(e.slot="bazzaui-combobox-group-label",e))(No||{});var At={slot:"bazzaui-combobox-icon",open:"data-popup-open"};var qo=(o=>(o.slot="bazzaui-combobox-list",o.list="data-popup-menu-list",o))(qo||{});var Ko=(b=>(b.slot="bazzaui-combobox-popup",b.open="data-open",b.closed="data-closed",b.side="data-side",b.align="data-align",b.startingStyle="data-starting-style",b.endingStyle="data-ending-style",b.instant="data-instant",b.focused="data-focused",b.hasOpenSubmenu="data-has-open-submenu",b.submenu="data-submenu",b.navigating="data-navigating",b))(Ko||{});var Ft={slotUp:"bazzaui-combobox-scroll-up-arrow",slotDown:"bazzaui-combobox-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Uo=(e=>(e.slot="bazzaui-combobox-separator",e))(Uo||{});export{zo as Combobox,Bo as ComboboxArrowDataAttributes,Wo as ComboboxBackdropDataAttributes,Me as ComboboxClear,jo as ComboboxEmptyDataAttributes,Go as ComboboxGroupDataAttributes,No as ComboboxGroupLabelDataAttributes,At as ComboboxIconDataAttributes,we as ComboboxInput,Q as ComboboxInputDataAttributes,ke as ComboboxInputWrapper,ge as ComboboxInputWrapperDataAttributes,Te as ComboboxItem,q as ComboboxItemDataAttributes,He as ComboboxItemIndicator,Pe as ComboboxItemIndicatorDataAttributes,Oe as ComboboxItemLabel,gt as ComboboxListCssVars,qo as ComboboxListDataAttributes,Ko as ComboboxPopupDataAttributes,De as ComboboxPositioner,Ct as ComboboxPositionerCssVars,Re as ComboboxPositionerDataAttributes,Ae as ComboboxRoot,Ft as ComboboxScrollArrowDataAttributes,Uo as ComboboxSeparatorDataAttributes,xt as ComboboxStore,Fe as ComboboxSurface,bt as commandScore,dt as defaultFilter,D as useComboboxContext,ue as useComboboxItemContext,Ee as useComboboxPositionerContext,ft as useMaybeComboboxContext,yt as useMaybeComboboxItemContext,ct as useMaybeSurfaceContext,mt as useSurfaceContext};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJFEVUUPCcjs = require('../chunk-JFEVUUPC.cjs');var _chunkEYMK7XHCcjs = require('../chunk-EYMK7XHC.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var fe={};_chunkM4G6J7DPcjs.a.call(void 0, fe,{Backdrop:()=>ue,CheckboxItem:()=>_chunkEYMK7XHCcjs.ga,CheckboxItemIndicator:()=>_chunkEYMK7XHCcjs.ha,Empty:()=>_chunkEYMK7XHCcjs.U,FocusZone:()=>_chunkEYMK7XHCcjs.na,Footer:()=>_chunkEYMK7XHCcjs.oa,Group:()=>_chunkEYMK7XHCcjs.pa,GroupLabel:()=>_chunkEYMK7XHCcjs.W,Header:()=>_chunkEYMK7XHCcjs.ra,Icon:()=>_chunkEYMK7XHCcjs.T,Input:()=>me,Item:()=>_chunkEYMK7XHCcjs.ia,List:()=>_chunkEYMK7XHCcjs.ba,Loading:()=>_chunkEYMK7XHCcjs.ca,Popup:()=>de,Portal:()=>ie,Root:()=>Pe,Separator:()=>_chunkEYMK7XHCcjs.sa,Shortcut:()=>_chunkEYMK7XHCcjs.ta,Subpage:()=>Me,SubpageBack:()=>_chunkEYMK7XHCcjs.Ba,SubpageBackItem:()=>_chunkEYMK7XHCcjs.Ca,SubpageTrigger:()=>_chunkEYMK7XHCcjs.Da,Surface:()=>_chunkEYMK7XHCcjs.fa,Trigger:()=>Se});var _dialog = require('@base-ui/react/dialog');var _react = require('react'); var y = _interopRequireWildcard(_react); var se = _interopRequireWildcard(_react); var s = _interopRequireWildcard(_react); var L = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Ce = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var ue=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=_chunkEYMK7XHCcjs.e.call(void 0, ),u=y.useCallback(m=>{_optionalChain([p, 'optionalCall', _2 => _2(m)]),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(_chunkXMZZ62VJcjs.a.outsidePress,m.nativeEvent)},[p,t]);return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});var me=se.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return _jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.V,{ref:a,backspaceGoesBack:p,...r})});var de=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=_chunkEYMK7XHCcjs.d.call(void 0, ),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=_chunkEYMK7XHCcjs.r.call(void 0, {surfaceId:m,store:M.store}),[g,h]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(l=>({...l,hasOpenSubpage:n,subpageId:i}),[n,i]),k=s.useMemo(()=>typeof r=="function"?l=>r(c(l)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(l,P)=>t(l,c(P)):t,[t,c]),v=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:h,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return _jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.f.Provider,{value:m,children:_jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.k.Provider,{value:C,children:_jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.z.Provider,{value:v,children:_jsxruntime.jsxs.call(void 0, _dialog.Dialog.Popup,{ref:a,className:k,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,_jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.I,{})]})})})})});var ie=_dialog.Dialog.Portal;function Ue(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function Qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function qe(e,o){let a=_chunkJFEVUUPCcjs.d.call(void 0, ),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function We(e,o){return o.key===Qe(e)&&qe(e,o)}function ce(e,o,a){let p=d.useMemo(()=>_chunkJFEVUUPCcjs.a.call(void 0, e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=_optionalChain([a, 'optionalAccess', _3 => _3.enabled])!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!_optionalChain([i, 'optionalAccess', _4 => _4.allowInInput])&&Ue(n.target)||We(n,t)&&(_optionalChain([i, 'optionalAccess', _5 => _5.preventDefault])!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}function Pe(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:h,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:k}=_chunkEYMK7XHCcjs.q.call(void 0, {onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");ce(_nullishCoalesce(u, () => ("")),()=>f(!n.state.open,_chunkXMZZ62VJcjs.a.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let v=L.useCallback((P,N)=>{f(P,N.reason,N.event)},[f]),l=L.useCallback(P=>{!P&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),P||(n.clearHighlight(),_optionalChain([n, 'access', _6 => _6.context, 'access', _7 => _7.onCloseComplete, 'optionalCall', _8 => _8()]),_optionalChain([n, 'access', _9 => _9.context, 'access', _10 => _10.onPopupCloseComplete, 'optionalCall', _11 => _11()])),_optionalChain([t, 'optionalCall', _12 => _12(P)])},[n,t]);return _jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.N,{menuTreeResolver:k,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:h,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:_jsxruntime.jsx.call(void 0, _dialog.Dialog.Root,{open:D,onOpenChange:v,onOpenChangeComplete:l,modal:m,children:o})})}function Me(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return _jsxruntime.jsx.call(void 0, _chunkEYMK7XHCcjs.Aa,{closeRootOnEsc:o,...p,children:a})}var Se=Ce.forwardRef(function(o,a){let{disabled:p,...r}=o,t=_chunkEYMK7XHCcjs.e.call(void 0, ),u=p||_optionalChain([t, 'optionalAccess', _13 => _13.disabled])||!1;return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});exports.CommandMenu = fe; exports.CommandMenuRadioGroupValue = _chunkEYMK7XHCcjs.ka; exports.DataListContext = _chunkEYMK7XHCcjs.C; exports.DataSurfaceContext = _chunkEYMK7XHCcjs.y; exports.defaultGetResolvedId = _chunkEYMK7XHCcjs.p; exports.defineRadioGroup = _chunkEYMK7XHCcjs.X; exports.isDisplayGroupNode = _chunkEYMK7XHCcjs.Y; exports.isDisplayRadioGroupNode = _chunkEYMK7XHCcjs.Z; exports.isDisplayRowNode = _chunkEYMK7XHCcjs.$; exports.isDisplaySeparatorNode = _chunkEYMK7XHCcjs._; exports.isPopupMenuNode = _chunkEYMK7XHCcjs.o; exports.useAsyncMenuCoordinator = _chunkEYMK7XHCcjs.F; exports.useDataList = _chunkEYMK7XHCcjs.D; exports.useDataSurfaceContext = _chunkEYMK7XHCcjs.A; exports.useMaybeAsyncMenuCoordinator = _chunkEYMK7XHCcjs.G; exports.useMaybeDataList = _chunkEYMK7XHCcjs.E; exports.useMaybeDataSurfaceContext = _chunkEYMK7XHCcjs.B; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJFEVUUPCcjs = require('../chunk-JFEVUUPC.cjs');var _chunkZ2RGBRJPcjs = require('../chunk-Z2RGBRJP.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var ge={};_chunkM4G6J7DPcjs.a.call(void 0, ge,{Backdrop:()=>se,CheckboxItem:()=>_chunkZ2RGBRJPcjs.ha,CheckboxItemIndicator:()=>_chunkZ2RGBRJPcjs.ia,Empty:()=>_chunkZ2RGBRJPcjs.V,FocusZone:()=>_chunkZ2RGBRJPcjs.pa,Footer:()=>_chunkZ2RGBRJPcjs.qa,Group:()=>_chunkZ2RGBRJPcjs.ra,GroupLabel:()=>_chunkZ2RGBRJPcjs.X,Header:()=>_chunkZ2RGBRJPcjs.ta,Icon:()=>_chunkZ2RGBRJPcjs.U,Input:()=>de,Item:()=>_chunkZ2RGBRJPcjs.ja,LinkItem:()=>_chunkZ2RGBRJPcjs.ka,List:()=>_chunkZ2RGBRJPcjs.ca,Loading:()=>_chunkZ2RGBRJPcjs.da,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>_chunkZ2RGBRJPcjs.ua,Shortcut:()=>_chunkZ2RGBRJPcjs.va,Subpage:()=>Ce,SubpageBack:()=>_chunkZ2RGBRJPcjs.Da,SubpageBackItem:()=>_chunkZ2RGBRJPcjs.Ea,SubpageTrigger:()=>_chunkZ2RGBRJPcjs.Fa,Surface:()=>_chunkZ2RGBRJPcjs.ga,Trigger:()=>fe});var _dialog = require('@base-ui/react/dialog');var _react = require('react'); var y = _interopRequireWildcard(_react); var me = _interopRequireWildcard(_react); var s = _interopRequireWildcard(_react); var v = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Se = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=_chunkZ2RGBRJPcjs.e.call(void 0, ),u=y.useCallback(m=>{_optionalChain([p, 'optionalCall', _2 => _2(m)]),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(_chunkXMZZ62VJcjs.a.outsidePress,m.nativeEvent)},[p,t]);return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.W,{ref:a,backspaceGoesBack:p,...r})});var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=_chunkZ2RGBRJPcjs.d.call(void 0, ),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=_chunkZ2RGBRJPcjs.r.call(void 0, {surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.f.Provider,{value:m,children:_jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.k.Provider,{value:C,children:_jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.z.Provider,{value:L,children:_jsxruntime.jsxs.call(void 0, _dialog.Dialog.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,_jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.J,{})]})})})})});var ce=_dialog.Dialog.Portal;function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=_chunkJFEVUUPCcjs.d.call(void 0, ),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>_chunkJFEVUUPCcjs.a.call(void 0, e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=_optionalChain([a, 'optionalAccess', _3 => _3.enabled])!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!_optionalChain([i, 'optionalAccess', _4 => _4.allowInInput])&&Qe(n.target)||_e(n,t)&&(_optionalChain([i, 'optionalAccess', _5 => _5.preventDefault])!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=_chunkZ2RGBRJPcjs.q.call(void 0, {onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(_nullishCoalesce(u, () => ("")),()=>f(!n.state.open,_chunkXMZZ62VJcjs.a.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),_optionalChain([n, 'access', _6 => _6.context, 'access', _7 => _7.onCloseComplete, 'optionalCall', _8 => _8()]),_optionalChain([n, 'access', _9 => _9.context, 'access', _10 => _10.onPopupCloseComplete, 'optionalCall', _11 => _11()])),_optionalChain([t, 'optionalCall', _12 => _12(l)])},[n,t]);return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.O,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:_jsxruntime.jsx.call(void 0, _dialog.Dialog.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return _jsxruntime.jsx.call(void 0, _chunkZ2RGBRJPcjs.Ca,{closeRootOnEsc:o,...p,children:a})}var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=_chunkZ2RGBRJPcjs.e.call(void 0, ),u=p||_optionalChain([t, 'optionalAccess', _13 => _13.disabled])||!1;return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});exports.CommandMenu = ge; exports.CommandMenuRadioGroupValue = _chunkZ2RGBRJPcjs.ma; exports.DataListContext = _chunkZ2RGBRJPcjs.C; exports.DataSurfaceContext = _chunkZ2RGBRJPcjs.y; exports.defaultGetResolvedId = _chunkZ2RGBRJPcjs.p; exports.defineRadioGroup = _chunkZ2RGBRJPcjs.Y; exports.isDisplayGroupNode = _chunkZ2RGBRJPcjs.Z; exports.isDisplayRadioGroupNode = _chunkZ2RGBRJPcjs._; exports.isDisplayRowNode = _chunkZ2RGBRJPcjs.aa; exports.isDisplaySeparatorNode = _chunkZ2RGBRJPcjs.$; exports.isPopupMenuNode = _chunkZ2RGBRJPcjs.o; exports.useAsyncMenuCoordinator = _chunkZ2RGBRJPcjs.F; exports.useDataList = _chunkZ2RGBRJPcjs.D; exports.useDataSurfaceContext = _chunkZ2RGBRJPcjs.A; exports.useMaybeAsyncMenuCoordinator = _chunkZ2RGBRJPcjs.G; exports.useMaybeDataList = _chunkZ2RGBRJPcjs.E; exports.useMaybeDataSurfaceContext = _chunkZ2RGBRJPcjs.B; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","../../src/command-menu/index.parts.ts","../../src/command-menu/backdrop/backdrop.tsx","../../src/command-menu/input/input.tsx","../../src/command-menu/popup/popup.tsx","../../src/command-menu/portal/portal.tsx","../../src/command-menu/root/root.tsx","../../src/kbd/hooks/use-hotkey.ts","../../src/command-menu/subpage/subpage.tsx","../../src/command-menu/trigger/trigger.tsx"],"names":["index_parts_exports","__export","CommandMenuBackdrop","PopupMenuCheckboxItem","PopupMenuCheckboxItemIndicator","PopupMenuEmpty","PopupMenuFocusZone","PopupMenuFooter","PopupMenuGroup","PopupMenuGroupLabel","PopupMenuHeader","PopupMenuIcon","CommandMenuInput","PopupMenuItem","PopupMenuList","PopupMenuLoading","CommandMenuPopup","CommandMenuPortal","CommandMenuRoot","PopupMenuSeparator","PopupMenuShortcut","CommandMenuSubpage","PopupMenuSubpageBack","PopupMenuSubpageBackItem","PopupMenuSubpageTrigger","PopupMenuSurface","CommandMenuTrigger","props","forwardedRef","onPointerDown","rest","popupMenuContext","useMaybePopupMenuContext","handlePointerDown","event","reason_parts_exports","jsx","Dialog","backspaceGoesBack","PopupMenuInput","children","classNameProp","renderProp","surfaceId","usePopupMenuContext","subpageStackContextValue","isSubpageNavigating","hasOpenSubpage","subpageId","useSubpageStackState","dataSurfaceContext","setDataSurfaceContext","resolvedNodes","setResolvedNodes","toPopupState","baseState","className","render","popupProps","dataPopupContextValue","PopupSurfaceIdContext","SubpageStackContext","DataPopupContext","jsxs","DataSubpagesContent","isEditableTarget","target","getEventKey","key","matchesModifiers","chord","isApple","isApplePlatform","meta","ctrl","matchesChord","useHotkey","keys","handler","options","keybinding","parseKeybinding","firstChord","isSequence","enabled","handlerRef","optionsRef","handleKeyDown","currentOptions","openProp","defaultOpen","onOpenChange","onOpenChangeComplete","hotkey","modal","disabled","getResolvedId","idScope","store","focusOwnerStore","openChainStore","registerSurface","closeAll","handleOpenChange","menuDisabled","menuTreeResolver","usePopupMenuRoot","openState","handleDialogOpenChange","nextOpen","dialogDetails","handleDialogOpenChangeComplete","PopupMenuProviders","closeRootOnEsc","PopupMenuSubpage","isDisabled"],"mappings":"AAAA,4/BAAkD,yDAA+X,yDAA0D,yDAA2C,ICAthBA,EAAAA,CAAA,CAAA,CAAA,CAAAC,iCAAAA,EAAAD,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,EAAAE,EAAAA,CAAA,YAAA,CAAA,CAAA,CAAA,E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sF,CAAAA,CAAiB,CAAA,CAAA,CAAM,QAAA,CAAAzE,CAAAA,CAAU,GAAGV,CAAK,CAAA,CAAIH,CAAAA,CAErD,OACES,6BAAAA,oBAAC8E,CAAA,CAAiB,cAAA,CAAgBD,CAAAA,CAAiB,GAAGnF,CAAAA,CACnD,QAAA,CAAAU,CAAAA,CACH,CAEJ,CClBA,IAUad,EAAAA,CAA2B,EAAA,CAAA,UAAA,CAGtC,QAAA,CAA4BC,CAAAA,CAAOC,CAAAA,CAAc,CACjD,GAAM,CAAE,QAAA,CAAAmE,CAAAA,CAAU,GAAGjE,CAAK,CAAA,CAAIH,CAAAA,CACxBI,CAAAA,CAAmBC,iCAAAA,CAAyB,CAC5CmF,CAAAA,CAAapB,CAAAA,kBAAYhE,CAAAA,+BAAkB,UAAA,EAAY,CAAA,CAAA,CAE7D,OACEK,6BAAAA,cAACC,CAAO,OAAA,CAAP,CACC,GAAA,CAAKT,CAAAA,CACJ,GAAGE,CAAAA,CACJ,QAAA,CAAUqF,CAAAA,CACV,2BAAA,CAA0B,EAAA,CAC5B,CAEJ,CAAC,CAAA,CAAA,27BAAA","file":"/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","sourcesContent":[null,"// ============================================================================\n// Command Menu Parts\n// ============================================================================\n\n// Pure aliases of the canonical resolved-node model (ADR-0001): narrow the\n// alias if a family ever needs to diverge — never edit the canonical type.\nexport type {\n NodeDef,\n PopupMenuNode as Node,\n} from '../internal/popup-menu/index.js'\n\nexport {\n PopupMenuCheckboxItem as CheckboxItem,\n PopupMenuCheckboxItemIndicator as CheckboxItemIndicator,\n PopupMenuEmpty as Empty,\n PopupMenuFocusZone as FocusZone,\n PopupMenuFooter as Footer,\n PopupMenuGroup as Group,\n PopupMenuGroupLabel as GroupLabel,\n PopupMenuHeader as Header,\n PopupMenuIcon as Icon,\n PopupMenuItem as Item,\n PopupMenuList as List,\n PopupMenuLoading as Loading,\n PopupMenuSeparator as Separator,\n PopupMenuShortcut as Shortcut,\n PopupMenuSubpageBack as SubpageBack,\n PopupMenuSubpageBackItem as SubpageBackItem,\n PopupMenuSubpageTrigger as SubpageTrigger,\n PopupMenuSurface as Surface,\n} from '../internal/popup-menu/index.js'\nexport { CommandMenuBackdrop as Backdrop } from './backdrop/backdrop.js'\nexport { CommandMenuInput as Input } from './input/input.js'\nexport { CommandMenuPopup as Popup } from './popup/popup.js'\nexport { CommandMenuPortal as Portal } from './portal/portal.js'\nexport { CommandMenuRoot as Root } from './root/root.js'\nexport { CommandMenuSubpage as Subpage } from './subpage/subpage.js'\nexport { CommandMenuTrigger as Trigger } from './trigger/trigger.js'\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {}\nexport type CommandMenuBackdropState = Dialog.Backdrop.State\n\n/**\n * An overlay displayed beneath the command menu popup.\n *\n * Pressing down on the backdrop closes the menu immediately (pointerdown),\n * matching the outside-press behavior of the other menus, instead of waiting\n * for the Dialog's click-time dismissal. Consumers can opt out by calling\n * `event.preventDefault()` in their own `onPointerDown`.\n */\nexport const CommandMenuBackdrop = React.forwardRef<\n HTMLDivElement,\n CommandMenuBackdrop.Props\n>(function CommandMenuBackdrop(props, forwardedRef) {\n const { onPointerDown, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n\n const handlePointerDown = React.useCallback<\n NonNullable<Dialog.Backdrop.Props['onPointerDown']>\n >(\n (event) => {\n onPointerDown?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n if (popupMenuContext && !popupMenuContext.disabled) {\n popupMenuContext.closeAll(REASONS.outsidePress, event.nativeEvent)\n }\n },\n [onPointerDown, popupMenuContext],\n )\n\n return (\n <Dialog.Backdrop\n ref={forwardedRef}\n {...rest}\n onPointerDown={handlePointerDown}\n data-command-menu-backdrop=\"\"\n />\n )\n})\n\nexport namespace CommandMenuBackdrop {\n export interface Props extends CommandMenuBackdropProps {}\n export type State = CommandMenuBackdropState\n}\n","'use client'\n\nimport * as React from 'react'\nimport {\n PopupMenuInput,\n type PopupMenuInputProps,\n type PopupMenuInputState,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuInputProps extends PopupMenuInputProps {}\nexport type CommandMenuInputState = PopupMenuInputState\n\n/**\n * Search input for filtering command menu items.\n */\nexport const CommandMenuInput = React.forwardRef<\n HTMLInputElement,\n CommandMenuInput.Props\n>(function CommandMenuInput(props, forwardedRef) {\n const { backspaceGoesBack = true, ...rest } = props\n\n return (\n <PopupMenuInput\n ref={forwardedRef}\n backspaceGoesBack={backspaceGoesBack}\n {...rest}\n />\n )\n})\n\nexport namespace CommandMenuInput {\n export interface Props extends CommandMenuInputProps {}\n export type State = CommandMenuInputState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { PopupSurfaceIdContext } from '../../internal/popup-menu/contexts/popup-surface-id-context.js'\nimport { SubpageStackContext } from '../../internal/popup-menu/contexts/subpage-stack-context.js'\nimport {\n DataPopupContext,\n type DataSurfaceContextValue,\n type ResolvedNodesSlot,\n} from '../../internal/popup-menu/data-first/context.js'\nimport { DataSubpagesContent } from '../../internal/popup-menu/data-first/data-subpages.js'\nimport { useSubpageStackState } from '../../internal/popup-menu/hooks/use-subpage-stack-state.js'\nimport { usePopupMenuContext } from '../../internal/popup-menu/index.js'\nimport type { ComponentRenderFn } from '../../utils/types.js'\n\nexport interface CommandMenuPopupState extends Dialog.Popup.State {\n /**\n * Whether any non-root subpage is currently open.\n */\n hasOpenSubpage: boolean\n\n /**\n * Active subpage ID, or null when the root surface is active.\n */\n subpageId: string | null\n}\n\nexport interface CommandMenuPopupProps\n extends Omit<Dialog.Popup.Props, 'className' | 'render'> {\n /**\n * CSS class applied to the element, or a function that\n * returns a class based on the component's state.\n */\n className?: string | ((state: CommandMenuPopupState) => string)\n\n /**\n * Allows replacing the popup element with a custom element.\n * The render state includes dialog popup + subpage navigation state.\n */\n render?:\n | React.ReactElement\n | ComponentRenderFn<\n React.HTMLAttributes<HTMLElement>,\n CommandMenuPopupState\n >\n}\n\n/**\n * A container for the command menu contents.\n * Wraps Dialog.Popup with popup-menu subpage and data providers.\n */\nexport const CommandMenuPopup = React.forwardRef<\n HTMLDivElement,\n CommandMenuPopup.Props\n>(function CommandMenuPopup(props, forwardedRef) {\n const {\n children,\n className: classNameProp,\n render: renderProp,\n ...rest\n } = props\n\n const surfaceId = React.useId()\n const popupMenuContext = usePopupMenuContext()\n\n const {\n subpageStackContextValue,\n isSubpageNavigating,\n hasOpenSubpage,\n subpageId,\n } = useSubpageStackState({\n surfaceId,\n store: popupMenuContext.store,\n })\n\n const [dataSurfaceContext, setDataSurfaceContext] =\n React.useState<DataSurfaceContextValue | null>(null)\n const [resolvedNodes, setResolvedNodes] =\n React.useState<ResolvedNodesSlot | null>(null)\n\n const toPopupState = React.useCallback(\n (baseState: Dialog.Popup.State): CommandMenuPopupState => ({\n ...baseState,\n hasOpenSubpage,\n subpageId,\n }),\n [hasOpenSubpage, subpageId],\n )\n\n const className = React.useMemo(() => {\n if (typeof classNameProp === 'function') {\n return (baseState: Dialog.Popup.State) => {\n return classNameProp(toPopupState(baseState))\n }\n }\n return classNameProp\n }, [classNameProp, toPopupState])\n\n const render = React.useMemo(() => {\n if (typeof renderProp === 'function') {\n return (\n popupProps: React.HTMLAttributes<HTMLElement>,\n baseState: Dialog.Popup.State,\n ) => renderProp(popupProps, toPopupState(baseState))\n }\n\n return renderProp\n }, [renderProp, toPopupState])\n\n const dataPopupContextValue = React.useMemo(\n () => ({\n dataSurfaceContext,\n setDataSurfaceContext,\n resolvedNodes,\n setResolvedNodes,\n }),\n [dataSurfaceContext, resolvedNodes],\n )\n\n return (\n <PopupSurfaceIdContext.Provider value={surfaceId}>\n <SubpageStackContext.Provider value={subpageStackContextValue}>\n <DataPopupContext.Provider value={dataPopupContextValue}>\n <Dialog.Popup\n ref={forwardedRef}\n className={className}\n render={render}\n data-command-menu-popup=\"\"\n data-navigating={isSubpageNavigating ? '' : undefined}\n data-has-open-subpage={hasOpenSubpage ? '' : undefined}\n {...rest}\n >\n {children}\n <DataSubpagesContent />\n </Dialog.Popup>\n </DataPopupContext.Provider>\n </SubpageStackContext.Provider>\n </PopupSurfaceIdContext.Provider>\n )\n})\n\nexport namespace CommandMenuPopup {\n export type Props = CommandMenuPopupProps\n export type State = CommandMenuPopupState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\n\nexport interface CommandMenuPortalProps extends Dialog.Portal.Props {}\nexport type CommandMenuPortalState = Dialog.Portal.State\n\n/**\n * A portal element that moves the command menu popup to a different part of the DOM.\n */\nexport const CommandMenuPortal = Dialog.Portal\n\nexport namespace CommandMenuPortal {\n export type Props = CommandMenuPortalProps\n export type State = CommandMenuPortalState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport type { PopupMenuOpenChangeReason } from '../../internal/popup-menu/events.js'\nimport {\n type GetResolvedIdFn,\n type PopupMenuIdScope,\n PopupMenuProviders,\n type UsePopupMenuRootParams,\n usePopupMenuRoot,\n} from '../../internal/popup-menu/index.js'\nimport { useHotkey } from '../../kbd/hooks/use-hotkey.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuRootProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n onOpenChangeComplete?: (open: boolean) => void\n hotkey?: string\n modal?: boolean\n disabled?: boolean\n /**\n * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).\n * @default encoded surface Definition Path joined with `/`; `idScope=\"menu\"` uses the Definition Key\n * Read once when the menu root mounts — later changes have no effect. To retain the old dot-path default, use `node => node.def.id ?? node.definitionPath.join('.')`. This does not recreate former tree-item ancestry; exact compatibility requires walking `node.parent` and reproducing the old slug/key lineage.\n * @example\n * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />\n */\n getResolvedId?: GetResolvedIdFn\n /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */\n idScope?: PopupMenuIdScope\n}\n\n/**\n * Groups all parts of the command menu.\n * Manages open state and provides popup-menu context to children.\n * Doesn't render its own HTML element.\n */\nexport function CommandMenuRoot(props: CommandMenuRoot.Props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n hotkey,\n modal = true,\n disabled,\n getResolvedId,\n idScope = 'surface',\n } = props\n\n const {\n store,\n focusOwnerStore,\n openChainStore,\n registerSurface,\n closeAll,\n handleOpenChange,\n disabled: menuDisabled,\n menuTreeResolver,\n } = usePopupMenuRoot({\n onOpenChange:\n onOpenChange as unknown as UsePopupMenuRootParams['onOpenChange'],\n defaultOpen,\n disabled,\n closeOnOutsidePress: 'pointerdown',\n getResolvedId,\n idScope,\n })\n\n store.useControlledProp('openProp', openProp)\n\n const openState = store.useState('open')\n\n useHotkey(\n hotkey ?? '',\n () => handleOpenChange(!store.state.open, REASONS.imperativeAction),\n // allowInInput keeps the hotkey working as a *toggle*: while the menu is\n // open, focus sits in the search input, so the close press must be allowed\n // to fire from an editable target.\n { enabled: !!hotkey && !menuDisabled, allowInInput: true },\n )\n\n const handleDialogOpenChange = React.useCallback(\n (nextOpen: boolean, dialogDetails: Dialog.Root.ChangeEventDetails) => {\n handleOpenChange(\n nextOpen,\n dialogDetails.reason as PopupMenuOpenChangeReason,\n dialogDetails.event,\n )\n },\n [handleOpenChange],\n )\n\n const handleDialogOpenChangeComplete = React.useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && store.context.clearSearchOnClose === 'after-exit') {\n store.clearSearch()\n store.setInputActive(false)\n }\n\n if (!nextOpen) {\n store.clearHighlight()\n store.context.onCloseComplete?.()\n store.context.onPopupCloseComplete?.()\n }\n\n onOpenChangeComplete?.(nextOpen)\n },\n [store, onOpenChangeComplete],\n )\n\n return (\n <PopupMenuProviders\n menuTreeResolver={menuTreeResolver}\n store={store}\n focusOwnerStore={focusOwnerStore}\n openChainStore={openChainStore}\n disabled={menuDisabled}\n depth={0}\n closeAll={closeAll}\n explicitTabBehavior\n tabWithoutZones=\"inert\"\n registerSurface={registerSurface}\n menuType=\"dropdown\"\n closeOnOutsidePress=\"pointerdown\"\n componentName=\"command-menu\"\n >\n <Dialog.Root\n open={openState}\n onOpenChange={handleDialogOpenChange}\n onOpenChangeComplete={handleDialogOpenChangeComplete}\n modal={modal}\n >\n {children}\n </Dialog.Root>\n </PopupMenuProviders>\n )\n}\n\nexport namespace CommandMenuRoot {\n export interface Props extends CommandMenuRootProps {}\n}\n","'use client'\n\nimport * as React from 'react'\nimport type { KeyChord } from '../utils/parse-keybinding.js'\nimport { parseKeybinding } from '../utils/parse-keybinding.js'\nimport { isApplePlatform } from '../utils/platform.js'\n\n/**\n * Options for the useHotkey global keydown listener.\n *\n * @internal Not part of the public API — used by CommandMenu's `hotkey` prop.\n */\nexport interface UseHotkeyOptions {\n /** @default true */\n enabled?: boolean\n /** @default true */\n preventDefault?: boolean\n /** Fire even when focus is in an input/textarea/select/contenteditable. @default false */\n allowInInput?: boolean\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n )\n}\n\nfunction getEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n\n return key === ' ' ? 'space' : key\n}\n\nfunction matchesModifiers(event: KeyboardEvent, chord: KeyChord): boolean {\n const isApple = isApplePlatform()\n const meta = chord.meta || (isApple && chord.mod)\n const ctrl = chord.ctrl || (!isApple && chord.mod)\n\n return (\n event.metaKey === meta &&\n event.ctrlKey === ctrl &&\n event.altKey === chord.alt &&\n event.shiftKey === chord.shift\n )\n}\n\nfunction matchesChord(event: KeyboardEvent, chord: KeyChord): boolean {\n return chord.key === getEventKey(event) && matchesModifiers(event, chord)\n}\n\n/**\n * Calls a handler when a single-chord keybinding is pressed anywhere in the\n * document.\n *\n * @internal Not part of the public API. Deliberately unexported from\n * `kbd/index.ts` — consumers get global-shortcut behavior through\n * `CommandMenu.Root`'s `hotkey` prop instead. Import via the file path if\n * another primitive needs it.\n */\nexport function useHotkey(\n keys: string,\n handler: (event: KeyboardEvent) => void,\n options?: UseHotkeyOptions,\n): void {\n const keybinding = React.useMemo(() => parseKeybinding(keys), [keys])\n const [firstChord] = keybinding.chords\n const chord =\n keybinding.chords.length === 1 && firstChord !== undefined\n ? firstChord\n : null\n const isSequence = keybinding.chords.length > 1\n const enabled = options?.enabled !== false\n\n const handlerRef = React.useRef(handler)\n const optionsRef = React.useRef(options)\n\n handlerRef.current = handler\n optionsRef.current = options\n\n React.useEffect(() => {\n if (isSequence && process.env.NODE_ENV !== 'production') {\n console.warn(\n `useHotkey only supports single-chord keybindings. Received \"${keys}\", but sequences are not supported by useHotkey.`,\n )\n }\n }, [isSequence, keys])\n\n React.useEffect(() => {\n if (!enabled || chord === null || isSequence || chord.key === null) {\n return\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const currentOptions = optionsRef.current\n\n if (event.repeat) {\n return\n }\n\n if (!currentOptions?.allowInInput && isEditableTarget(event.target)) {\n return\n }\n\n if (!matchesChord(event, chord)) {\n return\n }\n\n if (currentOptions?.preventDefault !== false) {\n event.preventDefault()\n }\n\n handlerRef.current(event)\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [chord, enabled, isSequence])\n}\n","'use client'\n\nimport {\n PopupMenuSubpage,\n type PopupMenuSubpageProps,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuSubpageProps extends PopupMenuSubpageProps {}\n\n/**\n * Groups all parts of a command menu subpage.\n */\nexport function CommandMenuSubpage(props: CommandMenuSubpage.Props) {\n const { closeRootOnEsc = true, children, ...rest } = props\n\n return (\n <PopupMenuSubpage closeRootOnEsc={closeRootOnEsc} {...rest}>\n {children}\n </PopupMenuSubpage>\n )\n}\n\nexport namespace CommandMenuSubpage {\n export interface Props extends CommandMenuSubpageProps {}\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\n\nexport interface CommandMenuTriggerProps extends Dialog.Trigger.Props {}\nexport type CommandMenuTriggerState = Dialog.Trigger.State\n\n/**\n * A button that opens the command menu.\n */\nexport const CommandMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n CommandMenuTrigger.Props\n>(function CommandMenuTrigger(props, forwardedRef) {\n const { disabled, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n const isDisabled = disabled || popupMenuContext?.disabled || false\n\n return (\n <Dialog.Trigger\n ref={forwardedRef}\n {...rest}\n disabled={isDisabled}\n data-command-menu-trigger=\"\"\n />\n )\n})\n\nexport namespace CommandMenuTrigger {\n export interface Props extends CommandMenuTriggerProps {}\n export type State = CommandMenuTriggerState\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","../../src/command-menu/index.parts.ts","../../src/command-menu/backdrop/backdrop.tsx","../../src/command-menu/input/input.tsx","../../src/command-menu/popup/popup.tsx","../../src/command-menu/portal/portal.tsx","../../src/command-menu/root/root.tsx","../../src/kbd/hooks/use-hotkey.ts","../../src/command-menu/subpage/subpage.tsx","../../src/command-menu/trigger/trigger.tsx"],"names":["index_parts_exports","__export","CommandMenuBackdrop","PopupMenuCheckboxItem","PopupMenuCheckboxItemIndicator","PopupMenuEmpty","PopupMenuFocusZone","PopupMenuFooter","PopupMenuGroup","PopupMenuGroupLabel","PopupMenuHeader","PopupMenuIcon","CommandMenuInput","PopupMenuItem","PopupMenuLinkItem","PopupMenuList","PopupMenuLoading","CommandMenuPopup","CommandMenuPortal","CommandMenuRoot","PopupMenuSeparator","PopupMenuShortcut","CommandMenuSubpage","PopupMenuSubpageBack","PopupMenuSubpageBackItem","PopupMenuSubpageTrigger","PopupMenuSurface","CommandMenuTrigger","props","forwardedRef","onPointerDown","rest","popupMenuContext","useMaybePopupMenuContext","handlePointerDown","event","reason_parts_exports","jsx","Dialog","backspaceGoesBack","PopupMenuInput","children","classNameProp","renderProp","surfaceId","usePopupMenuContext","subpageStackContextValue","isSubpageNavigating","hasOpenSubpage","subpageId","useSubpageStackState","dataSurfaceContext","setDataSurfaceContext","resolvedNodes","setResolvedNodes","toPopupState","baseState","className","render","popupProps","dataPopupContextValue","PopupSurfaceIdContext","SubpageStackContext","DataPopupContext","jsxs","DataSubpagesContent","isEditableTarget","target","getEventKey","key","matchesModifiers","chord","isApple","isApplePlatform","meta","ctrl","matchesChord","useHotkey","keys","handler","options","keybinding","parseKeybinding","firstChord","isSequence","enabled","handlerRef","optionsRef","handleKeyDown","currentOptions","openProp","defaultOpen","onOpenChange","onOpenChangeComplete","hotkey","modal","disabled","getResolvedId","idScope","store","focusOwnerStore","openChainStore","registerSurface","closeAll","handleOpenChange","menuDisabled","menuTreeResolver","usePopupMenuRoot","openState","handleDialogOpenChange","nextOpen","dialogDetails","handleDialogOpenChangeComplete","PopupMenuProviders","closeRootOnEsc","PopupMenuSubpage","isDisabled"],"mappings":"AAAA,4/BAAkD,yDAA8Y,yDAA0D,yDAA2C,ICAriBA,EAAAA,CAAA,CAAA,CAAA,CAAAC,iCAAAA,EAAAD,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,EAAAE,EAAAA,CAAA,YAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,qBAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAAC,mBAAAA,CAAA,SAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,MAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,KA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,CAAiB,GAAGnF,CAAAA,CACnD,QAAA,CAAAU,CAAAA,CACH,CAEJ,CClBA,IAUad,EAAAA,CAA2B,EAAA,CAAA,UAAA,CAGtC,QAAA,CAA4BC,CAAAA,CAAOC,CAAAA,CAAc,CACjD,GAAM,CAAE,QAAA,CAAAmE,CAAAA,CAAU,GAAGjE,CAAK,CAAA,CAAIH,CAAAA,CACxBI,CAAAA,CAAmBC,iCAAAA,CAAyB,CAC5CmF,CAAAA,CAAapB,CAAAA,kBAAYhE,CAAAA,+BAAkB,UAAA,EAAY,CAAA,CAAA,CAE7D,OACEK,6BAAAA,cAACC,CAAO,OAAA,CAAP,CACC,GAAA,CAAKT,CAAAA,CACJ,GAAGE,CAAAA,CACJ,QAAA,CAAUqF,CAAAA,CACV,2BAAA,CAA0B,EAAA,CAC5B,CAEJ,CAAC,CAAA,CAAA,47BAAA","file":"/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","sourcesContent":[null,"// ============================================================================\n// Command Menu Parts\n// ============================================================================\n\n// Pure aliases of the canonical resolved-node model (ADR-0001): narrow the\n// alias if a family ever needs to diverge — never edit the canonical type.\nexport type {\n NodeDef,\n PopupMenuNode as Node,\n} from '../internal/popup-menu/index.js'\n\nexport {\n PopupMenuCheckboxItem as CheckboxItem,\n PopupMenuCheckboxItemIndicator as CheckboxItemIndicator,\n PopupMenuEmpty as Empty,\n PopupMenuFocusZone as FocusZone,\n PopupMenuFooter as Footer,\n PopupMenuGroup as Group,\n PopupMenuGroupLabel as GroupLabel,\n PopupMenuHeader as Header,\n PopupMenuIcon as Icon,\n PopupMenuItem as Item,\n PopupMenuLinkItem as LinkItem,\n PopupMenuList as List,\n PopupMenuLoading as Loading,\n PopupMenuSeparator as Separator,\n PopupMenuShortcut as Shortcut,\n PopupMenuSubpageBack as SubpageBack,\n PopupMenuSubpageBackItem as SubpageBackItem,\n PopupMenuSubpageTrigger as SubpageTrigger,\n PopupMenuSurface as Surface,\n} from '../internal/popup-menu/index.js'\nexport { CommandMenuBackdrop as Backdrop } from './backdrop/backdrop.js'\nexport { CommandMenuInput as Input } from './input/input.js'\nexport { CommandMenuPopup as Popup } from './popup/popup.js'\nexport { CommandMenuPortal as Portal } from './portal/portal.js'\nexport { CommandMenuRoot as Root } from './root/root.js'\nexport { CommandMenuSubpage as Subpage } from './subpage/subpage.js'\nexport { CommandMenuTrigger as Trigger } from './trigger/trigger.js'\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {}\nexport type CommandMenuBackdropState = Dialog.Backdrop.State\n\n/**\n * An overlay displayed beneath the command menu popup.\n *\n * Pressing down on the backdrop closes the menu immediately (pointerdown),\n * matching the outside-press behavior of the other menus, instead of waiting\n * for the Dialog's click-time dismissal. Consumers can opt out by calling\n * `event.preventDefault()` in their own `onPointerDown`.\n */\nexport const CommandMenuBackdrop = React.forwardRef<\n HTMLDivElement,\n CommandMenuBackdrop.Props\n>(function CommandMenuBackdrop(props, forwardedRef) {\n const { onPointerDown, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n\n const handlePointerDown = React.useCallback<\n NonNullable<Dialog.Backdrop.Props['onPointerDown']>\n >(\n (event) => {\n onPointerDown?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n if (popupMenuContext && !popupMenuContext.disabled) {\n popupMenuContext.closeAll(REASONS.outsidePress, event.nativeEvent)\n }\n },\n [onPointerDown, popupMenuContext],\n )\n\n return (\n <Dialog.Backdrop\n ref={forwardedRef}\n {...rest}\n onPointerDown={handlePointerDown}\n data-command-menu-backdrop=\"\"\n />\n )\n})\n\nexport namespace CommandMenuBackdrop {\n export interface Props extends CommandMenuBackdropProps {}\n export type State = CommandMenuBackdropState\n}\n","'use client'\n\nimport * as React from 'react'\nimport {\n PopupMenuInput,\n type PopupMenuInputProps,\n type PopupMenuInputState,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuInputProps extends PopupMenuInputProps {}\nexport type CommandMenuInputState = PopupMenuInputState\n\n/**\n * Search input for filtering command menu items.\n */\nexport const CommandMenuInput = React.forwardRef<\n HTMLInputElement,\n CommandMenuInput.Props\n>(function CommandMenuInput(props, forwardedRef) {\n const { backspaceGoesBack = true, ...rest } = props\n\n return (\n <PopupMenuInput\n ref={forwardedRef}\n backspaceGoesBack={backspaceGoesBack}\n {...rest}\n />\n )\n})\n\nexport namespace CommandMenuInput {\n export interface Props extends CommandMenuInputProps {}\n export type State = CommandMenuInputState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { PopupSurfaceIdContext } from '../../internal/popup-menu/contexts/popup-surface-id-context.js'\nimport { SubpageStackContext } from '../../internal/popup-menu/contexts/subpage-stack-context.js'\nimport {\n DataPopupContext,\n type DataSurfaceContextValue,\n type ResolvedNodesSlot,\n} from '../../internal/popup-menu/data-first/context.js'\nimport { DataSubpagesContent } from '../../internal/popup-menu/data-first/data-subpages.js'\nimport { useSubpageStackState } from '../../internal/popup-menu/hooks/use-subpage-stack-state.js'\nimport { usePopupMenuContext } from '../../internal/popup-menu/index.js'\nimport type { ComponentRenderFn } from '../../utils/types.js'\n\nexport interface CommandMenuPopupState extends Dialog.Popup.State {\n /**\n * Whether any non-root subpage is currently open.\n */\n hasOpenSubpage: boolean\n\n /**\n * Active subpage ID, or null when the root surface is active.\n */\n subpageId: string | null\n}\n\nexport interface CommandMenuPopupProps\n extends Omit<Dialog.Popup.Props, 'className' | 'render'> {\n /**\n * CSS class applied to the element, or a function that\n * returns a class based on the component's state.\n */\n className?: string | ((state: CommandMenuPopupState) => string)\n\n /**\n * Allows replacing the popup element with a custom element.\n * The render state includes dialog popup + subpage navigation state.\n */\n render?:\n | React.ReactElement\n | ComponentRenderFn<\n React.HTMLAttributes<HTMLElement>,\n CommandMenuPopupState\n >\n}\n\n/**\n * A container for the command menu contents.\n * Wraps Dialog.Popup with popup-menu subpage and data providers.\n */\nexport const CommandMenuPopup = React.forwardRef<\n HTMLDivElement,\n CommandMenuPopup.Props\n>(function CommandMenuPopup(props, forwardedRef) {\n const {\n children,\n className: classNameProp,\n render: renderProp,\n ...rest\n } = props\n\n const surfaceId = React.useId()\n const popupMenuContext = usePopupMenuContext()\n\n const {\n subpageStackContextValue,\n isSubpageNavigating,\n hasOpenSubpage,\n subpageId,\n } = useSubpageStackState({\n surfaceId,\n store: popupMenuContext.store,\n })\n\n const [dataSurfaceContext, setDataSurfaceContext] =\n React.useState<DataSurfaceContextValue | null>(null)\n const [resolvedNodes, setResolvedNodes] =\n React.useState<ResolvedNodesSlot | null>(null)\n\n const toPopupState = React.useCallback(\n (baseState: Dialog.Popup.State): CommandMenuPopupState => ({\n ...baseState,\n hasOpenSubpage,\n subpageId,\n }),\n [hasOpenSubpage, subpageId],\n )\n\n const className = React.useMemo(() => {\n if (typeof classNameProp === 'function') {\n return (baseState: Dialog.Popup.State) => {\n return classNameProp(toPopupState(baseState))\n }\n }\n return classNameProp\n }, [classNameProp, toPopupState])\n\n const render = React.useMemo(() => {\n if (typeof renderProp === 'function') {\n return (\n popupProps: React.HTMLAttributes<HTMLElement>,\n baseState: Dialog.Popup.State,\n ) => renderProp(popupProps, toPopupState(baseState))\n }\n\n return renderProp\n }, [renderProp, toPopupState])\n\n const dataPopupContextValue = React.useMemo(\n () => ({\n dataSurfaceContext,\n setDataSurfaceContext,\n resolvedNodes,\n setResolvedNodes,\n }),\n [dataSurfaceContext, resolvedNodes],\n )\n\n return (\n <PopupSurfaceIdContext.Provider value={surfaceId}>\n <SubpageStackContext.Provider value={subpageStackContextValue}>\n <DataPopupContext.Provider value={dataPopupContextValue}>\n <Dialog.Popup\n ref={forwardedRef}\n className={className}\n render={render}\n data-command-menu-popup=\"\"\n data-navigating={isSubpageNavigating ? '' : undefined}\n data-has-open-subpage={hasOpenSubpage ? '' : undefined}\n {...rest}\n >\n {children}\n <DataSubpagesContent />\n </Dialog.Popup>\n </DataPopupContext.Provider>\n </SubpageStackContext.Provider>\n </PopupSurfaceIdContext.Provider>\n )\n})\n\nexport namespace CommandMenuPopup {\n export type Props = CommandMenuPopupProps\n export type State = CommandMenuPopupState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\n\nexport interface CommandMenuPortalProps extends Dialog.Portal.Props {}\nexport type CommandMenuPortalState = Dialog.Portal.State\n\n/**\n * A portal element that moves the command menu popup to a different part of the DOM.\n */\nexport const CommandMenuPortal = Dialog.Portal\n\nexport namespace CommandMenuPortal {\n export type Props = CommandMenuPortalProps\n export type State = CommandMenuPortalState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport type { PopupMenuOpenChangeReason } from '../../internal/popup-menu/events.js'\nimport {\n type GetResolvedIdFn,\n type PopupMenuIdScope,\n PopupMenuProviders,\n type UsePopupMenuRootParams,\n usePopupMenuRoot,\n} from '../../internal/popup-menu/index.js'\nimport { useHotkey } from '../../kbd/hooks/use-hotkey.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuRootProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n onOpenChangeComplete?: (open: boolean) => void\n hotkey?: string\n modal?: boolean\n disabled?: boolean\n /**\n * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).\n * @default encoded surface Definition Path joined with `/`; `idScope=\"menu\"` uses the Definition Key\n * Read once when the menu root mounts — later changes have no effect. To retain the old dot-path default, use `node => node.def.id ?? node.definitionPath.join('.')`. This does not recreate former tree-item ancestry; exact compatibility requires walking `node.parent` and reproducing the old slug/key lineage.\n * @example\n * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />\n */\n getResolvedId?: GetResolvedIdFn\n /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */\n idScope?: PopupMenuIdScope\n}\n\n/**\n * Groups all parts of the command menu.\n * Manages open state and provides popup-menu context to children.\n * Doesn't render its own HTML element.\n */\nexport function CommandMenuRoot(props: CommandMenuRoot.Props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n hotkey,\n modal = true,\n disabled,\n getResolvedId,\n idScope = 'surface',\n } = props\n\n const {\n store,\n focusOwnerStore,\n openChainStore,\n registerSurface,\n closeAll,\n handleOpenChange,\n disabled: menuDisabled,\n menuTreeResolver,\n } = usePopupMenuRoot({\n onOpenChange:\n onOpenChange as unknown as UsePopupMenuRootParams['onOpenChange'],\n defaultOpen,\n disabled,\n closeOnOutsidePress: 'pointerdown',\n getResolvedId,\n idScope,\n })\n\n store.useControlledProp('openProp', openProp)\n\n const openState = store.useState('open')\n\n useHotkey(\n hotkey ?? '',\n () => handleOpenChange(!store.state.open, REASONS.imperativeAction),\n // allowInInput keeps the hotkey working as a *toggle*: while the menu is\n // open, focus sits in the search input, so the close press must be allowed\n // to fire from an editable target.\n { enabled: !!hotkey && !menuDisabled, allowInInput: true },\n )\n\n const handleDialogOpenChange = React.useCallback(\n (nextOpen: boolean, dialogDetails: Dialog.Root.ChangeEventDetails) => {\n handleOpenChange(\n nextOpen,\n dialogDetails.reason as PopupMenuOpenChangeReason,\n dialogDetails.event,\n )\n },\n [handleOpenChange],\n )\n\n const handleDialogOpenChangeComplete = React.useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && store.context.clearSearchOnClose === 'after-exit') {\n store.clearSearch()\n store.setInputActive(false)\n }\n\n if (!nextOpen) {\n store.clearHighlight()\n store.context.onCloseComplete?.()\n store.context.onPopupCloseComplete?.()\n }\n\n onOpenChangeComplete?.(nextOpen)\n },\n [store, onOpenChangeComplete],\n )\n\n return (\n <PopupMenuProviders\n menuTreeResolver={menuTreeResolver}\n store={store}\n focusOwnerStore={focusOwnerStore}\n openChainStore={openChainStore}\n disabled={menuDisabled}\n depth={0}\n closeAll={closeAll}\n explicitTabBehavior\n tabWithoutZones=\"inert\"\n registerSurface={registerSurface}\n menuType=\"dropdown\"\n closeOnOutsidePress=\"pointerdown\"\n componentName=\"command-menu\"\n >\n <Dialog.Root\n open={openState}\n onOpenChange={handleDialogOpenChange}\n onOpenChangeComplete={handleDialogOpenChangeComplete}\n modal={modal}\n >\n {children}\n </Dialog.Root>\n </PopupMenuProviders>\n )\n}\n\nexport namespace CommandMenuRoot {\n export interface Props extends CommandMenuRootProps {}\n}\n","'use client'\n\nimport * as React from 'react'\nimport type { KeyChord } from '../utils/parse-keybinding.js'\nimport { parseKeybinding } from '../utils/parse-keybinding.js'\nimport { isApplePlatform } from '../utils/platform.js'\n\n/**\n * Options for the useHotkey global keydown listener.\n *\n * @internal Not part of the public API — used by CommandMenu's `hotkey` prop.\n */\nexport interface UseHotkeyOptions {\n /** @default true */\n enabled?: boolean\n /** @default true */\n preventDefault?: boolean\n /** Fire even when focus is in an input/textarea/select/contenteditable. @default false */\n allowInInput?: boolean\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n )\n}\n\nfunction getEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n\n return key === ' ' ? 'space' : key\n}\n\nfunction matchesModifiers(event: KeyboardEvent, chord: KeyChord): boolean {\n const isApple = isApplePlatform()\n const meta = chord.meta || (isApple && chord.mod)\n const ctrl = chord.ctrl || (!isApple && chord.mod)\n\n return (\n event.metaKey === meta &&\n event.ctrlKey === ctrl &&\n event.altKey === chord.alt &&\n event.shiftKey === chord.shift\n )\n}\n\nfunction matchesChord(event: KeyboardEvent, chord: KeyChord): boolean {\n return chord.key === getEventKey(event) && matchesModifiers(event, chord)\n}\n\n/**\n * Calls a handler when a single-chord keybinding is pressed anywhere in the\n * document.\n *\n * @internal Not part of the public API. Deliberately unexported from\n * `kbd/index.ts` — consumers get global-shortcut behavior through\n * `CommandMenu.Root`'s `hotkey` prop instead. Import via the file path if\n * another primitive needs it.\n */\nexport function useHotkey(\n keys: string,\n handler: (event: KeyboardEvent) => void,\n options?: UseHotkeyOptions,\n): void {\n const keybinding = React.useMemo(() => parseKeybinding(keys), [keys])\n const [firstChord] = keybinding.chords\n const chord =\n keybinding.chords.length === 1 && firstChord !== undefined\n ? firstChord\n : null\n const isSequence = keybinding.chords.length > 1\n const enabled = options?.enabled !== false\n\n const handlerRef = React.useRef(handler)\n const optionsRef = React.useRef(options)\n\n handlerRef.current = handler\n optionsRef.current = options\n\n React.useEffect(() => {\n if (isSequence && process.env.NODE_ENV !== 'production') {\n console.warn(\n `useHotkey only supports single-chord keybindings. Received \"${keys}\", but sequences are not supported by useHotkey.`,\n )\n }\n }, [isSequence, keys])\n\n React.useEffect(() => {\n if (!enabled || chord === null || isSequence || chord.key === null) {\n return\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const currentOptions = optionsRef.current\n\n if (event.repeat) {\n return\n }\n\n if (!currentOptions?.allowInInput && isEditableTarget(event.target)) {\n return\n }\n\n if (!matchesChord(event, chord)) {\n return\n }\n\n if (currentOptions?.preventDefault !== false) {\n event.preventDefault()\n }\n\n handlerRef.current(event)\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [chord, enabled, isSequence])\n}\n","'use client'\n\nimport {\n PopupMenuSubpage,\n type PopupMenuSubpageProps,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuSubpageProps extends PopupMenuSubpageProps {}\n\n/**\n * Groups all parts of a command menu subpage.\n */\nexport function CommandMenuSubpage(props: CommandMenuSubpage.Props) {\n const { closeRootOnEsc = true, children, ...rest } = props\n\n return (\n <PopupMenuSubpage closeRootOnEsc={closeRootOnEsc} {...rest}>\n {children}\n </PopupMenuSubpage>\n )\n}\n\nexport namespace CommandMenuSubpage {\n export interface Props extends CommandMenuSubpageProps {}\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\n\nexport interface CommandMenuTriggerProps extends Dialog.Trigger.Props {}\nexport type CommandMenuTriggerState = Dialog.Trigger.State\n\n/**\n * A button that opens the command menu.\n */\nexport const CommandMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n CommandMenuTrigger.Props\n>(function CommandMenuTrigger(props, forwardedRef) {\n const { disabled, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n const isDisabled = disabled || popupMenuContext?.disabled || false\n\n return (\n <Dialog.Trigger\n ref={forwardedRef}\n {...rest}\n disabled={isDisabled}\n data-command-menu-trigger=\"\"\n />\n )\n})\n\nexport namespace CommandMenuTrigger {\n export interface Props extends CommandMenuTriggerProps {}\n export type State = CommandMenuTriggerState\n}\n"]}
@@ -1,19 +1,19 @@
1
- import { h as GetResolvedIdFn, j as PopupMenuIdScope, m as PopupMenuCheckboxItem, q as PopupMenuItem, r as PopupMenuNode, N as NodeDef, x as PopupMenuSubpageTrigger } from '../events-DPsuhBln.cjs';
2
- export { M as AsyncLoaderConfig, O as AsyncLoaderFetchStatus, Q as AsyncLoaderLoadingPhase, R as AsyncLoaderResult, S as AsyncLoaderSource, T as AsyncLoaderStatus, U as AsyncNodesConfig, V as AsyncRenderState, W as AsyncResultBehavior, X as AsyncState, Y as BreadcrumbNode, Z as CheckboxItemDef, _ as CheckboxItemRenderParams, $ as CheckboxItemRenderProps, y as CommandMenuCheckboxItemProps, z as CommandMenuCheckboxItemState, A as CommandMenuItemProps, B as CommandMenuItemState, K as CommandMenuSubpageTriggerProps, L as CommandMenuSubpageTriggerState, a0 as DataListChildrenState, a1 as DeepSearchConfig, a2 as DisplayGroupNode, a3 as DisplayNode, a4 as DisplayRadioGroupNode, a5 as DisplayRowNode, a6 as DisplaySeparatorNode, a7 as DisplaySubpageNode, a8 as GroupBehavior, a9 as GroupDef, ab as GroupRenderContext, ac as GroupRenderParams, ad as IncludeInDeepSearch, ae as InitialQueryBehavior, af as ItemDef, ag as ItemRenderParams, ah as ItemRenderProps, ai as LoaderComponentProps, aj as QueryAsyncNodesConfig, ak as QueryLoaderConfig, al as RadioGroupBehavior, am as RadioGroupDef, ao as RadioGroupRenderParams, ap as RadioGroupRenderProps, aq as RadioItemDef, ar as RadioItemRenderParams, as as RadioItemRenderProps, at as RowRenderContext, au as ScoredNode, av as SeparatorDef, aw as SeparatorRenderParams, ax as StaticAsyncNodesConfig, ay as StaticLoaderConfig, az as SubmenuDef, aA as SubmenuRenderParams, aB as SubmenuRenderProps, aC as SubpageContentRenderParams, aD as SubpageDef, aE as SubpageTriggerRenderParams, aF as SubpageTriggerRenderProps, aJ as UnresolvedMenuNode, aK as defineRadioGroup, aL as isDisplayGroupNode, aM as isDisplayRadioGroupNode, aN as isDisplayRowNode, aO as isDisplaySeparatorNode } from '../events-DPsuhBln.cjs';
3
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-DF-L-30G.cjs';
4
- import { P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator, f as PopupMenuSurface } from '../separator-BiySI623.cjs';
5
- export { g as CommandMenuEmptyProps, h as CommandMenuEmptyState, i as CommandMenuGroupLabelProps, j as CommandMenuGroupLabelState, k as CommandMenuGroupProps, l as CommandMenuGroupState, m as CommandMenuIconProps, n as CommandMenuIconState, o as CommandMenuListChildrenState, p as CommandMenuListProps, q as CommandMenuListState, r as CommandMenuSeparatorProps, s as CommandMenuSeparatorState, t as CommandMenuSurfaceProps, u as CommandMenuSurfaceState } from '../separator-BiySI623.cjs';
1
+ import { h as GetResolvedIdFn, j as PopupMenuIdScope, m as PopupMenuCheckboxItem, q as PopupMenuItem, r as PopupMenuLinkItem, u as PopupMenuNode, N as NodeDef, y as PopupMenuSubpageTrigger } from '../events-DuKEM5sQ.cjs';
2
+ export { R as AsyncLoaderConfig, S as AsyncLoaderFetchStatus, T as AsyncLoaderLoadingPhase, U as AsyncLoaderResult, V as AsyncLoaderSource, W as AsyncLoaderStatus, X as AsyncNodesConfig, Y as AsyncRenderState, Z as AsyncResultBehavior, _ as AsyncState, $ as BreadcrumbNode, a0 as CheckboxItemDef, a1 as CheckboxItemRenderParams, a2 as CheckboxItemRenderProps, z as CommandMenuCheckboxItemProps, A as CommandMenuCheckboxItemState, B as CommandMenuItemProps, D as CommandMenuItemState, E as CommandMenuLinkItemProps, F as CommandMenuLinkItemState, O as CommandMenuSubpageTriggerProps, Q as CommandMenuSubpageTriggerState, a3 as DataListChildrenState, a4 as DeepSearchConfig, a5 as DisplayGroupNode, a6 as DisplayNode, a7 as DisplayRadioGroupNode, a8 as DisplayRowNode, a9 as DisplaySeparatorNode, aa as DisplaySubpageNode, ab as GroupBehavior, ac as GroupDef, ae as GroupRenderContext, af as GroupRenderParams, ag as IncludeInDeepSearch, ah as InitialQueryBehavior, ai as ItemDef, aj as ItemRenderParams, ak as ItemRenderProps, al as LinkItemDef, am as LinkItemRenderParams, an as LinkItemRenderProps, ao as LoaderComponentProps, ap as QueryAsyncNodesConfig, aq as QueryLoaderConfig, ar as RadioGroupBehavior, as as RadioGroupDef, au as RadioGroupRenderParams, av as RadioGroupRenderProps, aw as RadioItemDef, ax as RadioItemRenderParams, ay as RadioItemRenderProps, az as RowRenderContext, aA as ScoredNode, aB as SeparatorDef, aC as SeparatorRenderParams, aD as StaticAsyncNodesConfig, aE as StaticLoaderConfig, aF as SubmenuDef, aG as SubmenuRenderParams, aH as SubmenuRenderProps, aI as SubpageContentRenderParams, aJ as SubpageDef, aK as SubpageTriggerRenderParams, aL as SubpageTriggerRenderProps, aP as UnresolvedMenuNode, aQ as defineRadioGroup, aR as isDisplayGroupNode, aS as isDisplayRadioGroupNode, aT as isDisplayRowNode, aU as isDisplaySeparatorNode } from '../events-DuKEM5sQ.cjs';
3
+ export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-r2eYfQth.cjs';
4
+ import { P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator, f as PopupMenuSurface } from '../separator-DzfgGPjS.cjs';
5
+ export { g as CommandMenuEmptyProps, h as CommandMenuEmptyState, i as CommandMenuGroupLabelProps, j as CommandMenuGroupLabelState, k as CommandMenuGroupProps, l as CommandMenuGroupState, m as CommandMenuIconProps, n as CommandMenuIconState, o as CommandMenuListChildrenState, p as CommandMenuListProps, q as CommandMenuListState, r as CommandMenuSeparatorProps, s as CommandMenuSeparatorState, t as CommandMenuSurfaceProps, u as CommandMenuSurfaceState } from '../separator-DzfgGPjS.cjs';
6
6
  import { P as PopupMenuLoading } from '../loading-C6WZGUc3.cjs';
7
7
  export { a as CommandMenuLoadingProps, b as CommandMenuLoadingState } from '../loading-C6WZGUc3.cjs';
8
- import { A as PopupMenuSubpageProps, P as PopupMenuCheckboxItemIndicator, a as PopupMenuFocusZone, b as PopupMenuFooter, c as PopupMenuHeader, e as PopupMenuShortcut, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem } from '../resolve-Dk_fAKb2.cjs';
9
- export { B as AsyncMenuCoordinatorValue, l as CommandMenuCheckboxItemIndicatorProps, m as CommandMenuCheckboxItemIndicatorState, n as CommandMenuFocusZoneProps, o as CommandMenuFocusZoneState, p as CommandMenuFooterProps, q as CommandMenuFooterState, r as CommandMenuHeaderProps, s as CommandMenuHeaderState, d as CommandMenuRadioGroupValue, C as CommandMenuRadioGroupValueProps, t as CommandMenuShortcutProps, v as CommandMenuShortcutState, w as CommandMenuSubpageBackItemProps, x as CommandMenuSubpageBackItemState, y as CommandMenuSubpageBackProps, z as CommandMenuSubpageBackState, E as DataListContext, F as DataSurfaceContext, D as DataSurfaceContextValue, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../resolve-Dk_fAKb2.cjs';
8
+ import { A as PopupMenuSubpageProps, P as PopupMenuCheckboxItemIndicator, a as PopupMenuFocusZone, b as PopupMenuFooter, c as PopupMenuHeader, e as PopupMenuShortcut, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem } from '../resolve-C5shwZ1S.cjs';
9
+ export { B as AsyncMenuCoordinatorValue, l as CommandMenuCheckboxItemIndicatorProps, m as CommandMenuCheckboxItemIndicatorState, n as CommandMenuFocusZoneProps, o as CommandMenuFocusZoneState, p as CommandMenuFooterProps, q as CommandMenuFooterState, r as CommandMenuHeaderProps, s as CommandMenuHeaderState, d as CommandMenuRadioGroupValue, C as CommandMenuRadioGroupValueProps, t as CommandMenuShortcutProps, v as CommandMenuShortcutState, w as CommandMenuSubpageBackItemProps, x as CommandMenuSubpageBackItemState, y as CommandMenuSubpageBackProps, z as CommandMenuSubpageBackState, E as DataListContext, F as DataSurfaceContext, D as DataSurfaceContextValue, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../resolve-C5shwZ1S.cjs';
10
10
  import * as _base_ui_react_dialog from '@base-ui/react/dialog';
11
11
  import { Dialog } from '@base-ui/react/dialog';
12
12
  import * as React from 'react';
13
13
  import { a as PopupMenuInputProps, b as PopupMenuInputState } from '../input-C95v6jB0.cjs';
14
14
  import { a as ComponentRenderFn } from '../types-DT4FOOa2.cjs';
15
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
16
- import '../ListboxStore-nmorsoqX.cjs';
16
+ import '../ListboxStore-DCGGpiBg.cjs';
17
17
  import '@base-ui/utils/store';
18
18
 
19
19
  interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {
@@ -148,7 +148,7 @@ declare namespace CommandMenuTrigger {
148
148
 
149
149
  declare const index_parts_NodeDef: typeof NodeDef;
150
150
  declare namespace index_parts {
151
- export { CommandMenuBackdrop as Backdrop, PopupMenuCheckboxItem as CheckboxItem, PopupMenuCheckboxItemIndicator as CheckboxItemIndicator, PopupMenuEmpty as Empty, PopupMenuFocusZone as FocusZone, PopupMenuFooter as Footer, PopupMenuGroup as Group, PopupMenuGroupLabel as GroupLabel, PopupMenuHeader as Header, PopupMenuIcon as Icon, CommandMenuInput as Input, PopupMenuItem as Item, PopupMenuList as List, PopupMenuLoading as Loading, PopupMenuNode as Node, index_parts_NodeDef as NodeDef, CommandMenuPopup as Popup, CommandMenuPortal as Portal, CommandMenuRoot as Root, PopupMenuSeparator as Separator, PopupMenuShortcut as Shortcut, CommandMenuSubpage as Subpage, PopupMenuSubpageBack as SubpageBack, PopupMenuSubpageBackItem as SubpageBackItem, PopupMenuSubpageTrigger as SubpageTrigger, PopupMenuSurface as Surface, CommandMenuTrigger as Trigger };
151
+ export { CommandMenuBackdrop as Backdrop, PopupMenuCheckboxItem as CheckboxItem, PopupMenuCheckboxItemIndicator as CheckboxItemIndicator, PopupMenuEmpty as Empty, PopupMenuFocusZone as FocusZone, PopupMenuFooter as Footer, PopupMenuGroup as Group, PopupMenuGroupLabel as GroupLabel, PopupMenuHeader as Header, PopupMenuIcon as Icon, CommandMenuInput as Input, PopupMenuItem as Item, PopupMenuLinkItem as LinkItem, PopupMenuList as List, PopupMenuLoading as Loading, PopupMenuNode as Node, index_parts_NodeDef as NodeDef, CommandMenuPopup as Popup, CommandMenuPortal as Portal, CommandMenuRoot as Root, PopupMenuSeparator as Separator, PopupMenuShortcut as Shortcut, CommandMenuSubpage as Subpage, PopupMenuSubpageBack as SubpageBack, PopupMenuSubpageBackItem as SubpageBackItem, PopupMenuSubpageTrigger as SubpageTrigger, PopupMenuSurface as Surface, CommandMenuTrigger as Trigger };
152
152
  }
153
153
 
154
154
  export { index_parts as CommandMenu, type CommandMenuBackdropProps, type CommandMenuBackdropState, PopupMenuFocusZone as CommandMenuFocusZone, PopupMenuFooter as CommandMenuFooter, PopupMenuHeader as CommandMenuHeader, type CommandMenuInputProps, type CommandMenuInputState, type CommandMenuPopupProps, type CommandMenuPopupState, type CommandMenuPortalProps, type CommandMenuPortalState, type CommandMenuRootProps, type CommandMenuSubpageProps, type CommandMenuTriggerProps, type CommandMenuTriggerState, GetResolvedIdFn, NodeDef, PopupMenuIdScope, PopupMenuNode };