📄 451.39577ad3.chunk.js
/home/palash/git/site/node_modules/new_site/build/static/js/451.39577ad3.chunk.js
Language: js • Lines: 2
"use strict";(self.webpackChunknew_site=self.webpackChunknew_site||[]).push([[451],{4451(e,t,n){n.d(t,{A:()=>le});var s=n(9379),a=n(5544),r=n(5043);const i="bg-slate-900",o="border-transparent",c="#6a80b8",l="#7a90b0",d="#3060a8",u="#8aa8d1",x="#64748b",h="#fbbf24",p="#7a60b6",m="#911c6e",f="#0f172a",g="#e2e8f0",b="#38bdf8",y="#f43f5e",v="#8395af",j="#21cea3",k="#818cf8",T="rgba(149, 165, 128, 0.08)",w="#fb923c",A="#f472b6",M="rgba(244, 114, 182, 0.08)",S="rgba(56, 189, 248, 0.08)",N="#7dd3fc",V="#ffffff",B="#6e899933",R="rgba(225, 29, 72, 0.15)",C="#a78bfa",I="#ff2a5f",W="#2ae8b2",E="rgba(255, 255, 255, 0.05)",z="rgba(255, 255, 255, 0.08)",O="rgba(56, 189, 248, 0.35)",q="#7dd3fc",L="#38bdf8",Y={0:[0,!1],1:[0,!0],2:[1,!1],3:[1,!0],4:[2,!1],5:[3,!1],6:[3,!0],7:[4,!1],8:[4,!0],9:[5,!1],10:[5,!0],11:[6,!1]},D=[{value:.25,label:"Sixteenth note"},{value:.5,label:"Eighth note"},{value:.75,label:"Dotted eighth note"},{value:1,label:"Quarter note"},{value:1.5,label:"Dotted quarter note"},{value:2,label:"Half note"},{value:3,label:"Dotted half note"},{value:4,label:"Whole note"},{value:6,label:"Dotted whole note"}],G=e=>{const t=D.find(t=>t.value===e);return t?t.label:"".concat(e," beats")},P=(e,t,n,s)=>{const r="treble"===t?64:43,i=e=>{const t=e%12;return 7*Math.floor(e/12)+(0,a.A)(Y[t],1)[0]};return{y:n+4*s-(i(e)-i(r))*(s/2),isSharp:Y[e%12][1]}},F=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=s=>{const a=t+s;return n?"M ".concat(e," ").concat(a," L ").concat(e+7," ").concat(a-8," L ").concat(e+7," ").concat(a-5," L ").concat(e," ").concat(a+3," Z"):"M ".concat(e," ").concat(a," L ").concat(e+7," ").concat(a+8," L ").concat(e+7," ").concat(a+5," L ").concat(e," ").concat(a-3," Z")};let r="";for(let i=0;i<s;i++)r+=a(n?-9*i:9*i)+" ";return r.trim()},H={1:{baseMidi:69},2:{baseMidi:64},3:{baseMidi:60},4:{baseMidi:55},5:{baseMidi:50},6:{baseMidi:45}},X=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],Q={o:4,"o.":6,".":2,"..":3,":":1,":.":1.5,"+":.5,"+.":.75,"=":.25,r:1,"r.":1.5,"r+":.5,"r=":.25};let _=null,J=null;const U=[],Z=e=>{for(;U.length>0&&U[0].time<=e;)U.shift().cleanup()},K=e=>{if(!e.masterGain){const t=e.createGain();t.gain.value=.5;const n=e.createBiquadFilter();n.type="lowshelf",n.frequency.value=350,n.gain.value=3.5;const s=e.createBiquadFilter();s.type="peaking",s.frequency.value=500,s.Q.value=.7,s.gain.value=.8;const a=e.createDynamicsCompressor();a.threshold.setValueAtTime(-12,e.currentTime),a.knee.setValueAtTime(12,e.currentTime),a.ratio.setValueAtTime(6,e.currentTime),a.attack.setValueAtTime(.002,e.currentTime),a.release.setValueAtTime(.1,e.currentTime),t.connect(n),n.connect(s),s.connect(a),a.connect(e.destination),e.masterGain=t}return e.masterGain},$=function(e,t,n,s){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,i=[];i=Array.isArray(t)?t:[{type:"pluck",midi:t,duration:s}];const o=a*(Array.isArray(t)&&t.length>1?.65:1)*(2===r?.65:1),c=i.reduce((e,t)=>e+(t.duration||0),0),l=i.find(e=>"number"===typeof e.midi),d=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.05,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;const a=e.createOscillator(),r=e.createOscillator(),i=e.createBiquadFilter(),o=e.createGain();a.type="triangle",a.frequency.setValueAtTime(95,t),r.type="sawtooth",r.frequency.setValueAtTime(1400,t),r.detune.setValueAtTime(40*Math.random()-20,t),i.type="bandpass",i.frequency.setValueAtTime(800,t),i.Q.value=2,o.gain.setValueAtTime(.18*s,t),o.gain.exponentialRampToValueAtTime(.001,t+n),a.connect(o),r.connect(i),i.connect(o),o.connect(K(e)),a.start(t),r.start(t),a.stop(t+n),r.stop(t+n),U.push({time:t+n+.02,cleanup:()=>{try{a.disconnect(),r.disconnect(),i.disconnect(),o.disconnect()}catch(e){}}})};if(!l){let e=n;for(let t=0;t<i.length;t++){const n=i[t],s=n.duration||.25;"mute"===n.type&&d(e,Math.min(.06,s)),e+=s}return}if(i.length>0&&i.every(e=>"mute"===e.type))return;const u=l.midi,x=440*Math.pow(2,(u-69)/12),h=function(e,t){const n=e.currentTime,s=Math.max(t,n);if(!_){_=[];const t=K(e);for(let n=0;n<12;n++){const n=e.createOscillator();n.type="triangle";const s=e.createGain();s.gain.value=0;const a=e.createBiquadFilter();a.type="lowpass",a.frequency.value=1e3;const r=e.createOscillator();r.type="triangle";const i=e.createGain();i.gain.value=0,n.connect(s),r.connect(i),i.connect(s),s.connect(a),a.connect(t),n.start(),r.start(),_.push({osc:n,bodyOsc:r,gain:s,bodyGain:i,filter:a,releaseTime:0})}}let a=null;for(const i of _)if(i.releaseTime<=s){a=i;break}a||(a=_.reduce((e,t)=>e.releaseTime<t.releaseTime?e:t));const r=s;return a.gain.gain.cancelScheduledValues(r),a.bodyGain.gain.cancelScheduledValues(r),a.filter.frequency.cancelScheduledValues(r),a.osc.frequency.cancelScheduledValues(r),a.bodyOsc.frequency.cancelScheduledValues(r),a.gain.gain.setValueAtTime(0,r),a.bodyGain.gain.setValueAtTime(0,r),a}(e,n);h.filter.frequency.setValueAtTime(Math.min(900,1.5*x),n),h.filter.frequency.exponentialRampToValueAtTime(Math.min(220,.6*x),n+Math.min(c,.5));const p=e.createBufferSource();p.buffer=function(e){if(!J){const t=e.sampleRate,n=Math.ceil(.06*t);J=e.createBuffer(1,n,t);const s=J.getChannelData(0);for(let e=0;e<n;e++)s[e]=2*Math.random()-1}return J}(e);const m=e.createBiquadFilter();m.type="bandpass",m.frequency.value=Math.min(1200,2.5*x),m.Q.value=1.2;const f=e.createGain();f.gain.setValueAtTime(0,n),f.gain.linearRampToValueAtTime(.08*o,n+.002),f.gain.exponentialRampToValueAtTime(.001,n+.025),p.connect(m),m.connect(f),f.connect(h.filter),p.start(n),p.stop(n+.06),U.push({time:n+.08,cleanup:()=>{try{p.disconnect(),m.disconnect(),f.disconnect()}catch(e){}}}),h.osc.frequency.setValueAtTime(1.012*x,n),h.osc.frequency.exponentialRampToValueAtTime(x,n+.025);if(h.gain.gain.setValueAtTime(0,n),h.gain.gain.linearRampToValueAtTime(.6*o,n+.01),2===r){h.gain.gain.exponentialRampToValueAtTime(.15*o,n+.08);const e=n+Math.max(c,.5);h.gain.gain.exponentialRampToValueAtTime(.001,e),h.gain.gain.setValueAtTime(.001,e),h.gain.gain.linearRampToValueAtTime(0,e+.015),h.releaseTime=e+.02}else{const e=Math.max(.95*c,1.2);h.gain.gain.exponentialRampToValueAtTime(.25*o,n+.06),h.gain.gain.exponentialRampToValueAtTime(.01,n+e-.03);const t=.015,s=n+e;h.gain.gain.setValueAtTime(.01,s-t),h.gain.gain.linearRampToValueAtTime(0,s),h.releaseTime=s}const g=6*Math.random()-3;h.osc.detune.setValueAtTime(g,n);const b=n+Math.max(.9*c,.3);h.bodyGain.gain.setValueAtTime(.5*o,n),h.bodyGain.gain.exponentialRampToValueAtTime(.18*o,n+.04),h.bodyGain.gain.exponentialRampToValueAtTime(.001,b),h.bodyOsc.frequency.setValueAtTime(x,n),h.bodyOsc.detune.setValueAtTime(8*Math.random()-4,n);let y=n,v=u;for(let j=0;j<i.length;j++){const e=i[j],t=y,n=y+e.duration,s="number"===typeof e.midi;if("mute"!==e.type){if("slide"===e.type){const a=440*Math.pow(2,(v-69)/12),r=s?440*Math.pow(2,(e.midi-69)/12):a;h.osc.frequency.setValueAtTime(a,t),h.bodyOsc.frequency.setValueAtTime(a,t),h.osc.frequency.linearRampToValueAtTime(r,n),h.bodyOsc.frequency.linearRampToValueAtTime(r,n),v=e.midi}else if("hammer"===e.type||"pull"===e.type){if(s){const s=440*Math.pow(2,(e.midi-69)/12);h.osc.frequency.setValueAtTime(s,t),h.bodyOsc.frequency.setValueAtTime(s,t),v=e.midi,h.osc.frequency.setValueAtTime(s,n),h.bodyOsc.frequency.setValueAtTime(s,n)}}else{const e=440*Math.pow(2,(v-69)/12);h.osc.frequency.setValueAtTime(e,n),h.bodyOsc.frequency.setValueAtTime(e,n)}y=n}else y=n}},ee=e=>{e.current.forEach(e=>{e()}),e.current=[]};const te=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=e.createOscillator(),a=e.createGain();s.type="triangle",s.frequency.setValueAtTime(n?1400:950,t),a.gain.setValueAtTime(0,t),a.gain.linearRampToValueAtTime(n?.55:.38,t+.002),a.gain.exponentialRampToValueAtTime(.001,t+.035);const r=e.createOscillator(),i=e.createGain();r.type="sine",r.frequency.setValueAtTime(n?3200:2600,t),i.gain.setValueAtTime(0,t),i.gain.linearRampToValueAtTime(n?.3:.18,t+.001),i.gain.exponentialRampToValueAtTime(.001,t+.012),s.connect(a),r.connect(i),e.masterGain?(a.connect(e.masterGain),i.connect(e.masterGain)):(a.connect(e.destination),i.connect(e.destination)),s.start(t),r.start(t);const o=t+.05,c=t+.02;s.stop(o),r.stop(c),U.push({time:Math.max(o,c)+.02,cleanup:()=>{try{s.disconnect(),a.disconnect(),r.disconnect(),i.disconnect()}catch(e){}}})},ne=(e,t)=>{const n=.025,s=e.sampleRate,a=Math.max(1,Math.ceil(s*n)),r=e.createBuffer(1,a,s),i=r.getChannelData(0);for(let u=0;u<a;u++)i[u]=2*Math.random()-1;const o=e.createBufferSource();o.buffer=r;const c=e.createBiquadFilter();c.type="bandpass",c.frequency.setValueAtTime(3500,t),c.Q.setValueAtTime(1.5,t);const l=e.createGain();l.gain.setValueAtTime(.45,t),l.gain.exponentialRampToValueAtTime(.001,t+n),o.connect(c),c.connect(l),e.masterGain?l.connect(e.masterGain):l.connect(e.destination),o.start(t);const d=t+n;o.stop(d),U.push({time:d+.02,cleanup:()=>{try{o.disconnect(),c.disconnect(),l.disconnect()}catch(e){}}})};function se(e,t,n,a,r,i,o,c,l,d,u,x,h,p){return function(){let m=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const f=null!==m?m:e.current,g=t.current,b=60/n,y=.5;let v=performance.now();const j=[];let k=null;d.current.push(()=>{null!==k&&(cancelAnimationFrame(k),k=null),j.length=0});const T=(e,t)=>{(e=>{const t=j.findIndex(t=>t.audioTime>e.audioTime);-1===t?j.push(e):j.splice(t,0,e)})({audioTime:e,globalIndex:t}),(()=>{if(null!==k)return;const e=()=>{if(!g||"closed"===g.state)return void(k=null);let t=null;const n=g.currentTime;for(;j.length>0&&j[0].audioTime<=n;)t=j.shift().globalIndex;null!==t&&l(t),k=j.length>0?requestAnimationFrame(e):null};k=requestAnimationFrame(e)})()},w=()=>{if(!g||"closed"===g.state)return;Z(g.currentTime);const e=g.currentTime-a.current+r.current;let t=0;const n=o.current.length,l=e+c;for(;i.current<n&&t<12;){const e=o.current[i.current];if(!e){i.current++;continue}const n=(e.startBeat-f)*b;if(n>=l)break;i.current++,t++;const c=e.notes[0],d=c?c.preCalculatedJitter:0,u=a.current-r.current+y+n+d;if(u<g.currentTime)continue;e.notes.forEach(e=>{if(e.isMetronomeTick&&(p||e.isPreviewTick))return void(e.isPreviewTick?ne(g,u):te(g,u,e.isDownbeat));const t=e.segments.map(e=>(0,s.A)((0,s.A)({},e),{},{duration:e.duration*b}));$(g,t,u,null,"mute"===e.type?0:e.preCalculatedVelocity,e.voice||1)});const x=a.current-r.current+y+n;T(x,e.globalIndex),e.notes.forEach(e=>{e.isMetronomeTick||e.segments.forEach(e=>{e.tiedEventIndices&&e.tiedEventIndices.forEach(e=>{const t=n+e.beatOffset*b,s=a.current-r.current+y+t;T(s,e.globalIndex)})})})}if(i.current>=n){const t=o.current[n-1];if(t){const n=Math.max(...t.notes.map(e=>e.segments?e.segments.reduce((e,t)=>e+t.duration,0):1),1),s=1e3*((t.startBeat-f+n)*b-e+y);((e,t,n)=>{let s=null;const a=()=>{null!==s&&(clearTimeout(s),s=null)};s=setTimeout(()=>{a(),e.current=e.current.filter(e=>e!==a),t()},n),e.current.push(a)})(d,()=>{u()},Math.max(0,s))}return}v+=h,x.current=setTimeout(w,Math.max(0,v-performance.now()))};w()}}var ae=n(4282),re=n(8770),ie=n(4196),oe=n(579);function ce(e,t,n,s,a,r,C,Y,D,G,P,H,X,Q,_,J,U,Z,K,$,ee,te,ne,se){return(ae,re)=>{let ie=ae.rowEvents,ce=ae.totalWidth,le=ae.barlineXPositions,de=ae.measureGroups,ue=ae.rowEndX;const xe=1===$?.62:2===$?.78:1,he=s*xe,pe="tab"!==se,me="sheet"!==se,fe=(e-105)*(4===$?1:.85),ge=(pe?t-55:C-15)*xe,be=(D+80)*xe,ye=(C+5*s+65)*xe,ve=(n+4*s+40)*xe,je=me?Math.max(be,ye):ve,ke=je-ge,Te=16*xe+"px",we=ie.find(e=>e.globalIndex===U),Ae=(pe?t-50:C-15)*xe,Me=(pe?me?D-t+95:n+4*s+70-t:D-C+60)*xe,Se=(pe?t-15:C-15)*xe,Ne=(pe?me?D-t+65:n+4*s+35-t:D-C+65)*xe;return(0,oe.jsx)("div",{className:"".concat(i," ").concat(o," rounded-lg shadow-xl p-4 w-full overflow-x-auto flex justify-start md:justify-center"),children:(0,oe.jsxs)("svg",{viewBox:"0 ".concat(ge," ").concat(ce," ").concat(ke),style:{width:"".concat(ce,"px"),maxWidth:"100%",height:"auto",maxHeight:"none"},className:"select-none block shrink-0",children:[(0,oe.jsxs)("defs",{children:[(0,oe.jsxs)("pattern",{id:"grid-".concat(re),width:"24",height:"24",patternUnits:"userSpaceOnUse",children:[(0,oe.jsx)("path",{d:"M 24 0 L 0 0 0 24",fill:"none",stroke:E,strokeWidth:"0.5"}),(0,oe.jsx)("path",{d:"M 48 0 L 0 0 0 48",fill:"none",stroke:z,strokeWidth:"0.5"})]}),(0,oe.jsxs)("filter",{id:"note-glow",filterUnits:"userSpaceOnUse",x:"-20",y:ge-20*xe,width:ce+40,height:je-ge+40*xe,children:[(0,oe.jsx)("feGaussianBlur",{stdDeviation:"2",result:"blur"}),(0,oe.jsxs)("feMerge",{children:[(0,oe.jsx)("feMergeNode",{in:"blur"}),(0,oe.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,oe.jsx)("rect",{x:0,y:ge,width:ce,height:je-ge+10,fill:"url(#grid-".concat(re,")"),pointerEvents:"none"}),_&&!J&&we&&(0,oe.jsx)("line",{x1:we.cx,y1:ge,x2:we.cx,y2:je,stroke:L,strokeWidth:"1.5",opacity:"0.4",strokeDasharray:"3 5",pointerEvents:"none"}),ne&&(pe||me)&&(0,oe.jsx)("g",{id:"metronome-tick-layer",pointerEvents:"none",children:ie.filter(e=>e.isMetronomeTick).map((e,a)=>{const r=_&&!J&&we&&we.measureNumber===e.measureNumber&&we.startBeat===e.startBeat;return(0,oe.jsx)("line",{x1:e.cx,y1:(t-30)*xe,x2:e.cx+.01,y2:me?(D-50)*xe:(n+4*s+10)*xe,stroke:e.isDownbeat?I:W,strokeWidth:r?"3":e.isDownbeat?"2":"1.5",strokeDasharray:"4 4",opacity:r?"1":e.isDownbeat?"0.7":"0.4",filter:r?"url(#note-glow)":"none"},"metro-tick-".concat(a))})}),(0,oe.jsx)("path",{d:"M ".concat(e-115," ").concat(t*xe," L ").concat(e-122," ").concat(t*xe," L ").concat(e-122," ").concat((n+4*s)*xe," L ").concat(e-115," ").concat((n+4*s)*xe),fill:"none",stroke:c,strokeWidth:"2.5"}),pe&&(0,oe.jsxs)(oe.Fragment,{children:[[0,1,2,3,4].map(n=>(0,oe.jsx)("line",{x1:e-40*(4===$?.7:2===$?.8:.9),y1:t*xe+n*he,x2:ue,y2:t*xe+n*he,stroke:c,strokeWidth:"1.6"},"treble-".concat(n))),(0,oe.jsx)("text",{x:fe,y:t*xe+3.5*he,style:{fontSize:"".concat(48*xe,"px")},fill:x,children:"\ud834\udd1e"}),[0,1,2,3,4].map(t=>(0,oe.jsx)("line",{x1:e-40*(4===$?.7:2===$?.8:.9),y1:n*xe+t*he,x2:ue,y2:n*xe+t*he,stroke:c,strokeWidth:"1"},"bass-".concat(t))),(0,oe.jsx)("text",{x:fe,y:n*xe+3.2*he,style:{fontSize:"".concat(48*xe,"px")},fill:x,children:"\ud834\udd22"})]}),(0,oe.jsxs)("g",{className:"font-serif font-black text-2xl text-center",fill:h,transform:"translate(".concat(e-90*(4===$?.7:2===$?.8:.9),", 0)"),children:[pe&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("text",{x:"0",y:t*xe+1.35*he,textAnchor:"middle",children:a}),(0,oe.jsx)("text",{x:"0",y:t*xe+3.35*he,textAnchor:"middle",children:r}),(0,oe.jsx)("text",{x:"0",y:n*xe+1.35*he,textAnchor:"middle",children:a}),(0,oe.jsx)("text",{x:"0",y:n*xe+3.35*he,textAnchor:"middle",children:r})]}),me&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("text",{x:"0",y:C*xe+1.6*he,textAnchor:"middle",className:"text-xl font-sans font-bold",fill:p,children:a}),(0,oe.jsx)("text",{x:"0",y:C*xe+4.1*he,textAnchor:"middle",className:"text-xl font-sans font-bold",fill:p,children:r})]})]}),me&&[0,1,2,3,4,5].map(t=>(0,oe.jsx)("line",{x1:e-40*(4===$?.7:2===$?.8:.9),y1:C*xe+t*he,x2:ue,y2:C*xe+t*he,stroke:l,strokeWidth:"2"},"t-l-".concat(t))),me&&(0,oe.jsxs)("g",{transform:"translate(".concat(fe,", ").concat(C*xe+36*xe,")"),fill:p,style:{fontSize:"".concat(36*xe,"px"),fontWeight:"900",letterSpacing:"-0.1em"},children:[(0,oe.jsx)("text",{x:"0",y:"0",children:"T"}),(0,oe.jsx)("text",{x:"0",y:36*xe,children:"A"}),(0,oe.jsx)("text",{x:"0",y:72*xe,children:"B"})]}),me&&[0,1,2,3,4,5].map(t=>(0,oe.jsx)("text",{x:e-60*(4===$?.7:2===$?.8:.9),y:C*xe+t*he+4*xe,textAnchor:"end",fill:m,style:{fontSize:"".concat(14*xe,"px"),fontWeight:"bold"},children:t+1},"string-".concat(t))),(0,oe.jsx)("line",{x1:e-40*(4===$?.7:2===$?.8:.9),y1:t*xe,x2:e-40*(4===$?.7:2===$?.8:.9),y2:(n+4*s)*xe,stroke:d,strokeWidth:"2"}),me&&(0,oe.jsx)("line",{x1:e-40*(4===$?.7:2===$?.8:.9),y1:C*xe,x2:e-40*(4===$?.7:2===$?.8:.9),y2:(C+5*s)*xe,stroke:l,strokeWidth:"2"}),le.map((e,a)=>(0,oe.jsxs)("g",{children:[pe&&(0,oe.jsx)("line",{x1:e,y1:t*xe,x2:e,y2:(n+4*s)*xe,stroke:d,strokeWidth:a===le.length-1?"2":"1.6"}),me&&(0,oe.jsx)("line",{x1:e,y1:C*xe,x2:e,y2:(C+5*s)*xe,stroke:l,strokeWidth:a===le.length-1?"2":"1.6"})]},"barline-".concat(a))),de.map(e=>{const a=(e.startX+e.endX)/2,r=null===Y||void 0===Y?void 0:Y[e.measureNumber],i=r&&(!r.valid1||!r.valid2);return(0,oe.jsxs)("g",{children:[i&&me&&(0,oe.jsx)("rect",{x:e.startX,y:(pe?t-40:C-15)*xe,width:e.endX-e.startX,height:(pe?me?D-t+85:n+4*s+45-t:D-C+60)*xe,fill:R,stroke:"rgba(239, 68, 68, 0.4)",strokeWidth:"1.5",rx:6}),me&&(0,oe.jsxs)("text",{x:a,y:(C+5*s+32)*xe,textAnchor:"middle",className:"text-[10px] font-mono font-bold",fill:i?"#f87171":m,children:["M",e.measureNumber," ",i?"\u26a0\ufe0f":""]}),me&&i&&r&&(()=>{const e=[];return r.present1&&!r.valid1&&e.push("v1:".concat(Number(r.sum1).toFixed(2),"/").concat(G)),r.present2&&!r.valid2&&e.push("v2:".concat(Number(r.sum2).toFixed(2),"/").concat(G)),(0,oe.jsx)("text",{x:a,y:(C+5*s+48)*xe,textAnchor:"middle",className:"text-[10px] font-mono font-semibold",fill:"#f87171",children:e.join(" ")})})()]},"measure-".concat(e.measureNumber))}),ie.map((e,a)=>{var r,i;const o=P.includes(e.globalIndex),l=_&&we&&we.measureNumber===e.measureNumber&&we.startBeat>=e.startBeat&&we.startBeat<e.startBeat+(e.beatValue||1),d=e.isTiedToNext&&(()=>{const t=ie.slice(a+1).find(t=>t.voice===e.voice&&!t.isRest);return!!t&&(P.includes(t.globalIndex)||_&&we&&we.measureNumber===t.measureNumber&&we.startBeat>=t.startBeat&&we.startBeat<t.startBeat+(t.beatValue||1))})(),x=o||l||d;let h=0;if(o)h=1;else if(l){const t=we.startBeat-e.startBeat,n=e.beatValue||1;h=Math.max(.15,.7*(1-t/n))}else d&&(h=.25);const p=x&&(P[0]===e.globalIndex||l),m=x?N:b,R=(2===e.voice?H:X)*xe,I=(2===e.voice?16:-16)*xe,W=1===e.voice&&!ee||2===e.voice&&!te;e.isMetronomeTick&&ne&&_&&!J&&we&&we.measureNumber===e.measureNumber&&(we.startBeat,e.startBeat);return(0,oe.jsxs)("g",{children:[x&&(0,oe.jsx)("rect",{"data-active-indicator":"true",x:e.cx-Q/2+2,y:Ae,width:Q-4,height:Me,fill:o?S:B,opacity:h,rx:4,filter:l||d?"url(#note-glow)":"none",style:{transition:"fill 0.2s ease"}}),p&&(0,oe.jsx)("rect",{"data-active-indicator":"true",x:e.cx-Q/2+2,y:Ae,width:Q-4,height:Me,fill:S,opacity:h,rx:4}),J&&U===e.globalIndex&&!e.isMetronomeTick&&(0,oe.jsx)("rect",{"data-paused-indicator":"true",x:e.cx-Q/2+2,y:Ae,width:Q-4,height:Me,fill:"none",stroke:V,strokeDasharray:"5 4",strokeWidth:1.6,rx:4,pointerEvents:"none"}),o&&!_&&(0,oe.jsxs)("g",{pointerEvents:"none",children:[(0,oe.jsxs)("circle",{cx:e.cx,cy:Ae+Me/2,r:"6",fill:"none",stroke:q,strokeWidth:"2",children:[(0,oe.jsx)("animate",{attributeName:"r",values:"6;32",dur:"1s",repeatCount:"indefinite"}),(0,oe.jsx)("animate",{attributeName:"opacity",values:"0.6;0",dur:"1s",repeatCount:"indefinite"}),(0,oe.jsx)("animate",{attributeName:"stroke-width",values:"2.5;0.5",dur:"1s",repeatCount:"indefinite"})]}),(0,oe.jsxs)("circle",{cx:e.cx,cy:Ae+Me/2,r:"6",fill:O,children:[(0,oe.jsx)("animate",{attributeName:"r",values:"6;20",dur:"1s",repeatCount:"indefinite"}),(0,oe.jsx)("animate",{attributeName:"opacity",values:"0.35;0",dur:"1s",repeatCount:"indefinite"})]})]}),e.isRest?(0,oe.jsxs)("g",{style:{opacity:W?.4:1},children:[pe&&(0,oe.jsx)(oe.Fragment,{children:4===e.beatValue?(0,oe.jsx)("rect",{x:e.cx-7,y:t*xe+1*he-.05*he,width:14,height:.6*he,fill:y,rx:1}):2===e.beatValue?(0,oe.jsx)("rect",{x:e.cx-7,y:t*xe+2*he+.4*he,width:14,height:.6*he,fill:y,rx:1}):(0,oe.jsxs)(oe.Fragment,{children:["r"===e.rhythm&&(0,oe.jsx)("path",{d:"M ".concat(e.cx-4," ").concat((t+28)*xe," L ").concat(e.cx+4," ").concat((t+34)*xe," L ").concat(e.cx-4," ").concat((t+40)*xe," Q ").concat(e.cx+6," ").concat((t+44)*xe," ").concat(e.cx," ").concat((t+50)*xe),fill:"none",stroke:y,strokeWidth:"2",strokeLinecap:"round"}),"r+"===e.rhythm&&(0,oe.jsx)("path",{d:"M ".concat(e.cx-3," ").concat((t+32)*xe," A 3.5 3.5 0 1 1 ").concat(e.cx+2," ").concat((t+34)*xe," Q ").concat(e.cx-2," ").concat((t+38)*xe," ").concat(e.cx+4," ").concat((t+30)*xe," L ").concat(e.cx-3," ").concat((t+50)*xe),fill:"none",stroke:y,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),"r="===e.rhythm&&(0,oe.jsxs)("g",{children:[(0,oe.jsx)("path",{d:"M ".concat(e.cx-2," ").concat((t+27)*xe," A 3 3 0 1 1 ").concat(e.cx+3," ").concat((t+29)*xe," Q ").concat(e.cx-1," ").concat((t+33)*xe," ").concat(e.cx+5," ").concat((t+25)*xe),fill:"none",stroke:y,strokeWidth:"2"}),(0,oe.jsx)("path",{d:"M ".concat(e.cx-4," ").concat((t+36)*xe," A 3 3 0 1 1 ").concat(e.cx+1," ").concat((t+38)*xe," Q ").concat(e.cx-3," ").concat((t+42)*xe," ").concat(e.cx+3," ").concat((t+34)*xe," L ").concat(e.cx-4," ").concat((t+52)*xe),fill:"none",stroke:y,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]})}),me&&(0,oe.jsx)("rect",{x:e.cx-8,y:(C+2*s-4)*xe+I,width:19,height:20*xe,fill:f}),me&&(0,oe.jsx)("text",{x:e.cx,y:(C+3*s-6)*xe+I,textAnchor:"middle",className:"text-lg font-mono font-bold",fill:y,children:"\ud834\udd3e"})]}):(0,oe.jsxs)("g",{children:[e.processedPitches.map((r,i)=>{const o="treble"===r.clef?t:n,h=o+4*s,p=r.staffY>h?Math.floor((r.staffY-h)/s):0,m=r.staffY<o?Math.floor((o-r.staffY)/s):0,f=2===e.voice?w:j,y=W?v:x?f:b,k=W?v:x?f:b,T=x&&!W?"url(#note-glow)":"none",A=r.staffY*xe,M=r.tabY*xe;return(0,oe.jsxs)("g",{children:[pe&&(0,oe.jsxs)(oe.Fragment,{children:[r.isSharp&&(0,oe.jsx)("text",{x:e.cx-18,y:A+5*xe,className:"text-base font-normal font-serif",fill:k,filter:T,children:"\u266f"}),Array.from({length:Math.max(0,m)}).map((t,n)=>(0,oe.jsx)("line",{x1:e.cx-14,y1:o*xe-(n+1)*he,x2:e.cx+14,y2:o*xe-(n+1)*he,stroke:c,strokeWidth:"1.2"},"up-ledg-".concat(n))),Array.from({length:Math.max(0,p)}).map((t,n)=>(0,oe.jsx)("line",{x1:e.cx-14,y1:h*xe+(n+1)*he,x2:e.cx+14,y2:h*xe+(n+1)*he,stroke:c,strokeWidth:"1.2"},"low-ledg-".concat(n))),null===r.fret?(0,oe.jsxs)("g",{children:[(0,oe.jsx)("line",{x1:e.cx-6,y1:A-6*xe,x2:e.cx+6,y2:A+6*xe,stroke:k,strokeWidth:"1.8",strokeLinecap:"round"}),(0,oe.jsx)("line",{x1:e.cx-6,y1:A+6*xe,x2:e.cx+6,y2:A-6*xe,stroke:k,strokeWidth:"1.8",strokeLinecap:"round"})]}):e.beatValue>=2?(0,oe.jsx)("ellipse",{cx:e.cx,cy:A,rx:6,ry:4*xe,transform:"rotate(-22 ".concat(e.cx," ").concat(A,")"),fill:"none",stroke:k,strokeWidth:"2.2",filter:T}):(0,oe.jsx)("ellipse",{cx:e.cx,cy:A,rx:6,ry:4*xe,transform:"rotate(-22 ".concat(e.cx," ").concat(A,")"),fill:y,filter:T}),e.isTiedToNext&&null!==r.fret&&(()=>{const t=ie.slice(a+1).find(t=>t.voice===e.voice&&!t.isRest);if(!t)return null;const n=t.processedPitches.find(e=>e.string===r.string)||t.processedPitches[0];return n&&null!==n.fret?(0,oe.jsx)("path",{d:"M ".concat(e.cx+4," ").concat(A+5*xe," Q ").concat((e.cx+t.cx)/2," ").concat(Math.max(r.staffY,n.staffY)*xe+16*xe," ").concat(t.cx-4," ").concat(n.staffY*xe+5*xe),fill:"none",stroke:u,strokeWidth:"1.8",strokeLinecap:"round"}):null})()]}),me&&e.isTiedToNext&&null!==r.fret&&(()=>{const t=ie.slice(a+1).find(t=>t.voice===e.voice&&!t.isRest);if(!t)return null;const n=t.processedPitches.find(e=>e.string===r.string);if(!n||null===n.fret)return null;const s=!W&&(P.includes(e.globalIndex)||P.includes(t.globalIndex)||l||d),i=s?2===e.voice?w:j:u,o=s?"url(#note-glow)":"none";return n.midi===r.midi?(0,oe.jsx)("path",{d:"M ".concat(e.cx+4," ").concat(M," Q ").concat((e.cx+t.cx)/2," ").concat(M+12*xe," ").concat(t.cx-4," ").concat(n.tabY*xe),fill:"none",stroke:i,strokeWidth:s?"2.5":"1.8",strokeLinecap:"round",filter:o}):(0,oe.jsx)("line",{x1:e.cx+12,y1:M,x2:t.cx-12,y2:n.tabY*xe,stroke:i,strokeWidth:s?"3":"2",strokeLinecap:"round",filter:o})})(),me&&(0,oe.jsx)("rect",{x:e.cx-13,y:M-11*xe,width:20,height:18*xe,fill:"#0f172a",stroke:k,strokeWidth:x?"2":"1.5",filter:T,rx:3}),me&&(0,oe.jsx)("text",{x:e.cx-3,y:M+3.2*xe,textAnchor:"middle",className:"font-sans tracking-wide",style:{fontSize:Te,fontWeight:"600"},fill:W?v:x?V:g,children:null===r.fret?"X":r.fret})]},"p-".concat(i))}),pe&&(0,oe.jsxs)(oe.Fragment,{children:[e.trebleStem&&e.beatValue<4&&(()=>{const t=2===e.voice?w:j,n=W?v:x?t:b,s=e.trebleStem,a=s.lowestY,r=s.highestY,i=s.stemDown,o=i?e.cx-5.5:e.cx+5.5,c=i?a*xe+28*xe:r*xe-28*xe,l=e.beatValue<=.25?2:e.beatValue<=.75?1:0;return(0,oe.jsxs)("g",{children:[(0,oe.jsx)("line",{x1:o,y1:r*xe,x2:o,y2:c,stroke:n,strokeWidth:"1.6"}),l>0&&(0,oe.jsx)("path",{d:F(o,c,i,l),fill:n})]})})(),e.bassStem&&e.beatValue<4&&(()=>{const t=2===e.voice?w:j,n=W?v:x?t:b,s=e.bassStem,a=s.lowestY,r=s.highestY,i=s.stemDown,o=i?e.cx-5.5:e.cx+5.5,c=i?a*xe+28*xe:r*xe-28*xe,l=e.beatValue<=.25?2:e.beatValue<=.75?1:0;return(0,oe.jsxs)("g",{children:[(0,oe.jsx)("line",{x1:o,y1:r*xe,x2:o,y2:c,stroke:n,strokeWidth:1.6*xe}),l>0&&(0,oe.jsx)("path",{d:F(o,c,i,l),fill:n})]})})(),[6,3,1.5,.75].includes(e.beatValue)&&(0,oe.jsx)("circle",{cx:e.cx+12,cy:(((null===(r=e.trebleStem)||void 0===r?void 0:r.highestY)||(null===(i=e.bassStem)||void 0===i?void 0:i.highestY)||t)-3)*xe,r:3*xe,fill:m})]})]}),!e.isMetronomeTick&&me&&(0,oe.jsxs)("g",{children:[(0,oe.jsx)("rect",{x:e.cx-Q/2+4,y:R-18*xe,width:Q-8,height:24*xe,fill:2===e.voice?M:T,rx:"2"}),e.isTiedToNext&&(()=>{const t=ie.slice(a+1).find(t=>t.voice===e.voice);return t?(0,oe.jsx)("line",{x1:e.cx+20,y1:R-4*xe,x2:t.cx-20,y2:R-4*xe,stroke:c,strokeWidth:"2",strokeLinecap:"round"}):null})(),(0,oe.jsx)("text",{x:e.cx,y:R,textAnchor:"middle",className:"font-mono font-black text-sm",fill:W?v:e.isRest?y:2===e.voice?A:k,children:e.rhythm})]}),(0,oe.jsx)("rect",{x:e.cx-Q/2,y:Se,width:Q,height:Ne,fill:"transparent",pointerEvents:"all",onPointerEnter:()=>{_&&!J||Z(e.globalIndex)},onPointerLeave:()=>{_&&!J||Z(null)},onPointerDown:()=>{_&&!J||Z(e.globalIndex)},onPointerUp:()=>{_&&!J||Z(null)},onClick:()=>{_&&!J||K(e.globalIndex)}})]},"node-".concat(a))})]})},"row-".concat(re))}}function le(e){let t=e.scoreData;const n=(0,r.useState)(null),i=(0,a.A)(n,2),o=i[0],c=i[1],l=(0,r.useState)(!1),d=(0,a.A)(l,2),u=d[0],x=d[1],h=(0,r.useState)(!1),p=(0,a.A)(h,2),m=p[0],f=p[1],g=(0,r.useState)(null),b=(0,a.A)(g,2),y=b[0],v=b[1],k=(0,r.useState)(100),T=(0,a.A)(k,2),A=T[0],M=T[1],S=(0,r.useState)(null),N=(0,a.A)(S,2),V=N[0],B=N[1],R=(0,r.useState)(6),I=(0,a.A)(R,2),W=I[0],E=I[1],z=(0,r.useRef)(null),O=(0,r.useRef)(null),q=(0,r.useState)(!1),Y=(0,a.A)(q,2),D=Y[0],F=Y[1],J=(0,r.useState)(!1),U=(0,a.A)(J,2),K=U[0],$=U[1],te=(0,r.useState)(!0),ne=(0,a.A)(te,2),le=ne[0],de=ne[1],ue=(0,r.useState)(!0),xe=(0,a.A)(ue,2),he=xe[0],pe=xe[1],me=(0,r.useState)(!1),fe=(0,a.A)(me,2),ge=fe[0],be=fe[1],ye=(0,r.useState)("tab"),ve=(0,a.A)(ye,2),je=ve[0],ke=ve[1],Te=(0,r.useRef)(null),we=(0,r.useMemo)(()=>(e=>{const t=60/e*1e3/4,n=Math.max(15,Math.min(45,Math.round(.4*t)));return{lookaheadInterval:n,scheduleAheadTime:Math.max(1,10*n/1e3)}})(A),[A]),Ae=we.lookaheadInterval,Me=we.scheduleAheadTime,Se=(0,r.useRef)([]),Ne=(0,r.useRef)(0),Ve=(0,r.useState)(4),Be=(0,a.A)(Ve,2),Re=Be[0],Ce=Be[1],Ie=(0,r.useState)(!1),We=(0,a.A)(Ie,2),Ee=We[0],ze=We[1],Oe=(0,r.useRef)(null),qe=(0,r.useRef)([]),Le=(0,r.useRef)([]),Ye=(0,r.useRef)(0),De=(0,r.useRef)(0),Ge=(0,r.useRef)(0);(0,r.useEffect)(()=>{const e=()=>{window.innerWidth<480?(Ce(1),E(40),ze(!0)):window.innerWidth<768?(Ce(2),E(50),ze(!0)):(Ce(4),E(50),ze(!1))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.useEffect)(()=>{u||c(null)},[u]);(0,r.useEffect)(()=>{const e=()=>F(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]);const Pe=function(e,t,n){return(0,r.useMemo)(()=>{var a,r;if(!e||!e.measures)return null;const i=(null===(a=e.timeSignature)||void 0===a?void 0:a.split("/")[0])||"4",o=(null===(r=e.timeSignature)||void 0===r?void 0:r.split("/")[1])||"4",c=parseInt(i,10),l=parseInt(o,10),d=c*(4/l),u=t;let x=[],h=0,p=0;e.measures.forEach(e=>{const t=e.measureNumber;let n={1:0,2:0};const a={};for(let s=0;s<c;s++){const e=4/l,n=h+s*e,r="0_".concat(n);a[r]={globalIndex:null,measureNumber:t,voice:0,startBeat:n,beatValue:e,isRest:!1,isMetronomeTick:!0,isDownbeat:0===s,rhythm:":",pitches:[],descriptions:["Metronome"]}}e.notes.forEach(e=>{let r=e.rhythm,i=e.pitches||[];e.pitches||void 0===e.fret||void 0===e.string||(i=[{fret:e.fret,string:e.string}]);const o={};i.forEach(e=>{(void 0===o[e.string]||e.fret>o[e.string].fret)&&(o[e.string]=e)}),i=Object.values(o);const c=0===i.length&&!e.tie;r||void 0===e.duration||(c?1.5===e.duration?r="r.":1===e.duration?r="r":.5===e.duration?r="r+":.25===e.duration&&(r="r="):6===e.duration?r="o.":4===e.duration?r="o":3===e.duration?r="..":2===e.duration?r=".":1.5===e.duration?r=":.":1===e.duration?r=":":.75===e.duration?r="+.":.5===e.duration?r="+":.25===e.duration&&(r="="));const l=void 0!==e.duration?e.duration:Q[r||":"]||1,d=e.voice||1,u=h+n[d];n[d]+=l;const x="".concat(d,"_").concat(u);a[x]?(a[x].pitches=[...a[x].pitches,...i],e.description&&a[x].descriptions.push(e.description),e.tie&&(a[x].isTiedToNext=!0)):a[x]=(0,s.A)((0,s.A)({},e),{},{pitches:[...i],descriptions:e.description?[e.description]:[],rhythm:r||(c?"r":":"),beatValue:l,isRest:c||r&&r.startsWith("r"),voice:d,startBeat:u,measureNumber:t,isTiedToNext:!!e.tie})});const r=new Set(Object.values(a).filter(e=>!e.isRest&&!e.isMetronomeTick).map(e=>e.startBeat));Object.values(a).forEach(e=>{e.isRest&&r.has(e.startBeat)&&(e.isRest=!1,e.rhythm="",e.pitches=[],e.descriptions&&e.descriptions.push("Suppressed Rest"))}),Object.values(a).forEach(e=>{e.descriptions&&e.descriptions.length>0?(e.description=e.descriptions.join(" | "),e.description=e.description.replaceAll("_"," ")):e.description||(e.description="");const t={};e.pitches.forEach(e=>{(void 0===t[e.string]||e.fret>t[e.string].fret)&&(t[e.string]=e)}),e.pitches=Object.values(t),x.push((0,s.A)((0,s.A)({},e),{},{globalIndex:p++}))}),h+=d});const m=e.measures.length>0?Math.max(...e.measures.map(e=>e.measureNumber)):1,f={};for(let e=1;e<=m;e++){const t=x.filter(t=>t.measureNumber===e&&1===t.voice),n=x.filter(t=>t.measureNumber===e&&2===t.voice),s=t.reduce((e,t)=>e+(t.beatValue||0),0),a=n.reduce((e,t)=>e+(t.beatValue||0),0),r=t.length>0,i=n.length>0,o=!r||Math.abs(s-d)<1e-6,c=!i||Math.abs(a-d)<1e-6;f[e]={sum1:s,sum2:a,present1:r,present2:i,valid1:o,valid2:c,valid:o&&c,isPolyphonic:r&&i}}const g={};x.forEach(e=>{g[e.measureNumber]||(g[e.measureNumber]=new Set),g[e.measureNumber].add(e.startBeat)});const b={};Object.keys(g).forEach(e=>{b[e]=Array.from(g[e]).sort((e,t)=>e-t)});const y=[];for(let e=0;e<m;e+=n){const t=Math.min(n,m-e),a=[],r=[];let i=130;for(let n=0;n<t;n++){var v;const t=e+n+1,s=i,o=s+(((null===(v=b[t])||void 0===v?void 0:v.length)||1)*u+50);r.push({measureNumber:t,startX:s,endX:o,slotsArray:b[t]||[]}),i=o,a.push(o)}const o=i,c=o+40,l=x.filter(n=>n.measureNumber>e&&n.measureNumber<=e+t).map(e=>{var t;const n=r.find(t=>t.measureNumber===e.measureNumber),a=n.slotsArray.indexOf(e.startBeat),i=n.startX+25+a*u+u/2,o=e.pitches.map(e=>{const t=340+18*(e.string-1),n=H[e.string].baseMidi+e.fret,a=n>=60?"treble":"bass",r=P(n,a,"treble"===a?100:220,18);return(0,s.A)((0,s.A)({},e),{},{tabY:t,staffY:r.y,isSharp:r.isSharp,midi:n,clef:a,noteName:"".concat(X[n%12]).concat(Math.floor(n/12)-1)})}),c=o.filter(e=>"treble"===e.clef),l=o.filter(e=>"bass"===e.clef),d=null===(t=f[e.measureNumber])||void 0===t?void 0:t.isPolyphonic,x=(t,n)=>{if(0===t.length)return null;const s=t.map(e=>e.staffY),a=Math.max(...s),r=Math.min(...s);let i=t.reduce((e,t)=>e+t.midi,0)/t.length>=n;return d&&(i=2===e.voice),{lowestY:a,highestY:r,stemDown:i}},h=o.some(e=>null===e.fret)?e.description?"".concat(e.description):"Muted string":e.description;return(0,s.A)((0,s.A)({},e),{},{description:h,cx:i,processedPitches:o,trebleStem:x(c,71),bassStem:x(l,50)})});y.push({rowEvents:l,totalWidth:c,barlineXPositions:a,measureGroups:r,rowEndX:o})}return{computedRows:y,timeSigTop:i,timeSigBottom:o,paddingX:130,trebleTopY:100,bassTopY:220,tabTopY:340,rhythmTopY:520,lineSpacing:18,SLOT_WIDTH:u,measureValidityMap:f,beatsPerMeasure:d}},[e,t,n])}(t,W,Re),Fe=(0,r.useRef)([]);(0,r.useEffect)(()=>{if(!Pe)return;$(!1);const e=setTimeout(()=>{const e=Pe.computedRows.flatMap(e=>e.rowEvents),t=[],n=new Set;e.forEach((a,r)=>{a.isMetronomeTick?t.push((0,s.A)((0,s.A)({},a),{},{type:"metronome",isMetronomeTick:!0,voice:0,startBeat:a.startBeat,globalIndex:a.globalIndex,preCalculatedJitter:0,preCalculatedVelocity:0,segments:[{type:"rest",duration:a.beatValue}]})):a.isRest?t.push({type:"rest",voice:a.voice,startBeat:a.startBeat,globalIndex:a.globalIndex,preCalculatedJitter:0,preCalculatedVelocity:0,segments:[{type:"rest",duration:a.beatValue}]}):a.processedPitches.forEach(s=>{const i="".concat(a.globalIndex,"_").concat(s.string);if(n.has(i))return;if(null===s.fret)return void t.push({type:"mute",voice:a.voice,startBeat:a.startBeat,globalIndex:a.globalIndex,preCalculatedJitter:.003*(Math.random()-.5),preCalculatedVelocity:.88+.22*Math.random(),segments:[{type:"mute",duration:a.beatValue}]});const o=[{type:"pluck",midi:s.midi,duration:a.beatValue}];let c=a,l=r,d=s;for(;c.isTiedToNext;){const t=e.slice(l+1).find(e=>e.voice===c.voice&&!e.isRest);if(!t)break;const s=t.processedPitches.find(e=>e.string===d.string);if(!s)break;const r=t.beatValue;if(o[o.length-1].tiedEventIndices||(o[o.length-1].tiedEventIndices=[]),o[o.length-1].tiedEventIndices.push({globalIndex:t.globalIndex,beatOffset:t.startBeat-a.startBeat}),s.midi===d.midi)o.push({type:"tie",midi:s.midi,duration:r});else{const e=o[o.length-1],t=e.duration/2;e.duration=t,o.push({type:"slide",midi:s.midi,duration:t}),o.push({type:"tie",midi:s.midi,duration:r})}const i="".concat(t.globalIndex,"_").concat(s.string);n.add(i),l=e.indexOf(t),c=t,d=s}t.push({type:"pluck",voice:a.voice,startBeat:a.startBeat,globalIndex:a.globalIndex,midi:s.midi,preCalculatedJitter:.003*(Math.random()-.5),preCalculatedVelocity:.88+.22*Math.random(),segments:o})})}),Fe.current=t,$(!0)},100);return()=>clearTimeout(e)},[Pe]);const He=(0,r.useMemo)(()=>{if(!Pe||!Pe.computedRows)return[];const e=Pe.computedRows.flatMap(e=>e.rowEvents).map(e=>e.voice);return Array.from(new Set(e)).sort((e,t)=>e-t)},[Pe]),Xe=function(e,t,n,s,a,r,i){return()=>{e.current&&(clearTimeout(e.current),e.current=null),ee(t),n(!1),s(!1),a(null),r.current=0,Z(1/0),i.current&&"closed"!==i.current.state&&i.current.close()}}(Te,qe,x,f,v,De,Oe),Qe=function(e,t,n,s,a,r,i,o){return()=>{if(!e||t)return;n.current&&(clearTimeout(n.current),n.current=null),ee(s);const c=a.current.currentTime-r.current;i.current+=c,o(!0),a.current&&a.current.suspend()}}(u,m,Te,qe,Oe,Ge,De,f),_e=se(Ye,Oe,A,Ge,De,Ne,Se,Me,v,qe,Xe,Te,Ae,ge),Je=function(e,t,n,s,a,r){return()=>{e&&t&&n.current&&(n.current.resume(),s.current=n.current.currentTime,a(!1),r())}}(u,m,Oe,Ge,f,_e),Ue=function(e,t,n,s,a,r,i,o,c,l,d,u,x,h,p,m){return function(){let f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(e||!t||!n)return;Z(1/0);const g=s.current;g&&"closed"!==g.state&&g.close(),_=null;const b=window.AudioContext||window.webkitAudioContext;s.current=new b({latencyHint:"playback",sampleRate:44100}),a(!0),r(!1),i.current=0;const y=s.current;o.current=y.currentTime;const v=t.computedRows.flatMap(e=>e.rowEvents).filter(e=>e.measureNumber>=f);c.current=v;const j=v.length>0?v[0].startBeat:0;l.current=j;const k=d.current.filter(e=>e.startBeat>=j).filter(e=>!(1===e.voice&&!p)&&!(2===e.voice&&!m)),T=[];v.forEach(e=>{const t=e.isMetronomeTick,n=void 0!==e.beatOffset&&e.beatOffset%1===0;(t||n)&&(T.some(t=>t.startBeat===e.startBeat)||T.push({startBeat:e.startBeat,globalIndex:e.globalIndex,voice:0,isMetronomeTick:!0,isDownbeat:e.isDownbeat||0===e.beatOffset,segments:[],preCalculatedJitter:0,preCalculatedVelocity:1}))});const w=parseInt(t.timeSigTop,10),A=4/parseInt(t.timeSigBottom,10),M=t.beatsPerMeasure;for(let e=0;e<w;e++){const t=j-M+e*A;T.unshift({startBeat:t,globalIndex:-(e+1),voice:0,isMetronomeTick:!0,isPreviewTick:!0,isDownbeat:0===e,segments:[],preCalculatedJitter:0,preCalculatedVelocity:1})}const S=[...k,...T],N=j-M;l.current=N;const V={};S.forEach(e=>{V[e.startBeat]||(V[e.startBeat]={startBeat:e.startBeat,globalIndex:e.globalIndex,notes:[]}),V[e.startBeat].notes.push(e)}),u.current=Object.values(V).sort((e,t)=>e.startBeat-t.startBeat),x.current=0,h(N)}}(u,Pe,K,Oe,x,f,De,Ge,Le,Ye,Fe,Se,Ne,_e,le,he);(0,r.useEffect)(()=>()=>Xe(),[]);const Ze=u&&null!==y&&y<0?-y:0,Ke=(0,r.useRef)({v1:[],v2:[]}),$e=u?m&&null!==o?o:y:o,et=e=>{u&&!m||c(t=>t===e?null:e)},tt=(0,r.useMemo)(()=>{if(null===$e||!Pe)return[];const e=Pe.computedRows.flatMap(e=>e.rowEvents),t=e.find(e=>e.globalIndex===$e);return t?e.filter(e=>e.measureNumber===t.measureNumber&&e.startBeat===t.startBeat&&!e.isMetronomeTick).sort((e,t)=>(e.voice||1)-(t.voice||1)):[]},[$e,Pe]),nt=(0,r.useMemo)(()=>tt.map(e=>e.globalIndex),[tt]),st=(0,r.useMemo)(()=>{var e,n;if(!Pe||!t)return null;const s=(null===(e=t.measures)||void 0===e?void 0:e.length)||0,a=t.timeSignature||"4/4",r=t.key||t.keySignature||"C",i=(parseInt(a.split("/")[0],10)||4)*(4/(parseInt(a.split("/")[1],10)||4)),o=60*(s*i)/A,c=Math.floor(o/60),l=Math.round(o%60),d=((null===(n=Pe.computedRows)||void 0===n?void 0:n.flatMap(e=>e.rowEvents))||[]).filter(e=>!e.isRest&&!e.isMetronomeTick).length;return{totalMeasures:s,timeSig:a,keySig:r,bpm:A,totalDuration:"".concat(c,":").concat(l.toString().padStart(2,"0")),noteCount:d,beatsPerMeasure:i}},[Pe,t,A]);(0,r.useEffect)(()=>{if(!u)return void(Ke.current={v1:[],v2:[]});const e=tt.filter(e=>1===e.voice),t=tt.filter(e=>2===e.voice);e.length>0&&(Ke.current.v1=e),t.length>0&&(Ke.current.v2=t)},[tt,u]);const at=(0,r.useMemo)(()=>{if(!u)return tt;const e=tt.filter(e=>1===e.voice),t=tt.filter(e=>2===e.voice),n=[...tt];return 0===e.length&&Ke.current.v1.length>0&&n.push(...Ke.current.v1),0===t.length&&Ke.current.v2.length>0&&n.push(...Ke.current.v2),n},[tt,u]),rt=(0,r.useMemo)(()=>{if(!at||0===at.length)return null;const e=["#21cea3","#fb923c"],t=at.filter(e=>1===e.voice),n=at.filter(e=>2===e.voice),s=(e,t,n)=>0===e.length?null:(0,oe.jsx)("div",{style:{flex:"1 1 0",minWidth:0,borderLeft:"2px solid ".concat(n),paddingLeft:"8px"},children:e.map((e,s)=>{const a=e.isRest?[{noteName:"Rest"}]:e.processedPitches;return(0,oe.jsxs)("div",{children:[(0,oe.jsxs)("div",{style:{fontSize:"10px",color:"#8892b0",marginBottom:"1px"},children:[(0,oe.jsx)("span",{style:{color:n},children:t}),!e.isRest&&(0,oe.jsx)("span",{style:{marginLeft:"4px"},children:G(e.beatValue)})]}),a.map((e,t)=>(0,oe.jsx)("div",{style:{color:n,fontSize:"13px",fontWeight:"600",lineHeight:1.3},children:null===e.fret?(0,oe.jsxs)("span",{style:{color:"#aaccff",fontStyle:"italic",fontWeight:"400",fontSize:"11px"},children:["Muted s",e.string]}):(0,oe.jsxs)("span",{style:{color:"#dfe6e9",fontWeight:"400"},children:[e.noteName,void 0!==e.string&&(0,oe.jsxs)("span",{style:{color:"#8892b0",fontSize:"11px",marginLeft:"4px"},children:["s",e.string," f",e.fret]})]})},t)),e.description&&(0,oe.jsx)("div",{style:{fontSize:"10px",color:"#aaccff",fontStyle:"italic",lineHeight:1.2,marginTop:"1px"},children:e.description})]},s)})});return(0,oe.jsxs)("div",{className:"d-flex",style:{gap:"12px"},children:[t.length>0&&s(t,"V1",e[0]),n.length>0&&s(n,"V2",e[1])]})},[at]),it=(0,r.useMemo)(()=>{if(!Pe||!Pe.computedRows)return null;const e=Pe.computedRows.flatMap(e=>e.rowEvents);if(0===e.length)return null;const t=e[0].startBeat,n=e[e.length-1],s=n.startBeat+(n.beatValue||1);return{firstBeat:t,lastBeat:s,totalBeats:s-t}},[Pe]);(0,r.useEffect)(()=>{if(u&&null!==y&&it&&it.totalBeats>0){if(y<0)return void B(0);const e=Pe.computedRows.flatMap(e=>e.rowEvents).find(e=>e.globalIndex===y);if(e){const t=(e.startBeat-it.firstBeat)/it.totalBeats*100,n=Math.max(0,Math.min(100,Math.round(t)));B(n)}else B(0)}else u||B(null)},[y,u,it,Pe]);const ot=(0,r.useMemo)(()=>null!==y&&Pe?Pe.computedRows.findIndex(e=>e.rowEvents.some(e=>e.globalIndex===y)):-1,[y,Pe]),ct=(0,r.useRef)(-1);if((0,r.useEffect)(()=>{const e=z.current;if(e){if(!u)return e.scrollTo({top:0,behavior:"smooth"}),void(ct.current=-1);if(-1!==ot&&ot!==ct.current){ct.current=ot;const t=e.querySelectorAll("tbody tr")[ot];if(t){const n=e.getBoundingClientRect(),s=t.getBoundingClientRect().top-n.top+e.scrollTop;e.scrollTo({top:Math.max(0,s-20),behavior:"auto"})}}}},[ot,u]),!Pe)return(0,oe.jsx)("div",{className:"text-slate-500 font-mono text-xs p-4",children:"No notation data package available."});const lt=Pe.computedRows,dt=Pe.timeSigTop,ut=Pe.timeSigBottom,xt=Pe.paddingX,ht=Pe.trebleTopY,pt=Pe.bassTopY,mt=Pe.tabTopY,ft=Pe.rhythmTopY,gt=Pe.lineSpacing,bt=Pe.SLOT_WIDTH,yt=Pe.measureValidityMap,vt=Pe.beatsPerMeasure,jt=ft,kt=ft+28;return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("style",{children:"\n                @keyframes countin-fade {\n                    0% { opacity: 1; transform: scale(1.3); }\n                    100% { opacity: 0; transform: scale(1); }\n                }\n            "}),(0,oe.jsxs)("div",{ref:O,className:"d-flex flex-column bg-dark",style:{height:D?"100vh":"calc(100vh - 56px)",overflow:"hidden"},children:[(0,oe.jsx)("div",{className:"bg-dark border-bottom border-secondary text-light shrink-0 ".concat(Ee?"px-0 py-1":"p-2"),style:{height:"auto"},children:Ee?(0,oe.jsxs)("div",{className:"d-flex flex-column gap-1",children:[(0,oe.jsxs)("div",{className:"d-flex gap-1",children:[(0,oe.jsxs)("div",{className:"d-flex flex-column gap-1",style:{flex:"2 1 auto"},children:[(0,oe.jsxs)("div",{className:"btn-group bg-black p-1 rounded border border-secondary",style:{height:"30px",alignItems:"center"},children:[u?m?(0,oe.jsx)(ae.A,{variant:"link",onClick:Je,className:"text-warning p-1",title:"Resume",children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M8 5v14l11-7z"})})}):(0,oe.jsx)(ae.A,{variant:"link",onClick:Qe,className:"text-warning p-1",title:"Pause",children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})})}):(0,oe.jsx)(ae.A,{variant:"link",onClick:Ue,className:"text-success p-1",title:"Start",disabled:!(le&&He.includes(1)||he&&He.includes(2)||ge),children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M8 5v14l11-7z"})})}),(0,oe.jsx)(ae.A,{variant:"link",onClick:Xe,disabled:!u,className:"p-1 ".concat(u?"text-danger":"text-muted"),title:"Stop",children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M6 6h12v12H6z"})})})]}),(0,oe.jsxs)("div",{className:"bg-black px-2 py-1 rounded border border-secondary d-flex align-items-center",style:{height:"26px"},children:[(0,oe.jsx)(re.A.Range,{min:"40",max:"240",value:A,onChange:e=>M(parseInt(e.target.value,10)),disabled:u,className:"flex-grow-1",style:{height:"5px"}}),(0,oe.jsx)("span",{className:"text-warning fw-bold font-monospace",style:{fontSize:"9px",minWidth:"22px"},children:A})]}),(0,oe.jsx)("div",{className:"bg-black px-1 rounded border border-secondary d-flex align-items-center",style:{height:"12px"},children:(0,oe.jsx)("div",{style:{width:"".concat(u&&null!==V?V:0,"%"),height:"4px",background:L,borderRadius:"2px",transition:"width 0.3s ease"}})})]}),(0,oe.jsxs)("div",{className:"d-flex flex-column gap-1",style:{flex:"1 1 auto"},children:[(0,oe.jsxs)("div",{className:"bg-black px-2 py-1 rounded border border-secondary d-flex flex-column gap-1",children:[(0,oe.jsx)("div",{style:{fontSize:"8px",textTransform:"uppercase",letterSpacing:"1px",color:"#586278"},children:"Audio Tracks"}),(0,oe.jsxs)("div",{className:"d-flex align-items-center gap-1",children:[(0,oe.jsxs)("div",{className:"d-flex align-items-center justify-content-between",style:{width:"50px",height:"16px"},children:[(0,oe.jsx)("span",{style:{fontSize:"10px",color:le?j:"#8892b0",fontWeight:"bold"},children:"V1"}),(0,oe.jsx)(re.A.Check,{type:"switch",id:"voice-toggle-0",label:"",className:"m-0 d-flex align-items-center",style:{transform:"scale(0.65)",transformOrigin:"right center"},checked:le&&He.includes(1),disabled:u||!He.includes(1),onChange:e=>de(e.target.checked)})]}),(0,oe.jsxs)("div",{className:"d-flex align-items-center justify-content-between",style:{width:"50px",height:"16px"},children:[(0,oe.jsx)("span",{style:{fontSize:"10px",color:he?w:"#8892b0",fontWeight:"bold"},children:"V2"}),(0,oe.jsx)(re.A.Check,{type:"switch",id:"voice-toggle-1",label:"",className:"m-0 d-flex align-items-center",style:{transform:"scale(0.65)",transformOrigin:"right center"},checked:he&&He.includes(2),disabled:u||!He.includes(2),onChange:e=>pe(e.target.checked)})]}),(0,oe.jsxs)("div",{className:"d-flex align-items-center justify-content-between",style:{width:"50px",height:"16px"},children:[(0,oe.jsx)("span",{style:{fontSize:"10px",color:ge?C:"#8892b0",fontWeight:"bold"},children:"Met"}),(0,oe.jsx)(re.A.Check,{type:"switch",id:"metronome-toggle",label:"",className:"m-0 d-flex align-items-center",style:{transform:"scale(0.65)",transformOrigin:"right center"},checked:ge,disabled:u,onChange:e=>be(e.target.checked)})]})]})]}),(0,oe.jsxs)("div",{className:"bg-black px-2 py-1 rounded border border-secondary d-flex flex-column gap-1",children:[(0,oe.jsx)("div",{style:{fontSize:"8px",textTransform:"uppercase",letterSpacing:"1px",color:"#586278"},children:"Audio Tracks"}),(0,oe.jsx)("div",{className:"d-flex align-items-center gap-1",style:{height:"18px"},children:["tab","both","sheet"].map(e=>(0,oe.jsx)("button",{onClick:()=>!u&&ke(e),disabled:u,style:{fontSize:"9px",fontWeight:je===e?"700":"400",color:je===e?"#fff":"#8892b0",background:je===e?"tab"===e?"#1a6b4a":"sheet"===e?"#6b4a8a":"#2a5a7a":"transparent",border:"1px solid ".concat(je===e?"transparent":"#3a3a5a"),borderRadius:"tab"===e?"4px 0 0 4px":"sheet"===e?"0 4px 4px 0":"0",padding:"0 7px",lineHeight:"16px",cursor:u?"default":"pointer",opacity:u?.5:1,transition:"all 0.15s ease",textTransform:"uppercase",letterSpacing:"0.3px"},children:"tab"===e?"Tab":"both"===e?"Both":"Staff"},e))})]})]})]}),(0,oe.jsx)("div",{className:"bg-black border border-secondary rounded p-2 font-monospace",style:{fontSize:"12px",lineHeight:"1.2",overflowY:"auto",height:"74px"},children:rt||(st?(0,oe.jsxs)("div",{className:"d-flex flex-column",style:{gap:"3px",color:"#8892b0"},children:[(0,oe.jsx)("div",{style:{fontSize:"8px",textTransform:"uppercase",letterSpacing:"1px",color:"#586278"},children:"Track Info"}),(0,oe.jsxs)("div",{className:"d-flex",style:{gap:"8px",flexWrap:"wrap"},children:[(0,oe.jsxs)("span",{style:{fontSize:"10px"},children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u231b"})," ",st.totalDuration]}),(0,oe.jsxs)("span",{style:{fontSize:"10px"},children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u2669"})," ",st.timeSig]}),(0,oe.jsxs)("span",{style:{fontSize:"10px"},children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u266f"})," ",st.keySig]}),(0,oe.jsxs)("span",{style:{fontSize:"10px"},children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\ud834\udd06"})," ",st.totalMeasures," bars"]}),(0,oe.jsxs)("span",{style:{fontSize:"10px"},children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u266a"})," ",st.noteCount," notes"]}),(0,oe.jsxs)("span",{style:{fontSize:"10px"},children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"BPM"})," ",st.bpm]})]})]}):(0,oe.jsx)("span",{className:"text-muted fst-italic",style:{fontSize:"11px"},children:"Select a note to view properties."}))})]}):(0,oe.jsxs)("div",{className:"d-flex gap-3",style:{minHeight:"76px"},children:[(0,oe.jsxs)("div",{className:"d-flex flex-column gap-1",style:{minWidth:"160px",flexShrink:0},children:[(0,oe.jsxs)("div",{className:"btn-group bg-black p-1 rounded border border-secondary",style:{height:"30px",alignItems:"center"},children:[u?m?(0,oe.jsx)(ae.A,{variant:"link",onClick:Je,className:"text-warning p-1",title:"Resume",children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M8 5v14l11-7z"})})}):(0,oe.jsx)(ae.A,{variant:"link",onClick:Qe,className:"text-warning p-1",title:"Pause",children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})})}):(0,oe.jsx)(ae.A,{variant:"link",onClick:Ue,className:"text-success p-1",title:"Start",disabled:!(le&&He.includes(1)||he&&He.includes(2)||ge),children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M8 5v14l11-7z"})})}),(0,oe.jsx)(ae.A,{variant:"link",onClick:Xe,disabled:!u,className:"p-1 ".concat(u?"text-danger":"text-muted"),title:"Stop",children:(0,oe.jsx)("svg",{width:"18",height:"18",fill:"currentColor",viewBox:"0 0 24 24",children:(0,oe.jsx)("path",{d:"M6 6h12v12H6z"})})})]}),(0,oe.jsxs)("div",{className:"bg-black px-2 py-1 rounded border border-secondary d-flex align-items-center",style:{height:"26px"},children:[(0,oe.jsx)(re.A.Range,{min:"40",max:"240",value:A,onChange:e=>M(parseInt(e.target.value,10)),disabled:u,className:"flex-grow-1",style:{height:"5px"}}),(0,oe.jsx)("span",{className:"text-warning fw-bold font-monospace",style:{fontSize:"9px",minWidth:"22px"},children:A})]}),(0,oe.jsx)("div",{className:"bg-black px-1 rounded border border-secondary d-flex align-items-center",style:{height:"12px"},children:(0,oe.jsx)("div",{style:{width:"".concat(u&&null!==V?V:0,"%"),height:"4px",background:L,borderRadius:"2px",transition:"width 0.3s ease"}})})]}),(0,oe.jsxs)("div",{className:"d-flex flex-column gap-1",style:{minWidth:"180px",flexShrink:0},children:[(0,oe.jsxs)("div",{className:"bg-black px-2 py-1 rounded border border-secondary d-flex flex-column gap-1",children:[(0,oe.jsx)("div",{style:{fontSize:"8px",textTransform:"uppercase",letterSpacing:"1px",color:"#586278"},children:"View Options"}),(0,oe.jsxs)("div",{className:"d-flex align-items-center gap-2",children:[(0,oe.jsxs)("div",{className:"d-flex align-items-center justify-content-between",style:{width:"52px",height:"16px"},children:[(0,oe.jsx)("span",{style:{fontSize:"10px",color:le?j:"#8892b0",fontWeight:"bold"},children:"V1"}),(0,oe.jsx)(re.A.Check,{type:"switch",id:"voice-toggle-0",label:"",className:"m-0 d-flex align-items-center",style:{transform:"scale(0.7)",transformOrigin:"right center"},checked:le&&He.includes(1),disabled:u||!He.includes(1),onChange:e=>de(e.target.checked)})]}),(0,oe.jsxs)("div",{className:"d-flex align-items-center justify-content-between",style:{width:"52px",height:"16px"},children:[(0,oe.jsx)("span",{style:{fontSize:"10px",color:he?w:"#8892b0",fontWeight:"bold"},children:"V2"}),(0,oe.jsx)(re.A.Check,{type:"switch",id:"voice-toggle-1",label:"",className:"m-0 d-flex align-items-center",style:{transform:"scale(0.7)",transformOrigin:"right center"},checked:he&&He.includes(2),disabled:u||!He.includes(2),onChange:e=>pe(e.target.checked)})]}),(0,oe.jsxs)("div",{className:"d-flex align-items-center justify-content-between",style:{width:"52px",height:"16px"},children:[(0,oe.jsx)("span",{style:{fontSize:"10px",color:ge?C:"#8892b0",fontWeight:"bold"},children:"Met"}),(0,oe.jsx)(re.A.Check,{type:"switch",id:"metronome-toggle",label:"",className:"m-0 d-flex align-items-center",style:{transform:"scale(0.7)",transformOrigin:"right center"},checked:ge,disabled:u,onChange:e=>be(e.target.checked)})]})]})]}),(0,oe.jsxs)("div",{className:"bg-black px-2 py-1 rounded border border-secondary d-flex flex-column gap-1",children:[(0,oe.jsx)("div",{style:{fontSize:"8px",textTransform:"uppercase",letterSpacing:"1px",color:"#586278"},children:"View Options"}),(0,oe.jsx)("div",{className:"d-flex align-items-center gap-1",style:{height:"18px"},children:["tab","both","sheet"].map(e=>(0,oe.jsx)("button",{onClick:()=>!u&&ke(e),disabled:u,style:{fontSize:"9px",fontWeight:je===e?"700":"400",color:je===e?"#fff":"#8892b0",background:je===e?"tab"===e?"#1a6b4a":"sheet"===e?"#6b4a8a":"#2a5a7a":"transparent",border:"1px solid ".concat(je===e?"transparent":"#3a3a5a"),borderRadius:"tab"===e?"4px 0 0 4px":"sheet"===e?"0 4px 4px 0":"0",padding:"0 8px",lineHeight:"16px",cursor:u?"default":"pointer",opacity:u?.5:1,transition:"all 0.15s ease",textTransform:"uppercase",letterSpacing:"0.3px"},children:"tab"===e?"Tab":"both"===e?"Both":"Staff"},e))})]})]}),(0,oe.jsx)("div",{className:"bg-black border border-secondary rounded p-2 font-monospace flex-grow-1 d-flex flex-column justify-content-center",style:{fontSize:"12px",lineHeight:"1.2",height:"76px",overflowY:"auto"},children:rt||(st?(0,oe.jsxs)("div",{className:"d-flex flex-column",style:{gap:"4px",color:"#8892b0"},children:[(0,oe.jsx)("div",{style:{fontSize:"9px",textTransform:"uppercase",letterSpacing:"1px",color:"#586278",marginBottom:"2px"},children:"Track Info"}),(0,oe.jsxs)("div",{className:"d-flex",style:{gap:"12px",flexWrap:"wrap"},children:[(0,oe.jsxs)("span",{children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u231b"})," ",st.totalDuration]}),(0,oe.jsxs)("span",{children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u2669"})," ",st.timeSig]}),(0,oe.jsxs)("span",{children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u266f"})," ",st.keySig]}),(0,oe.jsxs)("span",{children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\ud834\udd06"})," ",st.totalMeasures," bars"]}),(0,oe.jsxs)("span",{children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"\u266a"})," ",st.noteCount," notes"]}),(0,oe.jsxs)("span",{children:[(0,oe.jsx)("span",{style:{color:"#64748b"},children:"BPM"})," ",st.bpm]})]}),(0,oe.jsx)("div",{style:{fontSize:"10px",color:"#586278",marginTop:"2px"},children:"Click any note on the score to inspect its properties."})]}):(0,oe.jsx)("span",{className:"text-muted fst-italic",children:"Select a note to view properties."}))})]})}),(0,oe.jsxs)("div",{ref:z,className:"flex-grow-1",style:{overflowY:"auto",paddingTop:"12px",paddingBottom:"150px",position:"relative"},children:[(0,oe.jsx)("button",{onClick:()=>{var e,t,n,s;document.fullscreenElement?null===(e=(t=document).exitFullscreen)||void 0===e||e.call(t):null===(n=O.current)||void 0===n||null===(s=n.requestFullscreen)||void 0===s||s.call(n)},title:D?"Exit fullscreen":"Fullscreen",style:{position:"sticky",top:Ee?"4px":"8px",float:"right",zIndex:10,fontSize:Ee?"9px":"11px",padding:Ee?"2px 4px":"4px 6px",lineHeight:Ee?"10px":"14px",color:D?"#22d3ee":"#8892b0",background:"rgba(0,0,0,0.7)",border:"1px solid #3a3a5a",borderRadius:"4px",cursor:"pointer",marginRight:Ee?"4px":"8px",transition:"all 0.15s ease"},children:(0,oe.jsx)("svg",{width:Ee?10:14,height:Ee?10:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,oe.jsx)("path",{d:D?"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3":"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),(0,oe.jsx)(ie.A,{responsive:!0,bordered:!1,style:{margin:0,width:"100%"},children:(0,oe.jsx)("tbody",{children:lt.map((e,t)=>{const n=1===Re?"20px":2===Re?"32px":"48px";return(0,oe.jsx)("tr",{children:(0,oe.jsx)("td",{style:{border:0,padding:0},children:(0,oe.jsx)("div",{style:{background:"rgba(255,255,255,0.015)",borderRadius:"6px",border:"1px solid rgba(255,255,255,0.04)",marginTop:0===t?0:"24px",padding:"0 ".concat(Ee?"4px":"12px"," ").concat(n," ").concat(Ee?"4px":"12px")},children:ce(xt,ht,pt,gt,dt,ut,mt,yt,ft,vt,nt,kt,jt,bt,u,m,y,()=>{},et,Re,le&&He.includes(1),he&&He.includes(2),ge,je)(e,t)})})},t)})})})]}),Ze>0&&(0,oe.jsx)("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,pointerEvents:"none"},children:(0,oe.jsx)("div",{style:{fontSize:"140px",color:"rgba(167, 139, 250, 0.95)",fontWeight:"bold",fontFamily:"monospace",textShadow:"0 0 40px rgba(167, 139, 250, 0.5)",animation:"countin-fade 0.8s ease-out forwards"},children:Ze})},Ze)]})]})}}}]);
//# sourceMappingURL=451.39577ad3.chunk.js.map