text: var e=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,n=(t,o,a)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[o]=a,d=(e,t)=>{for(var o in t||(t={}))l.call(t,o)&&n(e,o,t[o]);if(a)for(var o of a(t))i.call(t,o)&&n(e,o,t[o]);return e},r=(e,a)=>t(e,o(a));import{nextTick as s}from"vue";const p={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},u={directive:"collapse",collapsed:!1,speed:300,ease:"easeInOutCubic"},m=(()=>{const e=new WeakMap,t=(e,t,o)=>e+(t-e)*o,o=(a,l,i)=>{const n=e.get(a),d=performance.now()-n.startTime,r=Math.min(p[i](d/l),1);a.style.height=`${Math.min(Math.max(t(n.oldHeight,n.endValue,r),0),n.oldHeight)}px`,a.style.paddingTop=`${Math.min(Math.max(t(n.oldPaddingTop,n.endValue,r),0),n.oldPaddingTop)}px`,a.style.paddingBottom=`${Math.min(Math.max(t(n.oldPaddingBottom,n.endValue,r),0),n.oldPaddingBottom)}px`,a.style.marginTop=`${Math.min(Math.max(t(n.oldMarginTop,n.endValue,r),0),n.oldMarginTop)}px`,a.style.marginBottom=`${Math.min(Math.max(t(n.oldMarginBottom,n.endValue,r),0),n.oldMarginBottom)}px`,a.style.overflow="hidden",r<1?requestAnimationFrame((()=>o(a,l,i))):(n.endTime=performance.now(),a.style.display=n.oldDisplay)},a=(o,l,i)=>{const n=e.get(o),d=performance.now()-n.startTime,r=Math.min(p[i](d/l),1);"none"===n.oldDisplay&&(o.style.display="block"),o.style.height=`${Math.min(Math.max(t(n.endValue,n.oldHeight,r),0),n.oldHeight)}px`,o.style.paddingTop=`${Math.min(Math.max(t(n.endValue,n.oldPaddingTop,r),0),n.oldPaddingTop)}px`,o.style.paddingBottom=`${Math.min(Math.max(t(n.endValue,n.oldPaddingBottom,r),0),n.oldPaddingBottom)}px`,o.style.marginTop=`${Math.min(Math.max(t(n.endValue,n.oldMarginTop,r),0),n.oldMarginTop)}px`,o.style.marginBottom=`${Math.min(Math.max(t(n.endValue,n.oldMarginBottom,r),0),n.oldMarginBottom)}px`,o.style.overflow="hidden",r<1?requestAnimationFrame((()=>a(o,l,i))):(n.endTime=performance.now(),o.style.overflow=n.oldOverflow)};function l(t,l,i){var n,s,p;const m="boolean"==typeof l.value?l.value:(null==(n=l.value)?void 0:n.collapsed)||u.collapsed,g=i?0:(null==(s=l.value)?void 0:s.speed)||u.speed,y=(null==(p=l.value)?void 0:p.ease)||u.ease;m?(e.set(t,r(d({},e.get(t)),{startTime:performance.now()})),requestAnimationFrame((()=>o(t,g,y)))):(e.set(t,r(d({},e.get(t)),{startTime:performance.now()})),requestAnimationFrame((()=>a(t,g,y))))}return{mounted(t,o){s((()=>{const a={el:t,startValue:t.getBoundingClientRect().height,endValue:0,startTime:0,endTime:0,oldPaddingTop:parseFloat(getComputedStyle(t).getPropertyValue("padding-top")),oldPaddingBottom:parseFloat(getComputedStyle(t).getPropertyValue("padding-bottom")),oldMarginTop:parseFloat(getComputedStyle(t).getPropertyValue("margin-top")),oldMarginBottom:parseFloat(getComputedStyle(t).getPropertyValue("margin-top")),oldDisplay:getComputedStyle(t).getPropertyValue("display"),oldOverflow:getComputedStyle(t).getPropertyValue("overflow"),oldPosition:getComputedStyle(t).getPropertyValue("position"),oldVisibility:getComputedStyle(t).getPropertyValue("visibility"),oldHeight:0};"none"===a.oldDisplay?(t.style.display="block",t.style.position="absolute",t.style.visibility="hidden",a.oldHeight=t.getBoundingClientRect().height,t.style.display=a.oldDisplay,t.style.position=a.oldPosition,t.style.visibility=a.oldVisibility):a.oldHeight=t.getBoundingClientRect().height,e.set(t,a),l(t,o,!0)}))},updated(e,t){if("boolean"==typeof t.value){if(t.value===t.oldValue)return}else if(t.value.collapsed===t.oldValue.collapsed)return;s((()=>{l(e,t)}))},unmounted(t){e.delete(t)}}})(),g={install(e,t){(null==t?void 0:t.collapsed)&&(u.collapsed=t.collapsed),(null==t?void 0:t.speed)&&(u.speed=t.speed),(null==t?void 0:t.ease)&&(u.ease=t.ease),e.directive((null==t?void 0:t.directive)||u.directive,m)}};export{m as VCollapseIt,g as default};
  