(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[463],{900463(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{m:()=>e.m});var e=__webpack_require__(914022)}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},914022(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{m:()=>u});var e=__webpack_require__(303280);__webpack_require__.n(e);var t=__webpack_require__(860012);var r=__webpack_require__(848574);var a=__webpack_require__(305142);var l=__webpack_require__(568894);var n=__webpack_require__(556734);var o=__webpack_require__(219384);var c=__webpack_require__(679968);var i=__webpack_require__(126528);var s=__webpack_require__(68940);let u=u=>{let f=(0,e.c)(42);let{options:m,selectedId:h,onChange:b,testId:p}=u;let[v,w]=(0,t.useState)(!1);let[k,g]=(0,t.useState)(-1);let E=(0,t.useRef)(null);let $=(0,t.useRef)(null);let y;f[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],f[0]=y):y=f[0];let D=(0,t.useRef)(y);let S;if(f[1]!==m||f[2]!==h){let e;f[4]!==h?(e=e=>e.id===h,f[4]=h,f[5]=e):e=f[5],S=m.find(e),f[1]=m,f[2]=h,f[3]=S}else S=f[3];let x=S;let _;f[6]!==h?(_=e=>e.id===h,f[6]=h,f[7]=_):_=f[7];let T=m.findIndex(_);let A;let C;f[8]!==v?(A=()=>{let e=e=>{E.current&&!E.current.contains(e.target)&&(w(!1),g(-1))};return v&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},C=[v],f[8]=v,f[9]=A,f[10]=C):(A=f[9],C=f[10]),(0,t.useEffect)(A,C);let L;let I;f[11]!==v||f[12]!==T?(L=()=>{v&&T>=0&&(g(T),D.current[T]?.focus())},I=[v,T],f[11]=v,f[12]=T,f[13]=L,f[14]=I):(L=f[13],I=f[14]),(0,t.useEffect)(L,I);let M;f[15]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{w(d)},f[15]=M):M=f[15];let N=M;let R;f[16]!==b?(R=e=>{b(e.id),w(!1),g(-1),$.current?.focus()},f[16]=b,f[17]=R):R=f[17];let z=R;let K;f[18]===Symbol.for("react.memo_cache_sentinel")?(K=e=>{switch(e.key){case"Enter":case" ":case"ArrowDown":case"ArrowUp":{e.preventDefault(),w(!0);break}default:}},f[18]=K):K=f[18];let H=K;let U;f[19]!==z||f[20]!==m?(U=(e,t)=>{switch(e.key){case"Enter":case" ":{e.preventDefault(),z(m[t]);break}case"ArrowDown":{e.preventDefault(),t<m.length-1&&(g(t+1),D.current[t+1]?.focus());break}case"ArrowUp":{e.preventDefault(),t>0&&(g(t-1),D.current[t-1]?.focus());break}case"Escape":{e.preventDefault(),w(!1),g(-1),$.current?.focus();break}case"Tab":{w(!1),g(-1);break}default:}},f[19]=z,f[20]=m,f[21]=U):U=f[21];let j=U;let B=`${p}-button`;let G=x?.label??"";let J;f[22]!==G?(J=t.createElement(s.E,{variant:r.J3.BodySm,color:r.r7.TextDefault},G),f[22]=G,f[23]=J):J=f[23];let P=v?a.$M.ArrowUp:a.$M.ArrowDown;let V;f[24]!==P?(V=t.createElement(o.I,{name:P,size:a.lK.Xs,color:a.Li.IconDefault,className:"ml-auto"}),f[24]=P,f[25]=V):V=f[25];let X;f[26]!==v||f[27]!==B||f[28]!==J||f[29]!==V?(X=t.createElement(c.u,{ref:$,size:l.PH.Sm,className:"flex items-center justify-start gap-1 rounded-lg bg-background-muted px-3 py-2 hover:bg-hover active:opacity-70",onClick:N,onKeyDown:H,"aria-haspopup":"listbox","aria-expanded":v,"data-testid":B},J,V),f[26]=v,f[27]=B,f[28]=J,f[29]=V,f[30]=X):X=f[30];let q;f[31]!==k||f[32]!==j||f[33]!==z||f[34]!==v||f[35]!==m||f[36]!==h||f[37]!==p?(q=v&&t.createElement(i.a,{className:"absolute left-0 top-full z-10 mt-1 min-w-[120px] overflow-hidden rounded-lg border border-border-muted bg-background-default shadow-lg",flexDirection:n.uV.Column,role:"listbox","aria-activedescendant":k>=0?`${p}-option-${m[k]?.id}`:undefined,"data-testid":`${p}-menu`},m.map((e,l)=>{let n=e.id===h;return t.createElement(c.u,{key:e.id,ref:e=>{D.current[l]=e},onClick:()=>z(e),onKeyDown:e=>j(e,l),className:`w-full justify-between text-left rounded-none px-3 py-2 min-w-0 h-auto active:bg-pressed ${n?"bg-hover":"bg-transparent hover:bg-hover"}`,role:"option","aria-selected":n,id:`${p}-option-${e.id}`,"data-testid":`${p}-option-${e.id}`},t.createElement(s.E,{variant:r.J3.BodySm,color:r.r7.TextDefault},e.label),n&&t.createElement(o.I,{name:a.$M.Check,size:a.lK.Sm,color:a.Li.IconDefault}))})),f[31]=k,f[32]=j,f[33]=z,f[34]=v,f[35]=m,f[36]=h,f[37]=p,f[38]=q):q=f[38];let F;return f[39]!==X||f[40]!==q?(F=t.createElement(i.a,{ref:E,className:"relative"},X,q),f[39]=X,f[40]=q,f[41]=F):F=f[41],F};function d(e){return!e}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);