@segmentify/ui 0.0.45 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/segmentify-ui.cjs +1 -1
- package/dist/segmentify-ui.js +6 -9
- package/dist/ui.css +0 -3
- package/package.json +1 -1
package/dist/segmentify-ui.cjs
CHANGED
|
@@ -83,7 +83,7 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
83
83
|
${s.right}px ${s.bottom}px,
|
|
84
84
|
${s.right}px ${s.top}px,
|
|
85
85
|
${s.left}px ${s.top}px
|
|
86
|
-
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});process.env.NODE_ENV!=="production"&&(LD.displayName="InternalBackdrop");function uJ(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const $0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&($0.displayName="ComboboxRootContext");const G0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(G0.displayName="ComboboxFloatingContext");const H0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(H0.displayName="ComboboxDerivedItemsContext");const W0=b.createContext("");process.env.NODE_ENV!=="production"&&(W0.displayName="ComboboxInputValueContext");function Gn(){const e=b.useContext($0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(22));return e}function _f(){const e=b.useContext(G0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(23));return e}function Ii(){const e=b.useContext(H0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(24));return e}function z0(){return b.useContext(W0)}const cJ=(e,t)=>Object.is(e,t);function ns(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function dJ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:ns(t,r,n))}function gd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:ns(r,t,n))}function fJ(e,t,n){return e.filter(r=>!ns(t,r,n))}function mv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function q0(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function pJ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(q0(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function On(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return mv(e)}function $a(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?mv(e.value):mv(e)}function FD(e,t,n){function r(){return On(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=q0(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=o.find(s=>s.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=o.find(s=>s&&s.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function hJ(e,t,n){return e.reduce((r,o,i)=>(i>0&&r.push(", "),r.push(h.jsx(b.Fragment,{children:FD(o,t,n)},i)),r),[])}const be={id:De(e=>e.id),query:De(e=>e.query),items:De(e=>e.items),selectedValue:De(e=>e.selectedValue),hasSelectionChips:De(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:De(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:De((e,t)=>t?pJ(e.items):!1),open:De(e=>e.open),mounted:De(e=>e.mounted),forceMounted:De(e=>e.forceMounted),inline:De(e=>e.inline),activeIndex:De(e=>e.activeIndex),selectedIndex:De(e=>e.selectedIndex),isActive:De((e,t)=>e.activeIndex===t),isSelected:De((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(o=>ns(t,o,n)):ns(t,r,n)}),transitionStatus:De(e=>e.transitionStatus),popupProps:De(e=>e.popupProps),inputProps:De(e=>e.inputProps),triggerProps:De(e=>e.triggerProps),getItemProps:De(e=>e.getItemProps),positionerElement:De(e=>e.positionerElement),listElement:De(e=>e.listElement),triggerElement:De(e=>e.triggerElement),inputElement:De(e=>e.inputElement),popupSide:De(e=>e.popupSide),openMethod:De(e=>e.openMethod),inputInsidePopup:De(e=>e.inputInsidePopup),selectionMode:De(e=>e.selectionMode),listRef:De(e=>e.listRef),labelsRef:De(e=>e.labelsRef),popupRef:De(e=>e.popupRef),emptyRef:De(e=>e.emptyRef),inputRef:De(e=>e.inputRef),keyboardActiveRef:De(e=>e.keyboardActiveRef),chipsContainerRef:De(e=>e.chipsContainerRef),clearRef:De(e=>e.clearRef),valuesRef:De(e=>e.valuesRef),allValuesRef:De(e=>e.allValuesRef),name:De(e=>e.name),disabled:De(e=>e.disabled),readOnly:De(e=>e.readOnly),required:De(e=>e.required),grid:De(e=>e.grid),isGrouped:De(e=>e.isGrouped),virtualized:De(e=>e.virtualized),onOpenChangeComplete:De(e=>e.onOpenChangeComplete),openOnInputClick:De(e=>e.openOnInputClick),itemToStringLabel:De(e=>e.itemToStringLabel),isItemEqualToValue:De(e=>e.isItemEqualToValue),modal:De(e=>e.modal),autoHighlight:De(e=>e.autoHighlight),submitOnItemClick:De(e=>e.submitOnItemClick)};let JE=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const gJ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mJ={valid(e){return e===null?null:e?{[JE.valid]:""}:{[JE.invalid]:""}}},BD=b.createContext({invalid:void 0,name:void 0,validityData:{state:gJ,errors:[],error:"",value:"",initialValue:null},setValidityData:Lt,disabled:void 0,touched:!1,setTouched:Lt,dirty:!1,setDirty:Lt,filled:!1,setFilled:Lt,focused:!1,setFocused:Lt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(BD.displayName="FieldRootContext");function bu(e=!0){const t=b.useContext(BD);if(t.setValidityData===Lt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Fr(28));return t}function bJ(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const VD=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Lt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(VD.displayName="FormContext");function $D(){return b.useContext(VD)}function vJ(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=$D(),{invalid:l,markedDirtyRef:u,validityData:c,setValidityData:d}=bu(),f=ke(e.getValue);Ge(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),c.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,c.initialValue,f]),Ge(()=>{!t||!r||a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:bJ(c,l),validate(p=!0){let g=n;g===void 0&&(g=f()),u.current=!0,p?so.flushSync(()=>s(g)):s(g)}})},[s,i,t,a,f,r,l,u,o,c,n]),Ge(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const GD=b.createContext({controlId:void 0,registerControlId:Lt,labelId:void 0,setLabelId:Lt,messageIds:[],setMessageIds:Lt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(GD.displayName="LabelableContext");function U0(){return b.useContext(GD)}function HD(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=U0(),s=tD(t),a=n?o:void 0,l=cr(()=>Symbol("labelable-control")),u=b.useRef(!1),c=b.useRef(t!=null),d=ke(()=>{!u.current||i===Lt||(u.current=!1,i(l.current,void 0))});return Ge(()=>{if(i===Lt)return;let f;if(n){const p=r?.current;Ot(p)&&p.closest("label")!=null?f=t??null:f=a??s}else if(t!=null)c.current=!0,f=t;else if(c.current)f=s;else{d();return}if(f===void 0){d();return}u.current=!0,i(l.current,f)},[t,r,a,i,n,s,l,d]),b.useEffect(()=>d,[d]),o??s}function yJ(e,t){return(n,r)=>{if(n==null)return!1;const o=On(n,t);return e.contains(o,r)}}function xJ(e,t,n){return(r,o)=>{if(r==null)return!1;if(!o)return!0;const i=On(r,t),s=n!=null?On(n,t):"";return s&&e.contains(s,o)&&s.length===o.length?!0:e.contains(i,o)}}const KE=new Map;function WD(e){return Array.isArray(e)?e.map(t=>WD(t)).join(","):e==null?"":String(e)}function wJ(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${WD(e.locale)}|${JSON.stringify(t)}`,r=KE.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(s,a,l){if(!a)return!0;const u=On(s,l);for(let c=0;c<=u.length-a.length;c+=1)if(o.compare(u.slice(c,c+a.length),a)===0)return!0;return!1},startsWith(s,a,l){if(!a)return!0;const u=On(s,l);return o.compare(u.slice(0,a.length),a)===0},endsWith(s,a,l){if(!a)return!0;const u=On(s,l),c=a.length;return u.length>=c&&o.compare(u.slice(u.length-c),a)===0}};return KE.set(n,i),i}const CJ=wJ;function oc(e,t){const n=b.useRef(e),r=ke(t);Ge(()=>{n.current!==e&&r(n.current)},[e,r]),Ge(()=>{n.current=e},[e])}const zD=Symbol("none"),$i={value:zD,index:-1};function SJ(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:u,name:c,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:g,grid:m=!1,items:v,filteredItems:y,filter:x,openOnInputClick:w=!0,autoHighlight:C=!1,keepHighlight:S=!1,highlightItemOnHover:R=!0,loopFocus:I=!0,itemToStringLabel:T,itemToStringValue:_,isItemEqualToValue:$=cJ,virtualized:A=!1,inline:M=!1,fillInputOnItemPress:O=!0,modal:B=!1,limit:j=-1,autoComplete:D="list",formAutoComplete:V,locale:G,submitOnItemClick:z=!1}=e,{clearErrors:H}=$D(),{setDirty:ne,validityData:W,shouldValidateOnChange:J,setFilled:K,name:U,disabled:oe,setTouched:X,setFocused:te,validationMode:Q,validation:se}=bu(),ae=HD({id:t}),L=CJ({locale:G}),[Z,k]=b.useState(!1),[ie,Y]=b.useState(null),le=b.useRef([]),pe=b.useRef([]),re=b.useRef(null),fe=b.useRef(null),de=b.useRef(null),ve=b.useRef(!0),we=b.useRef(!1),Se=b.useRef(null),Ye=b.useRef(null),at=b.useRef(null),Xe=b.useRef($i),Ue=b.useRef(null),rt=b.useRef([]),et=b.useRef([]),gt=oe||d,ct=U??c,ot=l==="multiple",mt=l==="single",Nt=a!==void 0||s!==void 0,Bt=v!==void 0,tt=y!==void 0;let Ze;C==="always"?Ze="always":Ze=C?"input-change":!1;const[ee,ye]=Rm({controlled:o,default:ot?r??Yu:r,name:"Combobox",state:"selectedValue"}),ge=b.useMemo(()=>x===null?()=>!0:x!==void 0?x:mt&&!Z?xJ(L,T,ee):yJ(L,T),[x,mt,ee,Z,L,T]),xe=cr(()=>Nt?s??"":mt?On(ee,T):"").current,[Ae,Ie]=Rm({controlled:a,default:xe,name:"Combobox",state:"inputValue"}),[qe,Pt]=Rm({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),lt=q0(v),it=ie??(Ae===""?"":String(Ae).trim()),_t=mt?On(ee,T):"",Et=mt&&!Z&&it!==""&&_t!==""&&_t.length===it.length&&L.contains(_t,it),sn=Et?"":it,mr=Bt&&tt&&Et,Wn=b.useMemo(()=>v?lt?v.flatMap(Ce=>Ce.items):v:Yu,[v,lt]),pn=b.useMemo(()=>{if(y&&!mr)return y;if(!v)return Yu;if(lt){const Me=v,Ke=[];let It=0;for(const st of Me){if(j>-1&&It>=j)break;const Dt=sn===""?st.items:st.items.filter(zr=>ge(zr,sn,T));if(Dt.length===0)continue;const Xn=j>-1?j-It:1/0,An=Dt.slice(0,Xn);if(An.length>0){const zr={...st,items:An};Ke.push(zr),It+=An.length}}return Ke}if(sn==="")return j>-1?Wn.slice(0,j):Wn;const Ce=[];for(const Me of Wn){if(j>-1&&Ce.length>=j)break;ge(Me,sn,T)&&Ce.push(Me)}return Ce},[y,mr,v,lt,sn,j,ge,T,Wn]),Jt=b.useMemo(()=>lt?pn.flatMap(Me=>Me.items):pn,[pn,lt]),Ve=cr(()=>new DD({id:ae,selectedValue:ee,open:qe,filter:ge,query:it,items:v,selectionMode:l,listRef:le,labelsRef:pe,popupRef:re,emptyRef:de,inputRef:fe,keyboardActiveRef:ve,chipsContainerRef:Se,clearRef:Ye,valuesRef:rt,allValuesRef:et,selectionEventRef:at,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,openOnInputClick:w,itemToStringLabel:T,isItemEqualToValue:$,modal:B,autoHighlight:Ze,submitOnItemClick:z,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:M,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Lt,setOpen:Lt,setInputValue:Lt,setSelectedValue:Lt,setIndices:Lt,onItemHighlighted:Lt,handleSelection:Lt,getItemProps:()=>En,forceMount:Lt,requestSubmit:Lt})).current,zn=l==="none"?Ae:ee,Sa=b.useMemo(()=>l==="none"?zn:Array.isArray(ee)?ee.map(Ce=>$a(Ce,_)):$a(ee,_),[zn,_,l,ee]),Oi=ke(u),Ni=ke(n),Go=me(Ve,be.activeIndex),nn=me(Ve,be.selectedIndex),Ho=me(Ve,be.positionerElement),Es=me(Ve,be.listElement),bo=me(Ve,be.triggerElement),Pi=me(Ve,be.inputElement),Cn=me(Ve,be.inline),Mt=me(Ve,be.inputInsidePopup),Ea=rr(bo),{mounted:Is,setMounted:Ia,transitionStatus:_i}=M0(qe),{openMethod:Rs,triggerProps:Hr,reset:As}=eJ(qe);vJ({id:ae,name:ct,commit:se.commit,value:zn,controlRef:Mt?Ea:fe,getValue:()=>Sa});const br=ke(()=>{v?pe.current=Jt.map(Ce=>On(Ce,T)):Ve.set("forceMounted",!0)}),qn=b.useRef(ee);Ge(()=>{ee!==qn.current&&br()},[br,ee]);const an=ke(Ce=>{Ve.update(Ce);const Me=Ce.type||"none";if(Ce.activeIndex!==void 0)if(Ce.activeIndex===null)Xe.current!==$i&&(Xe.current=$i,Oi(void 0,Ba(Me,void 0,{index:-1})));else{const Ke=rt.current[Ce.activeIndex];Xe.current={value:Ke,index:Ce.activeIndex},Oi(Ke,Ba(Me,void 0,{index:Ce.activeIndex}))}}),Rn=ke((Ce,Me)=>{if(we.current=Me.reason===ei,e.onInputValueChange?.(Ce,Me),!Me.isCanceled){if(Me.reason===Hs){const Ke=Me.event,It=Ke.inputType;if(Ke.type==="compositionend"||It!=null&&It!==""&&It!=="insertReplacementText"){const Dt=Ce.trim()!=="";Dt&&k(!0),Ue.current={hasQuery:Dt},Dt&&Ze&&Ve.state.activeIndex==null&&Ve.set("activeIndex",0)}}Ie(Ce)}}),vo=ke((Ce,Me)=>{if(qe!==Ce&&(Me.reason==="escape-key"&&Bt&&Jt.length===0&&!Ve.state.emptyRef.current&&Me.allowPropagation(),e.onOpenChange?.(Ce,Me),!Me.isCanceled&&(!Ce&&Z&&(mt?(Cn||Y(it),it===""&&k(!1)):ot&&(Cn||Mt?an({activeIndex:null}):Y(it),Rn("",Qe(ei,Me.event)))),Pt(Ce),!Ce&&Mt&&(Me.reason===Rf||Me.reason===O0)&&(X(!0),te(!1),Q==="onBlur")))){const Ke=l==="none"?Ae:ee;se.commit(Ke)}}),Wo=ke((Ce,Me)=>{if(i?.(Ce,Me),Me.isCanceled)return;ye(Ce),(l==="none"&&re.current&&O||mt&&!Ve.state.inputInsidePopup)&&Rn(On(Ce,T),Qe(Me.reason,Me.event)),mt&&Ce!=null&&Me.reason!==Hs&&Z&&!Cn&&Y(it)}),Ra=ke((Ce,Me)=>{let Ke=Me;if(Ke===void 0){if(Go===null)return;Ke=rt.current[Go]}const It=Nn(Ce),st=at.current??Ce;at.current=null;const Dt=Qe(s7,st),Xn=It?.closest("a")?.getAttribute("href");if(Xn){Xn.startsWith("#")&&vo(!1,Dt);return}if(ot){const An=Array.isArray(ee)?ee:[],Uo=dJ(An,Ke,Ve.state.isItemEqualToValue)?fJ(An,Ke,Ve.state.isItemEqualToValue):[...An,Ke];if(Wo(Uo,Dt),!(fe.current?fe.current.value.trim()!=="":!1))return;Ve.state.inputInsidePopup?Rn("",Qe(ei,Dt.event)):vo(!1,Dt)}else Wo(Ke,Dt),vo(!1,Dt)}),Mi=ke(()=>{if(!Ve.state.submitOnItemClick)return;const Ce=Ve.state.inputElement?.form;Ce&&typeof Ce.requestSubmit=="function"&&Ce.requestSubmit()}),Wr=ke(()=>{if(Ia(!1),Ni?.(!1),k(!1),As(),Y(null),an(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ot&&fe.current&&fe.current.value!==""&&!we.current&&Rn("",Qe(ei)),mt)if(Ve.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Rn("",Qe(ei));else{const Ce=On(ee,T);fe.current&&fe.current.value!==Ce&&Rn(Ce,Qe(Ce===""?ei:er))}}),Di=b.useMemo(()=>Cn&&Ho?{current:Ho.closest('[role="dialog"]')}:re,[Cn,Ho]);Of({enabled:!e.actionsRef,open:qe,ref:Di,onComplete(){qe||Wr()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:Wr}),[Wr]),Ge(function(){if(qe||l==="none")return;const Me=v?Wn:et.current;if(ot){const Ke=Array.isArray(ee)?ee:[],It=Ke[Ke.length-1],st=gd(Me,It,$);an({selectedIndex:st===-1?null:st})}else{const Ke=gd(Me,ee,$);an({selectedIndex:Ke===-1?null:Ke})}},[qe,ee,v,l,Wn,ot,$,an]),Ge(()=>{v&&(rt.current=Jt,le.current.length=Jt.length)},[v,Jt]),Ge(()=>{const Ce=Ue.current;if(Ce&&(Ce.hasQuery?Ze&&Ve.set("activeIndex",0):Ze==="always"&&Ve.set("activeIndex",0),Ue.current=null),!qe&&!Cn)return;const Ke=Bt||tt?Jt:rt.current,It=Ve.state.activeIndex;if(It==null){if(Ze==="always"&&Ke.length>0){Ve.set("activeIndex",0);return}Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1})));return}if(It>=Ke.length){Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1}))),Ve.set("activeIndex",null);return}const st=Ke[It],Dt=Xe.current.value,Xn=Dt!==zD&&ns(st,Dt,Ve.state.isItemEqualToValue);(Xe.current.index!==It||!Xn)&&(Xe.current={value:st,index:It},Ve.state.onItemHighlighted(st,Ba(er,void 0,{index:It})))},[Go,Ze,tt,Bt,Jt,Cn,qe,Ve]),Ge(()=>{if(l==="none"){K(String(Ae)!=="");return}K(ot?Array.isArray(ee)&&ee.length>0:ee!=null)},[K,l,Ae,ee,ot]),b.useEffect(()=>{Bt&&Ze&&Jt.length===0&&an({activeIndex:null})},[Bt,Ze,Jt.length,an]),oc(it,()=>{!qe||it===""||it===String(xe)||k(!0)}),oc(ee,()=>{if(l!=="none"&&(H(ct),ne(ee!==W.initialValue),J()?se.commit(ee):se.commit(ee,!0),mt&&!Nt&&!Mt)){const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))}}),oc(Ae,()=>{l==="none"&&(H(ct),ne(Ae!==W.initialValue),J()?se.commit(Ae):se.commit(Ae,!0))}),oc(v,()=>{if(!mt||Nt||Mt||Z)return;const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))});const Un=kD({open:Cn?!0:qe,onOpenChange:vo,elements:{reference:Mt?bo:Pi,floating:Ho}});let zo,qo;Cn||(zo=m?"grid":"listbox",qo=qe?"true":"false");const Aa=b.useMemo(()=>{const Ce=Pi?.tagName==="INPUT",Me=Ce||qe,Ke=Ce?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Me&&(Ke.role="combobox",Ke["aria-expanded"]=qo,Ke["aria-haspopup"]=zo,Ke["aria-controls"]=qe?Es?.id:void 0,Ke["aria-autocomplete"]=D),{reference:Ke,floating:{role:"presentation"}}},[Pi,qe,qo,zo,Es?.id,D]),Ta=PD(Un,{enabled:!f&&!gt&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Mt?0:50,reason:l7}),Oa=hZ(Un,{enabled:!f&&!gt&&!Cn,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Cn?!0:void 0,outsidePress(Ce){const Me=Nn(Ce);return!ft(bo,Me)&&!ft(Ye.current,Me)&&!ft(Se.current,Me)}}),Na=JZ(Un,{enabled:!f&&!gt,id:ae,listRef:le,activeIndex:Go,selectedIndex:nn,virtual:!0,loopFocus:I,allowEscape:I&&!Ze,focusItemOnOpen:Z||l==="none"&&!Ze?!1:"auto",focusItemOnHover:R,resetOnPointerLeave:!S,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:Yu,onNavigate(Ce,Me){!Me&&!qe||_i==="ending"||an(Me?{activeIndex:Ce,type:ve.current?"keyboard":"pointer"}:{activeIndex:Ce})}}),{getReferenceProps:yo,getFloatingProps:ki,getItemProps:ji}=UZ([Aa,Ta,Oa,Na]);uJ(()=>{Ve.update({inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,getItemProps:ji,setOpen:vo,setInputValue:Rn,setSelectedValue:Wo,setIndices:an,onItemHighlighted:Oi,handleSelection:Ra,forceMount:br,requestSubmit:Mi})}),Ge(()=>{Ve.update({id:ae,selectedValue:ee,open:qe,mounted:Is,transitionStatus:_i,items:v,inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,openMethod:Rs,getItemProps:ji,selectionMode:l,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,onOpenChangeComplete:Ni,openOnInputClick:w,itemToStringLabel:T,modal:B,autoHighlight:Ze,isItemEqualToValue:$,submitOnItemClick:z,hasInputValue:Nt,requestSubmit:Mi})},[Ve,ae,ee,qe,Is,_i,v,ki,yo,ji,Rs,Hr,l,ct,gt,f,p,se,m,lt,A,Ni,w,T,B,$,z,Nt,M,Mi,Ze]);const xo=Ml(g,se.inputRef),Dn=b.useMemo(()=>({query:it,hasItems:Bt,filteredItems:pn,flatFilteredItems:Jt}),[it,Bt,pn,Jt]),vr=b.useMemo(()=>Array.isArray(zn)?"":$a(zn,_),[zn,_]),yr=ot&&Array.isArray(ee)&&ee.length>0,Li=ot||l==="none"?void 0:ct,Yn=b.useMemo(()=>!ot||!Array.isArray(ee)||!ct?null:ee.map(Ce=>{const Me=$a(Ce,_);return h.jsx("input",{type:"hidden",name:ct,value:Me},Me)}),[ot,ee,ct,_]),Pa=h.jsxs(b.Fragment,{children:[e.children,h.jsx("input",{...se.getInputValidationProps({onFocus(){if(Mt){bo?.focus();return}(fe.current||bo)?.focus()},onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;const Me=Ce.target.value,Ke=Qe(er,Ce.nativeEvent);function It(){if(ot)return;if(l==="none"){ne(Me!==W.initialValue),Rn(Me,Ke),J()&&se.commit(Me);return}const st=rt.current.find(Dt=>$a(Dt,_).toLowerCase()===Me.toLowerCase());st!=null&&(ne(st!==W.initialValue),Wo?.(st,Ke),J()&&se.commit(st))}v?It():(br(),queueMicrotask(It))}}),id:ae&&Li==null?`${ae}-hidden-input`:void 0,name:Li,autoComplete:V,disabled:gt,required:p&&!yr,readOnly:f,value:vr,ref:xo,style:Li?tZ:L0,tabIndex:-1,"aria-hidden":!0}),Yn]});return h.jsx($0.Provider,{value:Ve,children:h.jsx(G0.Provider,{value:Un,children:h.jsx(H0.Provider,{value:Dn,children:h.jsx(W0.Provider,{value:Ae,children:Pa})})})})}const qD={...aJ,...mJ,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function EJ(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const i=parseFloat(n.width)||0,s=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,a),c=Math.max(t.height,s,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const ic=2,UD=b.forwardRef(function(t,n){const{render:r,className:o,nativeButton:i=!0,disabled:s=!1,id:a,...l}=t,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:p,validation:g}=bu(),{labelId:m}=U0(),v=Gn(),{filteredItems:y}=Ii(),x=me(v,be.selectionMode),w=me(v,be.disabled),C=me(v,be.readOnly),S=me(v,be.required),R=me(v,be.mounted),I=me(v,be.popupSide),T=me(v,be.positionerElement),_=me(v,be.listElement),$=me(v,be.triggerProps),A=me(v,be.triggerElement),M=me(v,be.inputInsidePopup),O=me(v,be.id),B=me(v,be.open),j=me(v,be.selectedValue),D=me(v,be.activeIndex),V=me(v,be.selectedIndex),G=me(v,be.hasSelectedValue),z=_f(),H=z0(),ne=ts(),W=c||w||s,J=y.length===0,K=R&&T?I:null;HD({id:M?a:void 0});const U=M?a??O:a,oe=b.useRef("");function X(Y){oe.current=Y.pointerType}const te=z.useState("domReferenceElement");b.useEffect(()=>{M&&A&&A!==te&&z.set("domReferenceElement",A)},[A,te,z,M]);const{reference:Q}=KZ(z,{enabled:!B&&!C&&!w&&x==="single",listRef:v.state.labelsRef,activeIndex:D,selectedIndex:V,onMatch(Y){const le=v.state.valuesRef.current[Y];le!==void 0&&v.state.setSelectedValue(le,Qe("none"))}}),{reference:se}=PD(z,{enabled:!C&&!w,event:"mousedown"}),{buttonRef:ae,getButtonProps:L}=Af({native:i,disabled:W}),Z={...u,open:B,disabled:W,popupSide:K,listEmpty:J,placeholder:!G},k=ke(Y=>{v.set("triggerElement",Y)});return Mn("button",t,{ref:[n,ae,k],state:Z,props:[$,se,Q,{id:U,tabIndex:M?0:-1,role:M?"combobox":void 0,"aria-expanded":B?"true":"false","aria-haspopup":M?"dialog":"listbox","aria-controls":B?_?.id:void 0,"aria-required":M&&S||void 0,"aria-labelledby":m,onPointerDown:X,onPointerEnter:X,onFocus(){f(!0),!(W||C)&&ne.start(0,v.state.forceMount)},onBlur(Y){if(!ft(T,Y.relatedTarget)&&(d(!0),f(!1),p==="onBlur")){const le=x==="none"?H:j;g.commit(le)}},onMouseDown(Y){if(W||C||(M||z.set("domReferenceElement",Y.currentTarget),v.state.forceMount(),oe.current!=="touch"&&(v.state.inputRef.current?.focus(),M||Y.preventDefault()),B))return;const le=Ht(Y.currentTarget);function pe(re){if(!A)return;const fe=Nn(re),de=v.state.positionerElement,ve=v.state.listElement;if(ft(A,fe)||ft(de,fe)||ft(ve,fe)||fe===A)return;const we=EJ(A),Se=re.clientX>=we.left-ic&&re.clientX<=we.right+ic,Ye=re.clientY>=we.top-ic&&re.clientY<=we.bottom+ic;Se&&Ye||v.state.setOpen(!1,Qe("cancel-open",re))}M&&le.addEventListener("mouseup",pe,{once:!0})},onKeyDown(Y){W||C||(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Tt(Y),v.state.setOpen(!0,Qe(dl,Y.nativeEvent)),v.state.inputRef.current?.focus())}},g?g.getValidationProps(l):l,L],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(UD.displayName="ComboboxTrigger");const Y0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Y0.displayName="ComboboxChipsContext");function YD(){return b.useContext(Y0)}const X0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(X0.displayName="ComboboxPositionerContext");function Z0(e){const t=b.useContext(X0);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":Fr(21));return t}const J0=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,id:s,...a}=t,{state:l,disabled:u,setTouched:c,setFocused:d,validationMode:f,validation:p}=bu(),{labelId:g}=U0(),m=YD(),y=!!Z0(!0),x=Gn(),{filteredItems:w}=Ii(),C=z0(),S=YM(),R=me(x,be.required),I=me(x,be.disabled),T=me(x,be.readOnly),_=me(x,be.name),$=me(x,be.selectionMode),A=me(x,be.autoHighlight),M=me(x,be.inputProps),O=me(x,be.triggerProps),B=me(x,be.open),j=me(x,be.mounted),D=me(x,be.selectedValue),V=me(x,be.popupSide),G=me(x,be.positionerElement),z=me(x,be.id),H=me(x,be.inline),ne=!!A,W=j&&G?V:null,J=u||I||i,K=w.length===0,oe=tD(s??(y||H?void 0:z)),[X,te]=b.useState(null),Q=b.useRef(!1),se=b.useRef(null),ae=b.useRef(!1),L=ke(Y=>{const le=y||x.state.inline;le&&!x.state.hasInputValue&&x.state.setInputValue("",Qe(er)),x.update({inputElement:Y,inputInsidePopup:le})}),Z={...l,open:B,disabled:J,readOnly:T,popupSide:W,listEmpty:K};function k(Y){if(!m)return;let le;const{highlightedChipIndex:pe}=m;if(pe!==void 0){if(Y.key==="ArrowLeft")Y.preventDefault(),pe>0?le=pe-1:le=void 0;else if(Y.key==="ArrowRight")Y.preventDefault(),pe<D.length-1?le=pe+1:le=void 0;else if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault();const re=pe>=D.length-1?D.length-2:pe;le=re>=0?re:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return le}return Y.key==="ArrowLeft"&&(Y.currentTarget.selectionStart??0)===0&&D.length>0?(Y.preventDefault(),le=Math.max(D.length-1,0)):Y.key==="Backspace"&&Y.currentTarget.value===""&&D.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Y.preventDefault()),le}return Mn("input",t,{state:Z,ref:[n,x.state.inputRef,L],props:[M,O,{type:"text",value:t.value??X??C,"aria-readonly":T||void 0,"aria-required":R||void 0,"aria-labelledby":g,disabled:J,readOnly:T,required:$==="none"?R:void 0,...$==="none"&&_&&{name:_},id:oe,onFocus(){if(d(!0),!H||!ae.current)return;ae.current=!1;const Y=se.current;Y==null||!Object.hasOwn(x.state.valuesRef.current,Y)||x.state.setIndices({activeIndex:Y})},onBlur(){c(!0),d(!1);const Y=x.state.activeIndex;if(H&&Y!==null&&A!=="always"&&(se.current=Y,ae.current=!0,x.state.setIndices({activeIndex:null})),f==="onBlur"){const le=$==="none"?C:D;p.commit(le)}},onCompositionStart(Y){ld||(Q.current=!0,te(Y.currentTarget.value))},onCompositionEnd(Y){Q.current=!1;const le=Y.currentTarget.value;te(null),x.state.setInputValue(le,Qe(Hs,Y.nativeEvent))},onChange(Y){const le=Y.nativeEvent.inputType,pe=!le||le==="insertReplacementText",re=Q.current||!pe;if(Q.current){const we=Y.currentTarget.value;te(we),we===""&&!x.state.openOnInputClick&&!x.state.inputInsidePopup&&x.state.setOpen(!1,Qe(ei,Y.nativeEvent));const Se=we.trim(),Ye=ne&&Se!=="";!T&&!J&&Se&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!Ye&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"});return}x.state.setInputValue(Y.currentTarget.value,Qe(Hs,Y.nativeEvent));const fe=Y.currentTarget.value==="",de=Qe(ei,Y.nativeEvent);fe&&!x.state.inputInsidePopup&&($==="single"&&x.state.setSelectedValue(null,de),x.state.openOnInputClick||x.state.setOpen(!1,de));const ve=Y.currentTarget.value.trim();!T&&!J&&ve&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!ne&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Y){if(J||T||Y.ctrlKey||Y.shiftKey||Y.altKey||Y.metaKey)return;x.state.keyboardActiveRef.current=!0;const le=Y.currentTarget,pe=le.scrollWidth-le.clientWidth,re=S==="rtl";if(Y.key==="Home"){Tt(Y);const ve=PE&&re?le.value.length:0;le.setSelectionRange(ve,ve),le.scrollLeft=0;return}if(Y.key==="End"){Tt(Y);const ve=PE&&re?0:le.value.length;le.setSelectionRange(ve,ve),le.scrollLeft=re?-pe:pe;return}if(!j&&Y.key==="Escape"){const ve=$==="multiple"&&Array.isArray(D)?D.length===0:D===null,we=Qe(eD,Y.nativeEvent),Se=$==="multiple"?[]:null;x.state.setInputValue("",we),x.state.setSelectedValue(Se,we),!ve&&!x.state.inline&&!we.isPropagationAllowed&&Y.stopPropagation();return}if(m&&Y.key==="Backspace"&&le.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(D)&&D.length>0){const ve=D.slice(0,-1);x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),x.state.setSelectedValue(ve,Qe(er,Y.nativeEvent));return}const fe=m?.highlightedChipIndex!==void 0,de=k(Y);if(m?.setHighlightedChipIndex(de),de!==void 0?m?.chipsRef.current[de]?.focus():fe&&x.state.inputRef.current?.focus(),Y.which!==229&&Y.key==="Enter"&&B){const ve=x.state.activeIndex,we=Y.nativeEvent;if(ve===null){x.state.setOpen(!1,Qe(er,we));return}Tt(Y);const Se=x.state.listRef.current[ve];Se&&(x.state.selectionEventRef.current=we,Se.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(a):a],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(J0.displayName="ComboboxInput");const IJ={..._0,...sJ},XD=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,keepMounted:a=!1,...l}=t,{disabled:u}=bu(),c=Gn(),d=me(c,be.selectionMode),f=me(c,be.disabled),p=me(c,be.readOnly),g=me(c,be.open),m=me(c,be.selectedValue),v=me(c,be.hasSelectionChips),y=z0();let x=!1;d==="none"?x=y!=="":d==="single"?x=m!=null:x=v;const w=u||f||i,{buttonRef:C,getButtonProps:S}=Af({native:s,disabled:w}),{mounted:R,transitionStatus:I,setMounted:T}=M0(x),_={disabled:w,open:g,transitionStatus:I};Of({open:x,ref:c.state.clearRef,onComplete(){x||T(!1)}});const $=Mn("button",t,{state:_,ref:[n,C,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(M){M.preventDefault()},onClick(M){if(w||p)return;const O=c.state.keyboardActiveRef;c.state.setInputValue("",Qe(RE,M.nativeEvent)),d!=="none"?(c.state.setSelectedValue(Array.isArray(m)?[]:null,Qe(RE,M.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:O.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:O.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},l,S],stateAttributesMapping:IJ});return a||R?$:null});process.env.NODE_ENV!=="production"&&(XD.displayName="ComboboxClear");const ZD=b.createContext(null);process.env.NODE_ENV!=="production"&&(ZD.displayName="GroupCollectionContext");function RJ(){return b.useContext(ZD)}function AJ(e){const{children:t}=e,{filteredItems:n}=Ii(),r=RJ(),o=r?r.items:n;return o?h.jsx(b.Fragment,{children:o.map(t)}):null}const JD=b.forwardRef(function(t,n){var r;const{render:o,className:i,children:s,...a}=t,l=Gn(),u=_f(),c=!!Z0(!0),{filteredItems:d}=Ii(),f=me(l,be.items),p=me(l,be.labelsRef),g=me(l,be.listRef),m=me(l,be.selectionMode),v=me(l,be.grid),y=me(l,be.popupProps),x=me(l,be.disabled),w=me(l,be.readOnly),C=me(l,be.virtualized),S=m==="multiple",R=d.length===0,I=ke(O=>{l.set("positionerElement",O)}),T=ke(O=>{l.set("listElement",O)}),_=b.useMemo(()=>typeof s=="function"?r||(r=h.jsx(AJ,{children:s})):s,[s]),$={empty:R},A=u.useState("floatingId"),M=Mn("div",t,{state:$,ref:[n,T,c?null:I],props:[y,{children:_,tabIndex:-1,id:A,role:v?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(O){if(!(x||w)&&O.key==="Enter"){const B=l.state.activeIndex;if(B==null)return;Tt(O);const j=O.nativeEvent,D=l.state.listRef.current[B];D&&(l.state.selectionEventRef.current=j,D.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return C?M:h.jsx(qM,{elementsRef:g,labelsRef:f?void 0:p,children:M})});process.env.NODE_ENV!=="production"&&(JD.displayName="ComboboxList");const K0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(K0.displayName="ComboboxPortalContext");function TJ(){const e=b.useContext(K0);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":Fr(20));return e}const KD=b.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,i=Gn(),s=me(i,be.mounted),a=me(i,be.forceMounted);return s||r||a?h.jsx(K0.Provider,{value:r,children:h.jsx(ND,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(KD.displayName="ComboboxPortal");const OJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:d="real"}=ro(e,t)||{};if(u==null)return{};const f=yy(c),p={x:n,y:r},g=$d(o),m=Vd(g),v=await s.getDimensions(u),y=g==="y",x=y?"top":"left",w=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[g]-p[g]-i.floating[m],R=p[g]-i.reference[g],I=d==="real"?await s.getOffsetParent?.(u):a.floating;let T=a.floating[C]||i.floating[m];(!T||!await s.isElement?.(I))&&(T=a.floating[C]||i.floating[m]);const _=S/2-R/2,$=T/2-v[m]/2-1,A=Math.min(f[x],$),M=Math.min(f[w],$),O=A,B=T-v[m]-M,j=T/2-v[m]/2+_,D=Bc(O,j,B),V=!l.arrow&&Fo(o)!=null&&j!==D&&i.reference[m]/2-(j<O?A:M)-v[m]/2<0,G=V?j<O?j-O:j-B:0;return{[g]:p[g]+G,data:{[g]:D,centerOffset:j-D-G,...V&&{alignmentOffset:G}},reset:V}}}),NJ=(e,t)=>({...OJ(e),options:[e,t]}),PJ={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await qT().fn(e)).data?.referenceHidden||i}}}},_J={sideX:"left",sideY:"top"};function QD(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function QE(e,t,n){const{rects:r,placement:o}=e;return{side:QD(t,Ln(o),n),align:Fo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function MJ(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:C}=e,[S,R]=b.useState(null);!g&&S!==null&&R(null);const I=m.side||"flip",T=m.align||"flip",_=m.fallbackAxisSide||"end",$=typeof t=="function"?t:void 0,A=ke($),M=$?A:t,O=rr(t),j=YM()==="rtl",D=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],V=i==="center"?D:`${D}-${i}`;let G=l;const z=1,H=r==="bottom"?z:0,ne=r==="top"?z:0,W=r==="right"?z:0,J=r==="left"?z:0;typeof G=="number"?G={top:G+H,right:G+J,bottom:G+ne,left:G+W}:G&&(G={top:(G.top||0)+H,right:(G.right||0)+J,bottom:(G.bottom||0)+ne,left:(G.left||0)+W});const K={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},U=b.useRef(null),oe=rr(o),X=rr(s),se=[$T(tt=>{const Ze=QE(tt,r,j),ee=typeof oe.current=="function"?oe.current(Ze):oe.current,ye=typeof X.current=="function"?X.current(Ze):X.current;return{mainAxis:ee,crossAxis:ye,alignmentAxis:ye}},[typeof o!="function"?o:0,typeof s!="function"?s:0,j,r])],ae=T==="none"&&I!=="shift",L=!ae&&(u||v||I==="shift"),Z=I==="none"?null:WT({...K,padding:{top:G.top+z,right:G.right+z,bottom:G.bottom+z,left:G.left+z},mainAxis:!v&&I==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),k=ae?null:GT(tt=>{const Ze=Ht(tt.elements.floating).documentElement;return{...K,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:L,limiter:u||v?void 0:HT(ee=>{if(!U.current)return{};const{width:ye,height:ge}=U.current.getBoundingClientRect(),xe=sr(Ln(ee.placement)),Ae=xe==="y"?ye:ge,Ie=xe==="y"?G.left+G.right:G.top+G.bottom;return{offset:Ae/2+Ie/2}})}},[K,u,v,G,T]);I==="shift"||T==="shift"||i==="center"?se.push(k,Z):se.push(Z,k),se.push(zT({...K,apply({elements:{floating:tt},rects:{reference:Ze},availableWidth:ee,availableHeight:ye}){const ge=tt.style;ge.setProperty("--available-width",`${ee}px`),ge.setProperty("--available-height",`${ye}px`),ge.setProperty("--anchor-width",`${Ze.width}px`),ge.setProperty("--anchor-height",`${Ze.height}px`)}}),NJ(()=>({element:U.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(tt){const{elements:Ze,middlewareData:ee,placement:ye,rects:ge,y:xe}=tt,Ae=Ln(ye),Ie=sr(Ae),qe=U.current,Pt=ee.arrow?.x||0,lt=ee.arrow?.y||0,it=qe?.clientWidth||0,_t=qe?.clientHeight||0,Et=Pt+it/2,sn=lt+_t/2,mr=Math.abs(ee.shift?.y||0),Wn=ge.reference.height/2,pn=typeof o=="function"?o(QE(tt,r,j)):o,Jt=mr>pn,Ve={top:`${Et}px calc(100% + ${pn}px)`,bottom:`${Et}px ${-pn}px`,left:`calc(100% + ${pn}px) ${sn}px`,right:`${-pn}px ${sn}px`}[Ae],zn=`${Et}px ${ge.reference.y+Wn-xe}px`;return Ze.floating.style.setProperty("--transform-origin",L&&Ie==="y"&&Jt?zn:Ve),{}}},PJ,x),Ge(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const ie=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Y,elements:le,x:pe,y:re,middlewareData:fe,update:de,placement:ve,context:we,isPositioned:Se,floatingStyles:Ye}=qZ({rootContext:p,placement:V,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...tt)=>Gc(...tt,ie),nodeId:y,externalTree:C}),{sideX:at,sideY:Xe}=fe.adaptiveOrigin||_J,Ue=Se?n:"fixed",rt=b.useMemo(()=>{const tt=x?{position:Ue,[at]:pe,[Xe]:re}:{position:Ue,...Ye};return Se||(tt.opacity=0),tt},[x,Ue,at,pe,Xe,re,Ye,Se]),et=b.useRef(null);Ge(()=>{if(!g)return;const tt=O.current,Ze=typeof tt=="function"?tt():tt,ye=(eI(Ze)?Ze.current:Ze)||null||null;ye!==et.current&&(Y.setPositionReference(ye),et.current=ye)},[g,Y,M,O]),b.useEffect(()=>{if(!g)return;const tt=O.current;typeof tt!="function"&&eI(tt)&&tt.current!==et.current&&(Y.setPositionReference(tt.current),et.current=tt.current)},[g,Y,M,O]),b.useEffect(()=>{if(f&&g&&le.domReference&&le.floating)return Gc(le.domReference,le.floating,de,ie)},[f,g,le,de,ie]);const gt=Ln(ve),ct=QD(r,gt,j),ot=Fo(ve)||"center",mt=!!fe.hide?.referenceHidden;Ge(()=>{w&&g&&Se&&R(gt)},[w,g,Se,gt]);const Nt=b.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Bt=fe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:rt,arrowStyles:Nt,arrowRef:U,arrowUncentered:Bt,side:ct,align:ot,physicalSide:gt,anchorHidden:mt,refs:Y,context:we,isPositioned:Se,update:de}),[rt,Nt,U,Bt,ct,ot,gt,mt,Y,we,Se,de])}function eI(e){return e!=null&&"current"in e}function ek(e){return e==="starting"?J8:En}const tk=b.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=Q8,...y}=t,x=Gn(),{filteredItems:w}=Ii(),C=_f(),S=TJ(),R=me(x,be.modal),I=me(x,be.open),T=me(x,be.mounted),_=me(x,be.openMethod),$=me(x,be.triggerElement),A=me(x,be.inputElement),M=me(x,be.inputInsidePopup),O=me(x,be.transitionStatus),B=w.length===0,D=MJ({anchor:i??(M?$:A),floatingRootContext:C,positionMethod:s,mounted:T,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:v,lazyFlip:!0});K7(I&&R&&_!=="touch",$);const V=b.useMemo(()=>{const W={...D.positionerStyles};return I||(W.pointerEvents="none"),{role:"presentation",hidden:!T,style:W}},[I,T,D.positionerStyles]),G={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:B};Ge(()=>{x.set("popupSide",D.side)},[x,D.side]);const z=b.useMemo(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,anchorHidden:D.anchorHidden,isPositioned:D.isPositioned}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.anchorHidden,D.isPositioned]),H=ke(W=>{x.set("positionerElement",W)}),ne=Mn("div",t,{state:G,ref:[n,H],props:[V,ek(O),y],stateAttributesMapping:jD});return h.jsxs(X0.Provider,{value:z,children:[T&&R&&h.jsx(LD,{inert:lJ(!I),cutout:A??$}),ne]})});process.env.NODE_ENV!=="production"&&(tk.displayName="ComboboxPositioner");const DJ={...jD,..._0},nk=b.forwardRef(function(t,n){const{render:r,className:o,initialFocus:i,finalFocus:s,...a}=t,l=Gn(),u=Z0(),c=_f(),{filteredItems:d}=Ii(),f=me(l,be.mounted),p=me(l,be.open),g=me(l,be.openMethod),m=me(l,be.transitionStatus),v=me(l,be.inputInsidePopup),y=me(l,be.inputElement),x=d.length===0;Of({open:p,ref:l.state.popupRef,onComplete(){p&&l.state.onOpenChangeComplete(!0)}});const w={open:p,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:m,empty:x},C=Mn("div",t,{state:w,ref:[n,l.state.popupRef],props:[{role:v?"dialog":"presentation",tabIndex:-1,onFocus(T){const _=Nn(T.nativeEvent);g!=="touch"&&(ft(l.state.listElement,_)||_===T.currentTarget)&&l.state.inputRef.current?.focus()}},ek(m),a],stateAttributesMapping:DJ}),R=i===void 0?v?T=>T==="touch"?l.state.popupRef.current:y:!1:i;let I;return s!=null?I=s:I=v?void 0:!1,h.jsx(dZ,{context:c,disabled:!f,modal:!v,openInteractionType:g,initialFocus:R,returnFocus:I,children:C})});process.env.NODE_ENV!=="production"&&(nk.displayName="ComboboxPopup");const Q0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Q0.displayName="ComboboxItemContext");function rk(){const e=b.useContext(Q0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.":Fr(19));return e}const ok=b.createContext(!1);process.env.NODE_ENV!=="production"&&(ok.displayName="ComboboxRowContext");function kJ(){return b.useContext(ok)}const ik=b.memo(b.forwardRef(function(t,n){const{render:r,className:o,value:i=null,index:s,disabled:a=!1,nativeButton:l=!1,...u}=t,c=b.useRef(!1),d=b.useRef(null),f=oD({index:s,textRef:d,indexGuessBehavior:rD.GuessFromOrder}),p=Gn(),g=kJ(),{flatFilteredItems:m,hasItems:v}=Ii(),y=me(p,be.open),x=me(p,be.selectionMode),w=me(p,be.readOnly),C=me(p,be.virtualized),S=me(p,be.isItemEqualToValue),R=x!=="none",I=s??(C?gd(m,i,S):f.index),T=f.index!==-1,_=me(p,be.id),$=me(p,be.isActive,I),A=me(p,be.isSelected,i),M=me(p,be.getItemProps),O=b.useRef(null),B=_!=null&&T?`${_}-${I}`:void 0,j=A&&R;Ge(()=>{if(!(T&&(C||s!=null)))return;const U=p.state.listRef.current;return U[I]=O.current,()=>{delete U[I]}},[T,C,I,s,p]),Ge(()=>{if(!T||v)return;const K=p.state.valuesRef.current;return K[I]=i,x!=="none"&&p.state.allValuesRef.current.push(i),()=>{delete K[I]}},[T,v,I,i,p,x]),Ge(()=>{if(!y){c.current=!1;return}if(!T||v)return;const K=p.state.selectedValue,U=Array.isArray(K)?K[K.length-1]:K;ns(i,U,S)&&p.set("selectedIndex",I)},[T,v,y,p,I,i,S]);const D={disabled:a,selected:j,highlighted:$},V=M({active:$,selected:j});V.id=void 0,V.onFocus=void 0;const{getButtonProps:G,buttonRef:z}=Af({disabled:a,focusableWhenDisabled:!0,native:l});function H(K){function U(){p.state.handleSelection(K,i)}p.state.submitOnItemClick?(so.flushSync(U),p.state.requestSubmit()):U()}const ne={id:B,role:g?"gridcell":"option","aria-selected":R?j:void 0,tabIndex:void 0,onPointerDownCapture(K){c.current=!0,K.preventDefault()},onClick(K){a||w||H(K.nativeEvent)},onMouseUp(K){const U=c.current;c.current=!1,!(a||w||K.button!==0||U||!$)&&H(K.nativeEvent)}},W=Mn("div",t,{ref:[z,n,f.ref,O],state:D,props:[V,ne,u,G]}),J=b.useMemo(()=>({selected:j,textRef:d}),[j,d]);return h.jsx(Q0.Provider,{value:J,children:W})}));process.env.NODE_ENV!=="production"&&(ik.displayName="ComboboxItem");const sk=b.forwardRef(function(t,n){const{render:r,className:o,children:i,...s}=t,{filteredItems:a}=Ii(),l=Gn(),u=a.length===0?i:null;return Mn("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});process.env.NODE_ENV!=="production"&&(sk.displayName="ComboboxEmpty");const ak=b.forwardRef(function(t,n){const{className:r,render:o,orientation:i="horizontal",...s}=t;return Mn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},s]})});process.env.NODE_ENV!=="production"&&(ak.displayName="Separator");function jJ(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...s}=e;return h.jsx(SJ,{...s,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function LJ(e){const{children:t,placeholder:n}=e,r=Gn(),o=me(r,be.itemToStringLabel),i=me(r,be.selectedValue),s=me(r,be.items),a=me(r,be.selectionMode)==="multiple",l=me(r,be.hasSelectedValue),u=!l&&n!=null&&t==null,c=me(r,be.hasNullItemLabel,u);let d=null;return typeof t=="function"?d=t(i):t!=null?d=t:!l&&n!=null&&!c?d=n:a&&Array.isArray(i)?d=hJ(i,s,o):d=FD(i,s,o),h.jsx(b.Fragment,{children:d})}const lk=b.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=rk();return r||o?h.jsx(uk,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(lk.displayName="ComboboxItemIndicator");const uk=b.memo(b.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=rk(),a=b.useRef(null),{transitionStatus:l,setMounted:u}=M0(s),d=Mn("span",e,{ref:[t,a],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:_0});return Of({open:s,ref:a,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!=="production"&&(uk.displayName="Inner");const ck=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),a=me(s,be.open),l=me(s,be.hasSelectionChips),[u,c]=b.useState(void 0);a&&u!==void 0&&c(void 0);const d=b.useRef([]),f=Mn("div",t,{ref:[n,s.state.chipsContainerRef],props:[l?{role:"toolbar"}:En,i]}),p=b.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:c,chipsRef:d}),[u,c,d]);return h.jsx(Y0.Provider,{value:p,children:h.jsx(qM,{elementsRef:d,children:f})})});process.env.NODE_ENV!=="production"&&(ck.displayName="ComboboxChips");const ex=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(ex.displayName="ComboboxChipContext");function FJ(){const e=b.useContext(ex);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":Fr(17));return e}const dk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),{setHighlightedChipIndex:a,chipsRef:l}=YD(),u=me(s,be.disabled),c=me(s,be.readOnly),d=me(s,be.selectedValue),{ref:f,index:p}=oD();function g(x){let w=p;if(x.key==="ArrowLeft")x.preventDefault(),p>0?w=p-1:w=void 0;else if(x.key==="ArrowRight")x.preventDefault(),p<d.length-1?w=p+1:w=void 0;else if(x.key==="Backspace"||x.key==="Delete"){const C=p>=d.length-1?d.length-2:p;w=C>=0?C:void 0,Tt(x),s.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),s.state.setSelectedValue(d.filter((S,R)=>R!==p),Qe(er,x.nativeEvent))}else x.key==="Enter"||x.key===" "?(Tt(x),w=void 0):x.key==="ArrowDown"||x.key==="ArrowUp"?(Tt(x),s.state.setOpen(!0,Qe(dl,x.nativeEvent)),w=void 0):x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&(w=void 0);return w}const v=Mn("div",t,{ref:[n,f],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":c||void 0,onKeyDown(x){if(u||c)return;const w=g(x);so.flushSync(()=>{a(w)}),w===void 0?s.state.inputRef.current?.focus():l.current[w]?.focus()},onMouseDown(x){c||(x.preventDefault(),!u&&s.state.inputRef.current?.focus())}},i]}),y=b.useMemo(()=>({index:p}),[p]);return h.jsx(ex.Provider,{value:y,children:v})});process.env.NODE_ENV!=="production"&&(dk.displayName="ComboboxChip");const fk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,...a}=t,l=Gn(),{index:u}=FJ(),c=me(l,be.disabled),d=me(l,be.readOnly),f=me(l,be.selectedValue),p=me(l,be.isItemEqualToValue),g=c||i,{buttonRef:m,getButtonProps:v}=Af({native:s,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function x(S){const R=l.state.activeIndex;if(R==null)return;const I=gd(l.state.valuesRef.current,S,p);I!==-1&&R===I&&l.state.setIndices({activeIndex:null,type:l.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(S){const R=Qe(a7,S.nativeEvent),I=f[u];return x(I),l.state.setSelectedValue(f.filter((T,_)=>_!==u),R),l.state.inputRef.current?.focus(),R}return Mn("button",t,{ref:[n,m],state:y,props:[{tabIndex:-1,onClick(S){if(g||d)return;w(S).isPropagationAllowed||S.stopPropagation()},onKeyDown(S){g||d||(S.key==="Enter"||S.key===" ")&&(w(S).isPropagationAllowed||Tt(S))}},a,v]})});process.env.NODE_ENV!=="production"&&(fk.displayName="ComboboxChipRemove");function vu({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:F("ui:file:text-foreground ui:placeholder:text-muted-foreground ui:selection:bg-primary ui:selection:text-primary-foreground ui:dark:bg-input/30 ui:border-input ui:h-10 ui:w-full ui:min-w-0 ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-1 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:file:inline-flex ui:file:h-7 ui:file:border-0 ui:file:bg-transparent ui:file:text-sm ui:file:font-medium ui:disabled:pointer-events-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm","ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:focus-visible:ring-[3px]","ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive",e),...n})}function pk({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:F("ui:border-input ui:placeholder:text-muted-foreground ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:dark:bg-input/30 ui:flex ui:field-sizing-content ui:min-h-16 ui:w-full ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-2 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm",e),...t})}function BJ({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:F("ui:group/input-group ui:border-input ui:dark:bg-input/30 ui:relative ui:flex ui:w-full ui:items-center ui:rounded-md ui:border ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none","ui:h-9 ui:min-w-0 ui:has-[>textarea]:h-auto","ui:has-[>[data-align=inline-start]]:[&>input]:pl-2","ui:has-[>[data-align=inline-end]]:[&>input]:pr-2","ui:has-[>[data-align=block-start]]:h-auto ui:has-[>[data-align=block-start]]:flex-col ui:has-[>[data-align=block-start]]:[&>input]:pb-3","ui:has-[>[data-align=block-end]]:h-auto ui:has-[>[data-align=block-end]]:flex-col ui:has-[>[data-align=block-end]]:[&>input]:pt-3","ui:has-[[data-slot=input-group-control]:focus-visible]:border-ring ui:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 ui:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","ui:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ui:has-[[data-slot][aria-invalid=true]]:border-destructive ui:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const VJ=Si("ui:text-muted-foreground ui:flex ui:h-auto ui:cursor-text ui:items-center ui:justify-center ui:gap-2 ui:py-1.5 ui:text-sm ui:font-medium ui:select-none ui:[&>svg:not([class*=size-])]:size-4 ui:[&>kbd]:rounded-[calc(var(--radius)-5px)] ui:group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"ui:order-first ui:pl-3 ui:has-[>button]:ml-[-0.45rem] ui:has-[>kbd]:ml-[-0.35rem]","inline-end":"ui:order-last ui:pr-3 ui:has-[>button]:mr-[-0.45rem] ui:has-[>kbd]:mr-[-0.35rem]","block-start":"ui:order-first ui:w-full ui:justify-start ui:px-3 ui:pt-3 ui:[.border-b]:pb-3 ui:group-has-[>input]/input-group:pt-2.5","block-end":"ui:order-last ui:w-full ui:justify-start ui:px-3 ui:pb-3 ui:[.border-t]:pt-3 ui:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function $J({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:F(VJ({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const GJ=Si("ui:text-sm ui:shadow-none ui:flex ui:gap-2 ui:items-center",{variants:{size:{xs:"ui:h-6 ui:gap-1 ui:px-2 ui:rounded-[calc(var(--radius)-5px)] ui:[&>svg:not([class*=size-])]:size-3.5 ui:has-[>svg]:px-2",sm:"ui:h-8 ui:px-2.5 ui:gap-1.5 ui:rounded-md ui:has-[>svg]:px-2.5","icon-xs":"ui:size-6 ui:rounded-[calc(var(--radius)-5px)] ui:p-0 ui:has-[>svg]:p-0","icon-sm":"ui:size-8 ui:p-0 ui:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function hk({className:e,type:t="button",variant:n="ghost",size:r="xs",...o}){return h.jsx(on,{type:t,"data-size":r,variant:n,className:F(GJ({size:r}),e),...o})}function HJ({className:e,...t}){return h.jsx(vu,{"data-slot":"input-group-control",className:F("ui:flex-1 ui:rounded-none ui:border-0 ui:bg-transparent ui:shadow-none ui:focus-visible:ring-0 ui:dark:bg-transparent",e),...t})}const WJ=jJ;function km({...e}){return h.jsx(LJ,{"data-slot":"combobox-value",...e})}function gk({className:e,children:t,...n}){return h.jsxs(UD,{"data-slot":"combobox-trigger",className:F("ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(_e.ChevronDownIcon,{"data-slot":"combobox-trigger-icon",className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4"})]})}function zJ({className:e,...t}){return h.jsx(XD,{"data-slot":"combobox-clear",render:h.jsx(hk,{variant:"ghost",size:"icon-xs",className:"ui:rounded-md"}),className:F(e),...t,children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})}function tI({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:o=!1,...i}){return h.jsxs(BJ,{className:F("ui:w-auto",e),children:[h.jsx(J0,{render:h.jsx(HJ,{disabled:n}),...i}),h.jsxs($J,{align:"inline-end",children:[r&&h.jsx(hk,{size:"icon-xs",variant:"ghost",asChild:!0,"data-slot":"input-group-button",className:"ui:group-has-data-[slot=combobox-clear]/input-group:hidden ui:data-pressed:bg-transparent",disabled:n,children:h.jsx(gk,{className:"ui:rounded-md"})}),o&&h.jsx(zJ,{disabled:n})]}),t]})}function qJ({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:o=0,anchor:i,...s}){return h.jsx(KD,{children:h.jsx(tk,{side:t,sideOffset:n,align:r,alignOffset:o,anchor:i,className:"ui:isolate ui:z-50",children:h.jsx(nk,{"data-slot":"combobox-content","data-chips":!!i,className:F("ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:max-h-96 ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",e),...s})})})}function UJ({className:e,...t}){return h.jsx(JD,{"data-slot":"combobox-list",className:F("ui:max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] ui:scroll-py-1 ui:overflow-y-auto ui:p-1 ui:data-empty:p-0",e),...t})}function YJ({className:e,children:t,...n}){return h.jsxs(ik,{"data-slot":"combobox-item",className:F("ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(lk,{"data-slot":"combobox-item-indicator",render:h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center"}),children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4 ui:pointer-coarse:size-5"})})]})}function XJ({className:e,...t}){return h.jsx(sk,{"data-slot":"combobox-empty",className:F("ui:text-muted-foreground ui:hidden ui:w-full ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:group-data-empty/combobox-content:flex",e),...t})}function ZJ({className:e,...t}){return h.jsx(ak,{"data-slot":"combobox-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function JJ({className:e,...t}){return h.jsx(ck,{"data-slot":"combobox-chips",className:F("ui:dark:bg-input/30 ui:border-input ui:focus-within:border-ring ui:focus-within:ring-ring/50 ui:has-aria-invalid:ring-destructive/20 ui:dark:has-aria-invalid:ring-destructive/40 ui:has-aria-invalid:border-destructive ui:dark:has-aria-invalid:border-destructive/50 ui:flex ui:min-h-9 ui:flex-wrap ui:items-center ui:gap-1.5 ui:rounded-md ui:border ui:bg-transparent ui:bg-clip-padding ui:px-2.5 ui:py-1.5 ui:text-sm ui:shadow-xs ui:transition-[color,box-shadow] ui:focus-within:ring-[3px] ui:has-aria-invalid:ring-[3px] ui:has-data-[slot=combobox-chip]:px-1.5",e),...t})}function KJ({className:e,children:t,showRemove:n=!0,...r}){return h.jsxs(dk,{"data-slot":"combobox-chip",className:F("ui:bg-muted ui:text-foreground ui:flex ui:h-[calc(--spacing(5.5))] ui:w-fit ui:items-center ui:justify-center ui:gap-1 ui:rounded-sm ui:px-1.5 ui:text-xs ui:font-medium ui:whitespace-nowrap ui:has-disabled:pointer-events-none ui:has-disabled:cursor-not-allowed ui:has-disabled:opacity-50 ui:has-data-[slot=combobox-chip-remove]:pr-0",e),...r,children:[t,n&&h.jsx(fk,{render:h.jsx(on,{variant:"ghost",size:"xs",className:"ui:hover:bg-transparent"}),className:"ui:-ml-1 ui:opacity-50 ui:hover:opacity-100","data-slot":"combobox-chip-remove",children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})]})}function QJ({className:e,...t}){return h.jsx(J0,{"data-slot":"combobox-chip-input",className:F("ui:min-w-16 ui:flex-1 ui:outline-none",e),...t})}function eK(){return b.useRef(null)}const tK=e=>e.label,nK=(e,t)=>e.value===t.value,tx=({items:e,label:t,multiple:n=!1,hasClearButton:r=!1,disabled:o=!1,placeholder:i="Select...",containerClassName:s,emptyMessage:a="No results found.",hasAllOption:l=!1,allOptionLabel:u="All",inputMode:c="input",renderPopupTrigger:d,onInputChange:f,value:p,onValueChange:g})=>{const m=eK(),v=p??[],y=N.useMemo(()=>e.filter(R=>!R.disabled),[e]),x=n&&v.length===y.length&&y.length>0,w=N.useCallback(()=>{const I=v.length===y.length&&y.length>0?[]:y;g(I)},[y,v.length,g]),C=N.useCallback(R=>{Array.isArray(R)?g(R):g(R===null?[]:[R])},[g]),S=N.useCallback(R=>{f?.(R.target.value)},[f]);return h.jsxs("article",{className:s,children:[t&&h.jsx(gr,{className:"ui:mb-2",children:t}),h.jsxs(WJ,{multiple:n,autoHighlight:!0,items:e,itemToStringValue:tK,isItemEqualToValue:nK,disabled:o,value:n?v:v[0]??null,onValueChange:C,children:[h.jsxs(_r,{children:[h.jsx(rn,{condition:c==="popup",children:h.jsx(gk,{render:d?d(h.jsx(km,{placeholder:i}),v):h.jsx(on,{variant:"outline",className:"ui:w-full ui:font-normal ui:text-left ui:overflow-hidden ui:truncate ui:line-clamp-1",children:h.jsx(km,{placeholder:i})})})}),h.jsx(rn,{condition:n&&c==="input",children:h.jsx(JJ,{ref:m,className:"ui:w-full",children:h.jsx(km,{children:R=>h.jsxs(N.Fragment,{children:[R.map(I=>h.jsx(KJ,{children:I.label},I.value)),h.jsx(QJ,{placeholder:R.length?"":i,onChange:S})]})})})}),h.jsx(rn,{condition:!n&&c==="input",children:h.jsx(tI,{className:"ui:w-full",placeholder:i,showClear:r,disabled:o,onChange:S})})]}),h.jsxs(qJ,{className:"ui:min-w-64",anchor:m&&n&&c==="input"?m:void 0,children:[c==="popup"&&h.jsx(tI,{showTrigger:!1,placeholder:"Search...",onChange:S}),h.jsx(XJ,{children:a}),l&&n&&h.jsxs("div",{className:"ui:group-data-empty/combobox-content:hidden",children:[h.jsx("div",{className:F("ui:p-1 ui:pb-0",c==="popup"?"ui:mt-1":""),children:h.jsxs("div",{role:"option","aria-selected":x,onClick:w,className:F("ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none","ui:hover:bg-accent ui:hover:text-accent-foreground"),children:[u,x&&h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center",children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4"})})]})}),h.jsx(ZJ,{})]}),h.jsx(UJ,{children:R=>h.jsx(YJ,{value:R,disabled:!!R?.disabled,children:R.label},R.value)})]})]})]})},rK="dd/MM/yyyy",oK=({date:e,format:t=rK})=>e?h.jsx(h.Fragment,{children:Ws(e,t)}):null;function nx({...e}){return h.jsx(Z3,{"data-slot":"popover",...e})}const Mf=b.forwardRef(({...e},t)=>h.jsx(mN,{"data-slot":"popover-trigger",ref:t,...e}));Mf.displayName=mN.displayName;const Df=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>h.jsx(J3,{children:h.jsx(bN,{ref:o,"data-slot":"popover-content",align:t,sideOffset:n,className:F("ui-lib-root ui:z-[102] ui:w-72 ui:rounded-md ui:border ui:bg-popover ui:p-4 ui:text-popover-foreground ui:shadow-md ui:outline-none ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",e),...r})}));Df.displayName=bN.displayName;const mk=b.forwardRef(({...e},t)=>h.jsx(gN,{"data-slot":"popover-anchor",ref:t,...e}));mk.displayName=gN.displayName;const bk=({start:e,end:t,onConfirm:n,className:r,triggerButtonClassName:o,label:i,placeholder:s,confirmLabel:a="Confirm",disabledCondition:l,dateLocale:u})=>{const[c,d]=N.useState(!1),[f,p]=N.useState(e&&t?{from:e,to:t}:void 0),g=()=>{!f?.from||!f?.to||(n({from:f.from,to:f.to}),d(!1))};return h.jsxs("div",{className:F("ui:grid ui:gap-2",r),children:[i&&h.jsx(gr,{children:i}),h.jsxs(nx,{open:c,onOpenChange:d,children:[h.jsx(Mf,{asChild:!0,children:h.jsxs(on,{id:"date",variant:"outline",className:F("ui:h-auto ui:text-muted-foreground ui:justify-start ui:text-left ui:font-normal",!f&&"ui:text-muted-foreground",o),children:[h.jsx(_e.Calendar,{className:"ui:h-4 ui:w-4"}),f?.from?f.to?h.jsxs(h.Fragment,{children:[Ws(f.from,"LLL dd, y",{locale:u})," -",Ws(f.to,"LLL dd, y",{locale:u})]}):Ws(f.from,"LLL dd, y",{locale:u}):h.jsx("span",{children:s})]})}),h.jsxs(Df,{className:"ui:w-auto ui:p-0",align:"start",children:[h.jsx(e0,{mode:"range",defaultMonth:f?.from??new Date,selected:f,onSelect:p,numberOfMonths:2,disabled:l,locale:u}),h.jsx("div",{className:F("ui:px-3 ui:pb-4 ui:pt-2","ui:flex ui:justify-start ui:md:justify-end"),children:h.jsx(on,{variant:"success",onClick:g,className:"ui:w-full ui:md:w-max",children:a})})]})]})]})};function vk({value:e,onChange:t,className:n,inputClassName:r,name:o,placeholder:i,label:s}){const[a,l]=N.useState(e),u=N.useRef(null),c=N.useRef(t);N.useEffect(()=>{c.current=t},[t]);const d=N.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.length>=3?c.current(p):c.current("")},300)},[]),f=p=>{const g=decodeURIComponent(p);l(g),d(g)};return h.jsxs("search",{className:F("ui:w-full",n),children:[s&&h.jsx(gr,{htmlFor:o,className:"ui:leading-6 ui:w-full",children:s}),h.jsx(vu,{type:"search",name:o,id:o,"data-test-id":o,placeholder:i,value:a,onChange:({target:p})=>f(p.value),className:F("ui:max-h-10",r),autoFocus:!0})]})}const iK=({banner:e,campaignName:t,isControlled:n,open:r,setOpen:o,imageClassName:i})=>h.jsxs(S0,{...n&&{open:r,onOpenChange:o},children:[!n&&h.jsx(FM,{asChild:!0,children:h.jsx("div",{className:"ui:cursor-pointer",children:h.jsx("img",{className:F("ui:w-full ui:max-w-80 ui:mx-auto ui:mt-4! ui:scale-100 ui:hover:scale-110 ui:transition-all ui:duration-300 ui:aspect-video",i),src:e,alt:t})})}),h.jsxs(E0,{className:"ui:max-w-2xl",children:[h.jsx(I0,{children:h.jsx(R0,{children:t})}),h.jsx("img",{className:F("ui:w-full ui:aspect-video",i),src:e,alt:t})]})]});function sK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const yk=N.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),yu=()=>{const e=N.useContext(yk);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};sK(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
86
|
+
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});process.env.NODE_ENV!=="production"&&(LD.displayName="InternalBackdrop");function uJ(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const $0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&($0.displayName="ComboboxRootContext");const G0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(G0.displayName="ComboboxFloatingContext");const H0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(H0.displayName="ComboboxDerivedItemsContext");const W0=b.createContext("");process.env.NODE_ENV!=="production"&&(W0.displayName="ComboboxInputValueContext");function Gn(){const e=b.useContext($0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(22));return e}function _f(){const e=b.useContext(G0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(23));return e}function Ii(){const e=b.useContext(H0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(24));return e}function z0(){return b.useContext(W0)}const cJ=(e,t)=>Object.is(e,t);function ns(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function dJ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:ns(t,r,n))}function gd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:ns(r,t,n))}function fJ(e,t,n){return e.filter(r=>!ns(t,r,n))}function mv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function q0(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function pJ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(q0(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function On(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return mv(e)}function $a(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?mv(e.value):mv(e)}function FD(e,t,n){function r(){return On(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=q0(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=o.find(s=>s.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=o.find(s=>s&&s.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function hJ(e,t,n){return e.reduce((r,o,i)=>(i>0&&r.push(", "),r.push(h.jsx(b.Fragment,{children:FD(o,t,n)},i)),r),[])}const be={id:De(e=>e.id),query:De(e=>e.query),items:De(e=>e.items),selectedValue:De(e=>e.selectedValue),hasSelectionChips:De(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:De(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:De((e,t)=>t?pJ(e.items):!1),open:De(e=>e.open),mounted:De(e=>e.mounted),forceMounted:De(e=>e.forceMounted),inline:De(e=>e.inline),activeIndex:De(e=>e.activeIndex),selectedIndex:De(e=>e.selectedIndex),isActive:De((e,t)=>e.activeIndex===t),isSelected:De((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(o=>ns(t,o,n)):ns(t,r,n)}),transitionStatus:De(e=>e.transitionStatus),popupProps:De(e=>e.popupProps),inputProps:De(e=>e.inputProps),triggerProps:De(e=>e.triggerProps),getItemProps:De(e=>e.getItemProps),positionerElement:De(e=>e.positionerElement),listElement:De(e=>e.listElement),triggerElement:De(e=>e.triggerElement),inputElement:De(e=>e.inputElement),popupSide:De(e=>e.popupSide),openMethod:De(e=>e.openMethod),inputInsidePopup:De(e=>e.inputInsidePopup),selectionMode:De(e=>e.selectionMode),listRef:De(e=>e.listRef),labelsRef:De(e=>e.labelsRef),popupRef:De(e=>e.popupRef),emptyRef:De(e=>e.emptyRef),inputRef:De(e=>e.inputRef),keyboardActiveRef:De(e=>e.keyboardActiveRef),chipsContainerRef:De(e=>e.chipsContainerRef),clearRef:De(e=>e.clearRef),valuesRef:De(e=>e.valuesRef),allValuesRef:De(e=>e.allValuesRef),name:De(e=>e.name),disabled:De(e=>e.disabled),readOnly:De(e=>e.readOnly),required:De(e=>e.required),grid:De(e=>e.grid),isGrouped:De(e=>e.isGrouped),virtualized:De(e=>e.virtualized),onOpenChangeComplete:De(e=>e.onOpenChangeComplete),openOnInputClick:De(e=>e.openOnInputClick),itemToStringLabel:De(e=>e.itemToStringLabel),isItemEqualToValue:De(e=>e.isItemEqualToValue),modal:De(e=>e.modal),autoHighlight:De(e=>e.autoHighlight),submitOnItemClick:De(e=>e.submitOnItemClick)};let JE=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const gJ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mJ={valid(e){return e===null?null:e?{[JE.valid]:""}:{[JE.invalid]:""}}},BD=b.createContext({invalid:void 0,name:void 0,validityData:{state:gJ,errors:[],error:"",value:"",initialValue:null},setValidityData:Lt,disabled:void 0,touched:!1,setTouched:Lt,dirty:!1,setDirty:Lt,filled:!1,setFilled:Lt,focused:!1,setFocused:Lt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(BD.displayName="FieldRootContext");function bu(e=!0){const t=b.useContext(BD);if(t.setValidityData===Lt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Fr(28));return t}function bJ(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const VD=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Lt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(VD.displayName="FormContext");function $D(){return b.useContext(VD)}function vJ(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=$D(),{invalid:l,markedDirtyRef:u,validityData:c,setValidityData:d}=bu(),f=ke(e.getValue);Ge(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),c.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,c.initialValue,f]),Ge(()=>{!t||!r||a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:bJ(c,l),validate(p=!0){let g=n;g===void 0&&(g=f()),u.current=!0,p?so.flushSync(()=>s(g)):s(g)}})},[s,i,t,a,f,r,l,u,o,c,n]),Ge(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const GD=b.createContext({controlId:void 0,registerControlId:Lt,labelId:void 0,setLabelId:Lt,messageIds:[],setMessageIds:Lt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(GD.displayName="LabelableContext");function U0(){return b.useContext(GD)}function HD(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=U0(),s=tD(t),a=n?o:void 0,l=cr(()=>Symbol("labelable-control")),u=b.useRef(!1),c=b.useRef(t!=null),d=ke(()=>{!u.current||i===Lt||(u.current=!1,i(l.current,void 0))});return Ge(()=>{if(i===Lt)return;let f;if(n){const p=r?.current;Ot(p)&&p.closest("label")!=null?f=t??null:f=a??s}else if(t!=null)c.current=!0,f=t;else if(c.current)f=s;else{d();return}if(f===void 0){d();return}u.current=!0,i(l.current,f)},[t,r,a,i,n,s,l,d]),b.useEffect(()=>d,[d]),o??s}function yJ(e,t){return(n,r)=>{if(n==null)return!1;const o=On(n,t);return e.contains(o,r)}}function xJ(e,t,n){return(r,o)=>{if(r==null)return!1;if(!o)return!0;const i=On(r,t),s=n!=null?On(n,t):"";return s&&e.contains(s,o)&&s.length===o.length?!0:e.contains(i,o)}}const KE=new Map;function WD(e){return Array.isArray(e)?e.map(t=>WD(t)).join(","):e==null?"":String(e)}function wJ(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${WD(e.locale)}|${JSON.stringify(t)}`,r=KE.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(s,a,l){if(!a)return!0;const u=On(s,l);for(let c=0;c<=u.length-a.length;c+=1)if(o.compare(u.slice(c,c+a.length),a)===0)return!0;return!1},startsWith(s,a,l){if(!a)return!0;const u=On(s,l);return o.compare(u.slice(0,a.length),a)===0},endsWith(s,a,l){if(!a)return!0;const u=On(s,l),c=a.length;return u.length>=c&&o.compare(u.slice(u.length-c),a)===0}};return KE.set(n,i),i}const CJ=wJ;function oc(e,t){const n=b.useRef(e),r=ke(t);Ge(()=>{n.current!==e&&r(n.current)},[e,r]),Ge(()=>{n.current=e},[e])}const zD=Symbol("none"),$i={value:zD,index:-1};function SJ(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:u,name:c,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:g,grid:m=!1,items:v,filteredItems:y,filter:x,openOnInputClick:w=!0,autoHighlight:C=!1,keepHighlight:S=!1,highlightItemOnHover:R=!0,loopFocus:I=!0,itemToStringLabel:T,itemToStringValue:_,isItemEqualToValue:$=cJ,virtualized:A=!1,inline:M=!1,fillInputOnItemPress:O=!0,modal:B=!1,limit:j=-1,autoComplete:D="list",formAutoComplete:V,locale:G,submitOnItemClick:z=!1}=e,{clearErrors:H}=$D(),{setDirty:ne,validityData:W,shouldValidateOnChange:J,setFilled:K,name:U,disabled:oe,setTouched:X,setFocused:te,validationMode:Q,validation:se}=bu(),ae=HD({id:t}),L=CJ({locale:G}),[Z,k]=b.useState(!1),[ie,Y]=b.useState(null),le=b.useRef([]),pe=b.useRef([]),re=b.useRef(null),fe=b.useRef(null),de=b.useRef(null),ve=b.useRef(!0),we=b.useRef(!1),Se=b.useRef(null),Ye=b.useRef(null),at=b.useRef(null),Xe=b.useRef($i),Ue=b.useRef(null),rt=b.useRef([]),et=b.useRef([]),gt=oe||d,ct=U??c,ot=l==="multiple",mt=l==="single",Nt=a!==void 0||s!==void 0,Bt=v!==void 0,tt=y!==void 0;let Ze;C==="always"?Ze="always":Ze=C?"input-change":!1;const[ee,ye]=Rm({controlled:o,default:ot?r??Yu:r,name:"Combobox",state:"selectedValue"}),ge=b.useMemo(()=>x===null?()=>!0:x!==void 0?x:mt&&!Z?xJ(L,T,ee):yJ(L,T),[x,mt,ee,Z,L,T]),xe=cr(()=>Nt?s??"":mt?On(ee,T):"").current,[Ae,Ie]=Rm({controlled:a,default:xe,name:"Combobox",state:"inputValue"}),[qe,Pt]=Rm({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),lt=q0(v),it=ie??(Ae===""?"":String(Ae).trim()),_t=mt?On(ee,T):"",Et=mt&&!Z&&it!==""&&_t!==""&&_t.length===it.length&&L.contains(_t,it),sn=Et?"":it,mr=Bt&&tt&&Et,Wn=b.useMemo(()=>v?lt?v.flatMap(Ce=>Ce.items):v:Yu,[v,lt]),pn=b.useMemo(()=>{if(y&&!mr)return y;if(!v)return Yu;if(lt){const Me=v,Ke=[];let It=0;for(const st of Me){if(j>-1&&It>=j)break;const Dt=sn===""?st.items:st.items.filter(zr=>ge(zr,sn,T));if(Dt.length===0)continue;const Xn=j>-1?j-It:1/0,An=Dt.slice(0,Xn);if(An.length>0){const zr={...st,items:An};Ke.push(zr),It+=An.length}}return Ke}if(sn==="")return j>-1?Wn.slice(0,j):Wn;const Ce=[];for(const Me of Wn){if(j>-1&&Ce.length>=j)break;ge(Me,sn,T)&&Ce.push(Me)}return Ce},[y,mr,v,lt,sn,j,ge,T,Wn]),Jt=b.useMemo(()=>lt?pn.flatMap(Me=>Me.items):pn,[pn,lt]),Ve=cr(()=>new DD({id:ae,selectedValue:ee,open:qe,filter:ge,query:it,items:v,selectionMode:l,listRef:le,labelsRef:pe,popupRef:re,emptyRef:de,inputRef:fe,keyboardActiveRef:ve,chipsContainerRef:Se,clearRef:Ye,valuesRef:rt,allValuesRef:et,selectionEventRef:at,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,openOnInputClick:w,itemToStringLabel:T,isItemEqualToValue:$,modal:B,autoHighlight:Ze,submitOnItemClick:z,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:M,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Lt,setOpen:Lt,setInputValue:Lt,setSelectedValue:Lt,setIndices:Lt,onItemHighlighted:Lt,handleSelection:Lt,getItemProps:()=>En,forceMount:Lt,requestSubmit:Lt})).current,zn=l==="none"?Ae:ee,Sa=b.useMemo(()=>l==="none"?zn:Array.isArray(ee)?ee.map(Ce=>$a(Ce,_)):$a(ee,_),[zn,_,l,ee]),Oi=ke(u),Ni=ke(n),Go=me(Ve,be.activeIndex),nn=me(Ve,be.selectedIndex),Ho=me(Ve,be.positionerElement),Es=me(Ve,be.listElement),bo=me(Ve,be.triggerElement),Pi=me(Ve,be.inputElement),Cn=me(Ve,be.inline),Mt=me(Ve,be.inputInsidePopup),Ea=rr(bo),{mounted:Is,setMounted:Ia,transitionStatus:_i}=M0(qe),{openMethod:Rs,triggerProps:Hr,reset:As}=eJ(qe);vJ({id:ae,name:ct,commit:se.commit,value:zn,controlRef:Mt?Ea:fe,getValue:()=>Sa});const br=ke(()=>{v?pe.current=Jt.map(Ce=>On(Ce,T)):Ve.set("forceMounted",!0)}),qn=b.useRef(ee);Ge(()=>{ee!==qn.current&&br()},[br,ee]);const an=ke(Ce=>{Ve.update(Ce);const Me=Ce.type||"none";if(Ce.activeIndex!==void 0)if(Ce.activeIndex===null)Xe.current!==$i&&(Xe.current=$i,Oi(void 0,Ba(Me,void 0,{index:-1})));else{const Ke=rt.current[Ce.activeIndex];Xe.current={value:Ke,index:Ce.activeIndex},Oi(Ke,Ba(Me,void 0,{index:Ce.activeIndex}))}}),Rn=ke((Ce,Me)=>{if(we.current=Me.reason===ei,e.onInputValueChange?.(Ce,Me),!Me.isCanceled){if(Me.reason===Hs){const Ke=Me.event,It=Ke.inputType;if(Ke.type==="compositionend"||It!=null&&It!==""&&It!=="insertReplacementText"){const Dt=Ce.trim()!=="";Dt&&k(!0),Ue.current={hasQuery:Dt},Dt&&Ze&&Ve.state.activeIndex==null&&Ve.set("activeIndex",0)}}Ie(Ce)}}),vo=ke((Ce,Me)=>{if(qe!==Ce&&(Me.reason==="escape-key"&&Bt&&Jt.length===0&&!Ve.state.emptyRef.current&&Me.allowPropagation(),e.onOpenChange?.(Ce,Me),!Me.isCanceled&&(!Ce&&Z&&(mt?(Cn||Y(it),it===""&&k(!1)):ot&&(Cn||Mt?an({activeIndex:null}):Y(it),Rn("",Qe(ei,Me.event)))),Pt(Ce),!Ce&&Mt&&(Me.reason===Rf||Me.reason===O0)&&(X(!0),te(!1),Q==="onBlur")))){const Ke=l==="none"?Ae:ee;se.commit(Ke)}}),Wo=ke((Ce,Me)=>{if(i?.(Ce,Me),Me.isCanceled)return;ye(Ce),(l==="none"&&re.current&&O||mt&&!Ve.state.inputInsidePopup)&&Rn(On(Ce,T),Qe(Me.reason,Me.event)),mt&&Ce!=null&&Me.reason!==Hs&&Z&&!Cn&&Y(it)}),Ra=ke((Ce,Me)=>{let Ke=Me;if(Ke===void 0){if(Go===null)return;Ke=rt.current[Go]}const It=Nn(Ce),st=at.current??Ce;at.current=null;const Dt=Qe(s7,st),Xn=It?.closest("a")?.getAttribute("href");if(Xn){Xn.startsWith("#")&&vo(!1,Dt);return}if(ot){const An=Array.isArray(ee)?ee:[],Uo=dJ(An,Ke,Ve.state.isItemEqualToValue)?fJ(An,Ke,Ve.state.isItemEqualToValue):[...An,Ke];if(Wo(Uo,Dt),!(fe.current?fe.current.value.trim()!=="":!1))return;Ve.state.inputInsidePopup?Rn("",Qe(ei,Dt.event)):vo(!1,Dt)}else Wo(Ke,Dt),vo(!1,Dt)}),Mi=ke(()=>{if(!Ve.state.submitOnItemClick)return;const Ce=Ve.state.inputElement?.form;Ce&&typeof Ce.requestSubmit=="function"&&Ce.requestSubmit()}),Wr=ke(()=>{if(Ia(!1),Ni?.(!1),k(!1),As(),Y(null),an(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ot&&fe.current&&fe.current.value!==""&&!we.current&&Rn("",Qe(ei)),mt)if(Ve.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Rn("",Qe(ei));else{const Ce=On(ee,T);fe.current&&fe.current.value!==Ce&&Rn(Ce,Qe(Ce===""?ei:er))}}),Di=b.useMemo(()=>Cn&&Ho?{current:Ho.closest('[role="dialog"]')}:re,[Cn,Ho]);Of({enabled:!e.actionsRef,open:qe,ref:Di,onComplete(){qe||Wr()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:Wr}),[Wr]),Ge(function(){if(qe||l==="none")return;const Me=v?Wn:et.current;if(ot){const Ke=Array.isArray(ee)?ee:[],It=Ke[Ke.length-1],st=gd(Me,It,$);an({selectedIndex:st===-1?null:st})}else{const Ke=gd(Me,ee,$);an({selectedIndex:Ke===-1?null:Ke})}},[qe,ee,v,l,Wn,ot,$,an]),Ge(()=>{v&&(rt.current=Jt,le.current.length=Jt.length)},[v,Jt]),Ge(()=>{const Ce=Ue.current;if(Ce&&(Ce.hasQuery?Ze&&Ve.set("activeIndex",0):Ze==="always"&&Ve.set("activeIndex",0),Ue.current=null),!qe&&!Cn)return;const Ke=Bt||tt?Jt:rt.current,It=Ve.state.activeIndex;if(It==null){if(Ze==="always"&&Ke.length>0){Ve.set("activeIndex",0);return}Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1})));return}if(It>=Ke.length){Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1}))),Ve.set("activeIndex",null);return}const st=Ke[It],Dt=Xe.current.value,Xn=Dt!==zD&&ns(st,Dt,Ve.state.isItemEqualToValue);(Xe.current.index!==It||!Xn)&&(Xe.current={value:st,index:It},Ve.state.onItemHighlighted(st,Ba(er,void 0,{index:It})))},[Go,Ze,tt,Bt,Jt,Cn,qe,Ve]),Ge(()=>{if(l==="none"){K(String(Ae)!=="");return}K(ot?Array.isArray(ee)&&ee.length>0:ee!=null)},[K,l,Ae,ee,ot]),b.useEffect(()=>{Bt&&Ze&&Jt.length===0&&an({activeIndex:null})},[Bt,Ze,Jt.length,an]),oc(it,()=>{!qe||it===""||it===String(xe)||k(!0)}),oc(ee,()=>{if(l!=="none"&&(H(ct),ne(ee!==W.initialValue),J()?se.commit(ee):se.commit(ee,!0),mt&&!Nt&&!Mt)){const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))}}),oc(Ae,()=>{l==="none"&&(H(ct),ne(Ae!==W.initialValue),J()?se.commit(Ae):se.commit(Ae,!0))}),oc(v,()=>{if(!mt||Nt||Mt||Z)return;const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))});const Un=kD({open:Cn?!0:qe,onOpenChange:vo,elements:{reference:Mt?bo:Pi,floating:Ho}});let zo,qo;Cn||(zo=m?"grid":"listbox",qo=qe?"true":"false");const Aa=b.useMemo(()=>{const Ce=Pi?.tagName==="INPUT",Me=Ce||qe,Ke=Ce?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Me&&(Ke.role="combobox",Ke["aria-expanded"]=qo,Ke["aria-haspopup"]=zo,Ke["aria-controls"]=qe?Es?.id:void 0,Ke["aria-autocomplete"]=D),{reference:Ke,floating:{role:"presentation"}}},[Pi,qe,qo,zo,Es?.id,D]),Ta=PD(Un,{enabled:!f&&!gt&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Mt?0:50,reason:l7}),Oa=hZ(Un,{enabled:!f&&!gt&&!Cn,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Cn?!0:void 0,outsidePress(Ce){const Me=Nn(Ce);return!ft(bo,Me)&&!ft(Ye.current,Me)&&!ft(Se.current,Me)}}),Na=JZ(Un,{enabled:!f&&!gt,id:ae,listRef:le,activeIndex:Go,selectedIndex:nn,virtual:!0,loopFocus:I,allowEscape:I&&!Ze,focusItemOnOpen:Z||l==="none"&&!Ze?!1:"auto",focusItemOnHover:R,resetOnPointerLeave:!S,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:Yu,onNavigate(Ce,Me){!Me&&!qe||_i==="ending"||an(Me?{activeIndex:Ce,type:ve.current?"keyboard":"pointer"}:{activeIndex:Ce})}}),{getReferenceProps:yo,getFloatingProps:ki,getItemProps:ji}=UZ([Aa,Ta,Oa,Na]);uJ(()=>{Ve.update({inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,getItemProps:ji,setOpen:vo,setInputValue:Rn,setSelectedValue:Wo,setIndices:an,onItemHighlighted:Oi,handleSelection:Ra,forceMount:br,requestSubmit:Mi})}),Ge(()=>{Ve.update({id:ae,selectedValue:ee,open:qe,mounted:Is,transitionStatus:_i,items:v,inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,openMethod:Rs,getItemProps:ji,selectionMode:l,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,onOpenChangeComplete:Ni,openOnInputClick:w,itemToStringLabel:T,modal:B,autoHighlight:Ze,isItemEqualToValue:$,submitOnItemClick:z,hasInputValue:Nt,requestSubmit:Mi})},[Ve,ae,ee,qe,Is,_i,v,ki,yo,ji,Rs,Hr,l,ct,gt,f,p,se,m,lt,A,Ni,w,T,B,$,z,Nt,M,Mi,Ze]);const xo=Ml(g,se.inputRef),Dn=b.useMemo(()=>({query:it,hasItems:Bt,filteredItems:pn,flatFilteredItems:Jt}),[it,Bt,pn,Jt]),vr=b.useMemo(()=>Array.isArray(zn)?"":$a(zn,_),[zn,_]),yr=ot&&Array.isArray(ee)&&ee.length>0,Li=ot||l==="none"?void 0:ct,Yn=b.useMemo(()=>!ot||!Array.isArray(ee)||!ct?null:ee.map(Ce=>{const Me=$a(Ce,_);return h.jsx("input",{type:"hidden",name:ct,value:Me},Me)}),[ot,ee,ct,_]),Pa=h.jsxs(b.Fragment,{children:[e.children,h.jsx("input",{...se.getInputValidationProps({onFocus(){if(Mt){bo?.focus();return}(fe.current||bo)?.focus()},onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;const Me=Ce.target.value,Ke=Qe(er,Ce.nativeEvent);function It(){if(ot)return;if(l==="none"){ne(Me!==W.initialValue),Rn(Me,Ke),J()&&se.commit(Me);return}const st=rt.current.find(Dt=>$a(Dt,_).toLowerCase()===Me.toLowerCase());st!=null&&(ne(st!==W.initialValue),Wo?.(st,Ke),J()&&se.commit(st))}v?It():(br(),queueMicrotask(It))}}),id:ae&&Li==null?`${ae}-hidden-input`:void 0,name:Li,autoComplete:V,disabled:gt,required:p&&!yr,readOnly:f,value:vr,ref:xo,style:Li?tZ:L0,tabIndex:-1,"aria-hidden":!0}),Yn]});return h.jsx($0.Provider,{value:Ve,children:h.jsx(G0.Provider,{value:Un,children:h.jsx(H0.Provider,{value:Dn,children:h.jsx(W0.Provider,{value:Ae,children:Pa})})})})}const qD={...aJ,...mJ,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function EJ(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const i=parseFloat(n.width)||0,s=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,a),c=Math.max(t.height,s,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const ic=2,UD=b.forwardRef(function(t,n){const{render:r,className:o,nativeButton:i=!0,disabled:s=!1,id:a,...l}=t,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:p,validation:g}=bu(),{labelId:m}=U0(),v=Gn(),{filteredItems:y}=Ii(),x=me(v,be.selectionMode),w=me(v,be.disabled),C=me(v,be.readOnly),S=me(v,be.required),R=me(v,be.mounted),I=me(v,be.popupSide),T=me(v,be.positionerElement),_=me(v,be.listElement),$=me(v,be.triggerProps),A=me(v,be.triggerElement),M=me(v,be.inputInsidePopup),O=me(v,be.id),B=me(v,be.open),j=me(v,be.selectedValue),D=me(v,be.activeIndex),V=me(v,be.selectedIndex),G=me(v,be.hasSelectedValue),z=_f(),H=z0(),ne=ts(),W=c||w||s,J=y.length===0,K=R&&T?I:null;HD({id:M?a:void 0});const U=M?a??O:a,oe=b.useRef("");function X(Y){oe.current=Y.pointerType}const te=z.useState("domReferenceElement");b.useEffect(()=>{M&&A&&A!==te&&z.set("domReferenceElement",A)},[A,te,z,M]);const{reference:Q}=KZ(z,{enabled:!B&&!C&&!w&&x==="single",listRef:v.state.labelsRef,activeIndex:D,selectedIndex:V,onMatch(Y){const le=v.state.valuesRef.current[Y];le!==void 0&&v.state.setSelectedValue(le,Qe("none"))}}),{reference:se}=PD(z,{enabled:!C&&!w,event:"mousedown"}),{buttonRef:ae,getButtonProps:L}=Af({native:i,disabled:W}),Z={...u,open:B,disabled:W,popupSide:K,listEmpty:J,placeholder:!G},k=ke(Y=>{v.set("triggerElement",Y)});return Mn("button",t,{ref:[n,ae,k],state:Z,props:[$,se,Q,{id:U,tabIndex:M?0:-1,role:M?"combobox":void 0,"aria-expanded":B?"true":"false","aria-haspopup":M?"dialog":"listbox","aria-controls":B?_?.id:void 0,"aria-required":M&&S||void 0,"aria-labelledby":m,onPointerDown:X,onPointerEnter:X,onFocus(){f(!0),!(W||C)&&ne.start(0,v.state.forceMount)},onBlur(Y){if(!ft(T,Y.relatedTarget)&&(d(!0),f(!1),p==="onBlur")){const le=x==="none"?H:j;g.commit(le)}},onMouseDown(Y){if(W||C||(M||z.set("domReferenceElement",Y.currentTarget),v.state.forceMount(),oe.current!=="touch"&&(v.state.inputRef.current?.focus(),M||Y.preventDefault()),B))return;const le=Ht(Y.currentTarget);function pe(re){if(!A)return;const fe=Nn(re),de=v.state.positionerElement,ve=v.state.listElement;if(ft(A,fe)||ft(de,fe)||ft(ve,fe)||fe===A)return;const we=EJ(A),Se=re.clientX>=we.left-ic&&re.clientX<=we.right+ic,Ye=re.clientY>=we.top-ic&&re.clientY<=we.bottom+ic;Se&&Ye||v.state.setOpen(!1,Qe("cancel-open",re))}M&&le.addEventListener("mouseup",pe,{once:!0})},onKeyDown(Y){W||C||(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Tt(Y),v.state.setOpen(!0,Qe(dl,Y.nativeEvent)),v.state.inputRef.current?.focus())}},g?g.getValidationProps(l):l,L],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(UD.displayName="ComboboxTrigger");const Y0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Y0.displayName="ComboboxChipsContext");function YD(){return b.useContext(Y0)}const X0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(X0.displayName="ComboboxPositionerContext");function Z0(e){const t=b.useContext(X0);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":Fr(21));return t}const J0=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,id:s,...a}=t,{state:l,disabled:u,setTouched:c,setFocused:d,validationMode:f,validation:p}=bu(),{labelId:g}=U0(),m=YD(),y=!!Z0(!0),x=Gn(),{filteredItems:w}=Ii(),C=z0(),S=YM(),R=me(x,be.required),I=me(x,be.disabled),T=me(x,be.readOnly),_=me(x,be.name),$=me(x,be.selectionMode),A=me(x,be.autoHighlight),M=me(x,be.inputProps),O=me(x,be.triggerProps),B=me(x,be.open),j=me(x,be.mounted),D=me(x,be.selectedValue),V=me(x,be.popupSide),G=me(x,be.positionerElement),z=me(x,be.id),H=me(x,be.inline),ne=!!A,W=j&&G?V:null,J=u||I||i,K=w.length===0,oe=tD(s??(y||H?void 0:z)),[X,te]=b.useState(null),Q=b.useRef(!1),se=b.useRef(null),ae=b.useRef(!1),L=ke(Y=>{const le=y||x.state.inline;le&&!x.state.hasInputValue&&x.state.setInputValue("",Qe(er)),x.update({inputElement:Y,inputInsidePopup:le})}),Z={...l,open:B,disabled:J,readOnly:T,popupSide:W,listEmpty:K};function k(Y){if(!m)return;let le;const{highlightedChipIndex:pe}=m;if(pe!==void 0){if(Y.key==="ArrowLeft")Y.preventDefault(),pe>0?le=pe-1:le=void 0;else if(Y.key==="ArrowRight")Y.preventDefault(),pe<D.length-1?le=pe+1:le=void 0;else if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault();const re=pe>=D.length-1?D.length-2:pe;le=re>=0?re:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return le}return Y.key==="ArrowLeft"&&(Y.currentTarget.selectionStart??0)===0&&D.length>0?(Y.preventDefault(),le=Math.max(D.length-1,0)):Y.key==="Backspace"&&Y.currentTarget.value===""&&D.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Y.preventDefault()),le}return Mn("input",t,{state:Z,ref:[n,x.state.inputRef,L],props:[M,O,{type:"text",value:t.value??X??C,"aria-readonly":T||void 0,"aria-required":R||void 0,"aria-labelledby":g,disabled:J,readOnly:T,required:$==="none"?R:void 0,...$==="none"&&_&&{name:_},id:oe,onFocus(){if(d(!0),!H||!ae.current)return;ae.current=!1;const Y=se.current;Y==null||!Object.hasOwn(x.state.valuesRef.current,Y)||x.state.setIndices({activeIndex:Y})},onBlur(){c(!0),d(!1);const Y=x.state.activeIndex;if(H&&Y!==null&&A!=="always"&&(se.current=Y,ae.current=!0,x.state.setIndices({activeIndex:null})),f==="onBlur"){const le=$==="none"?C:D;p.commit(le)}},onCompositionStart(Y){ld||(Q.current=!0,te(Y.currentTarget.value))},onCompositionEnd(Y){Q.current=!1;const le=Y.currentTarget.value;te(null),x.state.setInputValue(le,Qe(Hs,Y.nativeEvent))},onChange(Y){const le=Y.nativeEvent.inputType,pe=!le||le==="insertReplacementText",re=Q.current||!pe;if(Q.current){const we=Y.currentTarget.value;te(we),we===""&&!x.state.openOnInputClick&&!x.state.inputInsidePopup&&x.state.setOpen(!1,Qe(ei,Y.nativeEvent));const Se=we.trim(),Ye=ne&&Se!=="";!T&&!J&&Se&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!Ye&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"});return}x.state.setInputValue(Y.currentTarget.value,Qe(Hs,Y.nativeEvent));const fe=Y.currentTarget.value==="",de=Qe(ei,Y.nativeEvent);fe&&!x.state.inputInsidePopup&&($==="single"&&x.state.setSelectedValue(null,de),x.state.openOnInputClick||x.state.setOpen(!1,de));const ve=Y.currentTarget.value.trim();!T&&!J&&ve&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!ne&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Y){if(J||T||Y.ctrlKey||Y.shiftKey||Y.altKey||Y.metaKey)return;x.state.keyboardActiveRef.current=!0;const le=Y.currentTarget,pe=le.scrollWidth-le.clientWidth,re=S==="rtl";if(Y.key==="Home"){Tt(Y);const ve=PE&&re?le.value.length:0;le.setSelectionRange(ve,ve),le.scrollLeft=0;return}if(Y.key==="End"){Tt(Y);const ve=PE&&re?0:le.value.length;le.setSelectionRange(ve,ve),le.scrollLeft=re?-pe:pe;return}if(!j&&Y.key==="Escape"){const ve=$==="multiple"&&Array.isArray(D)?D.length===0:D===null,we=Qe(eD,Y.nativeEvent),Se=$==="multiple"?[]:null;x.state.setInputValue("",we),x.state.setSelectedValue(Se,we),!ve&&!x.state.inline&&!we.isPropagationAllowed&&Y.stopPropagation();return}if(m&&Y.key==="Backspace"&&le.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(D)&&D.length>0){const ve=D.slice(0,-1);x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),x.state.setSelectedValue(ve,Qe(er,Y.nativeEvent));return}const fe=m?.highlightedChipIndex!==void 0,de=k(Y);if(m?.setHighlightedChipIndex(de),de!==void 0?m?.chipsRef.current[de]?.focus():fe&&x.state.inputRef.current?.focus(),Y.which!==229&&Y.key==="Enter"&&B){const ve=x.state.activeIndex,we=Y.nativeEvent;if(ve===null){x.state.setOpen(!1,Qe(er,we));return}Tt(Y);const Se=x.state.listRef.current[ve];Se&&(x.state.selectionEventRef.current=we,Se.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(a):a],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(J0.displayName="ComboboxInput");const IJ={..._0,...sJ},XD=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,keepMounted:a=!1,...l}=t,{disabled:u}=bu(),c=Gn(),d=me(c,be.selectionMode),f=me(c,be.disabled),p=me(c,be.readOnly),g=me(c,be.open),m=me(c,be.selectedValue),v=me(c,be.hasSelectionChips),y=z0();let x=!1;d==="none"?x=y!=="":d==="single"?x=m!=null:x=v;const w=u||f||i,{buttonRef:C,getButtonProps:S}=Af({native:s,disabled:w}),{mounted:R,transitionStatus:I,setMounted:T}=M0(x),_={disabled:w,open:g,transitionStatus:I};Of({open:x,ref:c.state.clearRef,onComplete(){x||T(!1)}});const $=Mn("button",t,{state:_,ref:[n,C,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(M){M.preventDefault()},onClick(M){if(w||p)return;const O=c.state.keyboardActiveRef;c.state.setInputValue("",Qe(RE,M.nativeEvent)),d!=="none"?(c.state.setSelectedValue(Array.isArray(m)?[]:null,Qe(RE,M.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:O.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:O.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},l,S],stateAttributesMapping:IJ});return a||R?$:null});process.env.NODE_ENV!=="production"&&(XD.displayName="ComboboxClear");const ZD=b.createContext(null);process.env.NODE_ENV!=="production"&&(ZD.displayName="GroupCollectionContext");function RJ(){return b.useContext(ZD)}function AJ(e){const{children:t}=e,{filteredItems:n}=Ii(),r=RJ(),o=r?r.items:n;return o?h.jsx(b.Fragment,{children:o.map(t)}):null}const JD=b.forwardRef(function(t,n){var r;const{render:o,className:i,children:s,...a}=t,l=Gn(),u=_f(),c=!!Z0(!0),{filteredItems:d}=Ii(),f=me(l,be.items),p=me(l,be.labelsRef),g=me(l,be.listRef),m=me(l,be.selectionMode),v=me(l,be.grid),y=me(l,be.popupProps),x=me(l,be.disabled),w=me(l,be.readOnly),C=me(l,be.virtualized),S=m==="multiple",R=d.length===0,I=ke(O=>{l.set("positionerElement",O)}),T=ke(O=>{l.set("listElement",O)}),_=b.useMemo(()=>typeof s=="function"?r||(r=h.jsx(AJ,{children:s})):s,[s]),$={empty:R},A=u.useState("floatingId"),M=Mn("div",t,{state:$,ref:[n,T,c?null:I],props:[y,{children:_,tabIndex:-1,id:A,role:v?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(O){if(!(x||w)&&O.key==="Enter"){const B=l.state.activeIndex;if(B==null)return;Tt(O);const j=O.nativeEvent,D=l.state.listRef.current[B];D&&(l.state.selectionEventRef.current=j,D.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return C?M:h.jsx(qM,{elementsRef:g,labelsRef:f?void 0:p,children:M})});process.env.NODE_ENV!=="production"&&(JD.displayName="ComboboxList");const K0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(K0.displayName="ComboboxPortalContext");function TJ(){const e=b.useContext(K0);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":Fr(20));return e}const KD=b.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,i=Gn(),s=me(i,be.mounted),a=me(i,be.forceMounted);return s||r||a?h.jsx(K0.Provider,{value:r,children:h.jsx(ND,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(KD.displayName="ComboboxPortal");const OJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:d="real"}=ro(e,t)||{};if(u==null)return{};const f=yy(c),p={x:n,y:r},g=$d(o),m=Vd(g),v=await s.getDimensions(u),y=g==="y",x=y?"top":"left",w=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[g]-p[g]-i.floating[m],R=p[g]-i.reference[g],I=d==="real"?await s.getOffsetParent?.(u):a.floating;let T=a.floating[C]||i.floating[m];(!T||!await s.isElement?.(I))&&(T=a.floating[C]||i.floating[m]);const _=S/2-R/2,$=T/2-v[m]/2-1,A=Math.min(f[x],$),M=Math.min(f[w],$),O=A,B=T-v[m]-M,j=T/2-v[m]/2+_,D=Bc(O,j,B),V=!l.arrow&&Fo(o)!=null&&j!==D&&i.reference[m]/2-(j<O?A:M)-v[m]/2<0,G=V?j<O?j-O:j-B:0;return{[g]:p[g]+G,data:{[g]:D,centerOffset:j-D-G,...V&&{alignmentOffset:G}},reset:V}}}),NJ=(e,t)=>({...OJ(e),options:[e,t]}),PJ={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await qT().fn(e)).data?.referenceHidden||i}}}},_J={sideX:"left",sideY:"top"};function QD(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function QE(e,t,n){const{rects:r,placement:o}=e;return{side:QD(t,Ln(o),n),align:Fo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function MJ(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:C}=e,[S,R]=b.useState(null);!g&&S!==null&&R(null);const I=m.side||"flip",T=m.align||"flip",_=m.fallbackAxisSide||"end",$=typeof t=="function"?t:void 0,A=ke($),M=$?A:t,O=rr(t),j=YM()==="rtl",D=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],V=i==="center"?D:`${D}-${i}`;let G=l;const z=1,H=r==="bottom"?z:0,ne=r==="top"?z:0,W=r==="right"?z:0,J=r==="left"?z:0;typeof G=="number"?G={top:G+H,right:G+J,bottom:G+ne,left:G+W}:G&&(G={top:(G.top||0)+H,right:(G.right||0)+J,bottom:(G.bottom||0)+ne,left:(G.left||0)+W});const K={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},U=b.useRef(null),oe=rr(o),X=rr(s),se=[$T(tt=>{const Ze=QE(tt,r,j),ee=typeof oe.current=="function"?oe.current(Ze):oe.current,ye=typeof X.current=="function"?X.current(Ze):X.current;return{mainAxis:ee,crossAxis:ye,alignmentAxis:ye}},[typeof o!="function"?o:0,typeof s!="function"?s:0,j,r])],ae=T==="none"&&I!=="shift",L=!ae&&(u||v||I==="shift"),Z=I==="none"?null:WT({...K,padding:{top:G.top+z,right:G.right+z,bottom:G.bottom+z,left:G.left+z},mainAxis:!v&&I==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),k=ae?null:GT(tt=>{const Ze=Ht(tt.elements.floating).documentElement;return{...K,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:L,limiter:u||v?void 0:HT(ee=>{if(!U.current)return{};const{width:ye,height:ge}=U.current.getBoundingClientRect(),xe=sr(Ln(ee.placement)),Ae=xe==="y"?ye:ge,Ie=xe==="y"?G.left+G.right:G.top+G.bottom;return{offset:Ae/2+Ie/2}})}},[K,u,v,G,T]);I==="shift"||T==="shift"||i==="center"?se.push(k,Z):se.push(Z,k),se.push(zT({...K,apply({elements:{floating:tt},rects:{reference:Ze},availableWidth:ee,availableHeight:ye}){const ge=tt.style;ge.setProperty("--available-width",`${ee}px`),ge.setProperty("--available-height",`${ye}px`),ge.setProperty("--anchor-width",`${Ze.width}px`),ge.setProperty("--anchor-height",`${Ze.height}px`)}}),NJ(()=>({element:U.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(tt){const{elements:Ze,middlewareData:ee,placement:ye,rects:ge,y:xe}=tt,Ae=Ln(ye),Ie=sr(Ae),qe=U.current,Pt=ee.arrow?.x||0,lt=ee.arrow?.y||0,it=qe?.clientWidth||0,_t=qe?.clientHeight||0,Et=Pt+it/2,sn=lt+_t/2,mr=Math.abs(ee.shift?.y||0),Wn=ge.reference.height/2,pn=typeof o=="function"?o(QE(tt,r,j)):o,Jt=mr>pn,Ve={top:`${Et}px calc(100% + ${pn}px)`,bottom:`${Et}px ${-pn}px`,left:`calc(100% + ${pn}px) ${sn}px`,right:`${-pn}px ${sn}px`}[Ae],zn=`${Et}px ${ge.reference.y+Wn-xe}px`;return Ze.floating.style.setProperty("--transform-origin",L&&Ie==="y"&&Jt?zn:Ve),{}}},PJ,x),Ge(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const ie=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Y,elements:le,x:pe,y:re,middlewareData:fe,update:de,placement:ve,context:we,isPositioned:Se,floatingStyles:Ye}=qZ({rootContext:p,placement:V,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...tt)=>Gc(...tt,ie),nodeId:y,externalTree:C}),{sideX:at,sideY:Xe}=fe.adaptiveOrigin||_J,Ue=Se?n:"fixed",rt=b.useMemo(()=>{const tt=x?{position:Ue,[at]:pe,[Xe]:re}:{position:Ue,...Ye};return Se||(tt.opacity=0),tt},[x,Ue,at,pe,Xe,re,Ye,Se]),et=b.useRef(null);Ge(()=>{if(!g)return;const tt=O.current,Ze=typeof tt=="function"?tt():tt,ye=(eI(Ze)?Ze.current:Ze)||null||null;ye!==et.current&&(Y.setPositionReference(ye),et.current=ye)},[g,Y,M,O]),b.useEffect(()=>{if(!g)return;const tt=O.current;typeof tt!="function"&&eI(tt)&&tt.current!==et.current&&(Y.setPositionReference(tt.current),et.current=tt.current)},[g,Y,M,O]),b.useEffect(()=>{if(f&&g&&le.domReference&&le.floating)return Gc(le.domReference,le.floating,de,ie)},[f,g,le,de,ie]);const gt=Ln(ve),ct=QD(r,gt,j),ot=Fo(ve)||"center",mt=!!fe.hide?.referenceHidden;Ge(()=>{w&&g&&Se&&R(gt)},[w,g,Se,gt]);const Nt=b.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Bt=fe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:rt,arrowStyles:Nt,arrowRef:U,arrowUncentered:Bt,side:ct,align:ot,physicalSide:gt,anchorHidden:mt,refs:Y,context:we,isPositioned:Se,update:de}),[rt,Nt,U,Bt,ct,ot,gt,mt,Y,we,Se,de])}function eI(e){return e!=null&&"current"in e}function ek(e){return e==="starting"?J8:En}const tk=b.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=Q8,...y}=t,x=Gn(),{filteredItems:w}=Ii(),C=_f(),S=TJ(),R=me(x,be.modal),I=me(x,be.open),T=me(x,be.mounted),_=me(x,be.openMethod),$=me(x,be.triggerElement),A=me(x,be.inputElement),M=me(x,be.inputInsidePopup),O=me(x,be.transitionStatus),B=w.length===0,D=MJ({anchor:i??(M?$:A),floatingRootContext:C,positionMethod:s,mounted:T,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:v,lazyFlip:!0});K7(I&&R&&_!=="touch",$);const V=b.useMemo(()=>{const W={...D.positionerStyles};return I||(W.pointerEvents="none"),{role:"presentation",hidden:!T,style:W}},[I,T,D.positionerStyles]),G={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:B};Ge(()=>{x.set("popupSide",D.side)},[x,D.side]);const z=b.useMemo(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,anchorHidden:D.anchorHidden,isPositioned:D.isPositioned}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.anchorHidden,D.isPositioned]),H=ke(W=>{x.set("positionerElement",W)}),ne=Mn("div",t,{state:G,ref:[n,H],props:[V,ek(O),y],stateAttributesMapping:jD});return h.jsxs(X0.Provider,{value:z,children:[T&&R&&h.jsx(LD,{inert:lJ(!I),cutout:A??$}),ne]})});process.env.NODE_ENV!=="production"&&(tk.displayName="ComboboxPositioner");const DJ={...jD,..._0},nk=b.forwardRef(function(t,n){const{render:r,className:o,initialFocus:i,finalFocus:s,...a}=t,l=Gn(),u=Z0(),c=_f(),{filteredItems:d}=Ii(),f=me(l,be.mounted),p=me(l,be.open),g=me(l,be.openMethod),m=me(l,be.transitionStatus),v=me(l,be.inputInsidePopup),y=me(l,be.inputElement),x=d.length===0;Of({open:p,ref:l.state.popupRef,onComplete(){p&&l.state.onOpenChangeComplete(!0)}});const w={open:p,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:m,empty:x},C=Mn("div",t,{state:w,ref:[n,l.state.popupRef],props:[{role:v?"dialog":"presentation",tabIndex:-1,onFocus(T){const _=Nn(T.nativeEvent);g!=="touch"&&(ft(l.state.listElement,_)||_===T.currentTarget)&&l.state.inputRef.current?.focus()}},ek(m),a],stateAttributesMapping:DJ}),R=i===void 0?v?T=>T==="touch"?l.state.popupRef.current:y:!1:i;let I;return s!=null?I=s:I=v?void 0:!1,h.jsx(dZ,{context:c,disabled:!f,modal:!v,openInteractionType:g,initialFocus:R,returnFocus:I,children:C})});process.env.NODE_ENV!=="production"&&(nk.displayName="ComboboxPopup");const Q0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Q0.displayName="ComboboxItemContext");function rk(){const e=b.useContext(Q0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.":Fr(19));return e}const ok=b.createContext(!1);process.env.NODE_ENV!=="production"&&(ok.displayName="ComboboxRowContext");function kJ(){return b.useContext(ok)}const ik=b.memo(b.forwardRef(function(t,n){const{render:r,className:o,value:i=null,index:s,disabled:a=!1,nativeButton:l=!1,...u}=t,c=b.useRef(!1),d=b.useRef(null),f=oD({index:s,textRef:d,indexGuessBehavior:rD.GuessFromOrder}),p=Gn(),g=kJ(),{flatFilteredItems:m,hasItems:v}=Ii(),y=me(p,be.open),x=me(p,be.selectionMode),w=me(p,be.readOnly),C=me(p,be.virtualized),S=me(p,be.isItemEqualToValue),R=x!=="none",I=s??(C?gd(m,i,S):f.index),T=f.index!==-1,_=me(p,be.id),$=me(p,be.isActive,I),A=me(p,be.isSelected,i),M=me(p,be.getItemProps),O=b.useRef(null),B=_!=null&&T?`${_}-${I}`:void 0,j=A&&R;Ge(()=>{if(!(T&&(C||s!=null)))return;const U=p.state.listRef.current;return U[I]=O.current,()=>{delete U[I]}},[T,C,I,s,p]),Ge(()=>{if(!T||v)return;const K=p.state.valuesRef.current;return K[I]=i,x!=="none"&&p.state.allValuesRef.current.push(i),()=>{delete K[I]}},[T,v,I,i,p,x]),Ge(()=>{if(!y){c.current=!1;return}if(!T||v)return;const K=p.state.selectedValue,U=Array.isArray(K)?K[K.length-1]:K;ns(i,U,S)&&p.set("selectedIndex",I)},[T,v,y,p,I,i,S]);const D={disabled:a,selected:j,highlighted:$},V=M({active:$,selected:j});V.id=void 0,V.onFocus=void 0;const{getButtonProps:G,buttonRef:z}=Af({disabled:a,focusableWhenDisabled:!0,native:l});function H(K){function U(){p.state.handleSelection(K,i)}p.state.submitOnItemClick?(so.flushSync(U),p.state.requestSubmit()):U()}const ne={id:B,role:g?"gridcell":"option","aria-selected":R?j:void 0,tabIndex:void 0,onPointerDownCapture(K){c.current=!0,K.preventDefault()},onClick(K){a||w||H(K.nativeEvent)},onMouseUp(K){const U=c.current;c.current=!1,!(a||w||K.button!==0||U||!$)&&H(K.nativeEvent)}},W=Mn("div",t,{ref:[z,n,f.ref,O],state:D,props:[V,ne,u,G]}),J=b.useMemo(()=>({selected:j,textRef:d}),[j,d]);return h.jsx(Q0.Provider,{value:J,children:W})}));process.env.NODE_ENV!=="production"&&(ik.displayName="ComboboxItem");const sk=b.forwardRef(function(t,n){const{render:r,className:o,children:i,...s}=t,{filteredItems:a}=Ii(),l=Gn(),u=a.length===0?i:null;return Mn("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});process.env.NODE_ENV!=="production"&&(sk.displayName="ComboboxEmpty");const ak=b.forwardRef(function(t,n){const{className:r,render:o,orientation:i="horizontal",...s}=t;return Mn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},s]})});process.env.NODE_ENV!=="production"&&(ak.displayName="Separator");function jJ(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...s}=e;return h.jsx(SJ,{...s,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function LJ(e){const{children:t,placeholder:n}=e,r=Gn(),o=me(r,be.itemToStringLabel),i=me(r,be.selectedValue),s=me(r,be.items),a=me(r,be.selectionMode)==="multiple",l=me(r,be.hasSelectedValue),u=!l&&n!=null&&t==null,c=me(r,be.hasNullItemLabel,u);let d=null;return typeof t=="function"?d=t(i):t!=null?d=t:!l&&n!=null&&!c?d=n:a&&Array.isArray(i)?d=hJ(i,s,o):d=FD(i,s,o),h.jsx(b.Fragment,{children:d})}const lk=b.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=rk();return r||o?h.jsx(uk,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(lk.displayName="ComboboxItemIndicator");const uk=b.memo(b.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=rk(),a=b.useRef(null),{transitionStatus:l,setMounted:u}=M0(s),d=Mn("span",e,{ref:[t,a],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:_0});return Of({open:s,ref:a,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!=="production"&&(uk.displayName="Inner");const ck=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),a=me(s,be.open),l=me(s,be.hasSelectionChips),[u,c]=b.useState(void 0);a&&u!==void 0&&c(void 0);const d=b.useRef([]),f=Mn("div",t,{ref:[n,s.state.chipsContainerRef],props:[l?{role:"toolbar"}:En,i]}),p=b.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:c,chipsRef:d}),[u,c,d]);return h.jsx(Y0.Provider,{value:p,children:h.jsx(qM,{elementsRef:d,children:f})})});process.env.NODE_ENV!=="production"&&(ck.displayName="ComboboxChips");const ex=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(ex.displayName="ComboboxChipContext");function FJ(){const e=b.useContext(ex);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":Fr(17));return e}const dk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),{setHighlightedChipIndex:a,chipsRef:l}=YD(),u=me(s,be.disabled),c=me(s,be.readOnly),d=me(s,be.selectedValue),{ref:f,index:p}=oD();function g(x){let w=p;if(x.key==="ArrowLeft")x.preventDefault(),p>0?w=p-1:w=void 0;else if(x.key==="ArrowRight")x.preventDefault(),p<d.length-1?w=p+1:w=void 0;else if(x.key==="Backspace"||x.key==="Delete"){const C=p>=d.length-1?d.length-2:p;w=C>=0?C:void 0,Tt(x),s.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),s.state.setSelectedValue(d.filter((S,R)=>R!==p),Qe(er,x.nativeEvent))}else x.key==="Enter"||x.key===" "?(Tt(x),w=void 0):x.key==="ArrowDown"||x.key==="ArrowUp"?(Tt(x),s.state.setOpen(!0,Qe(dl,x.nativeEvent)),w=void 0):x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&(w=void 0);return w}const v=Mn("div",t,{ref:[n,f],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":c||void 0,onKeyDown(x){if(u||c)return;const w=g(x);so.flushSync(()=>{a(w)}),w===void 0?s.state.inputRef.current?.focus():l.current[w]?.focus()},onMouseDown(x){c||(x.preventDefault(),!u&&s.state.inputRef.current?.focus())}},i]}),y=b.useMemo(()=>({index:p}),[p]);return h.jsx(ex.Provider,{value:y,children:v})});process.env.NODE_ENV!=="production"&&(dk.displayName="ComboboxChip");const fk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,...a}=t,l=Gn(),{index:u}=FJ(),c=me(l,be.disabled),d=me(l,be.readOnly),f=me(l,be.selectedValue),p=me(l,be.isItemEqualToValue),g=c||i,{buttonRef:m,getButtonProps:v}=Af({native:s,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function x(S){const R=l.state.activeIndex;if(R==null)return;const I=gd(l.state.valuesRef.current,S,p);I!==-1&&R===I&&l.state.setIndices({activeIndex:null,type:l.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(S){const R=Qe(a7,S.nativeEvent),I=f[u];return x(I),l.state.setSelectedValue(f.filter((T,_)=>_!==u),R),l.state.inputRef.current?.focus(),R}return Mn("button",t,{ref:[n,m],state:y,props:[{tabIndex:-1,onClick(S){if(g||d)return;w(S).isPropagationAllowed||S.stopPropagation()},onKeyDown(S){g||d||(S.key==="Enter"||S.key===" ")&&(w(S).isPropagationAllowed||Tt(S))}},a,v]})});process.env.NODE_ENV!=="production"&&(fk.displayName="ComboboxChipRemove");function vu({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:F("ui:file:text-foreground ui:placeholder:text-muted-foreground ui:selection:bg-primary ui:selection:text-primary-foreground ui:dark:bg-input/30 ui:border-input ui:h-10 ui:w-full ui:min-w-0 ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-1 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:file:inline-flex ui:file:h-7 ui:file:border-0 ui:file:bg-transparent ui:file:text-sm ui:file:font-medium ui:disabled:pointer-events-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm","ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:focus-visible:ring-[3px]","ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive",e),...n})}function pk({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:F("ui:border-input ui:placeholder:text-muted-foreground ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:dark:bg-input/30 ui:flex ui:field-sizing-content ui:min-h-16 ui:w-full ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-2 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm",e),...t})}function BJ({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:F("ui:group/input-group ui:border-input ui:dark:bg-input/30 ui:relative ui:flex ui:w-full ui:items-center ui:rounded-md ui:border ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none","ui:h-9 ui:min-w-0 ui:has-[>textarea]:h-auto","ui:has-[>[data-align=inline-start]]:[&>input]:pl-2","ui:has-[>[data-align=inline-end]]:[&>input]:pr-2","ui:has-[>[data-align=block-start]]:h-auto ui:has-[>[data-align=block-start]]:flex-col ui:has-[>[data-align=block-start]]:[&>input]:pb-3","ui:has-[>[data-align=block-end]]:h-auto ui:has-[>[data-align=block-end]]:flex-col ui:has-[>[data-align=block-end]]:[&>input]:pt-3","ui:has-[[data-slot=input-group-control]:focus-visible]:border-ring ui:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 ui:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","ui:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ui:has-[[data-slot][aria-invalid=true]]:border-destructive ui:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const VJ=Si("ui:text-muted-foreground ui:flex ui:h-auto ui:cursor-text ui:items-center ui:justify-center ui:gap-2 ui:py-1.5 ui:text-sm ui:font-medium ui:select-none ui:[&>svg:not([class*=size-])]:size-4 ui:[&>kbd]:rounded-[calc(var(--radius)-5px)] ui:group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"ui:order-first ui:pl-3 ui:has-[>button]:ml-[-0.45rem] ui:has-[>kbd]:ml-[-0.35rem]","inline-end":"ui:order-last ui:pr-3 ui:has-[>button]:mr-[-0.45rem] ui:has-[>kbd]:mr-[-0.35rem]","block-start":"ui:order-first ui:w-full ui:justify-start ui:px-3 ui:pt-3 ui:[.border-b]:pb-3 ui:group-has-[>input]/input-group:pt-2.5","block-end":"ui:order-last ui:w-full ui:justify-start ui:px-3 ui:pb-3 ui:[.border-t]:pt-3 ui:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function $J({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:F(VJ({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const GJ=Si("ui:text-sm ui:shadow-none ui:flex ui:gap-2 ui:items-center",{variants:{size:{xs:"ui:h-6 ui:gap-1 ui:px-2 ui:rounded-[calc(var(--radius)-5px)] ui:[&>svg:not([class*=size-])]:size-3.5 ui:has-[>svg]:px-2",sm:"ui:h-8 ui:px-2.5 ui:gap-1.5 ui:rounded-md ui:has-[>svg]:px-2.5","icon-xs":"ui:size-6 ui:rounded-[calc(var(--radius)-5px)] ui:p-0 ui:has-[>svg]:p-0","icon-sm":"ui:size-8 ui:p-0 ui:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function hk({className:e,type:t="button",variant:n="ghost",size:r="xs",...o}){return h.jsx(on,{type:t,"data-size":r,variant:n,className:F(GJ({size:r}),e),...o})}function HJ({className:e,...t}){return h.jsx(vu,{"data-slot":"input-group-control",className:F("ui:flex-1 ui:rounded-none ui:border-0 ui:bg-transparent ui:shadow-none ui:focus-visible:ring-0 ui:dark:bg-transparent",e),...t})}const WJ=jJ;function km({...e}){return h.jsx(LJ,{"data-slot":"combobox-value",...e})}function gk({className:e,children:t,...n}){return h.jsxs(UD,{"data-slot":"combobox-trigger",className:F("ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(_e.ChevronDownIcon,{"data-slot":"combobox-trigger-icon",className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4"})]})}function zJ({className:e,...t}){return h.jsx(XD,{"data-slot":"combobox-clear",render:h.jsx(hk,{variant:"ghost",size:"icon-xs",className:"ui:rounded-md"}),className:F(e),...t,children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})}function tI({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:o=!1,...i}){return h.jsxs(BJ,{className:F("ui:w-auto ui:shrink-0",e),children:[h.jsx(J0,{render:h.jsx(HJ,{disabled:n}),...i}),h.jsxs($J,{align:"inline-end",children:[r&&h.jsx(hk,{size:"icon-xs",variant:"ghost",asChild:!0,"data-slot":"input-group-button",className:"ui:group-has-data-[slot=combobox-clear]/input-group:hidden ui:data-pressed:bg-transparent",disabled:n,children:h.jsx(gk,{className:"ui:rounded-md"})}),o&&h.jsx(zJ,{disabled:n})]}),t]})}function qJ({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:o=0,anchor:i,...s}){return h.jsx(KD,{children:h.jsx(tk,{side:t,sideOffset:n,align:r,alignOffset:o,anchor:i,className:"ui:isolate ui:z-50",children:h.jsx(nk,{"data-slot":"combobox-content","data-chips":!!i,className:F("ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:flex ui:min-h-0 ui:max-h-96 ui:flex-col ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",e),...s})})})}function UJ({className:e,...t}){return h.jsx(JD,{"data-slot":"combobox-list",className:F("ui:min-h-0 ui:flex-1 ui:overflow-y-auto ui:scroll-py-1 ui:p-1 ui:data-empty:p-0",e),...t})}function YJ({className:e,children:t,...n}){return h.jsxs(ik,{"data-slot":"combobox-item",className:F("ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(lk,{"data-slot":"combobox-item-indicator",render:h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center"}),children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4 ui:pointer-coarse:size-5"})})]})}function XJ({className:e,...t}){return h.jsx(sk,{"data-slot":"combobox-empty",className:F("ui:hidden ui:w-full ui:shrink-0 ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:text-muted-foreground ui:group-data-empty/combobox-content:flex",e),...t})}function ZJ({className:e,...t}){return h.jsx(ak,{"data-slot":"combobox-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function JJ({className:e,...t}){return h.jsx(ck,{"data-slot":"combobox-chips",className:F("ui:dark:bg-input/30 ui:border-input ui:focus-within:border-ring ui:focus-within:ring-ring/50 ui:has-aria-invalid:ring-destructive/20 ui:dark:has-aria-invalid:ring-destructive/40 ui:has-aria-invalid:border-destructive ui:dark:has-aria-invalid:border-destructive/50 ui:flex ui:min-h-9 ui:flex-wrap ui:items-center ui:gap-1.5 ui:rounded-md ui:border ui:bg-transparent ui:bg-clip-padding ui:px-2.5 ui:py-1.5 ui:text-sm ui:shadow-xs ui:transition-[color,box-shadow] ui:focus-within:ring-[3px] ui:has-aria-invalid:ring-[3px] ui:has-data-[slot=combobox-chip]:px-1.5",e),...t})}function KJ({className:e,children:t,showRemove:n=!0,...r}){return h.jsxs(dk,{"data-slot":"combobox-chip",className:F("ui:bg-muted ui:text-foreground ui:flex ui:h-[calc(--spacing(5.5))] ui:w-fit ui:items-center ui:justify-center ui:gap-1 ui:rounded-sm ui:px-1.5 ui:text-xs ui:font-medium ui:whitespace-nowrap ui:has-disabled:pointer-events-none ui:has-disabled:cursor-not-allowed ui:has-disabled:opacity-50 ui:has-data-[slot=combobox-chip-remove]:pr-0",e),...r,children:[t,n&&h.jsx(fk,{render:h.jsx(on,{variant:"ghost",size:"xs",className:"ui:hover:bg-transparent"}),className:"ui:-ml-1 ui:opacity-50 ui:hover:opacity-100","data-slot":"combobox-chip-remove",children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})]})}function QJ({className:e,...t}){return h.jsx(J0,{"data-slot":"combobox-chip-input",className:F("ui:min-w-16 ui:flex-1 ui:outline-none",e),...t})}function eK(){return b.useRef(null)}const tK=e=>e.label,nK=(e,t)=>e.value===t.value,tx=({items:e,label:t,multiple:n=!1,hasClearButton:r=!1,disabled:o=!1,placeholder:i="Select...",containerClassName:s,emptyMessage:a="No results found.",hasAllOption:l=!1,allOptionLabel:u="All",inputMode:c="input",renderPopupTrigger:d,onInputChange:f,value:p,onValueChange:g})=>{const m=eK(),v=p??[],y=N.useMemo(()=>e.filter(R=>!R.disabled),[e]),x=n&&v.length===y.length&&y.length>0,w=N.useCallback(()=>{const I=v.length===y.length&&y.length>0?[]:y;g(I)},[y,v.length,g]),C=N.useCallback(R=>{Array.isArray(R)?g(R):g(R===null?[]:[R])},[g]),S=N.useCallback(R=>{f?.(R.target.value)},[f]);return h.jsxs("article",{className:s,children:[t&&h.jsx(gr,{className:"ui:mb-2",children:t}),h.jsxs(WJ,{multiple:n,autoHighlight:!0,items:e,itemToStringValue:tK,isItemEqualToValue:nK,disabled:o,value:n?v:v[0]??null,onValueChange:C,children:[h.jsxs(_r,{children:[h.jsx(rn,{condition:c==="popup",children:h.jsx(gk,{render:d?d(h.jsx(km,{placeholder:i}),v):h.jsx(on,{variant:"outline",className:"ui:w-full ui:font-normal ui:text-left ui:overflow-hidden ui:truncate ui:line-clamp-1",children:h.jsx(km,{placeholder:i})})})}),h.jsx(rn,{condition:n&&c==="input",children:h.jsx(JJ,{ref:m,className:"ui:w-full",children:h.jsx(km,{children:R=>h.jsxs(N.Fragment,{children:[R.map(I=>h.jsx(KJ,{children:I.label},I.value)),h.jsx(QJ,{placeholder:R.length?"":i,onChange:S})]})})})}),h.jsx(rn,{condition:!n&&c==="input",children:h.jsx(tI,{className:"ui:w-full",placeholder:i,showClear:r,disabled:o,onChange:S})})]}),h.jsxs(qJ,{className:"ui:min-w-64",anchor:m&&n&&c==="input"?m:void 0,children:[c==="popup"&&h.jsx(tI,{showTrigger:!1,placeholder:"Search...",onChange:S}),h.jsx(XJ,{children:a}),l&&n&&h.jsxs("div",{className:"ui:shrink-0 ui:group-data-empty/combobox-content:hidden",children:[h.jsx("div",{className:F("ui:p-1 ui:pb-0",c==="popup"?"ui:mt-1":""),children:h.jsxs("div",{role:"option","aria-selected":x,onClick:w,className:F("ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none","ui:hover:bg-accent ui:hover:text-accent-foreground"),children:[u,x&&h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center",children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4"})})]})}),h.jsx(ZJ,{})]}),h.jsx(UJ,{children:R=>h.jsx(YJ,{value:R,disabled:!!R?.disabled,children:R.label},R.value)})]})]})]})},rK="dd/MM/yyyy",oK=({date:e,format:t=rK})=>e?h.jsx(h.Fragment,{children:Ws(e,t)}):null;function nx({...e}){return h.jsx(Z3,{"data-slot":"popover",...e})}const Mf=b.forwardRef(({...e},t)=>h.jsx(mN,{"data-slot":"popover-trigger",ref:t,...e}));Mf.displayName=mN.displayName;const Df=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>h.jsx(J3,{children:h.jsx(bN,{ref:o,"data-slot":"popover-content",align:t,sideOffset:n,className:F("ui-lib-root ui:z-[102] ui:w-72 ui:rounded-md ui:border ui:bg-popover ui:p-4 ui:text-popover-foreground ui:shadow-md ui:outline-none ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",e),...r})}));Df.displayName=bN.displayName;const mk=b.forwardRef(({...e},t)=>h.jsx(gN,{"data-slot":"popover-anchor",ref:t,...e}));mk.displayName=gN.displayName;const bk=({start:e,end:t,onConfirm:n,className:r,triggerButtonClassName:o,label:i,placeholder:s,confirmLabel:a="Confirm",disabledCondition:l,dateLocale:u})=>{const[c,d]=N.useState(!1),[f,p]=N.useState(e&&t?{from:e,to:t}:void 0),g=()=>{!f?.from||!f?.to||(n({from:f.from,to:f.to}),d(!1))};return h.jsxs("div",{className:F("ui:grid ui:gap-2",r),children:[i&&h.jsx(gr,{children:i}),h.jsxs(nx,{open:c,onOpenChange:d,children:[h.jsx(Mf,{asChild:!0,children:h.jsxs(on,{id:"date",variant:"outline",className:F("ui:h-auto ui:text-muted-foreground ui:justify-start ui:text-left ui:font-normal",!f&&"ui:text-muted-foreground",o),children:[h.jsx(_e.Calendar,{className:"ui:h-4 ui:w-4"}),f?.from?f.to?h.jsxs(h.Fragment,{children:[Ws(f.from,"LLL dd, y",{locale:u})," -",Ws(f.to,"LLL dd, y",{locale:u})]}):Ws(f.from,"LLL dd, y",{locale:u}):h.jsx("span",{children:s})]})}),h.jsxs(Df,{className:"ui:w-auto ui:p-0",align:"start",children:[h.jsx(e0,{mode:"range",defaultMonth:f?.from??new Date,selected:f,onSelect:p,numberOfMonths:2,disabled:l,locale:u}),h.jsx("div",{className:F("ui:px-3 ui:pb-4 ui:pt-2","ui:flex ui:justify-start ui:md:justify-end"),children:h.jsx(on,{variant:"success",onClick:g,className:"ui:w-full ui:md:w-max",children:a})})]})]})]})};function vk({value:e,onChange:t,className:n,inputClassName:r,name:o,placeholder:i,label:s}){const[a,l]=N.useState(e),u=N.useRef(null),c=N.useRef(t);N.useEffect(()=>{c.current=t},[t]);const d=N.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.length>=3?c.current(p):c.current("")},300)},[]),f=p=>{const g=decodeURIComponent(p);l(g),d(g)};return h.jsxs("search",{className:F("ui:w-full",n),children:[s&&h.jsx(gr,{htmlFor:o,className:"ui:leading-6 ui:w-full",children:s}),h.jsx(vu,{type:"search",name:o,id:o,"data-test-id":o,placeholder:i,value:a,onChange:({target:p})=>f(p.value),className:F("ui:max-h-10",r),autoFocus:!0})]})}const iK=({banner:e,campaignName:t,isControlled:n,open:r,setOpen:o,imageClassName:i})=>h.jsxs(S0,{...n&&{open:r,onOpenChange:o},children:[!n&&h.jsx(FM,{asChild:!0,children:h.jsx("div",{className:"ui:cursor-pointer",children:h.jsx("img",{className:F("ui:w-full ui:max-w-80 ui:mx-auto ui:mt-4! ui:scale-100 ui:hover:scale-110 ui:transition-all ui:duration-300 ui:aspect-video",i),src:e,alt:t})})}),h.jsxs(E0,{className:"ui:max-w-2xl",children:[h.jsx(I0,{children:h.jsx(R0,{children:t})}),h.jsx("img",{className:F("ui:w-full ui:aspect-video",i),src:e,alt:t})]})]});function sK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const yk=N.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),yu=()=>{const e=N.useContext(yk);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};sK(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
87
87
|
[data-state=closed]
|
|
88
88
|
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function aK(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function lK(){return rx(/^Mac/)}function uK(){return rx(/^iPhone/)}function nI(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function cK(){return rx(/^iPad/)||lK()&&navigator.maxTouchPoints>1}function xk(){return uK()||cK()}function rx(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const dK=24,fK=typeof window<"u"?N.useLayoutEffect:N.useEffect;function rI(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const jm=typeof document<"u"&&window.visualViewport;function oI(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function wk(e){for(oI(e)&&(e=e.parentElement);e&&!oI(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const pK=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let sc=0,Lm;function hK(e={}){let{isDisabled:t}=e;fK(()=>{if(!t)return sc++,sc===1&&xk()&&(Lm=gK()),()=>{sc--,sc===0&&Lm?.()}},[t])}function gK(){let e,t=0,n=d=>{e=wk(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&f>t||p>=g&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;bv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;bv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",jm&&(jm.height<window.innerHeight?requestAnimationFrame(()=>{iI(f)}):jm.addEventListener("resize",()=>iI(f),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,u=rI(mK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let c=rI(Ga(document,"touchstart",n,{passive:!1,capture:!0}),Ga(document,"touchmove",r,{passive:!1,capture:!0}),Ga(document,"touchend",o,{passive:!1,capture:!0}),Ga(document,"focus",i,!0),Ga(window,"scroll",s));return()=>{u(),c(),window.scrollTo(a,l)}}function mK(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ga(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function iI(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=wk(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+dK;i>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function bv(e){return e instanceof HTMLInputElement&&!pK.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function bK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function vK(...e){return t=>e.forEach(n=>bK(n,t))}function Ck(...e){return b.useCallback(vK(...e),e)}const Sk=new WeakMap;function en(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Sk.set(e,r)}function yK(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Sk.get(e);n&&(e.style[t]=n[t])}const Ut=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ac(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Ut(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Ut(t)?5:4]):null)}function xK(e){return 8*(Math.log(e+1)-2)}function Fm(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function wK(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const kt={DURATION:.5,EASE:[.32,.72,0,1]},Ek=.4,CK=.25,SK=100,Ik=8,Gi=16,vv=26,Bm="vaul-dragging";function Rk(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function EK({defaultProp:e,onChange:t}){const n=N.useState(e),[r]=n,o=N.useRef(r),i=Rk(t);return N.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Ak({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=EK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Rk(n),l=N.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function IK({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:s,direction:a="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=Ak({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=N.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);N.useEffect(()=>{function I(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const g=N.useMemo(()=>c===n?.[n.length-1]||null,[n,c]),m=N.useMemo(()=>{var I;return(I=n?.findIndex(T=>T===c))!=null?I:null},[n,c]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,y=N.useMemo(()=>{const I=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n?.map(_=>{const $=typeof _=="string";let A=0;if($&&(A=parseInt(_,10)),Ut(a)){const O=$?A:f?_*I.height:0;return f?a==="bottom"?I.height-O:-I.height+O:O}const M=$?A:f?_*I.width:0;return f?a==="right"?I.width-M:-I.width+M:M}))!=null?T:[]},[n,f,l]),x=N.useMemo(()=>m!==null?y?.[m]:null,[y,m]),w=N.useCallback(I=>{var T;const _=(T=y?.findIndex($=>$===I))!=null?T:null;s(_),en(r.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Ut(a)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`}),y&&_!==y.length-1&&i!==void 0&&_!==i&&_<i?en(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"0"}):en(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(_,0)])},[r.current,n,y,i,o,d]);N.useEffect(()=>{if(c||e){var I;const T=(I=n?.findIndex(_=>_===e||_===c))!=null?I:-1;y&&T!==-1&&typeof y[T]=="number"&&w(y[T])}},[c,e,n,y,w]);function C({draggedDistance:I,closeDrawer:T,velocity:_,dismissible:$}){if(i===void 0)return;const A=a==="bottom"||a==="right"?(x??0)-I:(x??0)+I,M=m===i-1,O=m===0,B=I>0;if(M&&en(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),!u&&_>2&&!B){$?T():w(y[0]);return}if(!u&&_>2&&B&&y&&n){w(y[n.length-1]);return}const j=y?.reduce((V,G)=>typeof V!="number"||typeof G!="number"?V:Math.abs(G-A)<Math.abs(V-A)?G:V),D=Ut(a)?window.innerHeight:window.innerWidth;if(_>Ek&&Math.abs(I)<D*.4){const V=B?1:-1;if(V>0&&g&&n){w(y[n.length-1]);return}if(O&&V<0&&$&&T(),m===null)return;w(y[m+V]);return}w(j)}function S({draggedDistance:I}){if(x===null)return;const T=a==="bottom"||a==="right"?x-I:x+I;(a==="bottom"||a==="right")&&T<y[y.length-1]||(a==="top"||a==="left")&&T>y[y.length-1]||en(r.current,{transform:Ut(a)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function R(I,T){if(!n||typeof m!="number"||!y||i===void 0)return null;const _=m===i-1;if(m>=i&&T)return 0;if(_&&!T)return 1;if(!v&&!_)return null;const A=_?m+1:m-1,M=_?y[A]-y[A-1]:y[A+1]-y[A],O=I/Math.abs(M);return _?1-O:O}return{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:R,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:C,onDrag:S,snapPointsOffset:y}}const RK=()=>()=>{};function AK(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=yu(),i=N.useRef(null),s=N.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-vv)/window.innerWidth}N.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;wK(r&&!o?Fm(document.body,{background:"black"}):RK,Fm(l,{transformOrigin:Ut(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`}));const u=Fm(l,{borderRadius:`${Ik}px`,overflow:"hidden",...Ut(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},kt.DURATION*1e3)}}},[t,n,s])}let Ha=null;function TK({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[s,a]=N.useState(()=>typeof window<"u"?window.location.href:""),l=N.useRef(0),u=N.useCallback(()=>{if(nI()&&Ha===null&&e&&!i){Ha={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&l.current>=f&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),c=N.useCallback(()=>{if(nI()&&Ha!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ha),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),Ha=null}},[s]);return N.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),N.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),N.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,r,s,t,n,u,c]),{restorePositionSetting:c}}function OK({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=CK,scrollLockTimeout:u=SK,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:x,noBodyStyles:w=!1,direction:C="bottom",defaultOpen:S=!1,disablePreventScroll:R=!0,snapToSequentialPoint:I=!1,preventScrollRestoration:T=!1,repositionInputs:_=!0,onAnimationEnd:$,container:A,autoFocus:M=!1}){var O,B;const[j=!1,D]=Ak({defaultProp:S,prop:e,onChange:ee=>{t?.(ee),!ee&&!x&&Xe(),setTimeout(()=>{$?.(ee)},kt.DURATION*1e3),ee&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[V,G]=N.useState(!1),[z,H]=N.useState(!1),[ne,W]=N.useState(!1),J=N.useRef(null),K=N.useRef(null),U=N.useRef(null),oe=N.useRef(null),X=N.useRef(null),te=N.useRef(!1),Q=N.useRef(null),se=N.useRef(0),ae=N.useRef(!1),L=N.useRef(!S),Z=N.useRef(0),k=N.useRef(null),ie=N.useRef(((O=k.current)==null?void 0:O.getBoundingClientRect().height)||0),Y=N.useRef(((B=k.current)==null?void 0:B.getBoundingClientRect().width)||0),le=N.useRef(0),pe=N.useCallback(ee=>{i&&ee===we.length-1&&(K.current=new Date)},[]),{activeSnapPoint:re,activeSnapPointIndex:fe,setActiveSnapPoint:de,onRelease:ve,snapPointsOffset:we,onDrag:Se,shouldFade:Ye,getPercentageDragged:at}=IK({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:k,fadeFromIndex:f,overlayRef:J,onSnapPointChange:pe,direction:C,container:A,snapToSequentialPoint:I});hK({isDisabled:!j||z||!v||ne||!V||!_||!R});const{restorePositionSetting:Xe}=TK({isOpen:j,modal:v,nested:x??!1,hasBeenOpened:V,preventScrollRestoration:T,noBodyStyles:w});function Ue(){return(window.innerWidth-vv)/window.innerWidth}function rt(ee){var ye,ge;!c&&!i||k.current&&!k.current.contains(ee.target)||(ie.current=((ye=k.current)==null?void 0:ye.getBoundingClientRect().height)||0,Y.current=((ge=k.current)==null?void 0:ge.getBoundingClientRect().width)||0,H(!0),U.current=new Date,xk()&&window.addEventListener("touchend",()=>te.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),se.current=Ut(C)?ee.pageY:ee.pageX)}function et(ee,ye){var ge;let xe=ee;const Ae=(ge=window.getSelection())==null?void 0:ge.toString(),Ie=k.current?ac(k.current,C):null,qe=new Date;if(xe.tagName==="SELECT"||xe.hasAttribute("data-vaul-no-drag")||xe.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(K.current&&qe.getTime()-K.current.getTime()<500)return!1;if(Ie!==null&&(C==="bottom"?Ie>0:Ie<0))return!0;if(Ae&&Ae.length>0)return!1;if(X.current&&qe.getTime()-X.current.getTime()<u&&Ie===0||ye)return X.current=qe,!1;for(;xe;){if(xe.scrollHeight>xe.clientHeight){if(xe.scrollTop!==0)return X.current=new Date,!1;if(xe.getAttribute("role")==="dialog")return!0}xe=xe.parentNode}return!0}function gt(ee){if(k.current&&z){const ye=C==="bottom"||C==="right"?1:-1,ge=(se.current-(Ut(C)?ee.pageY:ee.pageX))*ye,xe=ge>0,Ae=i&&!c&&!xe;if(Ae&&fe===0)return;const Ie=Math.abs(ge),qe=document.querySelector("[data-vaul-drawer-wrapper]"),Pt=C==="bottom"||C==="top"?ie.current:Y.current;let lt=Ie/Pt;const it=at(Ie,xe);if(it!==null&&(lt=it),Ae&<>=1||!te.current&&!et(ee.target,xe))return;if(k.current.classList.add(Bm),te.current=!0,en(k.current,{transition:"none"}),en(J.current,{transition:"none"}),i&&Se({draggedDistance:ge}),xe&&!i){const Et=xK(ge),sn=Math.min(Et*-1,0)*ye;en(k.current,{transform:Ut(C)?`translate3d(0, ${sn}px, 0)`:`translate3d(${sn}px, 0, 0)`});return}const _t=1-lt;if((Ye||f&&fe===f-1)&&(r?.(ee,lt),en(J.current,{opacity:`${_t}`,transition:"none"},!0)),qe&&J.current&&s){const Et=Math.min(Ue()+lt*(1-Ue()),1),sn=8-lt*8,mr=Math.max(0,14-lt*14);en(qe,{borderRadius:`${sn}px`,transform:Ut(C)?`scale(${Et}) translate3d(0, ${mr}px, 0)`:`scale(${Et}) translate3d(${mr}px, 0, 0)`,transition:"none"},!0)}if(!i){const Et=Ie*ye;en(k.current,{transform:Ut(C)?`translate3d(0, ${Et}px, 0)`:`translate3d(${Et}px, 0, 0)`})}}}N.useEffect(()=>{window.requestAnimationFrame(()=>{L.current=!0})},[]),N.useEffect(()=>{var ee;function ye(){if(!k.current||!_)return;const ge=document.activeElement;if(bv(ge)||ae.current){var xe;const Ae=((xe=window.visualViewport)==null?void 0:xe.height)||0,Ie=window.innerHeight;let qe=Ie-Ae;const Pt=k.current.getBoundingClientRect().height||0,lt=Pt>Ie*.8;le.current||(le.current=Pt);const it=k.current.getBoundingClientRect().top;if(Math.abs(Z.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&we&&fe){const _t=we[fe]||0;qe+=_t}if(Z.current=qe,Pt>Ae||ae.current){const _t=k.current.getBoundingClientRect().height;let Et=_t;_t>Ae&&(Et=Ae-(lt?it:vv)),m?k.current.style.height=`${_t-Math.max(qe,0)}px`:k.current.style.height=`${Math.max(Et,Ae-it)}px`}else aK()||(k.current.style.height=`${le.current}px`);i&&i.length>0&&!ae.current?k.current.style.bottom="0px":k.current.style.bottom=`${Math.max(qe,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",ye),()=>{var ge;return(ge=window.visualViewport)==null?void 0:ge.removeEventListener("resize",ye)}},[fe,i,we]);function ct(ee){mt(),y?.(),ee||D(!1),setTimeout(()=>{i&&de(i[0])},kt.DURATION*1e3)}function ot(){if(!k.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),ye=ac(k.current,C);en(k.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),en(J.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),s&&ye&&ye>0&&j&&en(ee,{borderRadius:`${Ik}px`,overflow:"hidden",...Ut(C)?{transform:`scale(${Ue()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ue()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`},!0)}function mt(){!z||!k.current||(k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date)}function Nt(ee){if(!z||!k.current)return;k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date;const ye=ac(k.current,C);if(!ee||!et(ee.target,!1)||!ye||Number.isNaN(ye)||U.current===null)return;const ge=oe.current.getTime()-U.current.getTime(),xe=se.current-(Ut(C)?ee.pageY:ee.pageX),Ae=Math.abs(xe)/ge;if(Ae>.05&&(W(!0),setTimeout(()=>{W(!1)},200)),i){ve({draggedDistance:xe*(C==="bottom"||C==="right"?1:-1),closeDrawer:ct,velocity:Ae,dismissible:c}),o?.(ee,!0);return}if(C==="bottom"||C==="right"?xe>0:xe<0){ot(),o?.(ee,!0);return}if(Ae>Ek){ct(),o?.(ee,!1);return}var Ie;const qe=Math.min((Ie=k.current.getBoundingClientRect().height)!=null?Ie:0,window.innerHeight);var Pt;const lt=Math.min((Pt=k.current.getBoundingClientRect().width)!=null?Pt:0,window.innerWidth),it=C==="left"||C==="right";if(Math.abs(ye)>=(it?lt:qe)*l){ct(),o?.(ee,!1);return}o?.(ee,!0),ot()}N.useEffect(()=>(j&&(en(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{yK(document.documentElement,"scrollBehavior")}),[j]);function Bt(ee){const ye=ee?(window.innerWidth-Gi)/window.innerWidth:1,ge=ee?-Gi:0;Q.current&&window.clearTimeout(Q.current),en(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Ut(C)?`scale(${ye}) translate3d(0, ${ge}px, 0)`:`scale(${ye}) translate3d(${ge}px, 0, 0)`}),!ee&&k.current&&(Q.current=setTimeout(()=>{const xe=ac(k.current,C);en(k.current,{transition:"none",transform:Ut(C)?`translate3d(0, ${xe}px, 0)`:`translate3d(${xe}px, 0, 0)`})},500))}function tt(ee,ye){if(ye<0)return;const ge=(window.innerWidth-Gi)/window.innerWidth,xe=ge+ye*(1-ge),Ae=-Gi+ye*Gi;en(k.current,{transform:Ut(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`,transition:"none"})}function Ze(ee,ye){const ge=Ut(C)?window.innerHeight:window.innerWidth,xe=ye?(ge-Gi)/ge:1,Ae=ye?-Gi:0;ye&&en(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Ut(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`})}return N.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),N.createElement(Xl,{defaultOpen:S,onOpenChange:ee=>{!c&&!ee||(ee?G(!0):ct(!0),D(ee))},open:j},N.createElement(yk.Provider,{value:{activeSnapPoint:re,snapPoints:i,setActiveSnapPoint:de,drawerRef:k,overlayRef:J,onOpenChange:t,onPress:rt,onRelease:Nt,onDrag:gt,dismissible:c,shouldAnimate:L,handleOnly:d,isOpen:j,isDragging:z,shouldFade:Ye,closeDrawer:ct,onNestedDrag:tt,onNestedOpenChange:Bt,onNestedRelease:Ze,keyboardIsOpen:ae,modal:v,snapPointsOffset:we,activeSnapPointIndex:fe,direction:C,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:w,container:A,autoFocus:M}},n))}const Tk=N.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:s,modal:a,shouldAnimate:l}=yu(),u=Ck(t,n),c=r&&r.length>0;if(!a)return null;const d=N.useCallback(f=>o(f),[o]);return N.createElement(Jl,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&c?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});Tk.displayName="Drawer.Overlay";const Ok=N.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:s,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:x,autoFocus:w}=yu(),[C,S]=N.useState(!1),R=Ck(o,i),I=N.useRef(null),T=N.useRef(null),_=N.useRef(!1),$=m&&m.length>0;AK();const A=(O,B,j=0)=>{if(_.current)return!0;const D=Math.abs(O.y),V=Math.abs(O.x),G=V>D,z=["bottom","right"].includes(B)?1:-1;if(B==="left"||B==="right"){if(!(O.x*z<0)&&V>=0&&V<=j)return G}else if(!(O.y*z<0)&&D>=0&&D<=j)return!G;return _.current=!0,!0};N.useEffect(()=>{$&&window.requestAnimationFrame(()=>{S(!0)})},[]);function M(O){I.current=null,_.current=!1,a(O)}return N.createElement(Kl,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":p&&$?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[d??0]}px`,...t}:t,onPointerDown:O=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,O),I.current={x:O.pageX,y:O.pageY},s(O))},onOpenAutoFocus:O=>{n?.(O),w||O.preventDefault()},onPointerDownOutside:O=>{if(e?.(O),!f||O.defaultPrevented){O.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:O=>{if(!f){O.preventDefault();return}},onPointerMove:O=>{if(T.current=O,y||(r.onPointerMove==null||r.onPointerMove.call(r,O),!I.current))return;const B=O.pageY-I.current.y,j=O.pageX-I.current.x,D=O.pointerType==="touch"?10:2;A({x:j,y:B},g,D)?l(O):(Math.abs(j)>D||Math.abs(B)>D)&&(I.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),I.current=null,_.current=!1,a(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),M(T.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),T.current&&M(T.current)}})});Ok.displayName="Drawer.Content";const NK=250,PK=120,_K=N.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:f,onDrag:p}=yu(),g=N.useRef(null),m=N.useRef(!1);function v(){if(m.current){w();return}window.setTimeout(()=>{y()},PK)}function y(){if(i||e||m.current){w();return}if(w(),!s||s.length===0){u||o();return}if(a===s[s.length-1]&&u){o();return}const S=s.findIndex(I=>I===a);if(S===-1)return;const R=s[S+1];l(R)}function x(){g.current=window.setTimeout(()=>{m.current=!0},NK)}function w(){g.current&&window.clearTimeout(g.current),m.current=!1}return N.createElement("div",{onClick:v,onPointerCancel:w,onPointerDown:C=>{c&&f(C),x()},onPointerMove:C=>{c&&p(C)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},N.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});_K.displayName="Drawer.Handle";function MK(e){const t=yu(),{container:n=t.container,...r}=e;return N.createElement(Zl,{container:n,...r})}const Ri={Root:OK,Content:Ok,Overlay:Tk,Trigger:jd,Portal:MK,Close:ds,Title:Ld,Description:Fd};function DK({...e}){return h.jsx(Ri.Root,{"data-slot":"drawer",...e})}function kK({...e}){return h.jsx(Ri.Trigger,{"data-slot":"drawer-trigger",...e})}function Nk({...e}){return h.jsx(Ri.Portal,{"data-slot":"drawer-portal",...e})}function jK({...e}){return h.jsx(Ri.Close,{"data-slot":"drawer-close",...e})}function Pk({className:e,...t}){return h.jsx(Ri.Overlay,{"data-slot":"drawer-overlay",className:F("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function LK({className:e,children:t,...n}){return h.jsxs(Nk,{"data-slot":"drawer-portal",children:[h.jsx(Pk,{}),h.jsxs(Ri.Content,{"data-slot":"drawer-content",className:F("ui:group/drawer-content ui:bg-background ui:fixed ui:flex ui:h-auto ui:flex-col ui:rounded-t-[10px] ui:z-100 ui:mt-24","ui:data-[vaul-drawer-direction=top]:inset-x-0 ui:data-[vaul-drawer-direction=top]:top-0 ui:data-[vaul-drawer-direction=top]:mb-24 ui:data-[vaul-drawer-direction=top]:max-h-[80vh] ui:data-[vaul-drawer-direction=top]:rounded-b-lg ui:data-[vaul-drawer-direction=top]:border-b","ui:data-[vaul-drawer-direction=bottom]:inset-x-0 ui:data-[vaul-drawer-direction=bottom]:bottom-0 ui:data-[vaul-drawer-direction=bottom]:mt-24 ui:data-[vaul-drawer-direction=bottom]:max-h-[80vh] ui:data-[vaul-drawer-direction=bottom]:rounded-t-lg ui:data-[vaul-drawer-direction=bottom]:border-t","ui:data-[vaul-drawer-direction=right]:inset-y-0 ui:data-[vaul-drawer-direction=right]:right-0 ui:data-[vaul-drawer-direction=right]:w-3/4 ui:data-[vaul-drawer-direction=right]:border-l ui:data-[vaul-drawer-direction=right]:sm:max-w-sm","ui:data-[vaul-drawer-direction=left]:inset-y-0 ui:data-[vaul-drawer-direction=left]:left-0 ui:data-[vaul-drawer-direction=left]:w-3/4 ui:data-[vaul-drawer-direction=left]:border-r ui:data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[h.jsx("div",{className:"ui:bg-muted ui:mx-auto ui:mt-4 ui:hidden ui:h-2 ui:w-[100px] ui:shrink-0 ui:rounded-full ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function FK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-header",className:F("ui:flex ui:flex-col ui:gap-0.5 ui:p-4 ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center ui:group-data-[vaul-drawer-direction=top]/drawer-content:text-center ui:md:gap-1.5 ui:md:text-left",e),...t})}function BK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-footer",className:F("ui:mt-auto ui:flex ui:flex-col ui:gap-2 ui:p-4",e),...t})}function VK({className:e,...t}){return h.jsx(Ri.Title,{"data-slot":"drawer-title",className:F("ui:text-foreground ui:font-semibold",e),...t})}function $K({className:e,...t}){return h.jsx(Ri.Description,{"data-slot":"drawer-description",className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function ox({...e}){return h.jsx(b3,{"data-slot":"dropdown-menu",...e})}function GK({...e}){return h.jsx(ZO,{"data-slot":"dropdown-menu-portal",...e})}function ix({...e}){return h.jsx(v3,{"data-slot":"dropdown-menu-trigger",...e})}function sx({className:e,sideOffset:t=4,...n}){return h.jsx(ZO,{children:h.jsx(y3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:max-h-(--radix-dropdown-menu-content-available-height) ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-x-hidden ui:overflow-y-auto ui:rounded-md ui:border ui:p-1 ui:shadow-md",e),...n})})}function HK({...e}){return h.jsx(x3,{"data-slot":"dropdown-menu-group",...e})}function _k({className:e,inset:t,variant:n="default",...r}){return h.jsx(C3,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[variant=destructive]:text-destructive ui:data-[variant=destructive]:focus:bg-destructive/10 ui:dark:data-[variant=destructive]:focus:bg-destructive/20 ui:data-[variant=destructive]:focus:text-destructive ui:data-[variant=destructive]:*:[svg]:!text-destructive ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r})}function yv({className:e,children:t,checked:n,...r}){return h.jsxs(S3,{"data-slot":"dropdown-menu-checkbox-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(JO,{children:h.jsx(_e.CheckIcon,{className:"ui:size-4"})})}),t]})}function WK({...e}){return h.jsx(E3,{"data-slot":"dropdown-menu-radio-group",...e})}function zK({className:e,children:t,...n}){return h.jsxs(I3,{"data-slot":"dropdown-menu-radio-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(JO,{children:h.jsx(_e.CircleIcon,{className:"ui:size-2 ui:fill-current"})})}),t]})}function qK({className:e,inset:t,...n}){return h.jsx(w3,{"data-slot":"dropdown-menu-label","data-inset":t,className:F("ui:px-2 ui:py-1.5 ui:text-sm ui:font-medium ui:data-[inset]:pl-8",e),...n})}function UK({className:e,...t}){return h.jsx(R3,{"data-slot":"dropdown-menu-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function YK({className:e,...t}){return h.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:F("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}function XK({...e}){return h.jsx(A3,{"data-slot":"dropdown-menu-sub",...e})}function ZK({className:e,inset:t,children:n,...r}){return h.jsxs(T3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[state=open]:bg-accent ui:data-[state=open]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(_e.ChevronRightIcon,{className:"ui:ml-auto ui:size-4"})]})}function JK({className:e,...t}){return h.jsx(O3,{"data-slot":"dropdown-menu-sub-content",className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-hidden ui:rounded-md ui:border ui:p-1 ui:shadow-lg",e),...t})}function KK({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:F("ui:flex ui:min-w-0 ui:flex-1 ui:flex-col ui:items-center ui:justify-center ui:gap-6 ui:rounded-lg ui:border-dashed ui:p-6 ui:text-center ui:text-balance ui:md:p-12",e),...t})}function QK({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:F("ui:flex ui:max-w-sm ui:flex-col ui:items-center ui:gap-2 ui:text-center",e),...t})}const eQ=Si("ui:flex ui:shrink-0 ui:items-center ui:justify-center ui:mb-2 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0",{variants:{variant:{default:"ui:bg-transparent",icon:"ui:bg-muted ui:text-foreground ui:flex ui:size-10 ui:shrink-0 ui:items-center ui:justify-center ui:rounded-lg ui:[&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function tQ({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:F(eQ({variant:t,className:e})),...n})}function nQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:F("ui:text-lg ui:font-medium ui:tracking-tight",e),...t})}function rQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:F("ui:text-muted-foreground ui:[&>a:hover]:text-primary ui:text-sm/relaxed ui:[&>a]:underline ui:[&>a]:underline-offset-4",e),...t})}function oQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-content",className:F("ui:flex ui:w-full ui:max-w-sm ui:min-w-0 ui:flex-col ui:items-center ui:gap-4 ui:text-sm ui:text-balance",e),...t})}function Mk({message:e,className:t}){return h.jsx("p",{className:F("ui:text-red-500 ui:text-xs ui:mt-2 ui:has-error",t),children:e})}const Dk=b.createContext(null),kk=b.createContext(null),kf=()=>{const e=b.useContext(Dk),t=b.useContext(kk);if(!e)throw new Error("useFormField must be used within <FormField>");if(!t)throw new Error("useFormField must be used within <FormItem>");const{id:n}=t,{name:r,error:o}=e;return{name:r,error:o,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`}},Br=e=>h.jsx(ur.Controller,{...e,render:t=>h.jsx(Dk.Provider,{value:{name:e.name,error:t.fieldState.error},children:e.render?.(t)})});function dr({className:e,...t}){const n=b.useId();return h.jsx(kk.Provider,{value:{id:n},children:h.jsx("div",{"data-slot":"form-item",className:F("ui:grid ui:gap-2",e),...t})})}function oo({className:e,required:t=!1,...n}){const{error:r,formItemId:o}=kf();return h.jsxs(gr,{"data-slot":"form-label","data-error":!!r,htmlFor:o,className:F("ui:text-sm",r?"ui:text-destructive":"ui:text-black-950",e),...n,children:[n.children,t&&h.jsx("span",{className:"ui:text-destructive ml-1",children:"*"})]})}function fr(e){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=kf();return h.jsx(Bo,{"data-slot":"form-control",id:n,"aria-invalid":!!t,"aria-describedby":t?`${r} ${o}`:r,...e})}function po({className:e,...t}){const{formDescriptionId:n}=kf();return h.jsx("p",{"data-slot":"form-description",id:n,className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function Vr({className:e,showErrorPlaceholder:t,...n}){const{error:r,formMessageId:o}=kf(),i=r?String(r.message??""):n.children;return i?h.jsx("p",{"data-slot":"form-message",id:o,className:F("ui:text-destructive ui:text-sm",e),...n,children:i}):t?h.jsx("p",{className:"ui:h-4"}):null}const iQ=({name:e,control:t,formClassName:n,...r})=>{const o=ur.useFormContext(),i=t??o?.control;if(!i)throw new Error("FormCheckbox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:i,name:e,render:({field:s})=>h.jsxs(dr,{className:n,children:[h.jsx(fr,{children:h.jsx(zM,{...s,checked:!!s.value,onCheckedChange:s.onChange,...r})}),h.jsx(Vr,{})]})})};function ax({delayDuration:e=0,...t}){return h.jsx(JH,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function lx({...e}){return h.jsx(ax,{children:h.jsx(KH,{"data-slot":"tooltip",...e})})}function ux({...e}){return h.jsx(QH,{"data-slot":"tooltip-trigger",...e})}function jf({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(n_,{children:h.jsxs(r_,{"data-slot":"tooltip-content",sideOffset:t,className:F("ui:bg-foreground ui:text-background ui:animate-in ui:fade-in-0 ui:zoom-in-95 ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=closed]:zoom-out-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-fit ui:origin-(--radix-tooltip-content-transform-origin) ui:rounded-md ui:px-3 ui:py-1.5 ui:text-xs ui:text-balance",e),...r,children:[n,h.jsx(e9,{className:"ui:bg-foreground ui:fill-foreground ui:z-50 ui:size-2.5 ui:translate-y-[calc(-50%-2px)] ui:rotate-45 ui:rounded-[2px]"})]})})}const jk=b.forwardRef(({children:e,...t},n)=>h.jsx(n_,{children:h.jsx(jf,{ref:n,...t,children:e})}));jk.displayName=r_.displayName;const ya=({trigger:e,content:t,asChild:n=!0,wrapTrigger:r=!0,triggerClassName:o="",contentClassName:i="ui:max-w-sm",disableContent:s=!1,isPortal:a=!1})=>s?e:h.jsxs(lx,{children:[h.jsx(ux,{asChild:n,children:r?h.jsx("div",{className:F("ui:truncate",o),children:e}):e}),a?h.jsx(jk,{className:i,children:t}):h.jsx(jf,{className:i,children:t})]}),sQ=({name:e,label:t,placeholder:n,items:r=[],description:o,multiple:i=!1,emptyMessage:s="No results found",containerClassName:a,hasClearButton:l=!1,hasAllOption:u=!1,allOptionLabel:c="All",disabled:d=!1,tooltipContent:f,control:p,inputMode:g="input"})=>{const m=ur.useFormContext(),v=p??m?.control;if(!v)throw new Error("FormCombobox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:v,name:e,render:({field:y})=>h.jsxs(dr,{className:F("ui:flex ui:flex-col",a),children:[t&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!f}),children:[t,f&&h.jsx(ya,{triggerClassName:"ui:order-last",content:f,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(tx,{items:r,multiple:i,value:y.value,onValueChange:y.onChange,placeholder:n,emptyMessage:s,disabled:d,hasClearButton:l,hasAllOption:u,allOptionLabel:c,inputMode:g}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},aQ=({name:e,control:t,disabledCondition:n=!1,label:r,placeholder:o,description:i,containerClassName:s,triggerClassName:a,showErrorPlaceholder:l})=>{const u=ur.useFormContext(),c=t??u?.control;if(!c)throw new Error("FormDatePicker must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(dr,{className:F("ui:flex ui:flex-col",s),children:[h.jsx(_r,{children:h.jsx(rn,{condition:!!r,children:h.jsx(oo,{children:r})})}),h.jsxs(nx,{children:[h.jsx(Mf,{asChild:!0,children:h.jsx(fr,{children:h.jsxs(on,{variant:"outline",className:F("ui:w-[240px] ui:pl-3 ui:text-left ui:font-normal",!d.value&&"ui:text-muted-foreground",a),children:[d.value?ti(new Date(d.value),"dd/MM/yyyy"):h.jsx("span",{children:o}),h.jsx(_e.CalendarIcon,{className:"ui:ml-auto ui:h-4 ui:w-4 ui:opacity-50"})]})})}),h.jsx(Df,{className:"ui:w-auto ui:p-0",align:"start",children:h.jsx(e0,{mode:"single",selected:d.value?new Date(d.value):void 0,onSelect:f=>{f&&d.onChange(f)},disabled:n,initialFocus:!0})})]}),h.jsx(_r,{children:h.jsx(rn,{condition:!!i,children:h.jsx(po,{children:i})})}),h.jsx(Vr,{showErrorPlaceholder:l})]})})},lQ=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},uQ=e=>e.type.startsWith("image/"),cQ=({uploadedFile:e,onRemove:t})=>h.jsx("div",{className:"ui:p-3 ui:bg-muted/50 ui:border ui:border-border ui:rounded-lg",children:h.jsxs("div",{className:"ui:flex ui:items-center ui:justify-between ui:gap-3",children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-3 ui:min-w-0",children:[uQ(e.file)?h.jsx("img",{src:e.url,alt:e.file.name,className:"ui:shrink-0 ui:w-10 ui:h-10 ui:object-cover ui:rounded-md"}):h.jsx("div",{className:"ui:shrink-0 ui:p-2 ui:bg-primary/10 ui:rounded-md",children:h.jsx(_e.FileText,{size:20,className:"ui:text-primary"})}),h.jsxs("div",{className:"ui:min-w-0",children:[h.jsx("p",{className:"ui:text-sm ui:font-medium ui:text-foreground ui:truncate",children:e.file.name}),h.jsx("p",{className:"ui:text-xs ui:text-muted-foreground",children:lQ(e.file.size)})]})]}),h.jsx(Do,{variant:"ghost",size:"sm",isIconOnly:!0,onClick:t,icon:h.jsx(_e.X,{size:16}),className:F("ui:shrink-0 ui:text-muted-foreground","ui:hover:text-destructive ui:hover:bg-destructive/10")})]})}),Lk=({name:e,control:t,label:n,uploadButtonLabel:r="Upload File",uploadingLabel:o="Uploading...",uploadFailedMessage:i="Upload failed",description:s,accept:a="*",disabled:l=!1,multiple:u=!1,containerClassName:c,tooltipContent:d,hasRequiredIndicator:f=!1,onUpload:p})=>{const g=ur.useFormContext(),m=t??g?.control;if(!m)throw new Error("FormFileUpload must be used within a FormProvider or receive a control prop");const v=N.useRef(null),[y,x]=N.useState(!1),w=async(S,R,I)=>{const T=S.target.files;if(T?.length){x(!0);try{if(u){const _=Array.from(T),$=[];for(const M of _){const O=p?await p(M):URL.createObjectURL(M);$.push({file:M,url:O})}const A=Array.isArray(I)?I:[];R([...A,...$])}else{const _=T[0],$=p?await p(_):URL.createObjectURL(_);R({file:_,url:$})}}catch(_){const $=_ instanceof Error?_.message:i;Jv.toast.error($)}finally{x(!1),v.current&&(v.current.value="")}}},C=(S,R,I)=>{if(u&&Array.isArray(R)&&I){const T=R.filter(_=>_!==I);S(T.length>0?T:null)}else S(null);v.current&&(v.current.value="")};return h.jsx(Br,{control:m,name:e,render:({field:S})=>{const R=S.value,I=u?Array.isArray(R)?R:[]:R&&"file"in R?[R]:[];return h.jsxs(dr,{className:F("ui:w-full",c),children:[n&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!d}),children:[n,f&&h.jsx("span",{children:"*"}),d&&h.jsx(ya,{content:d,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:text-muted-foreground ui:cursor-pointer"})})]}),h.jsx(fr,{children:h.jsxs("div",{className:"ui:space-y-3",children:[h.jsxs("div",{className:"ui:relative ui:inline-block",children:[h.jsx("input",{ref:v,type:"file",accept:a,multiple:u,onChange:T=>w(T,S.onChange,R),disabled:l||y,className:F("ui:absolute ui:inset-0 ui:w-full ui:h-full ui:opacity-0 ui:cursor-pointer","ui:disabled:cursor-not-allowed")}),h.jsx(Do,{variant:"outline",label:y?o:r,icon:y?h.jsx(_e.Loader2,{size:16,className:"ui:animate-spin"}):h.jsx(_e.Upload,{size:16}),disabled:l||y})]}),I.length>0&&h.jsx("div",{className:"ui:space-y-2",children:I.map((T,_)=>h.jsx(cQ,{uploadedFile:T,onRemove:()=>C(S.onChange,R,T)},`${T.file.name}-${T.file.size}-${_}`))})]})}),h.jsx(Vr,{}),s&&h.jsx(po,{children:s})]})}})};Lk.displayName="FormFileUpload";const cx=N.forwardRef(({name:e,label:t,labelVariant:n,type:r,value:o,onChange:i,description:s="",placeholder:a,className:l,inputClassName:u,isReadOnly:c=!1,hasRequiredIndicator:d=!1,...f},p)=>h.jsxs("article",{className:l,children:[t&&h.jsxs(gr,{variant:n,className:"ui:mb-2",children:[t,d&&h.jsx("span",{children:"*"})]}),h.jsx(vu,{ref:p,"data-test-id":e,placeholder:a,value:o,type:r,onChange:i,className:F({"ui:pointer-events-none ui:opacity-30":c},u),...f}),s&&h.jsx(If,{description:s})]})),dQ=({label:e,containerClassName:t,inputClassName:n,name:r,description:o,placeholder:i="",tooltipContent:s,hasRequiredIndicator:a=!1,control:l,...u})=>{const c=ur.useFormContext(),d=l??c?.control;if(!d)throw new Error("FormInput must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:d,name:r,render:({field:f})=>h.jsxs(dr,{className:F("ui:w-full",t),children:[h.jsxs(oo,{className:s?"ui:flex ui:items-center ui:gap-2":void 0,children:[e,a&&h.jsx("span",{children:"*"}),s&&h.jsx(ya,{content:s,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(fr,{children:h.jsx(cx,{...f,...u,placeholder:i,inputClassName:F(n)})}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},fQ=({label:e,name:t,containerClassName:n,description:r,placeholder:o,tooltipContent:i,control:s,hasRequiredIndicator:a=!1,...l})=>{const u=ur.useFormContext(),c=s??u?.control;if(!c)throw new Error("FormPassword must be used within a FormProvider or receive a control prop");const[d,f]=N.useState(!1),p=()=>{f(g=>!g)};return h.jsx(Br,{control:c,name:t,render:({field:g})=>h.jsxs(dr,{className:F("ui:w-full",n),children:[e&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!i}),children:[e,a&&h.jsx("span",{children:"*"}),i&&h.jsx(ya,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(fr,{children:h.jsxs("div",{className:"ui:relative",children:[h.jsx(cx,{...g,...l,type:d?"text":"password",placeholder:o,hasRequiredIndicator:a,inputClassName:"pr-8"}),h.jsx("button",{type:"button",onClick:p,className:"ui:absolute ui:right-3 ui:top-1/2 ui:-translate-y-1/2 ui:text-muted-foreground ui:hover:text-foreground ui:transition-colors",tabIndex:-1,children:d?h.jsx(_e.EyeOff,{size:16,className:"ui:cursor-pointer"}):h.jsx(_e.Eye,{size:16,className:"ui:cursor-pointer"})})]})}),r&&h.jsx(po,{children:r}),h.jsx(Vr,{})]})})};function Fk({className:e,...t}){return h.jsx(aG,{"data-slot":"radio-group",className:F("ui:grid ui:gap-3",e),...t})}function Bk({className:e,...t}){return h.jsx(lG,{"data-slot":"radio-group-item",className:F("ui:p-0! ui:aspect-square ui:h-4 ui:w-4 ui:rounded-full ui:border ui:border-solid ui:border-primary ui:text-primary ui:bg-transparent ui:hover:bg-transparent ui:ring-offset-background ui:focus:outline-none ui:focus-visible:ring-2 ui:focus-visible:ring-ring ui:focus-visible:ring-offset-2 ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:transition-none",e),...t,children:h.jsx(uG,{"data-slot":"radio-group-indicator",className:"ui:relative ui:flex ui:items-center ui:justify-center",children:h.jsx(_e.CircleIcon,{className:"ui:fill-primary ui:absolute ui:top-1/2 ui:left-1/2 ui:size-2 ui:-translate-x-1/2 ui:-translate-y-1/2"})})})}const pQ=({name:e,label:t,items:n,control:r,containerClassName:o,itemClassName:i,itemLabelClassName:s,selectedClassName:a,description:l})=>{const u=ur.useFormContext(),c=r??u?.control;if(!c)throw new Error("FormRadio must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(dr,{className:F("ui:space-y-3",o),children:[t&&h.jsx(oo,{children:t}),h.jsx(fr,{children:h.jsx(Fk,{onValueChange:d.onChange,defaultValue:d.value,className:"ui:flex ui:flex-col ui:space-y-1",children:n.map(f=>h.jsxs(dr,{className:F("ui:flex ui:items-center ui:space-y-0",i,d.value===f.value&&a),children:[h.jsx(fr,{children:h.jsx(Bk,{value:f.value})}),h.jsx(oo,{className:F("ui:font-normal",s),children:f.label})]},f.value))})}),h.jsx(Vr,{}),l&&h.jsx(po,{children:l})]})})};function Vk({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const s=b.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return h.jsxs(xH,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:F("ui:relative ui:flex ui:w-full ui:touch-none ui:items-center ui:select-none ui:data-[disabled]:opacity-50 ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:min-h-44 ui:data-[orientation=vertical]:w-auto ui:data-[orientation=vertical]:flex-col",e),...i,children:[h.jsx(wH,{"data-slot":"slider-track",className:F("ui:bg-muted ui:relative ui:grow ui:overflow-hidden ui:rounded-full ui:data-[orientation=horizontal]:h-1.5 ui:data-[orientation=horizontal]:w-full ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:w-1.5"),children:h.jsx(CH,{"data-slot":"slider-range",className:F("ui:bg-primary ui:absolute ui:data-[orientation=horizontal]:h-full ui:data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(a,l)=>h.jsx(SH,{"data-slot":"slider-thumb",className:"ui:border-primary ui:ring-ring/50 ui:block ui:size-4 ui:shrink-0 ui:rounded-full ui:border ui:bg-white ui:shadow-sm ui:transition-[color,box-shadow] ui:hover:ring-4 ui:focus-visible:ring-4 ui:focus-visible:outline-hidden ui:disabled:pointer-events-none ui:disabled:opacity-50"},l))]})}const hQ=({name:e,control:t,label:n,description:r,min:o=0,max:i=100,step:s=1,leftLabel:a,rightLabel:l,showLabels:u=!0,complementaryField:c,onValueChange:d,containerClassName:f,labelClassName:p,showErrorPlaceholder:g=!1,tooltipContent:m,...v})=>{const y=ur.useFormContext(),x=t??y?.control;if(!x)throw new Error("FormSlider must be used within a FormProvider or receive a control prop");const w=N.useRef(!1),C=ur.useWatch({control:x,name:e});return h.jsx(Br,{control:x,name:e,render:({field:S})=>{const R=T=>{if(w.current)return;const _=T[0];w.current=!0,S.onChange(String(_)),c&&y?.setValue&&y.setValue(c,String(i-_),{shouldValidate:!0}),d&&d(_),setTimeout(()=>{w.current=!1},0)},I=Number(C)||o+(i-o)/2;return h.jsxs(dr,{className:F("ui:w-full",f),children:[h.jsx(_r,{children:h.jsx(rn,{condition:!!n,children:h.jsxs(oo,{className:F(p,{"ui:flex ui:items-center ui:gap-2":!!m}),children:[n,m&&h.jsx(ya,{content:m,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,color:"#737373",className:"ui:cursor-pointer"})})]})})}),h.jsx(fr,{children:h.jsxs("div",{className:"ui:space-y-2",children:[h.jsx(Vk,{value:[I],onValueChange:R,min:o,max:i,step:s,className:"ui:w-full",...v}),u&&h.jsxs("div",{className:"ui:flex ui:justify-between ui:text-sm ui:text-gray-600",children:[a&&h.jsxs("span",{children:[a,": ",I,i===100?"%":""]}),l&&h.jsxs("span",{children:[l,": ",c?i-I:I,i===100?"%":""]})]})]})}),h.jsx(_r,{children:h.jsx(rn,{condition:!!r,children:h.jsx(po,{className:"ui:text-xs",children:r})})}),h.jsx(Vr,{showErrorPlaceholder:g})]})}})};function $k({className:e,...t}){return h.jsx(TH,{"data-slot":"switch",className:F("ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",e),...t,children:h.jsx(OH,{"data-slot":"switch-thumb",className:F("ui:bg-background ui:dark:data-[state=unchecked]:bg-foreground ui:dark:data-[state=checked]:bg-primary-foreground ui:pointer-events-none ui:block ui:size-4 ui:rounded-full ui:ring-0 ui:transition-transform ui:data-[state=checked]:translate-x-[calc(100%-2px)] ui:data-[state=unchecked]:translate-x-0")})})}const Gk=({label:e,name:t,...n})=>h.jsxs("article",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx($k,{id:t,...n}),h.jsx(gr,{htmlFor:t,children:e})]}),gQ=({name:e,label:t,description:n,control:r,...o})=>{const i=ur.useFormContext(),s=r??i?.control;if(!s)throw new Error("FormSwitch must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:s,name:e,render:({field:a})=>h.jsxs(dr,{children:[h.jsx(fr,{children:h.jsx(Gk,{...a,...o,label:t})}),h.jsx(Vr,{}),n&&h.jsx(po,{children:n})]})})},Hk=({textAreaClassName:e,value:t,onChange:n,label:r,...o})=>h.jsxs("article",{children:[r&&h.jsx(gr,{className:"ui:mb-2 ui:block",children:r}),h.jsx(pk,{className:F("ui:w-full",e),value:t,onChange:n,...o})]}),mQ=({label:e,name:t,description:n,placeholder:r,containerClassName:o,control:i,...s})=>{const a=ur.useFormContext(),l=i??a?.control;if(!l)throw new Error("FormTextarea must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:l,name:t,render:({field:u})=>h.jsxs(dr,{className:F("ui:w-full",o),children:[h.jsx(oo,{children:e}),h.jsx(fr,{children:h.jsx(Hk,{placeholder:r,...u,...s})}),n&&h.jsx(po,{children:n}),h.jsx(Vr,{})]})})};function bQ({...e}){return h.jsx(L3,{"data-slot":"hover-card",...e})}function vQ({...e}){return h.jsx(F3,{"data-slot":"hover-card-trigger",...e})}function yQ({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(B3,{"data-slot":"hover-card-portal",children:h.jsx(V3,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-64 ui:origin-(--radix-hover-card-content-transform-origin) ui:rounded-md ui:border ui:p-4 ui:shadow-md ui:outline-hidden",e),...r})})}function xQ({name:e,className:t,...n}){return h.jsx("i",{className:F(`icon-${e}`,t),...n,children:h.jsxs("span",{className:"ui:for-screenreader-only",children:[e," icon"]})})}var wQ=Object.defineProperty,CQ=Object.defineProperties,SQ=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,Wk=Object.prototype.hasOwnProperty,zk=Object.prototype.propertyIsEnumerable,sI=(e,t,n)=>t in e?wQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EQ=(e,t)=>{for(var n in t||(t={}))Wk.call(t,n)&&sI(e,n,t[n]);if(md)for(var n of md(t))zk.call(t,n)&&sI(e,n,t[n]);return e},IQ=(e,t)=>CQ(e,SQ(t)),RQ=(e,t)=>{var n={};for(var r in e)Wk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&md)for(var r of md(e))t.indexOf(r)<0&&zk.call(e,r)&&(n[r]=e[r]);return n};function AQ(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function TQ(e){let t=b.useRef();return b.useEffect(()=>{t.current=e}),t.current}var OQ=18,qk=40,NQ=`${qk}px`,PQ=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function _Q({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[o,i]=b.useState(!1),[s,a]=b.useState(!1),[l,u]=b.useState(!1),c=b.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&o&&s,[o,s,n]),d=b.useCallback(()=>{let f=e.current,p=t.current;if(!f||!p||l||n==="none")return;let g=f,m=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,y=m-OQ,x=v;document.querySelectorAll(PQ).length===0&&document.elementFromPoint(y,x)===f||(i(!0),u(!0))},[e,t,l,n]);return b.useEffect(()=>{let f=e.current;if(!f||n==="none")return;function p(){let m=window.innerWidth-f.getBoundingClientRect().right;a(m>=qk)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,n]),b.useEffect(()=>{let f=r||document.activeElement===t.current;if(n==="none"||!f)return;let p=setTimeout(d,0),g=setTimeout(d,2e3),m=setTimeout(d,5e3),v=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(m),clearTimeout(v)}},[t,r,n,d]),{hasPWMBadge:o,willPushPWMBadge:c,PWM_BADGE_SPACE_WIDTH:NQ}}var MQ=b.createContext({}),Uk=b.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,maxLength:i,textAlign:s="left",pattern:a,placeholder:l,inputMode:u="numeric",onComplete:c,pushPasswordManagerStrategy:d="increase-width",pasteTransformer:f,containerClassName:p,noScriptCSSFallback:g=DQ,render:m,children:v}=n,y=RQ(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),x,w,C,S,R;let[I,T]=b.useState(typeof y.defaultValue=="string"?y.defaultValue:""),_=r??I,$=TQ(_),A=b.useCallback(k=>{o?.(k),T(k)},[o]),M=b.useMemo(()=>a?typeof a=="string"?new RegExp(a):a:null,[a]),O=b.useRef(null),B=b.useRef(null),j=b.useRef({value:_,onChange:A,isIOS:typeof window<"u"&&((w=(x=window?.CSS)==null?void 0:x.supports)==null?void 0:w.call(x,"-webkit-touch-callout","none"))}),D=b.useRef({prev:[(C=O.current)==null?void 0:C.selectionStart,(S=O.current)==null?void 0:S.selectionEnd,(R=O.current)==null?void 0:R.selectionDirection]});b.useImperativeHandle(t,()=>O.current,[]),b.useEffect(()=>{let k=O.current,ie=B.current;if(!k||!ie)return;j.current.value!==k.value&&j.current.onChange(k.value),D.current.prev=[k.selectionStart,k.selectionEnd,k.selectionDirection];function Y(){if(document.activeElement!==k){W(null),K(null);return}let re=k.selectionStart,fe=k.selectionEnd,de=k.selectionDirection,ve=k.maxLength,we=k.value,Se=D.current.prev,Ye=-1,at=-1,Xe;if(we.length!==0&&re!==null&&fe!==null){let gt=re===fe,ct=re===we.length&&we.length<ve;if(gt&&!ct){let ot=re;if(ot===0)Ye=0,at=1,Xe="forward";else if(ot===ve)Ye=ot-1,at=ot,Xe="backward";else if(ve>1&&we.length>1){let mt=0;if(Se[0]!==null&&Se[1]!==null){Xe=ot<Se[1]?"backward":"forward";let Nt=Se[0]===Se[1]&&Se[0]<ve;Xe==="backward"&&!Nt&&(mt=-1)}Ye=mt+ot,at=mt+ot+1}}Ye!==-1&&at!==-1&&Ye!==at&&O.current.setSelectionRange(Ye,at,Xe)}let Ue=Ye!==-1?Ye:re,rt=at!==-1?at:fe,et=Xe??de;W(Ue),K(rt),D.current.prev=[Ue,rt,et]}if(document.addEventListener("selectionchange",Y,{capture:!0}),Y(),document.activeElement===k&&H(!0),!document.getElementById("input-otp-style")){let re=document.createElement("style");if(re.id="input-otp-style",document.head.appendChild(re),re.sheet){let fe="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Wa(re.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Wa(re.sheet,`[data-input-otp]:autofill { ${fe} }`),Wa(re.sheet,`[data-input-otp]:-webkit-autofill { ${fe} }`),Wa(re.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Wa(re.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let le=()=>{ie&&ie.style.setProperty("--root-height",`${k.clientHeight}px`)};le();let pe=new ResizeObserver(le);return pe.observe(k),()=>{document.removeEventListener("selectionchange",Y,{capture:!0}),pe.disconnect()}},[]);let[V,G]=b.useState(!1),[z,H]=b.useState(!1),[ne,W]=b.useState(null),[J,K]=b.useState(null);b.useEffect(()=>{AQ(()=>{var k,ie,Y,le;(k=O.current)==null||k.dispatchEvent(new Event("input"));let pe=(ie=O.current)==null?void 0:ie.selectionStart,re=(Y=O.current)==null?void 0:Y.selectionEnd,fe=(le=O.current)==null?void 0:le.selectionDirection;pe!==null&&re!==null&&(W(pe),K(re),D.current.prev=[pe,re,fe])})},[_,z]),b.useEffect(()=>{$!==void 0&&_!==$&&$.length<i&&_.length===i&&c?.(_)},[i,c,$,_]);let U=_Q({containerRef:B,inputRef:O,pushPasswordManagerStrategy:d,isFocused:z}),oe=b.useCallback(k=>{let ie=k.currentTarget.value.slice(0,i);if(ie.length>0&&M&&!M.test(ie)){k.preventDefault();return}typeof $=="string"&&ie.length<$.length&&document.dispatchEvent(new Event("selectionchange")),A(ie)},[i,A,$,M]),X=b.useCallback(()=>{var k;if(O.current){let ie=Math.min(O.current.value.length,i-1),Y=O.current.value.length;(k=O.current)==null||k.setSelectionRange(ie,Y),W(ie),K(Y)}H(!0)},[i]),te=b.useCallback(k=>{var ie,Y;let le=O.current;if(!f&&(!j.current.isIOS||!k.clipboardData||!le))return;let pe=k.clipboardData.getData("text/plain"),re=f?f(pe):pe;k.preventDefault();let fe=(ie=O.current)==null?void 0:ie.selectionStart,de=(Y=O.current)==null?void 0:Y.selectionEnd,ve=(fe!==de?_.slice(0,fe)+re+_.slice(de):_.slice(0,fe)+re+_.slice(fe)).slice(0,i);if(ve.length>0&&M&&!M.test(ve))return;le.value=ve,A(ve);let we=Math.min(ve.length,i-1),Se=ve.length;le.setSelectionRange(we,Se),W(we),K(Se)},[i,A,M,_]),Q=b.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),se=b.useMemo(()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:s,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,s]),ae=b.useMemo(()=>b.createElement("input",IQ(EQ({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":_.length===0||void 0,"data-input-otp-mss":ne,"data-input-otp-mse":J,inputMode:u,pattern:M?.source,"aria-placeholder":l,style:se,maxLength:i,value:_,ref:O,onPaste:k=>{var ie;te(k),(ie=y.onPaste)==null||ie.call(y,k)},onChange:oe,onMouseOver:k=>{var ie;G(!0),(ie=y.onMouseOver)==null||ie.call(y,k)},onMouseLeave:k=>{var ie;G(!1),(ie=y.onMouseLeave)==null||ie.call(y,k)},onFocus:k=>{var ie;X(),(ie=y.onFocus)==null||ie.call(y,k)},onBlur:k=>{var ie;H(!1),(ie=y.onBlur)==null||ie.call(y,k)}})),[oe,X,te,u,se,i,J,ne,y,M?.source,_]),L=b.useMemo(()=>({slots:Array.from({length:i}).map((k,ie)=>{var Y;let le=z&&ne!==null&&J!==null&&(ne===J&&ie===ne||ie>=ne&&ie<J),pe=_[ie]!==void 0?_[ie]:null,re=_[0]!==void 0?null:(Y=l?.[ie])!=null?Y:null;return{char:pe,placeholderChar:re,isActive:le,hasFakeCaret:le&&pe===null}}),isFocused:z,isHovering:!y.disabled&&V}),[z,V,i,J,ne,y.disabled,_]),Z=b.useMemo(()=>m?m(L):b.createElement(MQ.Provider,{value:L},v),[v,L,m]);return b.createElement(b.Fragment,null,g!==null&&b.createElement("noscript",null,b.createElement("style",null,g)),b.createElement("div",{ref:B,"data-input-otp-container":!0,style:Q,className:p},Z,b.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ae)))});Uk.displayName="Input";function Wa(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var DQ=`
|
|
89
89
|
[data-input-otp] {
|
package/dist/segmentify-ui.js
CHANGED
|
@@ -26864,7 +26864,7 @@ function QE({
|
|
|
26864
26864
|
showClear: o = !1,
|
|
26865
26865
|
...i
|
|
26866
26866
|
}) {
|
|
26867
|
-
return /* @__PURE__ */ ne(nJ, { className: F("ui:w-auto", e), children: [
|
|
26867
|
+
return /* @__PURE__ */ ne(nJ, { className: F("ui:w-auto ui:shrink-0", e), children: [
|
|
26868
26868
|
/* @__PURE__ */ v(ew, { render: /* @__PURE__ */ v(sJ, { disabled: n }), ...i }),
|
|
26869
26869
|
/* @__PURE__ */ ne(oJ, { align: "inline-end", children: [
|
|
26870
26870
|
r && /* @__PURE__ */ v(
|
|
@@ -26908,7 +26908,7 @@ function uJ({
|
|
|
26908
26908
|
"data-slot": "combobox-content",
|
|
26909
26909
|
"data-chips": !!i,
|
|
26910
26910
|
className: F(
|
|
26911
|
-
"ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:max-h-96 ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",
|
|
26911
|
+
"ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:flex ui:min-h-0 ui:max-h-96 ui:flex-col ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",
|
|
26912
26912
|
e
|
|
26913
26913
|
),
|
|
26914
26914
|
...s
|
|
@@ -26922,10 +26922,7 @@ function cJ({ className: e, ...t }) {
|
|
|
26922
26922
|
XD,
|
|
26923
26923
|
{
|
|
26924
26924
|
"data-slot": "combobox-list",
|
|
26925
|
-
className: F(
|
|
26926
|
-
"ui:max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] ui:scroll-py-1 ui:overflow-y-auto ui:p-1 ui:data-empty:p-0",
|
|
26927
|
-
e
|
|
26928
|
-
),
|
|
26925
|
+
className: F("ui:min-h-0 ui:flex-1 ui:overflow-y-auto ui:scroll-py-1 ui:p-1 ui:data-empty:p-0", e),
|
|
26929
26926
|
...t
|
|
26930
26927
|
}
|
|
26931
26928
|
);
|
|
@@ -26936,7 +26933,7 @@ function dJ({ className: e, children: t, ...n }) {
|
|
|
26936
26933
|
{
|
|
26937
26934
|
"data-slot": "combobox-item",
|
|
26938
26935
|
className: F(
|
|
26939
|
-
"ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-
|
|
26936
|
+
"ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",
|
|
26940
26937
|
e
|
|
26941
26938
|
),
|
|
26942
26939
|
...n,
|
|
@@ -26960,7 +26957,7 @@ function fJ({ className: e, ...t }) {
|
|
|
26960
26957
|
{
|
|
26961
26958
|
"data-slot": "combobox-empty",
|
|
26962
26959
|
className: F(
|
|
26963
|
-
"ui:
|
|
26960
|
+
"ui:hidden ui:w-full ui:shrink-0 ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:text-muted-foreground ui:group-data-empty/combobox-content:flex",
|
|
26964
26961
|
e
|
|
26965
26962
|
),
|
|
26966
26963
|
...t
|
|
@@ -27118,7 +27115,7 @@ const vJ = (e) => e.label, yJ = (e, t) => e.value === t.value, pk = ({
|
|
|
27118
27115
|
children: [
|
|
27119
27116
|
c === "popup" && /* @__PURE__ */ v(QE, { showTrigger: !1, placeholder: "Search...", onChange: S }),
|
|
27120
27117
|
/* @__PURE__ */ v(fJ, { children: a }),
|
|
27121
|
-
l && n && /* @__PURE__ */ ne("div", { className: "ui:group-data-empty/combobox-content:hidden", children: [
|
|
27118
|
+
l && n && /* @__PURE__ */ ne("div", { className: "ui:shrink-0 ui:group-data-empty/combobox-content:hidden", children: [
|
|
27122
27119
|
/* @__PURE__ */ v("div", { className: F("ui:p-1 ui:pb-0", c === "popup" ? "ui:mt-1" : ""), children: /* @__PURE__ */ ne(
|
|
27123
27120
|
"div",
|
|
27124
27121
|
{
|
package/dist/ui.css
CHANGED
|
@@ -575,9 +575,6 @@
|
|
|
575
575
|
.ui\:max-h-\[300px\] {
|
|
576
576
|
max-height: 300px;
|
|
577
577
|
}
|
|
578
|
-
.ui\:max-h-\[min\(calc\(--spacing\(96\)---spacing\(9\)\)\,calc\(var\(--available-height\)---spacing\(9\)\)\)\] {
|
|
579
|
-
max-height: min(calc(calc(var(--ui-spacing) * 96) - calc(var(--ui-spacing) * 9)), calc(var(--available-height) - calc(var(--ui-spacing) * 9)));
|
|
580
|
-
}
|
|
581
578
|
.ui\:min-h-0 {
|
|
582
579
|
min-height: calc(var(--ui-spacing) * 0);
|
|
583
580
|
}
|