System.register(["./index-legacy-1cbe5d00.js","./index-legacy-c566e52e.js"],(function(e,a){"use strict";var l,n,r,o,t,d,s,i,u,c,v,p,m,b,g,y,f,h,x,k,A,C,V,j;return{setters:[e=>{l=e.c,n=e.d,r=e.ag,o=e.a2,t=e.a,d=e.aK,s=e.t,i=e.k,u=e.ai,c=e.n,v=e.r,p=e.aj,m=e.e,b=e.aL,g=e.w,y=e.aM,f=e.z,h=e.az,x=e.ak,k=e.h,A=e.g,C=e.v},e=>{V=e.c,j=e.C}],execute:function(){const[a,z]=l("collapse"),S=Symbol(a),B={border:s,accordion:Boolean,modelValue:{type:[String,Number,Array],default:""}};var L=n({name:a,props:B,emits:["change","update:modelValue"],setup(e,{emit:a,slots:l}){const{linkChildren:n,children:s}=r(S),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:[z(),{[d]:e.border}]},[null==(a=l.default)?void 0:a.call(l)])}}});e("C",i(L));const[N,w]=l("collapse-item"),E=["icon","title","value","label","right-icon"],R=u({},V,{name:c,isLink:s,disabled:Boolean,readonly:Boolean,lazyRender:s});var D=n({name:N,props:R,setup(e,{slots:a}){const l=v(),n=v(),{parent:r,index:d}=p(S);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)),z=()=>{i.value?l.value&&(l.value.style.height=""):u.value=!1};g(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,y((()=>{l.value&&(l.value.style.height=e?n:"0")}))}else z()})))}));const B=(e=!i.value)=>{r.toggle(s.value,e)},L=()=>{e.disabled||e.readonly||B()},N=()=>{const{border:l,disabled:n,readonly:r}=e,o=x(e,Object.keys(V));return r&&(o.isLink=!1),(n||r)&&(o.clickable=!1),t(j,k({role:"button",class:w("title",{disabled:n,expanded:i.value,borderless:!l}),"aria-expanded":String(i.value),onClick:L},o),x(a,E))},R=c((()=>{var e;return A(t("div",{ref:l,class:w("wrapper"),onTransitionend:z},[t("div",{ref:n,class:w("content")},[null==(e=a.default)?void 0:e.call(a)])]),[[C,u.value]])}));return o({toggle:B,expanded:i,itemName:s}),()=>t("div",{class:[w({border:d.value&&e.border})]},[N(),R()])}});e("a",i(D))}}}));
