Files
boc/backups/2026-07-12-1023/landvex-prod/assets/select-Bi-TzF3J.js
T

7 lines
21 KiB
JavaScript
Raw Normal View History

import{o as ft,r as t,az as Pe,g as mt,c as be,j as r,aB as ht,e as gt,as as Ie,ay as vt,H as k,au as $,P as j,a9 as St,bh as xt,aC as wt,d as P,aD as yt,bi as Re,aA as Ct,aE as It,aG as Tt,aH as bt,aI as Nt,aJ as Pt,aK as Rt,aL as Et,bg as Ne,aM as _t,i as G}from"./index-oAPVDf-r.js";import{C as Ee}from"./chevron-down-QDDHZwZg.js";import{C as jt}from"./check-CG8zylH4.js";/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mt=ft("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var At=[" ","Enter","ArrowUp","ArrowDown"],Dt=[" ","Enter"],Q="Select",[ie,de,Ot]=vt(Q),[oe]=gt(Q,[Ot,Pe]),ue=Pe(),[Lt,Y]=oe(Q),[kt,Bt]=oe(Q),_e=o=>{const{__scopeSelect:n,children:e,open:a,defaultOpen:i,onOpenChange:p,value:l,defaultValue:c,onValueChange:s,dir:f,name:v,autoComplete:w,disabled:b,required:N,form:T}=o,d=ue(n),[g,y]=t.useState(null),[u,h]=t.useState(null),[M,A]=t.useState(!1),ne=mt(f),[R,O]=be({prop:a,defaultProp:i??!1,onChange:p,caller:Q}),[W,X]=be({prop:l,defaultProp:c,onChange:s,caller:Q}),B=t.useRef(null),V=g?T||!!g.closest("form"):!0,[K,H]=t.useState(new Set),U=Array.from(K).map(E=>E.props.value).join(";");return r.jsx(ht,{...d,children:r.jsxs(Lt,{required:N,scope:n,trigger:g,onTriggerChange:y,valueNode:u,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:W,onValueChange:X,open:R,onOpenChange:O,dir:ne,triggerPointerDownPosRef:B,disabled:b,children:[r.jsx(ie.Provider,{scope:n,children:r.jsx(kt,{scope:o.__scopeSelect,onNativeOptionAdd:t.useCallback(E=>{H(L=>new Set(L).add(E))},[]),onNativeOptionRemove:t.useCallback(E=>{H(L=>{const F=new Set(L);return F.delete(E),F})},[]),children:e})}),V?r.jsxs(et,{"aria-hidden":!0,required:N,tabIndex:-1,name:v,autoComplete:w,value:W,onChange:E=>X(E.target.value),disabled:b,form:T,children:[W===void 0?r.jsx("option",{value:""}):null,Array.from(K)]},U):null]})})};_e.displayName=Q;var je="SelectTrigger",Me=t.forwardRef((o,n)=>{const{__scopeSelect:e,disabled:a=!1,...i}=o,p=ue(e),l=Y(je,e),c=l.disabled||a,s=k(n,l.onTriggerChange),f=de(e),v=t.useRef("touch"),[w,b,N]=ot(d=>{const g=f().filter(h=>!h.disabled),y=g.find(h=>h.value===l.value),u=nt(g,d,y);u!==void 0&&l.onValueChange(u.value)}),T=d=>{c||(l.onOpenChange(!0),N()),d&&(l.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(wt,{asChild:!0,...p,children:r.jsx(j.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":tt(l.value)?"":void 0,...i,ref:s,onClick:P(i.onClick,d=>{d.currentTarget.focus(),v.current!=="mouse"&&T(d)}),onPointerDown:P(i.onPointerDown,d=>{v.current=d.pointerType;const g=d.target;g.hasPointerCapture(d.pointerId)&&g.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(T(d),d.preventDefault())}),onKeyDown:P(i.onKeyDown,d=>{const g=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&b(d.key),!(g&&d.key===" ")&&At.includes(d.key)&&(T(),d.preventDefault())})})})});Me.displayName=je;var Ae="SelectValue",De=t.forwardRef((o,n)=>{const{__scopeSelect:e,className:a,style:i,children:p,placeholder:l="",...c}=o,s=Y(Ae,e),{onValueNodeHasChildrenChange:f}=s,v=p!==void 0,w=k(n,s.onValueNodeChange);return $(()=>{f(v)},[f,v]),r.jsx(j.span,{...c,ref:w,style:{pointerEvents:"none"},children:tt(s.value)?r.jsx(r.Fragment,{children:l}):p})});De.displayName=Ae;var Vt="SelectIcon",Oe=t.forwardRef((o,n)=>{const{__scopeSelect:e,children:a,...i}=o;return r.jsx(j.span,{"aria-hidden":!0,...i,ref:n,children:a||"▼"})});Oe.displayName=Vt;var Ht="SelectPortal",Le=o=>r.jsx(yt,{asChild:!0,...o});Le.displayName=Ht;var ee="SelectContent",ke=t.forwardRef((o,n)=>{const e=Y(ee,o.__scopeSelect),[a,i]=t.useState();if($(()=>{i(new DocumentFragment)},[]),!e.open){const p=a;return p?Re.createPortal(r.jsx(Be,{scope:o.__scopeSelect,children:r.jsx(ie.Slot,{scope:o.__scopeSelect,children:r.jsx("div",{children:o.children})})}),p):null}return r.jsx(Ve,{...o,ref:n})});ke.displayName=ee;var D=10,[Be,q]=oe(ee),Ut="SelectContentImpl",Ft=Nt("SelectContent.RemoveScroll"),Ve=t.forwardRef((o,n)=>{const{__scopeSelect:e,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:p,onPointerDownOutside:l,side:c,sideOffset:s,align:f,alignOffset:v,arrowPadding:w,collisionBoundary:b,collisionPadding:N,sticky:T,hideWhenDetached:d,avoidCollisions:g,...y}=o,u=Y(ee,e),[h,M]=t