tmex-cli 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/runtime/server.js +1163 -405
  2. package/package.json +1 -1
  3. package/resources/fe-dist/assets/DevicePage-n4JoyDed.js +26 -0
  4. package/resources/fe-dist/assets/DevicePage-n4JoyDed.js.map +1 -0
  5. package/resources/fe-dist/assets/{DevicesPage-C76Xejy5.js → DevicesPage-BwLKaiUR.js} +2 -2
  6. package/resources/fe-dist/assets/{DevicesPage-C76Xejy5.js.map → DevicesPage-BwLKaiUR.js.map} +1 -1
  7. package/resources/fe-dist/assets/SettingsPage-hS99lHcp.js +17 -0
  8. package/resources/fe-dist/assets/SettingsPage-hS99lHcp.js.map +1 -0
  9. package/resources/fe-dist/assets/index-CJaX5rlK.css +1 -0
  10. package/resources/fe-dist/assets/{index-Bmahx5fj.js → index-CJyFlAt8.js} +120 -119
  11. package/resources/fe-dist/assets/index-CJyFlAt8.js.map +1 -0
  12. package/resources/fe-dist/assets/{select-Wn7lKWHQ.js → select-DGBwxGiK.js} +2 -2
  13. package/resources/fe-dist/assets/{select-Wn7lKWHQ.js.map → select-DGBwxGiK.js.map} +1 -1
  14. package/resources/fe-dist/assets/{switch-JVIhfemP.js → switch-CWUBjs7N.js} +2 -2
  15. package/resources/fe-dist/assets/{switch-JVIhfemP.js.map → switch-CWUBjs7N.js.map} +1 -1
  16. package/resources/fe-dist/assets/{useValueChanged-DU---PIl.js → useValueChanged-DwJ_SDCu.js} +2 -2
  17. package/resources/fe-dist/assets/{useValueChanged-DU---PIl.js.map → useValueChanged-DwJ_SDCu.js.map} +1 -1
  18. package/resources/fe-dist/index.html +2 -2
  19. package/resources/gateway-drizzle/0002_broad_vengeance.sql +3 -0
  20. package/resources/gateway-drizzle/meta/0002_snapshot.json +535 -0
  21. package/resources/gateway-drizzle/meta/_journal.json +7 -0
  22. package/resources/fe-dist/assets/DevicePage-BTbDSWYN.js +0 -26
  23. package/resources/fe-dist/assets/DevicePage-BTbDSWYN.js.map +0 -1
  24. package/resources/fe-dist/assets/SettingsPage-DQ9W4fOo.js +0 -17
  25. package/resources/fe-dist/assets/SettingsPage-DQ9W4fOo.js.map +0 -1
  26. package/resources/fe-dist/assets/index-Bmahx5fj.js.map +0 -1
  27. package/resources/fe-dist/assets/index-CyKyNcdz.css +0 -1
@@ -1,4 +1,4 @@
1
- var Qt=e=>{throw TypeError(e)};var Nt=(e,t,n)=>t.has(e)||Qt("Cannot "+n);var le=(e,t,n)=>(Nt(e,t,"read from private field"),n?n.call(e):t.get(e)),Je=(e,t,n)=>t.has(e)?Qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ze=(e,t,n,r)=>(Nt(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Qe=(e,t,n)=>(Nt(e,t,"access private method"),n);import{aU as Zn,aV as Qn,aW as en,aX as er,aY as mn,a as tr,r as o,aZ as nr,a_ as rr,c as jt,a$ as zt,b0 as Me,b1 as dt,b2 as We,b3 as qe,b4 as tn,a5 as Q,b5 as kt,av as ft,b6 as Lt,x as Le,E as be,b7 as wt,C as he,j as se,k as ke,ae as sr,b8 as gn,aa as je,b9 as nn,ba as or,bb as ir,Z as hn,bc as bn,bd as _e,a4 as lr,ax as ar,be as cr,ac as me,bf as rn,az as Xe,ah as Tt,as as sn,bg as ur,ag as xn,bh as fr,bi as dr,a0 as Z,bj as Bt,a7 as pr,Y as Dt,bk as L,y as Ct,bl as mr,ak as gr,ap as hr,s as yn,a2 as br,v as vn,bm as xr,bn as yr,an as on,bo as vr,A as Rr,q as Rn,aJ as Sr,aA as wr,bp as Cr,L as Mr,M as Er,ab as Ir,N as Nr,Q as Tr,R as Ar,H as Sn,K as wn,bq as Pr,br as At,bs as ln,bt as Or,aE as Vr,bu as Ut,F as kr,bv as Lr,G as Cn,J as Dr,p as Pt}from"./index-Bmahx5fj.js";import{u as _t,i as Mn,j as Kt,k as En,l as In,m as Ur,n as Fr}from"./useValueChanged-DU---PIl.js";var Fe,Ke,Ie,He,ze,Rt,Ft,pn,Hr=(pn=class extends Zn{constructor(n,r){super();Je(this,ze);Je(this,Fe);Je(this,Ke);Je(this,Ie);Je(this,He);Ze(this,Fe,n),this.setOptions(r),this.bindMethods(),Qe(this,ze,Rt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var u;const r=this.options;this.options=le(this,Fe).defaultMutationOptions(n),Qn(this.options,r)||le(this,Fe).getMutationCache().notify({type:"observerOptionsUpdated",mutation:le(this,Ie),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&en(r.mutationKey)!==en(this.options.mutationKey)?this.reset():((u=le(this,Ie))==null?void 0:u.state.status)==="pending"&&le(this,Ie).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=le(this,Ie))==null||n.removeObserver(this)}onMutationUpdate(n){Qe(this,ze,Rt).call(this),Qe(this,ze,Ft).call(this,n)}getCurrentResult(){return le(this,Ke)}reset(){var n;(n=le(this,Ie))==null||n.removeObserver(this),Ze(this,Ie,void 0),Qe(this,ze,Rt).call(this),Qe(this,ze,Ft).call(this)}mutate(n,r){var u;return Ze(this,He,r),(u=le(this,Ie))==null||u.removeObserver(this),Ze(this,Ie,le(this,Fe).getMutationCache().build(le(this,Fe),this.options)),le(this,Ie).addObserver(this),le(this,Ie).execute(n)}},Fe=new WeakMap,Ke=new WeakMap,Ie=new WeakMap,He=new WeakMap,ze=new WeakSet,Rt=function(){var r;const n=((r=le(this,Ie))==null?void 0:r.state)??er();Ze(this,Ke,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ft=function(n){mn.batch(()=>{var r,u,s,d,l,f,p,x;if(le(this,He)&&this.hasListeners()){const i=le(this,Ke).variables,b=le(this,Ke).context,C={client:le(this,Fe),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(u=(r=le(this,He)).onSuccess)==null||u.call(r,n.data,i,b,C)}catch(E){Promise.reject(E)}try{(d=(s=le(this,He)).onSettled)==null||d.call(s,n.data,null,i,b,C)}catch(E){Promise.reject(E)}}else if((n==null?void 0:n.type)==="error"){try{(f=(l=le(this,He)).onError)==null||f.call(l,n.error,i,b,C)}catch(E){Promise.reject(E)}try{(x=(p=le(this,He)).onSettled)==null||x.call(p,void 0,n.error,i,b,C)}catch(E){Promise.reject(E)}}}this.listeners.forEach(i=>{i(le(this,Ke))})})},pn);function Ts(e,t){const n=tr(),[r]=o.useState(()=>new Hr(n,e));o.useEffect(()=>{r.setOptions(e)},[r,e]);const u=o.useSyncExternalStore(o.useCallback(d=>r.subscribe(mn.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=o.useCallback((d,l)=>{r.mutate(d,l).catch(nr)},[r]);if(u.error&&rr(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:s,mutateAsync:u.mutate}}/**
1
+ var Qt=e=>{throw TypeError(e)};var Nt=(e,t,n)=>t.has(e)||Qt("Cannot "+n);var le=(e,t,n)=>(Nt(e,t,"read from private field"),n?n.call(e):t.get(e)),Je=(e,t,n)=>t.has(e)?Qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ze=(e,t,n,r)=>(Nt(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Qe=(e,t,n)=>(Nt(e,t,"access private method"),n);import{aU as Zn,aV as Qn,aW as en,aX as er,aY as mn,a as tr,r as o,aZ as nr,a_ as rr,c as jt,a$ as zt,b0 as Me,b1 as dt,b2 as We,b3 as qe,b4 as tn,a5 as Q,b5 as kt,av as ft,b6 as Lt,x as Le,E as be,b7 as wt,C as he,j as se,k as ke,ae as sr,b8 as gn,aa as je,b9 as nn,ba as or,bb as ir,Z as hn,bc as bn,bd as _e,a4 as lr,ax as ar,be as cr,ac as me,bf as rn,az as Xe,ah as Tt,as as sn,bg as ur,ag as xn,bh as fr,bi as dr,a0 as Z,bj as Bt,a7 as pr,Y as Dt,bk as L,y as Ct,bl as mr,ak as gr,ap as hr,s as yn,a2 as br,v as vn,bm as xr,bn as yr,an as on,bo as vr,A as Rr,q as Rn,aJ as Sr,aA as wr,bp as Cr,L as Mr,M as Er,ab as Ir,N as Nr,Q as Tr,R as Ar,H as Sn,K as wn,bq as Pr,br as At,bs as ln,bt as Or,aE as Vr,bu as Ut,F as kr,bv as Lr,G as Cn,J as Dr,p as Pt}from"./index-CJyFlAt8.js";import{u as _t,i as Mn,j as Kt,k as En,l as In,m as Ur,n as Fr}from"./useValueChanged-DwJ_SDCu.js";var Fe,Ke,Ie,He,ze,Rt,Ft,pn,Hr=(pn=class extends Zn{constructor(n,r){super();Je(this,ze);Je(this,Fe);Je(this,Ke);Je(this,Ie);Je(this,He);Ze(this,Fe,n),this.setOptions(r),this.bindMethods(),Qe(this,ze,Rt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var u;const r=this.options;this.options=le(this,Fe).defaultMutationOptions(n),Qn(this.options,r)||le(this,Fe).getMutationCache().notify({type:"observerOptionsUpdated",mutation:le(this,Ie),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&en(r.mutationKey)!==en(this.options.mutationKey)?this.reset():((u=le(this,Ie))==null?void 0:u.state.status)==="pending"&&le(this,Ie).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=le(this,Ie))==null||n.removeObserver(this)}onMutationUpdate(n){Qe(this,ze,Rt).call(this),Qe(this,ze,Ft).call(this,n)}getCurrentResult(){return le(this,Ke)}reset(){var n;(n=le(this,Ie))==null||n.removeObserver(this),Ze(this,Ie,void 0),Qe(this,ze,Rt).call(this),Qe(this,ze,Ft).call(this)}mutate(n,r){var u;return Ze(this,He,r),(u=le(this,Ie))==null||u.removeObserver(this),Ze(this,Ie,le(this,Fe).getMutationCache().build(le(this,Fe),this.options)),le(this,Ie).addObserver(this),le(this,Ie).execute(n)}},Fe=new WeakMap,Ke=new WeakMap,Ie=new WeakMap,He=new WeakMap,ze=new WeakSet,Rt=function(){var r;const n=((r=le(this,Ie))==null?void 0:r.state)??er();Ze(this,Ke,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ft=function(n){mn.batch(()=>{var r,u,s,d,l,f,p,x;if(le(this,He)&&this.hasListeners()){const i=le(this,Ke).variables,b=le(this,Ke).context,C={client:le(this,Fe),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(u=(r=le(this,He)).onSuccess)==null||u.call(r,n.data,i,b,C)}catch(E){Promise.reject(E)}try{(d=(s=le(this,He)).onSettled)==null||d.call(s,n.data,null,i,b,C)}catch(E){Promise.reject(E)}}else if((n==null?void 0:n.type)==="error"){try{(f=(l=le(this,He)).onError)==null||f.call(l,n.error,i,b,C)}catch(E){Promise.reject(E)}try{(x=(p=le(this,He)).onSettled)==null||x.call(p,void 0,n.error,i,b,C)}catch(E){Promise.reject(E)}}}this.listeners.forEach(i=>{i(le(this,Ke))})})},pn);function Ts(e,t){const n=tr(),[r]=o.useState(()=>new Hr(n,e));o.useEffect(()=>{r.setOptions(e)},[r,e]);const u=o.useSyncExternalStore(o.useCallback(d=>r.subscribe(mn.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=o.useCallback((d,l)=>{r.mutate(d,l).catch(nr)},[r]);if(u.error&&rr(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:s,mutateAsync:u.mutate}}/**
2
2
  * @license lucide-react v0.564.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -14,4 +14,4 @@ var Qt=e=>{throw TypeError(e)};var Nt=(e,t,n)=>t.has(e)||Qt("Cannot "+n);var le=
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */const _r=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Kr=jt("chevron-up",_r);function xt(e,t,n){return Math.floor(e/t)!==n}function at(e,t){return t<0||t>=e.current.length}function Ot(e,t){return ye(e,{disabledIndices:t})}function an(e,t){return ye(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ye(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:u=1}={}){let s=t;do s+=n?-u:u;while(s>=0&&s<=e.current.length-1&&ct(e,s,r));return s}function Wr(e,{event:t,orientation:n,loopFocus:r,rtl:u,cols:s,disabledIndices:d,minIndex:l,maxIndex:f,prevIndex:p,stopEvent:x=!1}){let i=p;const b=[],C={};let E=!1;{let a=null,h=-1;e.current.forEach((m,c)=>{if(m==null)return;const g=m.closest('[role="row"]');g&&(E=!0),(g!==a||h===-1)&&(a=g,h+=1,b[h]=[]),b[h].push(c),C[c]=h})}const v=E&&b.length>0&&b.some(a=>a.length!==s);function w(a){if(!v||p===-1)return;const h=C[p];if(h==null)return;const m=b[h].indexOf(p);let c=a==="up"?h-1:h+1;r&&(c<0?c=b.length-1:c>=b.length&&(c=0));const g=new Set;for(;c>=0&&c<b.length&&!g.has(c);){g.add(c);const H=b[c];if(H.length===0){c=a==="up"?c-1:c+1;continue}const F=Math.min(m,H.length-1);for(let U=F;U>=0;U-=1){const J=H[U];if(!ct(e,J,d))return J}c=a==="up"?c-1:c+1,r&&(c<0?c=b.length-1:c>=b.length&&(c=0))}}if(t.key===zt){const a=w("up");if(a!==void 0)x&&Me(t),i=a;else{if(x&&Me(t),p===-1)i=f;else if(i=ye(e,{startingIndex:i,amount:s,decrement:!0,disabledIndices:d}),r&&(p-s<l||i<0)){const h=p%s,m=f%s,c=f-(m-h);m===h?i=f:i=m>h?c:c-s}at(e,i)&&(i=p)}}if(t.key===dt){const a=w("down");a!==void 0?(x&&Me(t),i=a):(x&&Me(t),p===-1?i=l:(i=ye(e,{startingIndex:p,amount:s,disabledIndices:d}),r&&p+s>f&&(i=ye(e,{startingIndex:p%s-s,amount:s,disabledIndices:d}))),at(e,i)&&(i=p))}if(n==="both"){const a=tn(p/s);t.key===(u?We:qe)&&(x&&Me(t),p%s!==s-1?(i=ye(e,{startingIndex:p,disabledIndices:d}),r&&xt(i,s,a)&&(i=ye(e,{startingIndex:p-p%s-1,disabledIndices:d}))):r&&(i=ye(e,{startingIndex:p-p%s-1,disabledIndices:d})),xt(i,s,a)&&(i=p)),t.key===(u?qe:We)&&(x&&Me(t),p%s!==0?(i=ye(e,{startingIndex:p,decrement:!0,disabledIndices:d}),r&&xt(i,s,a)&&(i=ye(e,{startingIndex:p+(s-p%s),decrement:!0,disabledIndices:d}))):r&&(i=ye(e,{startingIndex:p+(s-p%s),decrement:!0,disabledIndices:d})),xt(i,s,a)&&(i=p));const h=tn(f/s)===a;at(e,i)&&(r&&h?i=t.key===(u?qe:We)?f:ye(e,{startingIndex:p-p%s-1,disabledIndices:d}):i=p)}return i}function qr(e,t,n){const r=[];let u=0;return e.forEach(({width:s,height:d},l)=>{if(s>t)throw new Error(`[Floating UI]: Invalid grid - item width at index ${l} is greater than grid columns`);let f=!1;for(;!f;){const p=[];for(let x=0;x<s;x+=1)for(let i=0;i<d;i+=1)p.push(u+x+i*t);u%t+s<=t&&p.every(x=>r[x]==null)?(p.forEach(x=>{r[x]=l}),f=!0):u+=1}}),[...r]}function $r(e,t,n,r,u){if(e===-1)return-1;const s=n.indexOf(e),d=t[e];switch(u){case"tl":return s;case"tr":return d?s+d.width-1:s;case"bl":return d?s+(d.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function Yr(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function ct(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}const Tn=o.forwardRef(function(t,n){const{render:r,className:u,id:s,name:d,value:l,disabled:f=!1,onValueChange:p,defaultValue:x,autoFocus:i=!1,...b}=t,{state:C,name:E,disabled:v,setTouched:w,setDirty:a,validityData:h,setFocused:m,setFilled:c,validationMode:g,validation:H}=_t(),F=v||f,U=E??d,J={...C,disabled:F},{labelId:ae}=Mn(),G=Kt({id:s});Q(()=>{var K;const y=l!=null;(K=H.inputRef.current)!=null&&K.value||y&&l!==""?c(!0):y&&l===""&&c(!1)},[H.inputRef,c,l]);const j=o.useRef(null);Q(()=>{i&&j.current===kt(ft(j.current))&&m(!0)},[i,m]);const[W]=Lt({controlled:l,default:x,name:"FieldControl",state:"value"}),I=l!==void 0,ee=I?W:void 0;return En({id:G,name:U,commit:H.commit,value:ee,getValue:()=>{var y;return(y=H.inputRef.current)==null?void 0:y.value},controlRef:H.inputRef}),Le("input",t,{ref:[n,j],state:J,props:[{id:G,disabled:F,name:U,ref:H.inputRef,"aria-labelledby":ae,autoFocus:i,...I?{value:ee}:{defaultValue:x},onChange(y){const K=y.currentTarget.value;p==null||p(K,be(wt,y.nativeEvent)),a(K!==h.initialValue),c(K!=="")},onFocus(){m(!0)},onBlur(y){w(!0),m(!1),g==="onBlur"&&H.commit(y.currentTarget.value)},onKeyDown(y){y.currentTarget.tagName==="INPUT"&&y.key==="Enter"&&(w(!0),H.commit(y.currentTarget.value))}},H.getInputValidationProps(),b],stateAttributesMapping:In})});Tn.displayName="FieldControl";const An=o.forwardRef(function(t,n){return he.jsx(Tn,{ref:n,...t})});An.displayName="Input";function As({className:e,type:t,...n}){return se.jsxDEV(An,{type:t,"data-slot":"input",className:ke("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/input.tsx",lineNumber:8,columnNumber:5},this)}function Gr(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:u=!0,event:s="click",toggle:d=!0,ignoreMouse:l=!1,stickIfOpen:f=!0,touchOpenDelay:p=0,reason:x=sr}=t,i=o.useRef(void 0),b=gn(),C=je(),E=o.useMemo(()=>({onPointerDown(v){i.current=v.pointerType},onMouseDown(v){const w=i.current,a=v.nativeEvent,h=n.select("open");if(v.button!==0||s==="click"||nn(w,!0)&&l)return;const m=r.current.openEvent,c=m==null?void 0:m.type,g=n.select("domReferenceElement")!==v.currentTarget,H=h&&g||!(h&&d&&(!(m&&f)||c==="click"||c==="mousedown"));if(ir(a.target)){const U=be(x,a,a.target);H&&w==="touch"&&p>0?C.start(p,()=>{n.setOpen(!0,U)}):n.setOpen(H,U);return}const F=v.currentTarget;b.request(()=>{const U=be(x,a,F);H&&w==="touch"&&p>0?C.start(p,()=>{n.setOpen(!0,U)}):n.setOpen(H,U)})},onClick(v){if(s==="mousedown-only")return;const w=i.current;if(s==="mousedown"&&w){i.current=void 0;return}if(nn(w,!0)&&l)return;const a=n.select("open"),h=r.current.openEvent,m=n.select("domReferenceElement")!==v.currentTarget,c=a&&m||!(a&&d&&(!(h&&f)||or(h))),g=be(x,v.nativeEvent,v.currentTarget);c&&w==="touch"&&p>0?C.start(p,()=>{n.setOpen(!0,g)}):n.setOpen(c,g)},onKeyDown(){i.current=void 0}}),[r,s,l,n,f,d,b,C,p,x]);return o.useMemo(()=>u?{reference:E}:hn,[u,E])}const Xr="Escape";function Mt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function yt(e,t){return Mt(t,e===zt||e===dt,e===We||e===qe)}function Vt(e,t,n){return Mt(t,e===dt,n?e===We:e===qe)||e==="Enter"||e===" "||e===""}function Jr(e,t,n){return Mt(t,n?e===We:e===qe,e===dt)}function Zr(e,t,n,r){const u=n?e===qe:e===We,s=e===zt;return t==="both"||t==="horizontal"&&r&&r>1?e===Xr:Mt(t,u,s)}function Qr(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),u=n.useState("floatingElement"),s=n.useState("domReferenceElement"),d=n.context.dataRef,{listRef:l,activeIndex:f,onNavigate:p=()=>{},enabled:x=!0,selectedIndex:i=null,allowEscape:b=!1,loopFocus:C=!1,nested:E=!1,rtl:v=!1,virtual:w=!1,focusItemOnOpen:a="auto",focusItemOnHover:h=!0,openOnArrowKeyDown:m=!0,disabledIndices:c=void 0,orientation:g="vertical",parentOrientation:H,cols:F=1,id:U,resetOnPointerLeave:J=!0,externalTree:ae}=t;b&&(C||console.warn("`useListNavigation` looping must be enabled to allow escaping."),w||console.warn("`useListNavigation` must be virtual to allow escaping.")),g==="vertical"&&F>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".');const G=bn(u),j=_e(G),W=lr(),I=ar(ae);Q(()=>{d.current.orientation=g},[d,g]);const ee=cr(s),q=o.useRef(a),y=o.useRef(i??-1),K=o.useRef(null),R=o.useRef(!0),A=me(M=>{p(y.current===-1?null:y.current,M)}),X=o.useRef(A),N=o.useRef(!!u),ge=o.useRef(r),T=o.useRef(!1),te=o.useRef(!1),P=_e(c),$=_e(r),oe=_e(i),Ne=_e(J),Pe=me(()=>{function M(B){w?I==null||I.events.emit("virtualfocus",B):rn(B,{sync:T.current,preventScroll:!0})}const O=l.current[y.current],S=te.current;O&&M(O),(T.current?B=>B():requestAnimationFrame)(()=>{var ue;const B=l.current[y.current]||O;if(!B)return;O||M(B),Y&&(S||!R.current)&&((ue=B.scrollIntoView)==null||ue.call(B,{block:"nearest",inline:"nearest"}))})});Q(()=>{x&&(r&&u?(y.current=i??-1,q.current&&i!=null&&(te.current=!0,A())):N.current&&(y.current=-1,X.current()))},[x,r,u,i,A]),Q(()=>{if(x){if(!r){T.current=!1;return}if(u)if(f==null){if(T.current=!1,oe.current!=null)return;if(N.current&&(y.current=-1,Pe()),(!ge.current||!N.current)&&q.current&&(K.current!=null||q.current===!0&&K.current==null)){let M=0;const O=()=>{l.current[0]==null?(M<2&&(M?requestAnimationFrame:queueMicrotask)(O),M+=1):(y.current=K.current==null||Vt(K.current,g,v)||E?Ot(l):an(l),K.current=null,A())};O()}}else at(l,f)||(y.current=f,Pe(),te.current=!1)}},[x,r,u,f,oe,E,l,g,v,A,Pe,P]),Q(()=>{var B,k;if(!x||u||!I||w||!N.current)return;const M=I.nodesRef.current,O=(k=(B=M.find(ue=>ue.id===W))==null?void 0:B.context)==null?void 0:k.elements.floating,S=kt(ft(u)),D=M.some(ue=>ue.context&&Xe(ue.context.elements.floating,S));O&&!D&&R.current&&O.focus({preventScroll:!0})},[x,u,I,W,w]),Q(()=>{X.current=A,ge.current=r,N.current=!!u}),Q(()=>{r||(K.current=null,q.current=a)},[r,a]);const z=f!=null,Y=o.useMemo(()=>{function M(S){if(!$.current)return;const D=l.current.indexOf(S.currentTarget);D!==-1&&y.current!==D&&(y.current=D,A(S))}return{onFocus(S){T.current=!0,M(S)},onClick:({currentTarget:S})=>S.focus({preventScroll:!0}),onMouseMove(S){T.current=!0,te.current=!1,h&&M(S)},onPointerLeave(S){var B;if(!$.current||!R.current||S.pointerType==="touch")return;T.current=!0;const D=S.relatedTarget;!h||l.current.includes(D)||Ne.current&&(rn(null,{sync:!0}),y.current=-1,A(S),w||(B=j.current)==null||B.focus({preventScroll:!0}))}}},[$,j,h,l,A,Ne,w]),de=o.useCallback(()=>{var M,O,S;return H??((S=(O=(M=I==null?void 0:I.nodesRef.current.find(D=>D.id===W))==null?void 0:M.context)==null?void 0:O.dataRef)==null?void 0:S.current.orientation)},[W,I,H]),ce=me(M=>{if(R.current=!1,T.current=!0,M.which===229||!$.current&&M.currentTarget===j.current)return;if(E&&Zr(M.key,g,v,F)){yt(M.key,de())||Me(M),n.setOpen(!1,be(Tt,M.nativeEvent)),sn(s)&&(w?I==null||I.events.emit("virtualfocus",s):s.focus());return}const O=y.current,S=Ot(l,c),D=an(l,c);if(ee||(M.key==="Home"&&(Me(M),y.current=S,A(M)),M.key==="End"&&(Me(M),y.current=D,A(M))),F>1){const B=Array.from({length:l.current.length},()=>({width:1,height:1})),k=qr(B,F),ue=k.findIndex(Re=>Re!=null&&!ct(l,Re,c)),ve=k.reduce((Re,ne,Se)=>ne!=null&&!ct(l,ne,c)?Se:Re,-1),Te=k[Wr({current:k.map(Re=>Re!=null?l.current[Re]:null)},{event:M,orientation:g,loopFocus:C,rtl:v,cols:F,disabledIndices:Yr([...(typeof c!="function"?c:null)||l.current.map((Re,ne)=>ct(l,ne,c)?ne:void 0),void 0],k),minIndex:ue,maxIndex:ve,prevIndex:$r(y.current>D?S:y.current,B,k,F,M.key===dt?"bl":M.key===(v?We:qe)?"tr":"tl"),stopEvent:!0})];if(Te!=null&&(y.current=Te,A(M)),g==="both")return}if(yt(M.key,g)){if(Me(M),r&&!w&&kt(M.currentTarget.ownerDocument)===M.currentTarget){y.current=Vt(M.key,g,v)?S:D,A(M);return}Vt(M.key,g,v)?C?O>=D?b&&O!==l.current.length?y.current=-1:(T.current=!1,y.current=S):y.current=ye(l,{startingIndex:O,disabledIndices:c}):y.current=Math.min(D,ye(l,{startingIndex:O,disabledIndices:c})):C?O<=S?b&&O!==-1?y.current=l.current.length:(T.current=!1,y.current=D):y.current=ye(l,{startingIndex:O,decrement:!0,disabledIndices:c}):y.current=Math.max(S,ye(l,{startingIndex:O,decrement:!0,disabledIndices:c})),at(l,y.current)&&(y.current=-1),A(M)}}),fe=o.useMemo(()=>w&&r&&z&&{"aria-activedescendant":`${U}-${f}`},[w,r,z,U,f]),xe=o.useMemo(()=>({"aria-orientation":g==="both"?void 0:g,...ee?{}:fe,onKeyDown(M){if(M.key==="Tab"&&M.shiftKey&&r&&!w){const O=ur(M.nativeEvent);if(O&&!Xe(j.current,O))return;Me(M),n.setOpen(!1,be(xn,M.nativeEvent)),sn(s)&&s.focus();return}ce(M)},onPointerMove(){R.current=!0}}),[fe,ce,j,g,ee,n,r,w,s]),ie=o.useMemo(()=>{function M(S){a==="auto"&&fr(S.nativeEvent)&&(q.current=!w)}function O(S){q.current=a,a==="auto"&&dr(S.nativeEvent)&&(q.current=!0)}return{onKeyDown(S){const D=n.select("open");R.current=!1;const B=S.key.startsWith("Arrow"),k=Jr(S.key,de(),v),ue=yt(S.key,g),ve=(E?k:ue)||S.key==="Enter"||S.key.trim()==="";if(w&&D)return ce(S);if(!(!D&&!m&&B)){if(ve){const Te=yt(S.key,de());K.current=E&&Te?null:S.key}if(E){k&&(Me(S),D?(y.current=Ot(l,P.current),A(S)):n.setOpen(!0,be(Tt,S.nativeEvent,S.currentTarget)));return}ue&&(oe.current!=null&&(y.current=oe.current),Me(S),!D&&m?n.setOpen(!0,be(Tt,S.nativeEvent,S.currentTarget)):ce(S),D&&A(S))}},onFocus(S){n.select("open")&&!w&&(y.current=-1,A(S))},onPointerDown:O,onPointerEnter:O,onMouseDown:M,onClick:M}},[ce,P,a,l,E,A,n,m,g,de,v,oe,w]),pe=o.useMemo(()=>({...fe,...ie}),[fe,ie]);return o.useMemo(()=>x?{reference:pe,floating:xe,item:Y,trigger:ie}:{},[x,pe,xe,ie,Y])}function es(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,u=n.useState("open"),{listRef:s,activeIndex:d,onMatch:l,onTypingChange:f,enabled:p=!0,resetMs:x=750,selectedIndex:i=null}=t,b=je(),C=o.useRef(""),E=o.useRef(i??d??-1),v=o.useRef(null);Q(()=>{!u&&i!==null||(b.clear(),v.current=null,C.current!==""&&(C.current=""))},[u,i,b]),Q(()=>{u&&C.current===""&&(E.current=i??d??-1)},[u,i,d]);const w=me(g=>{g?r.current.typing||(r.current.typing=g,f==null||f(g)):r.current.typing&&(r.current.typing=g,f==null||f(g))}),a=me(g=>{function H(j,W,I){const ee=W.find(q=>(q==null?void 0:q.toLocaleLowerCase().indexOf(I.toLocaleLowerCase()))===0);return ee?j.indexOf(ee):-1}const F=s.current;if(C.current.length>0&&C.current[0]!==" "&&(H(F,F,C.current)===-1?w(!1):g.key===" "&&Me(g)),F==null||g.key.length!==1||g.ctrlKey||g.metaKey||g.altKey)return;u&&g.key!==" "&&(Me(g),w(!0));const U=C.current==="";U&&(E.current=i??d??-1),F.every(j=>{var W,I;return j?((W=j[0])==null?void 0:W.toLocaleLowerCase())!==((I=j[1])==null?void 0:I.toLocaleLowerCase()):!0})&&C.current===g.key&&(C.current="",E.current=v.current),C.current+=g.key,b.start(x,()=>{C.current="",E.current=v.current,w(!1)});const ae=U?i??d??-1:E.current,G=H(F,[...F.slice((ae||0)+1),...F.slice(0,(ae||0)+1)],C.current);G!==-1?(l==null||l(G),v.current=G):g.key!==" "&&(C.current="",w(!1))}),h=me(g=>{const H=g.relatedTarget,F=n.select("domReferenceElement"),U=n.select("floatingElement"),J=Xe(F,H),ae=Xe(U,H);J||ae||(b.clear(),C.current="",E.current=v.current,w(!1))}),m=o.useMemo(()=>({onKeyDown:a,onBlur:h}),[a,h]),c=o.useMemo(()=>({onKeyDown:a,onKeyUp(g){g.key===" "&&w(!1)},onBlur:h}),[a,h,w]);return o.useMemo(()=>p?{reference:m,floating:c}:{},[p,m,c])}function Ps({className:e,size:t="default",...n}){return se.jsxDEV("div",{"data-slot":"card","data-size":t,className:ke("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col",e),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/card.tsx",lineNumber:11,columnNumber:5},this)}function Os({className:e,...t}){return se.jsxDEV("div",{"data-slot":"card-header",className:ke("gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/card.tsx",lineNumber:22,columnNumber:5},this)}function Vs({className:e,...t}){return se.jsxDEV("div",{"data-slot":"card-title",className:ke("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/card.tsx",lineNumber:35,columnNumber:5},this)}function ks({className:e,...t}){return se.jsxDEV("div",{"data-slot":"card-description",className:ke("text-muted-foreground text-sm",e),...t},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/card.tsx",lineNumber:45,columnNumber:5},this)}function Ls({className:e,...t}){return se.jsxDEV("div",{"data-slot":"card-content",className:ke("px-4 group-data-[size=sm]/card:px-3",e),...t},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/card.tsx",lineNumber:68,columnNumber:5},this)}const Wt=o.createContext(null);Wt.displayName="SelectRootContext";const qt=o.createContext(null);qt.displayName="SelectFloatingContext";function Ue(){const e=o.useContext(Wt);if(e===null)throw new Error("Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");return e}function Pn(){const e=o.useContext(qt);if(e===null)throw new Error("Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");return e}const ts=(e,t)=>Object.is(e,t);function tt(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function ns(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:tt(t,r,n))}function ut(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:tt(r,t,n))}function rs(e,t,n){return e.filter(r=>!tt(t,r,n))}function Ht(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function On(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function ss(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(On(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 os(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 Ht(e)}function et(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ht(e.value):Ht(e)}function Vn(e,t,n){function r(){return os(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 u=On(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=u.find(d=>d.value===e);return s&&s.label!=null?s.label:r()}if("value"in e){const s=u.find(d=>d&&d.value===e.value);if(s&&s.label!=null)return s.label}}return r()}function is(e,t,n){return e.reduce((r,u,s)=>(s>0&&r.push(", "),r.push(he.jsx(o.Fragment,{children:Vn(u,t,n)},s)),r),[])}const V={id:Z(e=>e.id),modal:Z(e=>e.modal),multiple:Z(e=>e.multiple),items:Z(e=>e.items),itemToStringLabel:Z(e=>e.itemToStringLabel),itemToStringValue:Z(e=>e.itemToStringValue),isItemEqualToValue:Z(e=>e.isItemEqualToValue),value:Z(e=>e.value),hasSelectedValue:Z(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:et(t,r)!==""}),hasNullItemLabel:Z((e,t)=>t?ss(e.items):!1),open:Z(e=>e.open),mounted:Z(e=>e.mounted),forceMount:Z(e=>e.forceMount),transitionStatus:Z(e=>e.transitionStatus),openMethod:Z(e=>e.openMethod),activeIndex:Z(e=>e.activeIndex),selectedIndex:Z(e=>e.selectedIndex),isActive:Z((e,t)=>e.activeIndex===t),isSelected:Z((e,t,n)=>{const r=e.isItemEqualToValue,u=e.value;return e.multiple?Array.isArray(u)&&u.some(s=>tt(n,s,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:tt(n,u,r)}),isSelectedByFocus:Z((e,t)=>e.selectedIndex===t),popupProps:Z(e=>e.popupProps),triggerProps:Z(e=>e.triggerProps),triggerElement:Z(e=>e.triggerElement),positionerElement:Z(e=>e.positionerElement),listElement:Z(e=>e.listElement),scrollUpArrowVisible:Z(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Z(e=>e.scrollDownArrowVisible),hasScrollArrows:Z(e=>e.hasScrollArrows)};function ls(e){const{id:t,value:n,defaultValue:r=null,onValueChange:u,open:s,defaultOpen:d=!1,onOpenChange:l,name:f,autoComplete:p,disabled:x=!1,readOnly:i=!1,required:b=!1,modal:C=!0,actionsRef:E,inputRef:v,onOpenChangeComplete:w,items:a,multiple:h=!1,itemToStringLabel:m,itemToStringValue:c,isItemEqualToValue:g=ts,highlightItemOnHover:H=!0,children:F}=e,{clearErrors:U}=Ur(),{setDirty:J,setTouched:ae,setFocused:G,shouldValidateOnChange:j,validityData:W,setFilled:I,name:ee,disabled:q,validation:y,validationMode:K}=_t(),R=Kt({id:t}),A=q||x,X=ee??f,[N,ge]=Lt({controlled:n,default:h?r??on:r,name:"Select",state:"value"}),[T,te]=Lt({controlled:s,default:d,name:"Select",state:"open"}),P=o.useRef([]),$=o.useRef([]),oe=o.useRef(null),Ne=o.useRef(null),Pe=o.useRef(0),z=o.useRef(null),Y=o.useRef([]),de=o.useRef(!1),ce=o.useRef(!1),fe=o.useRef(null),xe=o.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ie=o.useRef(!1),{mounted:pe,setMounted:M,transitionStatus:O}=Bt(T),{openMethod:S,triggerProps:D,reset:B}=pr(T),k=Dt(()=>new vr({id:R,modal:C,multiple:h,itemToStringLabel:m,itemToStringValue:c,isItemEqualToValue:g,value:N,open:T,mounted:pe,transitionStatus:O,items:a,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ue=L(k,V.activeIndex),ve=L(k,V.selectedIndex),Te=L(k,V.triggerElement),Re=L(k,V.positionerElement),ne=o.useMemo(()=>h&&Array.isArray(N)&&N.length===0?"":et(N,c),[h,N,c]),Se=o.useMemo(()=>h&&Array.isArray(N)?N.map(_=>et(_,c)):et(N,c),[h,N,c]),Ee=_e(k.state.triggerElement);En({id:R,commit:y.commit,value:N,controlRef:Ee,name:X,getValue:()=>Se});const Oe=o.useRef(N);Q(()=>{N!==Oe.current&&k.set("forceMount",!0)},[k,N]),Q(()=>{I(h?Array.isArray(N)&&N.length>0:N!=null)},[h,N,I]),Q(function(){if(T)return;const re=Y.current;if(h){const Ve=Array.isArray(N)?N:[];if(Ve.length===0){k.set("selectedIndex",null);return}const Ae=Ve[Ve.length-1],Be=ut(re,Ae,g);k.set("selectedIndex",Be===-1?null:Be);return}const Ce=ut(re,N,g);k.set("selectedIndex",Ce===-1?null:Ce)},[h,T,N,Y,g,k]),Fr(N,()=>{U(X),J(N!==W.initialValue),j()?y.commit(N):y.commit(N,!0)});const nt=me((_,re)=>{if(l==null||l(_,re),!re.isCanceled&&(te(_),!_&&(re.reason===xn||re.reason===Rr)&&(ae(!0),G(!1),K==="onBlur"&&y.commit(N)),!_&&k.state.activeIndex!==null)){const Ce=P.current[k.state.activeIndex];queueMicrotask(()=>{Ce==null||Ce.setAttribute("tabindex","-1")})}}),rt=me(()=>{M(!1),k.set("activeIndex",null),B(),w==null||w(!1)});Ct({enabled:!E,open:T,ref:oe,onComplete(){T||rt()}}),o.useImperativeHandle(E,()=>({unmount:rt}),[rt]);const $e=me((_,re)=>{u==null||u(_,re),!re.isCanceled&&ge(_)}),st=me(()=>{const _=k.state.listElement||oe.current;if(!_)return;const re=_.scrollTop,Ce=_.scrollTop+_.clientHeight,Ve=re>1,Ae=Ce<_.scrollHeight-1;k.state.scrollUpArrowVisible!==Ve&&k.set("scrollUpArrowVisible",Ve),k.state.scrollDownArrowVisible!==Ae&&k.set("scrollDownArrowVisible",Ae)}),we=mr({open:T,onOpenChange:nt,elements:{reference:Te,floating:Re}}),pt=Gr(we,{enabled:!i&&!A,event:"mousedown"}),mt=gr(we,{bubbles:!1}),ot=Qr(we,{enabled:!i&&!A,listRef:P,activeIndex:ue,selectedIndex:ve,disabledIndices:on,onNavigate(_){_===null&&!T||k.set("activeIndex",_)},focusItemOnHover:!1}),De=es(we,{enabled:!i&&!A&&(T||!h),listRef:$,activeIndex:ue,selectedIndex:ve,onMatch(_){T?k.set("activeIndex",_):$e(Y.current[_],be("none"))},onTypingChange(_){de.current=_}}),{getReferenceProps:gt,getFloatingProps:Ye,getItemProps:it}=hr([pt,mt,ot,De]),lt=o.useMemo(()=>yn(gt(),D,R?{id:R}:hn),[gt,D,R]);br(()=>{k.update({popupProps:Ye(),triggerProps:lt})}),Q(()=>{k.update({id:R,modal:C,multiple:h,value:N,open:T,mounted:pe,transitionStatus:O,popupProps:Ye(),triggerProps:lt,items:a,itemToStringLabel:m,itemToStringValue:c,isItemEqualToValue:g,openMethod:S})},[k,R,C,h,N,T,pe,O,Ye,lt,a,m,c,g,S]);const Et=o.useMemo(()=>({store:k,name:X,required:b,disabled:A,readOnly:i,multiple:h,itemToStringLabel:m,itemToStringValue:c,highlightItemOnHover:H,setValue:$e,setOpen:nt,listRef:P,popupRef:oe,scrollHandlerRef:Ne,handleScrollArrowVisibility:st,scrollArrowsMountedCountRef:Pe,getItemProps:it,events:we.context.events,valueRef:z,valuesRef:Y,labelsRef:$,typingRef:de,selectionRef:xe,selectedItemTextRef:fe,validation:y,onOpenChangeComplete:w,keyboardActiveRef:ce,alignItemWithTriggerActiveRef:ie,initialValueRef:Oe}),[k,X,b,A,i,h,m,c,H,$e,nt,it,we.context.events,y,w,st]),ht=vn(v,y.inputRef),bt=h&&Array.isArray(N)&&N.length>0,It=o.useMemo(()=>!h||!Array.isArray(N)||!X?null:N.map(_=>{const re=et(_,c);return he.jsx("input",{type:"hidden",name:X,value:re},re)}),[h,N,X,c]);return he.jsx(Wt.Provider,{value:Et,children:he.jsxs(qt.Provider,{value:we,children:[F,he.jsx("input",{...y.getInputValidationProps({onFocus(){var _;(_=k.state.triggerElement)==null||_.focus({focusVisible:!0})},onChange(_){if(_.nativeEvent.defaultPrevented)return;const re=_.target.value,Ce=be(wt,_.nativeEvent);function Ve(){if(h)return;const Ae=Y.current.find(Be=>et(Be,c).toLowerCase()===re.toLowerCase());Ae!=null&&(J(Ae!==W.initialValue),$e(Ae,Ce),j()&&y.commit(Ae))}k.set("forceMount",!0),queueMicrotask(Ve)}}),name:h?void 0:X,autoComplete:p,value:ne,disabled:A,required:b&&!bt,readOnly:i,ref:ht,style:X?xr:yr,tabIndex:-1,"aria-hidden":!0}),It]})})}function as(e){return e.getBoundingClientRect()}const vt=2,cs=400,cn=200,us={...Sr,...In,value:()=>null},kn=o.forwardRef(function(t,n){const{render:r,className:u,id:s,disabled:d=!1,nativeButton:l=!0,...f}=t,{setTouched:p,setFocused:x,validationMode:i,state:b,disabled:C}=_t(),{labelId:E}=Mn(),{store:v,setOpen:w,selectionRef:a,validation:h,readOnly:m,required:c,alignItemWithTriggerActiveRef:g,disabled:H,keyboardActiveRef:F}=Ue(),U=C||H||d,J=L(v,V.open),ae=L(v,V.value),G=L(v,V.triggerProps),j=L(v,V.positionerElement),W=L(v,V.listElement),I=L(v,V.id),ee=L(v,V.hasSelectedValue),q=!ee&&J,y=L(v,V.hasNullItemLabel,q),K=s??I;Kt({id:K});const R=_e(j),A=o.useRef(null),{getButtonProps:X,buttonRef:N}=Rn({disabled:U,native:l}),ge=me(Y=>{v.set("triggerElement",Y)}),T=vn(n,A,N,ge),te=je(),P=je(),$=je(),oe=je();o.useEffect(()=>{if(J)return!(ee||y)?$.start(cs,()=>{a.current.allowUnselectedMouseUp=!0,a.current.allowSelectedMouseUp=!0}):oe.start(cn,()=>{a.current.allowUnselectedMouseUp=!0,$.start(cn,()=>{a.current.allowSelectedMouseUp=!0})}),()=>{$.clear(),oe.clear()};a.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},P.clear()},[J,ee,y,a,P,$,oe]);const Ne=o.useMemo(()=>{var Y;return(W==null?void 0:W.id)??((Y=bn(j))==null?void 0:Y.id)},[W,j]),Pe=yn(G,{id:K,role:"combobox","aria-expanded":J?"true":"false","aria-haspopup":"listbox","aria-controls":J?Ne:void 0,"aria-labelledby":E,"aria-readonly":m||void 0,"aria-required":c||void 0,tabIndex:U?-1:0,ref:T,onFocus(Y){x(!0),J&&g.current&&w(!1,be(wt,Y.nativeEvent)),te.start(0,()=>{v.set("forceMount",!0)})},onBlur(Y){Xe(j,Y.relatedTarget)||(p(!0),x(!1),i==="onBlur"&&h.commit(ae))},onPointerMove(){F.current=!1},onKeyDown(){F.current=!0},onMouseDown(Y){if(J)return;const de=ft(Y.currentTarget);function ce(fe){if(!A.current)return;const xe=fe.target;if(Xe(A.current,xe)||Xe(R.current,xe)||xe===A.current)return;const ie=as(A.current);fe.clientX>=ie.left-vt&&fe.clientX<=ie.right+vt&&fe.clientY>=ie.top-vt&&fe.clientY<=ie.bottom+vt||w(!1,be(wr,fe))}P.start(0,()=>{de.addEventListener("mouseup",ce,{once:!0})})}},h.getValidationProps,f,X);Pe.role="combobox";const z={...b,open:J,disabled:U,value:ae,readOnly:m,placeholder:!ee};return Le("button",t,{ref:[n,A],state:z,stateAttributesMapping:us,props:Pe})});kn.displayName="SelectTrigger";const fs={value:()=>null},Ln=o.forwardRef(function(t,n){const{className:r,render:u,children:s,placeholder:d,...l}=t,{store:f,valueRef:p}=Ue(),x=L(f,V.value),i=L(f,V.items),b=L(f,V.itemToStringLabel),C=L(f,V.hasSelectedValue),E=!C&&d!=null&&s==null,v=L(f,V.hasNullItemLabel,E),w={value:x,placeholder:!C};let a=null;return typeof s=="function"?a=s(x):s!=null?a=s:!C&&d!=null&&!v?a=d:Array.isArray(x)?a=is(x,i,b):a=Vn(x,i,b),Le("span",t,{state:w,ref:[n,p],props:[{children:a},l],stateAttributesMapping:fs})});Ln.displayName="SelectValue";const Dn=o.forwardRef(function(t,n){const{className:r,render:u,...s}=t,{store:d}=Ue(),f={open:L(d,V.open)};return Le("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:Cr})});Dn.displayName="SelectIcon";const Un=o.createContext(void 0);Un.displayName="SelectPortalContext";const Fn=o.forwardRef(function(t,n){const{store:r}=Ue(),u=L(r,V.mounted),s=L(r,V.forceMount);return u||s?he.jsx(Un.Provider,{value:!0,children:he.jsx(Mr,{ref:n,...t})}):null});Fn.displayName="SelectPortal";const $t=o.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});$t.displayName="CompositeListContext";function ds(){return o.useContext($t)}function ps(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:u}=e,s=me(u),d=o.useRef(0),l=Dt(gs).current,f=Dt(ms).current,[p,x]=o.useState(0),i=o.useRef(p),b=me((a,h)=>{f.set(a,h??null),i.current+=1,x(i.current)}),C=me(a=>{f.delete(a),i.current+=1,x(i.current)}),E=o.useMemo(()=>{const a=new Map;return Array.from(f.keys()).filter(m=>m.isConnected).sort(hs).forEach((m,c)=>{const g=f.get(m)??{};a.set(m,{...g,index:c})}),a},[f,p]);Q(()=>{if(typeof MutationObserver!="function"||E.size===0)return;const a=new MutationObserver(h=>{const m=new Set,c=g=>m.has(g)?m.delete(g):m.add(g);h.forEach(g=>{g.removedNodes.forEach(c),g.addedNodes.forEach(c)}),m.size===0&&(i.current+=1,x(i.current))});return E.forEach((h,m)=>{m.parentElement&&a.observe(m.parentElement,{childList:!0})}),()=>{a.disconnect()}},[E]),Q(()=>{i.current===p&&(n.current.length!==E.size&&(n.current.length=E.size),r&&r.current.length!==E.size&&(r.current.length=E.size),d.current=E.size),s(E)},[s,E,n,r,p]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{r&&(r.current=[])},[r]);const v=me(a=>(l.add(a),()=>{l.delete(a)}));Q(()=>{l.forEach(a=>a(E))},[l,E]);const w=o.useMemo(()=>({register:b,unregister:C,subscribeMapChange:v,elementsRef:n,labelsRef:r,nextIndexRef:d}),[b,C,v,n,r,d]);return he.jsx($t.Provider,{value:w,children:t})}function ms(){return new Map}function gs(){return new Set}function hs(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Yt=o.createContext(void 0);Yt.displayName="SelectPositionerContext";function Gt(){const e=o.useContext(Yt);if(!e)throw new Error("Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.");return e}function St(e,t){e&&Object.assign(e.style,t)}const Hn={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},bs={position:"fixed"},jn=o.forwardRef(function(t,n){const{anchor:r,positionMethod:u="absolute",className:s,render:d,side:l="bottom",align:f="center",sideOffset:p=0,alignOffset:x=0,collisionBoundary:i="clipping-ancestors",collisionPadding:b,arrowPadding:C=5,sticky:E=!1,disableAnchorTracking:v,alignItemWithTrigger:w=!0,collisionAvoidance:a=Er,...h}=t,{store:m,listRef:c,labelsRef:g,alignItemWithTriggerActiveRef:H,selectedItemTextRef:F,valuesRef:U,initialValueRef:J,popupRef:ae,setValue:G}=Ue(),j=Pn(),W=L(m,V.open),I=L(m,V.mounted),ee=L(m,V.modal),q=L(m,V.value),y=L(m,V.openMethod),K=L(m,V.positionerElement),R=L(m,V.triggerElement),A=L(m,V.isItemEqualToValue),X=L(m,V.transitionStatus),N=o.useRef(null),ge=o.useRef(null),[T,te]=o.useState(w),P=I&&T&&y!=="touch";!I&&T!==w&&te(w),Q(()=>{I||(V.scrollUpArrowVisible(m.state)&&m.set("scrollUpArrowVisible",!1),V.scrollDownArrowVisible(m.state)&&m.set("scrollDownArrowVisible",!1))},[m,I]),o.useImperativeHandle(H,()=>P),Ir((P||ee)&&W&&y!=="touch",R);const $=Nr({anchor:r,floatingRootContext:j,positionMethod:u,mounted:I,side:l,sideOffset:p,align:f,alignOffset:x,arrowPadding:C,collisionBoundary:i,collisionPadding:b,sticky:E,disableAnchorTracking:v??P,collisionAvoidance:a,keepMounted:!0}),oe=P?"none":$.side,Ne=P?bs:$.positionerStyles,Pe=o.useMemo(()=>{const ie={};return W||(ie.pointerEvents="none"),{role:"presentation",hidden:!I,style:{...Ne,...ie}}},[W,I,Ne]),z={open:W,side:oe,align:$.align,anchorHidden:$.anchorHidden},Y=me(ie=>{m.set("positionerElement",ie)}),de=Le("div",t,{ref:[n,Y],state:z,stateAttributesMapping:Sn,props:[Pe,wn(X),h]}),ce=o.useRef(0),fe=me(ie=>{if(ie.size===0&&ce.current===0||U.current.length===0)return;const pe=ce.current;if(ce.current=ie.size,ie.size===pe)return;const M=be(wt);if(pe!==0&&!m.state.multiple&&q!==null&&ut(U.current,q,A)===-1){const S=J.current,B=S!=null&&ut(U.current,S,A)!==-1?S:null;G(B,M),B===null&&(m.set("selectedIndex",null),F.current=null)}if(pe!==0&&m.state.multiple&&Array.isArray(q)){const O=D=>ut(U.current,D,A)!==-1,S=q.filter(D=>O(D));(S.length!==q.length||S.some(D=>!ns(q,D,A)))&&(G(S,M),S.length===0&&(m.set("selectedIndex",null),F.current=null))}if(W&&P){m.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const O={height:""};St(K,O),St(ae.current,O)}}),xe=o.useMemo(()=>({...$,side:oe,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:te,scrollUpArrowRef:N,scrollDownArrowRef:ge}),[$,oe,P,te]);return he.jsx(ps,{elementsRef:c,labelsRef:g,onMapChange:fe,children:he.jsxs(Yt.Provider,{value:xe,children:[I&&ee&&he.jsx(Tr,{inert:Ar(!W),cutout:R}),de]})})});jn.displayName="SelectPositioner";function zn(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Bn=o.createContext(void 0);Bn.displayName="ToolbarRootContext";function xs(e){return o.useContext(Bn)}const Ge=1,ys={...Sn,...Cn},_n=o.forwardRef(function(t,n){const{render:r,className:u,finalFocus:s,...d}=t,{store:l,popupRef:f,onOpenChangeComplete:p,setOpen:x,valueRef:i,selectedItemTextRef:b,keyboardActiveRef:C,multiple:E,handleScrollArrowVisibility:v,scrollHandlerRef:w,highlightItemOnHover:a}=Ue(),{side:h,align:m,alignItemWithTriggerActive:c,setControlledAlignItemWithTrigger:g,scrollDownArrowRef:H,scrollUpArrowRef:F}=Gt(),U=xs()!=null,J=Pn(),{nonce:ae,disableStyleElements:G}=Pr(),j=je(),W=L(l,V.id),I=L(l,V.open),ee=L(l,V.mounted),q=L(l,V.popupProps),y=L(l,V.transitionStatus),K=L(l,V.triggerElement),R=L(l,V.positionerElement),A=L(l,V.listElement),X=o.useRef(0),N=o.useRef(!1),ge=o.useRef(0),T=o.useRef(!1),te=o.useRef({}),P=gn(),$=me(z=>{if(!R||!f.current||!T.current)return;if(N.current||!c){v();return}const Y=R.style.top==="0px",de=R.style.bottom==="0px",ce=R.getBoundingClientRect().height,fe=ft(R),xe=getComputedStyle(R),ie=parseFloat(xe.marginTop),pe=parseFloat(xe.marginBottom),M=un(getComputedStyle(f.current)),O=Math.min(fe.documentElement.clientHeight-ie-pe,M),S=z.scrollTop,D=fn(z);let B=0,k=null,ue=!1,ve=!1;const Te=ne=>{R.style.height=`${ne}px`},Re=(ne,Se)=>{const Ee=At(ne,0,O-ce);Ee>0&&Te(ce+Ee),z.scrollTop=Se,O-(ce+Ee)<=Ge&&(N.current=!0),v()};if(Y){const ne=D-S,Se=ce+ne,Ee=Math.min(Se,O);if(B=Ee,ne<=Ge){Re(ne,D);return}O-Ee>Ge?ve=!0:ue=!0}else if(de){const ne=S,Se=ce+ne,Ee=Math.min(Se,O),Oe=Se-O;if(B=Ee,ne<=Ge){Re(ne,0);return}O-Ee>Ge?k=0:(ue=!0,S<D&&(k=S-(ne-Oe)))}if(B=Math.ceil(B),B!==0&&Te(B),ve||k!=null){const ne=fn(z),Se=ve?ne:At(k,0,ne);Math.abs(z.scrollTop-Se)>Ge&&(z.scrollTop=Se)}(ue||B>=O-Ge)&&(N.current=!0),v()});o.useImperativeHandle(w,()=>$,[$]),Ct({open:I,ref:f,onComplete(){I&&(p==null||p(!0))}});const oe={open:I,transitionStatus:y,side:h,align:m};Q(()=>{!R||!f.current||Object.keys(te.current).length||(te.current={top:R.style.top||"0",left:R.style.left||"0",right:R.style.right,height:R.style.height,bottom:R.style.bottom,minHeight:R.style.minHeight,maxHeight:R.style.maxHeight,marginTop:R.style.marginTop,marginBottom:R.style.marginBottom})},[f,R]),Q(()=>{I||c||(T.current=!1,N.current=!1,X.current=0,ge.current=0,St(R,te.current))},[I,c,R,f]),Q(()=>{const z=f.current;if(!(!I||!K||!R||!z||l.state.transitionStatus==="ending")){if(!c){T.current=!0,P.request(v),z.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var de;const Y=vs(z);z.style.removeProperty("--transform-origin");try{const ce=getComputedStyle(R),fe=getComputedStyle(z),xe=ft(K),ie=ln(R),pe=K.getBoundingClientRect(),M=R.getBoundingClientRect(),O=pe.left,S=pe.height,D=A||z,B=D.scrollHeight,k=parseFloat(fe.borderBottomWidth),ue=parseFloat(ce.marginTop)||10,ve=parseFloat(ce.marginBottom)||10,Te=parseFloat(ce.minHeight)||100,Re=un(fe),ne=5,Se=5,Ee=20,Oe=xe.documentElement.clientHeight-ue-ve,nt=xe.documentElement.clientWidth,rt=Oe-pe.bottom+S,$e=b.current,st=i.current;let we,pt=0,mt=0;if($e&&st){const re=st.getBoundingClientRect();we=$e.getBoundingClientRect();const Ce=re.left-O,Ve=we.left-M.left,Ae=re.top-pe.top+re.height/2,Be=we.top-M.top+we.height/2;pt=Ce-Ve,mt=Be-Ae}const ot=rt+mt+ve+k;let De=Math.min(Oe,ot);const gt=Oe-ue-ve,Ye=ot-De,it=Math.max(ne,O+pt),lt=nt-Se,Et=Math.max(0,it+M.width-lt);R.style.left=`${it-Et}px`,R.style.height=`${De}px`,R.style.maxHeight="auto",R.style.marginTop=`${ue}px`,R.style.marginBottom=`${ve}px`,z.style.height="100%";const ht=D.scrollHeight-D.clientHeight,bt=Ye>=ht;bt&&(De=Math.min(Oe,M.height)-(Ye-ht));const It=pe.top<Ee||pe.bottom>Oe-Ee||De<Math.min(B,Te),_=(((de=ie.visualViewport)==null?void 0:de.scale)??1)!==1&&Or;if(It||_){T.current=!0,St(R,te.current),Vr.flushSync(()=>g(!1));return}if(bt){const re=Math.max(0,Oe-ot);R.style.top=M.height>=gt?"0":`${re}px`,R.style.height=`${De}px`,D.scrollTop=D.scrollHeight-D.clientHeight,X.current=Math.max(Te,De)}else R.style.bottom="0",X.current=Math.max(Te,De),D.scrollTop=Ye;if(we){const re=M.top,Ce=M.height,Ve=we.top+we.height/2,Ae=Ce>0?(Ve-re)/Ce*100:50,Be=At(Ae,0,100);z.style.setProperty("--transform-origin",`50% ${Be}%`)}(X.current===Oe||De>=Re)&&(N.current=!0),v(),setTimeout(()=>{T.current=!0})}finally{Y()}})}},[l,I,R,K,i,b,f,v,c,g,P,H,F,A]),o.useEffect(()=>{if(!c||!R||!I)return;const z=ln(R);function Y(de){x(!1,be(Lr,de))}return z.addEventListener("resize",Y),()=>{z.removeEventListener("resize",Y)}},[x,c,R,I]);const Ne={...A?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":E||void 0,id:`${W}-list`},onKeyDown(z){C.current=!0,U&&Dr.has(z.key)&&z.stopPropagation()},onMouseMove(){C.current=!1},onPointerLeave(z){if(!a||zn(z)||z.pointerType==="touch")return;const Y=z.currentTarget;j.start(0,()=>{l.set("activeIndex",null),Y.focus({preventScroll:!0})})},onScroll(z){A||$(z.currentTarget)},...c&&{style:A?{height:"100%"}:Hn}},Pe=Le("div",t,{ref:[n,f],state:oe,stateAttributesMapping:ys,props:[q,Ne,wn(y),{className:!A&&c?Ut.className:void 0},d]});return he.jsxs(o.Fragment,{children:[!G&&Ut.getElement(ae),he.jsx(kr,{context:J,modal:!1,disabled:!ee,returnFocus:s,restoreFocus:!0,children:Pe})]})});_n.displayName="SelectPopup";function un(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function fn(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const dn=[["transform","none"],["scale","1"],["translate","0 0"]];function vs(e){const{style:t}=e,n={};for(const[r,u]of dn)n[r]=t.getPropertyValue(r),t.setProperty(r,u,"important");return()=>{for(const[r]of dn){const u=n[r];u?t.setProperty(r,u):t.removeProperty(r)}}}const Kn=o.forwardRef(function(t,n){const{className:r,render:u,...s}=t,{store:d,scrollHandlerRef:l}=Ue(),{alignItemWithTriggerActive:f}=Gt(),p=L(d,V.hasScrollArrows),x=L(d,V.openMethod),i=L(d,V.multiple),C={id:`${L(d,V.id)}-list`,role:"listbox","aria-multiselectable":i||void 0,onScroll(v){var w;(w=l.current)==null||w.call(l,v.currentTarget)},...f&&{style:Hn},className:p&&x!=="touch"?Ut.className:void 0},E=me(v=>{d.set("listElement",v)});return Le("div",t,{ref:[n,E],props:[C,s]})});Kn.displayName="SelectList";let Wn=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Rs(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:u,index:s}=e,{register:d,unregister:l,subscribeMapChange:f,elementsRef:p,labelsRef:x,nextIndexRef:i}=ds(),b=o.useRef(-1),[C,E]=o.useState(s??(u===Wn.GuessFromOrder?()=>{if(b.current===-1){const a=i.current;i.current+=1,b.current=a}return b.current}:-1)),v=o.useRef(null),w=o.useCallback(a=>{var h;if(v.current=a,C!==-1&&a!==null&&(p.current[C]=a,x)){const m=t!==void 0;x.current[C]=m?t:((h=r==null?void 0:r.current)==null?void 0:h.textContent)??a.textContent}},[C,p,x,t,r]);return Q(()=>{if(s!=null)return;const a=v.current;if(a)return d(a,n),()=>{l(a)}},[s,d,l,n]),Q(()=>{if(s==null)return f(a=>{var m;const h=v.current?(m=a.get(v.current))==null?void 0:m.index:null;h!=null&&E(h)})},[s,f,E]),o.useMemo(()=>({ref:w,index:C}),[C,w])}const Xt=o.createContext(void 0);Xt.displayName="SelectItemContext";function Jt(){const e=o.useContext(Xt);if(!e)throw new Error("Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");return e}const qn=o.memo(o.forwardRef(function(t,n){const{render:r,className:u,value:s=null,label:d,disabled:l=!1,nativeButton:f=!1,...p}=t,x=o.useRef(null),i=Rs({label:d,textRef:x,indexGuessBehavior:Wn.GuessFromOrder}),{store:b,getItemProps:C,setOpen:E,setValue:v,selectionRef:w,typingRef:a,valuesRef:h,keyboardActiveRef:m,multiple:c,highlightItemOnHover:g}=Ue(),H=je(),F=L(b,V.isActive,i.index),U=L(b,V.isSelected,i.index,s),J=L(b,V.isSelectedByFocus,i.index),ae=L(b,V.isItemEqualToValue),G=i.index,j=G!==-1,W=o.useRef(null),I=_e(G);Q(()=>{if(!j)return;const P=h.current;return P[G]=s,()=>{delete P[G]}},[j,G,s,h]),Q(()=>{if(!j)return;const P=b.state.value;let $=P;c&&Array.isArray(P)&&P.length>0&&($=P[P.length-1]),$!==void 0&&tt(s,$,ae)&&b.set("selectedIndex",G)},[j,G,c,ae,b,s]);const ee={disabled:l,selected:U,highlighted:F},q=C({active:F,selected:U});q.onFocus=void 0,q.id=void 0;const y=o.useRef(null),K=o.useRef("mouse"),R=o.useRef(!1),{getButtonProps:A,buttonRef:X}=Rn({disabled:l,focusableWhenDisabled:!0,native:f});function N(P){const $=b.state.value;if(c){const oe=Array.isArray($)?$:[],Ne=U?rs(oe,s,ae):[...oe,s];v(Ne,be(Pt,P))}else v(s,be(Pt,P)),E(!1,be(Pt,P))}const ge={role:"option","aria-selected":U,tabIndex:F?0:-1,onFocus(){b.set("activeIndex",G)},onMouseEnter(){!m.current&&b.state.selectedIndex===null&&g&&b.set("activeIndex",G)},onMouseMove(){g&&b.set("activeIndex",G)},onMouseLeave(P){!g||m.current||zn(P)||H.start(0,()=>{b.state.activeIndex===G&&b.set("activeIndex",null)})},onTouchStart(){w.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(P){y.current=P.key,b.set("activeIndex",G)},onClick(P){R.current=!1,!(P.type==="keydown"&&y.current===null)&&(l||y.current===" "&&a.current||K.current!=="touch"&&!F||(y.current=null,N(P.nativeEvent)))},onPointerEnter(P){K.current=P.pointerType},onPointerDown(P){K.current=P.pointerType,R.current=!0},onMouseUp(P){if(l)return;if(R.current){R.current=!1;return}const $=!w.current.allowSelectedMouseUp&&U,oe=!w.current.allowUnselectedMouseUp&&!U;$||oe||K.current!=="touch"&&!F||N(P.nativeEvent)}},T=Le("div",t,{ref:[X,n,i.ref,W],state:ee,props:[q,ge,p,A]}),te=o.useMemo(()=>({selected:U,indexRef:I,textRef:x,selectedByFocus:J,hasRegistered:j}),[U,I,x,J,j]);return he.jsx(Xt.Provider,{value:te,children:T})}));qn.displayName="SelectItem";const $n=o.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:u}=Jt();return r||u?he.jsx(Yn,{...t,ref:n}):null});$n.displayName="SelectItemIndicator";const Yn=o.memo(o.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:u,...s}=e,{selected:d}=Jt(),l=o.useRef(null),{transitionStatus:f,setMounted:p}=Bt(d),i=Le("span",e,{ref:[t,l],state:{selected:d,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:Cn});return Ct({open:d,ref:l,onComplete(){d||p(!1)}}),i}));Yn.displayName="Inner";const Gn=o.memo(o.forwardRef(function(t,n){const{indexRef:r,textRef:u,selectedByFocus:s,hasRegistered:d}=Jt(),{selectedItemTextRef:l}=Ue(),{className:f,render:p,...x}=t,i=o.useCallback(C=>{if(!C||!d)return;const E=l.current===null||!l.current.isConnected;(s||E&&r.current===0)&&(l.current=C)},[l,r,s,d]);return Le("div",t,{ref:[i,n,u],props:x})}));Gn.displayName="SelectItemText";const Zt=o.forwardRef(function(t,n){const{render:r,className:u,direction:s,keepMounted:d=!1,...l}=t,{store:f,popupRef:p,listRef:x,handleScrollArrowVisibility:i,scrollArrowsMountedCountRef:b}=Ue(),{side:C,scrollDownArrowRef:E,scrollUpArrowRef:v}=Gt(),w=s==="up"?V.scrollUpArrowVisible:V.scrollDownArrowVisible,a=L(f,w),h=L(f,V.openMethod),m=a&&h!=="touch",c=je(),g=s==="up"?v:E,{transitionStatus:H,setMounted:F}=Bt(m);Q(()=>(b.current+=1,f.state.hasScrollArrows||f.set("hasScrollArrows",!0),()=>{b.current=Math.max(0,b.current-1),b.current===0&&f.state.hasScrollArrows&&f.set("hasScrollArrows",!1)}),[f,b]),Ct({open:m,ref:g,onComplete(){m||F(!1)}});const ae=Le("div",t,{ref:[n,g],state:{direction:s,visible:m,side:C,transitionStatus:H},props:[{"aria-hidden":!0,children:s==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(j){if(j.movementX===0&&j.movementY===0||c.isStarted())return;f.set("activeIndex",null);function W(){var K;const I=f.state.listElement??p.current;if(!I)return;f.set("activeIndex",null),i();const ee=I.scrollTop===0,q=Math.round(I.scrollTop+I.clientHeight)>=I.scrollHeight;if(x.current.length===0&&(s==="up"?f.set("scrollUpArrowVisible",!ee):f.set("scrollDownArrowVisible",!q)),s==="up"&&ee||s==="down"&&q){c.clear();return}if((f.state.listElement||p.current)&&x.current&&x.current.length>0){const R=x.current,A=((K=g.current)==null?void 0:K.offsetHeight)||0;if(s==="up"){let X=0;const N=I.scrollTop+A;for(let T=0;T<R.length;T+=1){const te=R[T];if(te&&te.offsetTop>=N){X=T;break}}const ge=Math.max(0,X-1);if(ge<X){const T=R[ge];T&&(I.scrollTop=Math.max(0,T.offsetTop-A))}else I.scrollTop=0}else{let X=R.length-1;const N=I.scrollTop+I.clientHeight-A;for(let T=0;T<R.length;T+=1){const te=R[T];if(te&&te.offsetTop+te.offsetHeight>N){X=Math.max(0,T-1);break}}const ge=Math.min(R.length-1,X+1);if(ge>X){const T=R[ge];T&&(I.scrollTop=T.offsetTop+T.offsetHeight-I.clientHeight+A)}else I.scrollTop=I.scrollHeight-I.clientHeight}}c.start(40,W)}c.start(40,W)},onMouseLeave(){c.clear()}},l]});return m||d?ae:null});Zt.displayName="SelectScrollArrow";const Xn=o.forwardRef(function(t,n){return he.jsx(Zt,{...t,ref:n,direction:"down"})});Xn.displayName="SelectScrollDownArrow";const Jn=o.forwardRef(function(t,n){return he.jsx(Zt,{...t,ref:n,direction:"up"})});Jn.displayName="SelectScrollUpArrow";const Ds=ls;function Us({className:e,...t}){return se.jsxDEV(Ln,{"data-slot":"select-value",className:ke("flex flex-1 text-left",e),...t},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:21,columnNumber:5},this)}function Fs({className:e,size:t="default",children:n,...r}){return se.jsxDEV(kn,{"data-slot":"select-trigger","data-size":t,className:ke("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,se.jsxDEV(Dn,{render:se.jsxDEV(Nn,{className:"text-muted-foreground size-4 pointer-events-none"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:50,columnNumber:11},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:48,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:38,columnNumber:5},this)}function Hs({className:e,children:t,side:n="bottom",sideOffset:r=4,align:u="center",alignOffset:s=0,alignItemWithTrigger:d=!0,...l}){return se.jsxDEV(Fn,{children:se.jsxDEV(jn,{side:n,sideOffset:r,align:u,alignOffset:s,alignItemWithTrigger:d,className:"isolate z-50",children:se.jsxDEV(_n,{"data-slot":"select-content","data-align-trigger":d,className:ke("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...l,children:[se.jsxDEV(Ss,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:87,columnNumber:11},this),se.jsxDEV(Kn,{children:t},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:88,columnNumber:11},this),se.jsxDEV(ws,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:89,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:81,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:73,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:72,columnNumber:5},this)}function js({className:e,children:t,...n}){return se.jsxDEV(qn,{"data-slot":"select-item",className:ke("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[se.jsxDEV(Gn,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:123,columnNumber:7},this),se.jsxDEV($n,{render:se.jsxDEV("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:127,columnNumber:17},this),children:se.jsxDEV(zr,{className:"pointer-events-none"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:129,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:126,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:115,columnNumber:5},this)}function Ss({className:e,...t}){return se.jsxDEV(Jn,{"data-slot":"select-scroll-up-button",className:ke("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",e),...t,children:se.jsxDEV(Kr,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:158,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:153,columnNumber:5},this)}function ws({className:e,...t}){return se.jsxDEV(Xn,{"data-slot":"select-scroll-down-button",className:ke("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",e),...t,children:se.jsxDEV(Nn,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:174,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/select.tsx",lineNumber:169,columnNumber:5},this)}export{Ps as C,As as I,Ds as S,Os as a,Vs as b,Ls as c,Fs as d,Us as e,Hs as f,js as g,Rs as h,xs as i,ps as j,Qr as k,es as l,as as m,Gr as n,ks as o,Ts as u};
17
- //# sourceMappingURL=select-Wn7lKWHQ.js.map
17
+ //# sourceMappingURL=select-DGBwxGiK.js.map