instruments-legacy-43178158.js 15 KB

1
  1. System.register(["./index-legacy-e28491f2.js","./index-legacy-617daedb.js"],(function(e,o){"use strict";var t,n,l,a,i,r,s,c,u,d,m,p,v,h,g,b,f,C,T,S,B,x,y,H,k,w,O,D,A,L,P,M,V,F,G,N,E,R,W,$;return{setters:[e=>{t=e.aU,n=e.bh,l=e.bi,a=e.bj,i=e.d,r=e.bk,s=e.bl,c=e.bm,u=e.l,d=e.bn,m=e.bo,p=e.bp,v=e.bq,h=e.br,g=e.f,b=e.bs,f=e.bt,C=e.bu,T=e.bv,S=e.bw,B=e.bx,x=e.by,y=e.e,H=e.bz,k=e.w,w=e.bA,O=e.bB,D=e.bC,A=e.as,L=e.bD,P=e.aX,M=e.bE,V=e.bF,F=e.c,G=e.bG,N=e.bH,E=e.bI},e=>{R=e.T,W=e.c,$=e.u}],execute:function(){const[o,j,I]=t("picker"),z=e=>e.find((e=>!e.disabled))||e[0];function X(e,o){for(let t=o=a(o,0,e.length);t<e.length;t++)if(!e[t].disabled)return t;for(let t=o-1;t>=0;t--)if(!e[t].disabled)return t;return 0}const K=(e,o,t)=>void 0!==o&&!!e.find((e=>e[t.value]===o));function Q(e,o,t){const n=e.findIndex((e=>e[t.value]===o));return e[X(e,n)]}const[U,q]=t("picker-column"),Y=Symbol(U);var J=i({name:U,props:{value:r,fields:s(Object),options:c(),readonly:Boolean,allowHtml:Boolean,optionHeight:s(Number),swipeDuration:s(r),visibleOptionNum:s(r)},emits:["change","clickOption"],setup(e,{emit:o,slots:t}){let n,l,i,r,s;const c=u(),f=u(),C=u(0),T=u(0),S=d(),B=()=>e.options.length,x=()=>e.optionHeight*(+e.visibleOptionNum-1)/2,y=t=>{const l=X(e.options,t),a=-l*e.optionHeight,i=()=>{const t=e.options[l][e.fields.value];t!==e.value&&o("change",t)};n&&a!==C.value?s=i:i(),C.value=a},H=()=>e.readonly||!e.options.length,k=o=>a(Math.round(-o/e.optionHeight),0,B()-1),w=()=>{n=!1,T.value=0,s&&(s(),s=null)},O=e=>{if(!H()){if(S.start(e),n){const e=function(e){const{transform:o}=window.getComputedStyle(e),t=o.slice(7,o.length-1).split(", ")[5];return Number(t)}(f.value);C.value=Math.min(0,e-x())}T.value=0,l=C.value,i=Date.now(),r=l,s=null}},D=()=>{if(H())return;const o=C.value-r,t=Date.now()-i;if(t<300&&Math.abs(o)>15)return void((o,t)=>{const n=Math.abs(o/t);o=C.value+n/.003*(o<0?-1:1);const l=k(o);T.value=+e.swipeDuration,y(l)})(o,t);const l=k(C.value);T.value=200,y(l),setTimeout((()=>{n=!1}),0)},A=()=>{const l={height:`${e.optionHeight}px`};return e.options.map(((a,i)=>{const r=a[e.fields.text],{disabled:c}=a,u=a[e.fields.value],d={role:"button",style:l,tabindex:c?-1:0,class:[q("item",{disabled:c,selected:u===e.value}),a.className],onClick:()=>(t=>{n||H()||(s=null,T.value=200,y(t),o("clickOption",e.options[t]))})(i)},m={class:"van-ellipsis",[e.allowHtml?"innerHTML":"textContent"]:r};return g("li",d,[t.option?t.option(a,i):g("div",m,null)])}))};return m(Y),p({stopMomentum:w}),v((()=>{const o=e.options.findIndex((o=>o[e.fields.value]===e.value)),t=-X(e.options,o)*e.optionHeight;C.value=t})),h("touchmove",(o=>{if(H())return;S.move(o),S.isVertical()&&(n=!0,b(o,!0)),C.value=a(l+S.deltaY.value,-B()*e.optionHeight,e.optionHeight);const t=Date.now();t-i>300&&(i=t,r=C.value)}),{target:c}),()=>g("div",{ref:c,class:q(),onTouchstartPassive:O,onTouchend:D,onTouchcancel:D},[g("ul",{ref:f,style:{transform:`translate3d(0, ${C.value+x()}px, 0)`,transitionDuration:`${T.value}ms`,transitionProperty:T.value?"all":"none"},class:q("wrapper"),onTransitionend:w},[A()])])}});const[Z]=t("picker-toolbar"),_={title:String,cancelButtonText:String,confirmButtonText:String},ee=["cancel","confirm","title","toolbar"],oe=Object.keys(_);var te=i({name:Z,props:_,emits:["confirm","cancel"],setup(e,{emit:o,slots:t}){const n=()=>o("cancel"),l=()=>o("confirm"),a=()=>{const o=e.cancelButtonText||I("cancel");return g("button",{type:"button",class:[j("cancel"),f],onClick:n},[t.cancel?t.cancel():o])},i=()=>{const o=e.confirmButtonText||I("confirm");return g("button",{type:"button",class:[j("confirm"),f],onClick:l},[t.confirm?t.confirm():o])};return()=>g("div",{class:j("toolbar")},[t.toolbar?t.toolbar():[a(),t.title?t.title():e.title?g("div",{class:[j("title"),"van-ellipsis"]},[e.title]):void 0,i()]])}});const[ne,le]=t("picker-group"),ae=Symbol(ne),ie=l({tabs:c(),nextStepText:String},_);i({name:ne,props:ie,emits:["confirm","cancel"],setup(e,{emit:o,slots:t}){const n=u(0),{children:l,linkChildren:a}=C(ae);a();const i=()=>n.value<e.tabs.length-1&&e.nextStepText,r=()=>{i()?n.value++:o("confirm",l.map((e=>e.confirm())))},s=()=>o("cancel");return()=>{var o;const l=null==(o=t.default)?void 0:o.call(t),a=i()?e.nextStepText:e.confirmButtonText;return g("div",{class:le()},[g(te,{title:e.title,cancelButtonText:e.cancelButtonText,confirmButtonText:a,onConfirm:r,onCancel:s},T(t,ee)),g(R,{active:n.value,"onUpdate:active":e=>n.value=e,class:le("tabs"),shrink:!0,animated:!0,lazyRender:!1},{default:()=>[e.tabs.map(((e,o)=>g(W,{title:e,titleClass:le("tab-title")},{default:()=>[null==l?void 0:l[o]]})))]})])}}});const re=l({loading:Boolean,readonly:Boolean,allowHtml:Boolean,optionHeight:S(44),showToolbar:B,swipeDuration:S(1e3),visibleOptionNum:S(6)},_),se=l({},re,{columns:c(),modelValue:c(),toolbarPosition:x("top"),columnsFieldNames:Object});var ce=i({name:o,props:se,emits:["confirm","cancel","change","clickOption","update:modelValue"],setup(e,{emit:o,slots:t}){const a=u(),i=u(e.modelValue.slice(0)),{parent:r}=m(ae),{children:s,linkChildren:c}=C(Y);c();const d=y((()=>function(e){return l({text:"text",value:"value",children:"children"},e)}(e.columnsFieldNames))),v=y((()=>H(e.optionHeight))),f=y((()=>function(e,o){const t=e[0];if(t){if(Array.isArray(t))return"multiple";if(o.children in t)return"cascade"}return"default"}(e.columns,d.value))),S=y((()=>{const{columns:o}=e;switch(f.value){case"multiple":return o;case"cascade":return function(e,o,t){const l=[];let a={[o.children]:e},i=0;for(;a&&a[o.children];){const e=a[o.children],r=t.value[i];a=n(r)?Q(e,r,o):void 0,!a&&e.length&&(a=Q(e,z(e)[o.value],o)),i++,l.push(e)}return l}(o,d.value,i);default:return[o]}})),B=y((()=>S.value.some((e=>e.length)))),x=y((()=>S.value.map(((e,o)=>Q(e,i.value[o],d.value))))),P=y((()=>S.value.map(((e,o)=>e.findIndex((e=>e[d.value.value]===i.value[o])))))),M=(e,o)=>{if(i.value[e]!==o){const t=i.value.slice(0);t[e]=o,i.value=t}},V=()=>({selectedValues:i.value.slice(0),selectedOptions:x.value,selectedIndexes:P.value}),F=()=>{s.forEach((e=>e.stopMomentum()));const e=V();return A((()=>{o("confirm",e)})),e},G=()=>o("cancel",V()),N=()=>S.value.map(((n,a)=>g(J,{value:i.value[a],fields:d.value,options:n,readonly:e.readonly,allowHtml:e.allowHtml,optionHeight:v.value,swipeDuration:e.swipeDuration,visibleOptionNum:e.visibleOptionNum,onChange:e=>((e,t)=>{M(t,e),"cascade"===f.value&&i.value.forEach(((e,o)=>{const t=S.value[o];K(t,e,d.value)||M(o,t.length?t[0][d.value.value]:void 0)})),A((()=>{o("change",l({columnIndex:t},V()))}))})(e,a),onClickOption:e=>((e,t)=>o("clickOption",l({columnIndex:t,currentOption:e},V())))(e,a)},{option:t.option}))),E=e=>{if(B.value){const o={height:`${v.value}px`},t={backgroundSize:`100% ${(e-v.value)/2}px`};return[g("div",{class:j("mask"),style:t},null),g("div",{class:[L,j("frame")],style:o},null)]}},R=()=>{const o=v.value*+e.visibleOptionNum,t={height:`${o}px`};return g("div",{ref:a,class:j("columns"),style:t},[N(),E(o)])},W=()=>{if(e.showToolbar&&!r)return g(te,D(T(e,oe),{onConfirm:F,onCancel:G}),T(t,ee))};let $;return k(S,(e=>{e.forEach(((e,o)=>{e.length&&!K(e,i.value[o],d.value)&&M(o,z(e)[d.value.value])}))}),{immediate:!0}),k((()=>e.modelValue),(e=>{w(e,i.value)||w(e,$)||(i.value=e.slice(0),$=e.slice(0))}),{deep:!0}),k(i,(t=>{w(t,e.modelValue)||($=t.slice(0),o("update:modelValue",$))}),{immediate:!0}),h("touchmove",b,{target:a}),p({confirm:F,getSelectedOptions:()=>x.value}),()=>{var o,n;return g("div",{class:j()},["top"===e.toolbarPosition?W():null,e.loading?g(O,{class:j("loading")},null):null,null==(o=t["columns-top"])?void 0:o.call(t),R(),null==(n=t["columns-bottom"])?void 0:n.call(t),"bottom"===e.toolbarPosition?W():null])}}});e("a",P(ce));const[ue,de,me]=t("list"),pe={error:Boolean,offset:S(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:x("down"),loadingText:String,finishedText:String,immediateCheck:B};var ve=i({name:ue,props:pe,emits:["load","update:error","update:loading"],setup(e,{emit:o,slots:t}){const n=u(e.loading),l=u(),a=u(),i=$(),r=M(l),s=()=>{A((()=>{if(n.value||e.finished||e.disabled||e.error||!1===(null==i?void 0:i.value))return;const{direction:t}=e,s=+e.offset,c=G(r);if(!c.height||N(l))return;let u=!1;const d=G(a);u="up"===t?c.top-d.top<=s:d.bottom-c.bottom<=s,u&&(n.value=!0,o("update:loading",!0),o("load"))}))},c=()=>{if(e.finished){const o=t.finished?t.finished():e.finishedText;if(o)return g("div",{class:de("finished-text")},[o])}},d=()=>{o("update:error",!1),s()},m=()=>{if(e.error){const o=t.error?t.error():e.errorText;if(o)return g("div",{role:"button",class:de("error-text"),tabindex:0,onClick:d},[o])}},v=()=>{if(n.value&&!e.finished&&!e.disabled)return g("div",{class:de("loading")},[t.loading?t.loading():g(O,{class:de("loading-icon")},{default:()=>[e.loadingText||me("loading")]})])};return k((()=>[e.loading,e.finished,e.error]),s),i&&k(i,(e=>{e&&s()})),V((()=>{n.value=e.loading})),F((()=>{e.immediateCheck&&s()})),p({check:s}),h("scroll",s,{target:r,passive:!0}),()=>{var o;const i=null==(o=t.default)?void 0:o.call(t),r=g("div",{ref:a,class:de("placeholder")},null);return g("div",{ref:l,role:"feed",class:de(),"aria-busy":n.value},["down"===e.direction?i:r,v(),c(),m(),"up"===e.direction?i:r])}}});e("L",P(ve));const[he,ge]=t("progress"),be={color:String,inactive:Boolean,pivotText:String,textColor:String,showPivot:B,pivotColor:String,trackColor:String,strokeWidth:r,percentage:{type:r,default:0,validator:e=>+e>=0&&+e<=100}};var fe=i({name:he,props:be,setup(e){const o=y((()=>e.inactive?void 0:e.color)),t=()=>{const{textColor:t,pivotText:n,pivotColor:l,percentage:a}=e,i=null!=n?n:`${a}%`;if(e.showPivot&&i){const n={color:t,left:+a+"%",transform:`translate(-${+a}%,-50%)`,background:l||o.value};return g("span",{style:n,class:ge("pivot",{inactive:e.inactive})},[i])}};return()=>{const{trackColor:n,percentage:l,strokeWidth:a}=e,i={background:n,height:E(a)},r={width:`${l}%`,background:o.value};return g("div",{class:ge(),style:i},[g("span",{class:ge("portion",{inactive:e.inactive}),style:r},null),t()])}}});e("P",P(fe));const Ce={"Acoustic Grand Piano":"大钢琴","Bright Acoustic Piano":"明亮的钢琴","Electric Grand Piano":"电钢琴","Rhodes Piano":"柔和的电钢琴","Chorused Piano":"加合唱效果的电钢琴",Harpsichord:"羽管键琴",Clavichord:"科拉维科特琴",Celesta:"钢片琴",Glockenspiel:"钢片琴","Music box":"八音盒",Vibraphone:"颤音琴",Marimba:"马林巴",Xylophone:"木琴","Tubular Bells":"管钟",Dulcimer:"大扬琴","Hammond Organ":"击杆风琴","Percussive Organ":"打击式风琴","Rock Organ":"摇滚风琴","Church Organ":"教堂风琴","Reed Organ":"簧管风琴",Accordian:"手风琴",Harmonica:"口琴","Tango Accordian":"探戈手风琴","Acoustic Guitar":"钢弦吉他","Electric Guitar":"闷音电吉他","Overdriven Guitar":"加驱动效果的电吉他","Distortion Guitar":"加失真效果的电吉他","Guitar Harmonics":"吉他和音","Acoustic Bass":"大贝司","Electric Bass":"电贝司","Fretless Bass":"无品贝司","Slap Bass":"掌击","Synth Bass":"电子合成",Violin:"小提琴",Viola:"中提琴",Cello:"大提琴",Contrabass:"低音大提琴","Tremolo Strings":"弦乐群颤音音色","Pizzicato Strings":"弦乐群拨弦音色","Orchestral Harp":"竖琴",Timpani:"定音鼓","String Ensemble":"弦乐合奏音色","Synth Strings":"合成弦乐合奏音色","Choir Aahs":"人声合唱","Voice Oohs":"人声","Synth Voice":"合成人声","Orchestra Hit":"管弦乐敲击齐奏",Trumpet:"小号",Trombone:"长号",Tuba:"大号","Muted Trumpet":"加弱音器小号","French Horn":"法国号","Brass Section":"铜管组","Synth Brass":"合成铜管音色","Soprano Sax":"高音萨克斯管","Alto Sax":"中音萨克斯管","Tenor Sax":"次中音萨克斯管","Baritone Sax":"低音萨克斯管",Oboe:"双簧管","English Horn":"英国管",Bassoon:"巴松",Clarinet:"单簧管","Soprano Saxophone":"高音萨克斯管","Alto Saxophone":"中音萨克斯管","Tenor Saxophone":"次中音萨克斯管","Baritone Saxophone":"低音萨克斯管",Piccolo:"短笛",Flute:"长笛",Recorder:"竖笛","Soprano Recorder":"高音竖笛","Pan Flute":"排箫","Bottle Blow":"瓶木管",Whistle:"口哨声",Ocarina:"陶笛",Lead:"合成主音","Lead lead":"合成主音","Pad age":"合成音色",Pad:"合成音色",FX:"合成效果 科幻",Sitar:"西塔尔",Banjo:"班卓琴",Shamisen:"三昧线",Koto:"十三弦筝",Kalimba:"卡林巴",Bagpipe:"风笛",Fiddle:"民族提琴",Shanai:"山奈","Tinkle Bell":"叮当铃",Agogos:"阿戈戈铃","Steel Drums":"钢鼓","Taiko Drum":"太鼓","Melodic Toms":"嗵嗵鼓","Synth Drums":"合成鼓","Reverse Cymbals":"反向镲","Agogo Bells":"阿戈戈铃","Taiko Drums":"太鼓",Bongos:"邦戈鼓","Bongo Bell":"邦戈铃",Congas:"康加鼓",Guiro:"刮壶","Guitar Fret Noise":"吉他换把杂音","Breath Noise":"呼吸声",Seashore:"海浪声","Bird Tweet":"鸟鸣","Telephone Ring":"电话铃",Helicopter:"直升机",Applause:"鼓掌声",Gunshot:"枪声","Acoustic Bass Drum":"大鼓","Bass Drum":"大鼓","Side Drum":"小鼓鼓边","Acoustic Snare":"小鼓","Hand Claps":"拍手","Electric Snare":"小鼓","Low Floor Tom":"低音嗵鼓","Closed Hi-Hat":"闭合踩镲","High Floor Tom":"高音落地嗵鼓","Pedal Hi-Hat":"脚踏踩镲","Low Tom":"低音嗵鼓","Open Hi-Hat":"开音踩镲","Low-Mid Tom":"中低音嗵鼓","Hi Mid Tom":"高音鼓","Crash Cymbals":"对镲","High Tom":"高音嗵鼓","Ride Cymbals":"叮叮镲","Chinese Cymbals":"中国镲","Ride Bell":"圆铃",Tambourine:"铃鼓","Splash Cymbal":"溅音镲",Cowbell:"牛铃","Crash Cymbal":"强音钹","Vibra-Slap":"颤音器","Ride Cymbal":"打点钹","Hi Bongo":"高音邦戈鼓","Low Bongo":"低音邦戈鼓","Mute Hi Conga":"弱音高音康加鼓","Open Hi Conga":"强音高音康加鼓","Low Conga":"低音康加鼓","High Timbale":"高音天巴鼓","Low Timbale":"低音天巴鼓","High Agogo":"高音阿戈戈铃","Low Agogo":"低音阿戈戈铃",Cabasa:"卡巴萨",Maracas:"沙锤","Short Whistle":"短口哨","Long Whistle":"长口哨","Short Guiro":"短刮壶","Long Guiro":"长刮壶",Claves:"响棒","Hi Wood Block":"高音木鱼","Low Wood Block":"低音木鱼","Mute Triangle":"弱音三角铁","Open Triangle":"强音三角铁","Drum Set":"架子鼓","Hulusi flute":"葫芦丝",Melodica:"口风琴","Snare Drum":"小军鼓",Cymbal:"镲",Cymbals:"镲","Horn in F":"圆号",Triangle:"三角铁",Vibrato:"颤音琴","Suspend Cymbals":"吊镲","Suspended Cymbals":"吊镲","Tom-Toms":"嗵嗵鼓",Bell:"铃铛",Bells:"铃铛","Alto Clarinet":"中音单簧管","Bass Clarinet":"低音单簧管",Cornet:"短号",Euphonium:"上低音号","crash cymbals":"对镲",Castanets:"响板",Shaker:"沙锤","Mark tree":"音树",Chimes:"管钟","Mark Tree":"音树","Tom-toms":"嗵嗵鼓","Hi-Hat":"踩镲","Sleigh Bells":"雪橇铃",Flexatone:"弹音器","Brake drum":"闸鼓",Gong:"锣","concert tom":"音乐会嗵嗵鼓","brake drum":"车轮鼓","finger cymbal":"指钹","ride cymbal":"叮叮镲","Concert Toms":"音乐会嗵嗵鼓",Vibraslap:"弹音器","Wood Blocks":"木鱼","Temple Blocks":"木鱼","Wood Block":"木鱼","Field Drum":"军鼓","Quad-Toms":"筒鼓",Quads:"筒鼓","Drums set":"架子鼓","High Bongo":"邦戈",Timbales:"天巴鼓"};e("g",((e="")=>{if(!(e=e.toLocaleLowerCase().replace(/ /g,"")))return"";for(let o in Ce)if(o.toLocaleLowerCase().replace(/ /g,"").includes(e))return Ce[o];for(let o in Ce){const t=o.toLocaleLowerCase().replace(/ /g,"");if(e.includes(t))return Ce[o]}return""}))}}}));