import{r as i,a as s,F as f,j as c}from"./react.b0bedc10.js";import{a as k,S as C,b as S}from"./zarm.80120c4d.js";import{s as w}from"./selected.9605814d.js";import{g}from"./index.71687838.js";const v="_button_bar_1ch8m_12",x="_button_1_1ch8m_22",I="_button_2_1ch8m_33",N="_unity_pop_new_1ch8m_42",F="_unity_pop_1ch8m_42",E="_unity_check_1ch8m_66",j="_unity_check_2_1ch8m_73",B="_unity_choose_1ch8m_79",L="_unity_empty_1ch8m_98",P="_unity_close_1ch8m_108",z="_bar_1ch8m_126",A="_wrap_1ch8m_135",M="_cell_1ch8m_140",$="_selectIcon_1ch8m_151",q="_label_1ch8m_155",D="_placeholder_1ch8m_158";var t={"detail-cell":"_detail-cell_1ch8m_1",button_bar:v,button_1:x,button_2:I,unity_pop_new:N,unity_pop:F,unity_check:E,unity_check_2:j,unity_choose:B,unity_empty:L,unity_close:P,bar:z,wrap:A,cell:M,selectIcon:$,label:q,placeholder:D};const G=g("cancel1"),Q=({title:h,placeholder:u,visible:m,value:l,options:n,onClose:o,onSelected:p})=>{const[_,a]=i.exports.useState(),[r,y]=i.exports.useState(""),b=e=>{a(e),p([e]),o()};return i.exports.useEffect(()=>{if(l&&n)if(typeof l=="string"){const e=n.find(d=>d.value==l);e&&a(e)}else a(l[0])},[l]),s(f,{children:[!_&&u?c("span",{className:t.placeholder,children:u}):null,_?c("span",{className:t.value,children:_.label}):null,s(k,{visible:m,onMaskClick:o,children:[s("div",{className:t.bar,children:[c(G,{onClick:()=>o(),style:{fontSize:24,color:"#999",position:"absolute",left:16,top:3}}),c("span",{children:h||"\u8BF7\u9009\u62E9"})]}),s("div",{className:t.wrap,children:[c("div",{style:{height:"44px"},children:c(C,{placeholder:"\u8BF7\u8F93\u5165\u7EC4\u7EC7\u673A\u6784",value:r,onChange:e=>{y(e)}})}),n&&n.length&&(r?n.filter(e=>e.label.toLowerCase().includes(r.toLowerCase())):n).map(e=>c(S,{onClick:()=>b(e),children:s("div",{className:t.cell,children:[c("span",{className:t.label,children:e.label}),(_==null?void 0:_.value)==e.value?c("img",{className:t.selectIcon,src:w}):""]})},e.value))]})]})]})};export{Q as C};
