System.register(["./index-legacy-94f8815f.js","./index-legacy-ab4c0267.js"],(function(e,a){"use strict";var l,n,r,o,t,d,s,i,u,c,v,p,m,b,y,g,f,h,x,V,k,A,C,S;return{setters:[e=>{l=e.c,n=e.d,r=e.aa,o=e.Y,t=e.a,d=e.aU,s=e.t,i=e.k,u=e.ac,c=e.n,v=e.r,p=e.ad,m=e.e,b=e.aV,y=e.w,g=e.aG,f=e.z,h=e.aH,x=e.ae,V=e.h,k=e.g,A=e.v},e=>{C=e.c,S=e.C}],execute:function(){const[a,j]=l("collapse"),z=Symbol(a),B={border:s,accordion:Boolean,modelValue:{type:[String,Number,Array],default:""}};var N=n({name:a,props:B,emits:["change","update:modelValue"],setup(e,{emit:a,slots:l}){const{linkChildren:n,children:s}=r(z),i=e=>{a("change",e),a("update:modelValue",e)};return o({toggleAll:(a={})=>{if(e.accordion)return;"boolean"==typeof a&&(a={expanded:a});const{expanded:l,skipDisabled:n}=a,r=s.filter((e=>e.disabled&&n?e.expanded.value:null!=l?l:!e.expanded.value)).map((e=>e.itemName.value));i(r)}}),n({toggle:(a,l)=>{const{accordion:n,modelValue:r}=e;i(n?a===r?"":a:l?r.concat(a):r.filter((e=>e!==a)))},isExpanded:a=>{const{accordion:l,modelValue:n}=e;return!!function(e,a){return a&&Array.isArray(e)?(console.error('[Vant] Collapse: "v-model" should not be Array in accordion mode'),!1):!(!a&&!Array.isArray(e)&&(console.error('[Vant] Collapse: "v-model" should be Array in non-accordion mode'),1))}(n,l)&&(l?n===a:n.includes(a))}}),()=>{var a;return t("div",{class:[j(),{[d]:e.border}]},[null==(a=l.default)?void 0:a.call(l)])}}});e("C",i(N));const[R,w]=l("collapse-item"),E=["icon","title","value","label","right-icon"],H=u({},C,{name:c,isLink:s,disabled:Boolean,readonly:Boolean,lazyRender:s});var L=n({name:R,props:H,setup(e,{slots:a}){const l=v(),n=v(),{parent:r,index:d}=p(z);if(!r)return void console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.");const s=m((()=>{var a;return null!=(a=e.name)?a:d.value})),i=m((()=>r.isExpanded(s.value))),u=v(i.value),c=b((()=>u.value||!e.lazyRender)),j=()=>{i.value?l.value&&(l.value.style.height=""):u.value=!1};y(i,((e,a)=>{null!==a&&(e&&(u.value=!0),(e?f:h)((()=>{if(!n.value||!l.value)return;const{offsetHeight:a}=n.value;if(a){const n=`${a}px`;l.value.style.height=e?"0":n,g((()=>{l.value&&(l.value.style.height=e?n:"0")}))}else j()})))}));const B=(e=!i.value)=>{r.toggle(s.value,e)},N=()=>{e.disabled||e.readonly||B()},R=()=>{const{border:l,disabled:n,readonly:r}=e,o=x(e,Object.keys(C));return r&&(o.isLink=!1),(n||r)&&(o.clickable=!1),t(S,V({role:"button",class:w("title",{disabled:n,expanded:i.value,borderless:!l}),"aria-expanded":String(i.value),onClick:N},o),x(a,E))},H=c((()=>{var e;return k(t("div",{ref:l,class:w("wrapper"),onTransitionend:j},[t("div",{ref:n,class:w("content")},[null==(e=a.default)?void 0:e.call(a)])]),[[A,u.value]])}));return o({toggle:B,expanded:i,itemName:s}),()=>t("div",{class:[w({border:d.value&&e.border})]},[R(),H()])}});e("a",i(L))}}}));
