index-20dff202.js 2.5 KB

1
  1. import{bm as s,d as h,bn as B,bo as I,bp as V,w as m,bq as z,h as i,br as L,a5 as T,bs as u,bt as $,au as b,bu as A,bl as N,bv as R,l as M,n as U,m as n,V as g}from"./index-740d866a.js";function q(e){return["top","bottom","right","left","center"].includes(e)}var D={show:{type:Boolean,default:!1},position:{type:String,default:"center",validator:q},transition:{type:String},overlay:{type:Boolean,default:!0},overlayClass:{type:String},overlayStyle:{type:Object},lockScroll:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0},defaultStyle:{type:Boolean,default:!0},teleport:{type:String},onOpen:s(),onOpened:s(),onClose:s(),onClosed:s(),onClickOverlay:s(),"onUpdate:show":s(),onRouteChange:s()};function f(){return f=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(e[d]=l[d])}return e},f.apply(this,arguments)}function E(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!T(e)}var{n:r,classes:p}=A("popup");const v=h({name:"VarPopup",inheritAttrs:!1,props:D,setup(e,a){var{slots:l,attrs:d}=a,{zIndex:c}=B(()=>e.show,3),{disabled:O}=I(),C=()=>{var{closeOnClickOverlay:t,onClickOverlay:o}=e;u(o),t&&u(e["onUpdate:show"],!1)};V(()=>e.show,()=>e.lockScroll),m(()=>e.show,t=>{t?u(e.onOpen):u(e.onClose)}),z(()=>u(e.onRouteChange));var w=()=>{var{overlayClass:t="",overlayStyle:o}=e;return i("div",{class:p(r("overlay"),t),style:f({zIndex:c.value-1},o),onClick:C},null)},x=()=>i("div",N({class:p(r("content"),r("--"+e.position),[e.defaultStyle,r("--content-background-color")],[e.defaultStyle,r("$-elevation--3")]),style:{zIndex:c.value}},d),[u(l.default)]),y=()=>{var{onOpened:t,onClosed:o,show:S,overlay:P,transition:j,position:k}=e;return i(b,{name:r("$-fade"),onAfterEnter:t,onAfterLeave:o},{default:()=>[$(i("div",{class:p(r("$--box"),r()),style:{zIndex:c.value-2}},[P&&w(),i(b,{name:j||r("$-pop-"+k)},{default:()=>[S&&x()]})]),[[R,S]])]})};return()=>{var{teleport:t}=e;if(t){var o;return i(L,{to:t,disabled:O.value},E(o=y())?o:{default:()=>[o]})}return y()}}});v.install=function(e){e.component(v.name,v)};const F=h({name:"measureSpeed",setup(){const e=M(!1),a=U({speed:n.speed,originSpeed:n.originSpeed});return m(()=>n.section.length,()=>{if(n.modeType==="practise"){if(!e.value&&n.section.length===2){e.value=!0,a.speed=n.speed;const l=n.section[0].beatSpeed;n.originSpeed=l,g(l)}e.value&&n.section.length===0&&(e.value=!1,n.originSpeed=a.originSpeed,g(a.speed))}}),()=>i("div",null,null)}});export{F as M,v as P};