System.register(["./index-legacy-1cbe5d00.js","./index-legacy-4bfe3a0d.js"],(function(e,a){"use strict";var c,t,r,n,l,o,s,i,_,u,m,p,d,h,f,b,k,g,v,y;return{setters:[e=>{c=e.c,t=e.ai,r=e.m,n=e.t,l=e.d,o=e.bn,s=e.r,i=e.a2,_=e.a,u=e.ak,m=e.h,p=e.p,d=e.k,h=e.x,f=e.w,b=e.I,k=e.C,g=e.A},e=>{v=e.f,y=e.F}],execute:function(){var I=document.createElement("style");I.textContent="._m-search_cpkbm_1{--van-cell-background-color: transparent}._m-search_cpkbm_1 input::-moz-placeholder{color:var(--k-gray-4);font-size:.34667rem}._m-search_cpkbm_1 input::placeholder{color:var(--k-gray-4);font-size:.34667rem}._m-search_cpkbm_1 .van-field__control{-webkit-user-select:text!important;-moz-user-select:text!important;user-select:text!important;font-size:.34667rem}._m-search_cpkbm_1 .van-search__field{background:transparent!important;padding:0 var(--van-padding-xs) 0 0}._m-search_cpkbm_1 .van-field__right-icon{display:flex;align-items:center;justify-content:center;padding-right:.10667rem}._m-search_cpkbm_1._default_cpkbm_23 .van-search__content{background:#f8f9fc!important}._m-search_cpkbm_1._white_cpkbm_26 .van-search__content{background:#fff!important}._m-search_cpkbm_1._transparent_cpkbm_29 .van-search__content{background:rgba(255,255,255,.16)}._m-search_cpkbm_1._transparent_cpkbm_29 .van-search__content input::-moz-placeholder{color:#fff}._m-search_cpkbm_1._transparent_cpkbm_29 .van-search__content input::placeholder{color:#fff}._m-search_cpkbm_1._transparent_cpkbm_29 .van-search__content input,._m-search_cpkbm_1._transparent_cpkbm_29 .van-search__content .van-field__clear{color:#fff}._m-search_cpkbm_1 ._searchBtn_cpkbm_41{width:1.38667rem;height:.66667rem;padding:0;font-size:.34667rem;font-weight:500;--van-button-mini-height: .74667rem;--van-font-size-xs: .32rem;background:linear-gradient(to right,#40c4fe,#259CFE);border:none}._m-search_cpkbm_1 ._leftIcon_cpkbm_52{width:.37333rem;height:.37333rem;margin-top:-.05333rem}._m-search_cpkbm_1 ._leftIcon_cpkbm_52 img{width:100%;height:100%}\n",document.head.appendChild(I);const[w,x,B]=c("search"),C=t({},v,{label:String,shape:r("square"),leftIcon:r("search"),clearable:n,actionText:String,background:String,showAction:Boolean});var S=l({name:w,props:C,emits:["blur","focus","clear","search","cancel","clickInput","clickLeftIcon","clickRightIcon","update:modelValue"],setup(e,{emit:a,slots:c,attrs:r}){const n=o(),l=s(),d=()=>{c.action||(a("update:modelValue",""),a("cancel"))},h=c=>{13===c.keyCode&&(p(c),a("search",e.modelValue))},f=()=>e.id||`${n}-input`,b=()=>{if(c.label||e.label)return _("label",{class:x("label"),for:f()},[c.label?c.label():e.label])},k=()=>{if(e.showAction){const a=e.actionText||B("cancel");return _("div",{class:x("action"),role:"button",tabindex:0,onClick:d},[c.action?c.action():a])}},g=e=>a("blur",e),I=e=>a("focus",e),w=e=>a("clear",e),C=e=>a("clickInput",e),S=e=>a("clickLeftIcon",e),V=e=>a("clickRightIcon",e),z=Object.keys(v),j=()=>{const n=t({},r,u(e,z),{id:f()});return _(y,m({ref:l,type:"search",class:x("field"),border:!1,onBlur:g,onFocus:I,onClear:w,onKeypress:h,onClickInput:C,onClickLeftIcon:S,onClickRightIcon:V,"onUpdate:modelValue":e=>a("update:modelValue",e)},n),u(c,["left-icon","right-icon"]))};return i({focus:()=>{var e;return null==(e=l.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=l.value)?void 0:e.blur()}}),()=>{var a;return _("div",{class:x({"show-action":e.showAction}),style:{background:e.background}},[null==(a=c.left)?void 0:a.call(c),_("div",{class:x("content",e.shape)},[b(),j()]),k()])}}});const V=d(S),z={"m-search":"_m-search_cpkbm_1",default:"_default_cpkbm_23",white:"_white_cpkbm_26",transparent:"_transparent_cpkbm_29",searchBtn:"_searchBtn_cpkbm_41",leftIcon:"_leftIcon_cpkbm_52"},j=""+new URL("icon-search-237b58b1.svg",a.meta.url).href;e("M",l({name:"m-search",props:{modelValue:{type:String,default:""},shape:{type:String,default:"round"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},autofocus:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入搜索关键词"},background:{type:String,default:"#fff"},searchIcon:{type:String,default:j},inputBackground:{type:String,default:"default"}},emits:["search","focus","blur"],setup(e,{slots:a,emit:c}){const t=h({search:e.modelValue||""});return f((()=>e.modelValue),(()=>{t.search=e.modelValue})),()=>_(V,{class:[z["m-search"],z[e.inputBackground]],shape:e.shape,background:e.background,placeholder:e.placeholder,disabled:e.disabled,autofocus:e.autofocus,autocomplete:"off",clearable:e.clearable,modelValue:t.search,"onUpdate:modelValue":e=>t.search=e,clearTrigger:"always",onClear:()=>{console.log("clear"),t.search="",c("search",t.search)},onFocus:()=>c("focus"),onBlur:()=>c("blur",t.search),onSearch:()=>c("search",t.search)},{left:()=>a.left&&a.left(),"left-icon":()=>_(b,{name:e.searchIcon,class:z.leftIcon},null),"right-icon":()=>_(k,{disabled:e.disabled,class:z.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>c("search",t.search)},{default:()=>[g("搜索")]})})}}))}}}));
