PageSourceSearch

https://www.gitori.com/assets/FBG-422.CU5AF8Tx.js

js gitori.com collected 2026-09-28 10:42:16 UTC 16,813 bytes, 1 lines download raw bytes

1import{_ as H}from"./CohortProgressDisplay.tzp6M6BG.js";import{_ as R}from"./BackgroundGalaxy.BJ2RzC2H.js";import{_ as U}from"./BackButtonDesktop.xCjHD2cS.js";import{_ as E}from"./BackButtonMobile.CS55ZlfT.js";import{_ as q}from"./BoxDisplayLargeTextScales.OK-6eEiG.js";import{_ as z}from"./TimeLeft.DNDPJFS8.js";import{_ as V}from"./Lives.15KDJAU3.js";import{_ as J}from"./FretSettings.BxaA-0cA.js";import{i as F}from"./user.zwA28n-7.js";import{a2 as Q,a as W,A as Y,o as n,c as h,b as s,d as l,n as M,g as m,h as f,F as K,a4 as T,B as G,w as _,i as c,u as X,j as Z}from"./entry.BXoBKzgO.js";import{c as ee}from"./memoryRecord.UWwacoZZ.js";import{A as te}from"./AudioPlayMixin.CwjprL5Q.js";import{p as re,m as se,_ as ie}from"./Fretboard.Ba0Y6L-j.js";import{u as p,a as oe}from"./game.BC_Aqop3.js";import{b as d,a as w,u as ne}from"./failures.0LWKwbY7.js";import{u as v}from"./timer.DC9WC_fU.js";import{u as I}from"./score.BJ0P2qmI.js";import"./index.B1lRv9sW.js";import{u as y}from"./multiNoteState.DovpesZJ.js";import{u as g}from"./currentChallenge.mbdMP0oP.js";import{F as C,h as le,c as ae,a as P,f as ue,b as ce,d as me}from"./FBG422ChallengeTuples.MZ0I5SER.js";import{u as A}from"./correctAnswersInCohort.CWBxvQI_.js";import{u as $}from"./uistate.CHgi35ls.js";import{U as he,h as de,G as fe,S as pe}from"./transition.DZk96Axv.js";import{_ as ge}from"./ChangeOrientation.QLkZZkIy.js";import{_ as _e}from"./FetchAchievementsBeforeGameOver.B3DphhFp.js";import{c as ye}from"./courseList.B2vwbwA5.js";import{u as O}from"./useLeaderboard.Di1UGySt.js";import{u as Ce}from"./index.DlH4uHas.js";import{u as be}from"./consecutiveCorrectAnswers.BKFdHP_a.js";import{u as k}from"./useSavePercentageProgressInDatabase.DMqWew9o.js";import"./PitchDetection.DRg62jIF.js";import"./settings.Cdc07AqA.js";import"./liveModeSensitivity.BaSWXQbd.js";import"./LiveModeSignalStrengthIndicators.DFHY0-3R.js";import"./accompanyingCourse.CS_W2hWo.js";import"./notePlayer.DD0GCaL8.js";import"./index.Ibl7EI5x.js";import"./audio.C80kKfSg.js";import"./NuxtParticles.vue.D15sM5FR.js";import"./noteForFretAllTunings.BC6ojPXo.js";import"./index.Djy5MAGS.js";import"./index.BQp1Dwlw.js";import"./index.DsIDSHS3.js";import"./index.Dl5xezoI.js";import"./tuning.CI4OCIan.js";import"./FireworksMixin.BpNxbKsr.js";import"./noteForFret.DXCpDxI0.js";import"./currentIndexOfMultiChordSelection.BIUYyEDB.js";import"./GrayGem.CjjQMp8A.js";import"./dynamic-import-helper.BxLOqBCD.js";import"./SettingsIcon.D-YYCnNC.js";import"./NotesLeft.q7Sy3T-H.js";import"./confetti-explosion.esm.CsIOM_D9.js";import"./fireworksConfigs.DZVQ8LkQ.js";import"./deviceCheck.BK3yVgLl.js";import"./usePosthog.D2_-x2_o.js";import"./timerDuration.BG1iu4wX.js";import"./noteUtils.qMGmFM6_.js";import"./dom.BwFJYJrF.js";import"./hidden.DVDnSMlX.js";import"./use-outside-click.wr0GP8YP.js";import"./disposables.CJjoKbfW.js";import"./description.CPrX1dRJ.js";import"./achievements.CRuDQW2T.js";import"./recentModules.eBPyC2Af.js";import"./dateUtils.HwxOqoFU.js";import"./percentageProgressBar.CKT2ynkg.js";function B(){const e={};for(let t=1;t<=C;t++)e[`position${t}`]=!0;return e}const xe=Q("FBG422Filters",{state:()=>B(),actions:{resetFilters(){Object.assign(this.$state,B())},setFormData(e){Object.assign(this.$state,e)},setPosition(e,t){const r=`position${e}`;r in this.$state&&(this[r]=t)}},getters:{areAllFiltersSetToDefault(){return Object.values(this.$state).every(Boolean)}}}),Se={mixins:[te],props:{options:{type:Object,required:!0}},data:function(){return{allChallengeTuples:[],currentChallengeTuple:null,currentFretboardLocations:null,currentFretboardRoot:null,currentChallengeName:null,inAudioMode:!1,lastSetOfStringFretsSuccessfullyIdentified:[],stopListeningForASecond:!1,pausePitchDetection:!1}},mounted(){this.$bus.$on("stopOrganChordsWhereNecessary",()=>{this.inAudioMode=!0,this.stopOrganSound()}),this.getFiltersFromQueryStringAndApplyThemBeforeFetchingRandomNotes(),y().reset(),this.allChallengeTuples=this.getAllChallengeTuples(),A().setCohortSize(50),d().setResetTimeDuration(this.level),d().$subscribe((e,t)=>{t.timeLeft===1&&!this.isPracticeMode&&(w().decrementLife(),this.$bus.$emit("buzzAndVibrate"),this.$bus.$emit("showYourSelfIfYoureTheRightAnswer"),this.stopOrganSound(),this.createPlayHistoryEntryForTimeouts())}),this.$bus.$on("clearTimer",()=>{clearInterval(v().timer),v().timer=null}),this.$bus.$on("audioNoteDetection",e=>{if(this.pausePitchDetection||this.stopListeningForASecond&&JSON.stringify(this.lastSetOfStringFretsSuccessfullyIdentified)===JSON.stringify(e))return;const t=(this.currentFretboardLocations||[]).map(o=>`s${o.string}f${o.fret}`),r=this.findIntersection(e,t);if(r.length>0)this.$bus.$emit("showIconForDetectedAudioNote",r),JSON.stringify(this.lastSetOfStringFretsSuccessfullyIdentified)===JSON.stringify(e)&&(this.stopListeningForASecond=!0,setTimeout(()=>{this.stopListeningForASecond=!1},2e3));else{const o=this.stringFretClosestToHighlightedArea(e);this.$bus.$emit("showIconForDetectedAudioNote",[o])}this.lastSetOfStringFretsSuccessfullyIdentified=e}),this.$bus.$on("nextChallenge",()=>{w().livesLeft!==0&&(this.$bus.$emit("clearTimer"),d().resetTime(),this.generateRandomFretboardLocations(),this.stopOrganSound(),this.inAudioMode||this.playOrganChordOnLoop(this.currentChallengeNameAbbreviated),v().timer=setInterval(()=>{d().decrementTime()},1e3))}),this.$bus.$on("refreshNoteQueue",()=>{this.allChallengeTuples=this.getAllChallengeTuples(),A().setCohortSize(50),this.$bus.$emit("nextChallenge")})},beforeUnmount(){this.stopOrganSound(),this.$bus.$off("nextChallenge"),this.$bus.$off("stopOrganChordsWhereNecessary"),this.$bus.$off("clearTimer"),this.$bus.$off("audioNoteDetection"),this.$bus.$off("refreshNoteQueue")},methods:{hintNotesForTuple(e){return Array.isArray(e==null?void 0:e.hintNotes)?e.hintNotes:[]},async createPlayHistoryEntryForTimeouts(){if(!F()||this.isPracticeMode)return;const e=g().memoryCardPayload,{error:t}=await G().from("play_history_entries").insert({payload:e,time_taken:d().resetTimeDuration,play_history_id:this.options.uuidOfPlayHistory,payload_hash:ee(e),user_id:T().value.id,game_id:this.$route.name,answered_correctly:!1});t&&console.error("Error inserting play history entry:",t)},stringFretClosestToHighlightedArea(e){if(e.length===1)return e[0];if(y().challengeNotes.length===0)return null;const t=e.map(u=>u.split("f")[1]),o=y().challengeNotes[0],a=t.map(u=>Math.abs(u-o.fret)),i=a.indexOf(Math.min(...a));return e[i]},findIntersection(e,t){return e===void 0||t===void 0?[]:e.filter(r=>t.includes(r))},onClick(){this.stopSound()},getFiltersFromQueryStringAndApplyThemBeforeFetchingRandomNotes(){this.filterStore.resetFilters();const e=this.$route.query;if(e.practice!=="true")return;for(let r=1;r<=C;r++)e[`position${r}`]==="false"&&this.filterStore.setPosition(r,!1);
1const t=typeof e.position=="string"?parseInt(e.position,10):null;if(t>=1&&t<=C)for(let r=1;r<=C;r++)this.filterStore.setPosition(r,r===t)},getAllCAGEDChallengeTuples(){return me()},tuplePositionAllowed(e,t){return ce(e,t)},getAllChallengeTuples(){const e=this.filtersFromStore;return this.getAllCAGEDChallengeTuples().filter(r=>this.tuplePositionAllowed(r,e))},generateRandomFretboardLocations(){const e=this.getRandomChallengeTuple();this.currentChallengeTuple=e;const t=this.hintNotesForTuple(e),r=P(e.challengeNotes,t);this.currentFretboardLocations=[e.root].concat(e.challengeNotes||[]),this.currentChallengeName=e.challengeName,this.currentFretboardRoot=e.root;const o=y();o.setChallengeNotes(r),o.setHintNotes(t),o.setHintNotesHideIntervals(!0),this.$bus.$emit("hideShowCorrectAnswerInGray"),this.$bus.$emit("justHideAnyExistingRootNotes"),this.$bus.$emit("partiallyDisableFretboard",ue(t,r)),this.$bus.$emit("armcorrectAnswersForMultiNoteChallenge",{fretboardLocations:r}),g().setCurrentChallenge(this.currentChallenge),g().setCurrentChallengeType("multiNote"),g().setMemoryCardPayload(this.memoryCardPayload)},getRandomChallengeTuple(){return this.allChallengeTuples.length===0?(alert("There are no challenge tuples"),{}):this.allChallengeTuples[Math.floor(Math.random()*this.allChallengeTuples.length)]},fillGap(e){if(!Array.isArray(e)||e.length<2||!e.every(r=>typeof r=="number"))return e;e.sort((r,o)=>r-o);const t=[e[0]];for(let r=1;r<e.length;r++){const o=e[r],a=e[r-1];if(o-a>1)for(let i=a+1;i<o;i++)t.push(i);t.push(o)}return t}},computed:{numberFlowTransformTiming(){return{duration:350,easing:"ease-out"}},numberFlowOpacityTiming(){return{duration:200,easing:"ease-out"}},scoreClass(){return this.showConsecutiveCorrect?"opacity-0":"opacity-100"},currentChallengeNameAbbreviated(){const e=(this.currentChallengeName||"").trim();let t="",r=!0;return/ (?:Maj\.?|M)\s+Pent\.\s*$/.test(e)?(t=e.replace(/ (?:Maj\.?|M)\s+Pent\.\s*$/,"").trim(),r=!0):/\sMajor$/.test(e)?(t=e.replace(/\s+Major$/,"").trim(),r=!0):/\sMinor$/.test(e)?(t=e.replace(/\s+Minor$/,"").trim(),r=!1):/min$/i.test(e)?(t=e.replace(/min$/i,"").trim(),r=!1):(r=e.includes("Maj"),t=e.split("Min")[0].split("Maj")[0].trim()),`${se(t)}${r?"M":"Min"}`},currentChallengeDisplayText(){const e=(this.currentChallengeName||"").trim();return e?/ (?:Maj\.?|M)\s+Pent\.\s*$/.test(e)?e.trim():/\sMajor$/.test(e)||/\sMinor$/.test(e)?e:/min$/i.test(e)?`${e.replace(/min$/i,"").trim()} Min`:/Maj$/.test(e)&&!/\sMaj/.test(e)?e:e.includes("Maj")?`${e.split("Maj")[0].trim()} M`:e.includes("Min")?`${e.split("Min")[0].trim()} Min`:e:""},filtersFromStore(){return Object.assign({},this.filterStore.$state)},level(){return this.$route.name},currentChallenge(){return{fretboardLocations:this.currentFretboardLocations,rootFretboardLocation:this.currentFretboardRoot,challengeName:this.currentChallengeName}},stringSpan(){const e=this.currentChallengeTuple;return e?ae(P(e.challengeNotes,this.hintNotesForTuple(e))):[]},allFiltersSetToDefault(){return this.filterStore.areAllFiltersSetToDefault},showConsecutiveCorrect(){return p().showConsecutiveCorrect},isGameRunning(){return p().isGameRunning},currentScore(){return I().score},isPracticeMode(){return p().isPracticeMode},currentUser(){return T().value},surroundingFrets(){return le(this.hintNotesForTuple(this.currentChallengeTuple))},surroundingStrings(){return this.stringSpan},evalClass(){return[this.hideIfFiltersHidden].join(" ")},hideIfFiltersHidden(){return""},filterStore(){return xe()},backButtonPath(){return this.$route.query.backButtonPath?this.$route.query.backButtonPath:null},memoryCardPayload(){var e,t;return re({challengeName:this.currentChallenge.challengeName,challengeNotes:((e=this.currentChallengeTuple)==null?void 0:e.challengeNotes)||[],hintNotes:this.hintNotesForTuple(this.currentChallengeTuple),root:this.currentChallenge.rootFretboardLocation,position:((t=this.currentChallengeTuple)==null?void 0:t.position)||null})}}},ve={class:"hidden lg:block"},$e={class:"flex"},Fe={class:"lg:hidden"},Te={key:0,class:"flex flex-row lg:flex-col pixelated ml-8 lg:ml-0"},we={key:0,class:"flex flex-col lg:ml-8 lg:mt-1 mr-8 lg:mr-0 mt-3"},Ne={key:1,class:"flex flex-col ml-8 opacity-0 mt-1"};function Me(e,t,r,o,a,i){const u=U,b=E,x=Y("NumberFlow"),S=q,N=z,j=V,D=J;return n(),h(K,null,[s("div",ve,[l(u,{path:i.backButtonPath},null,8,["path"])]),i.currentUser?(n(),h("div",{key:0,class:M(["text-white flex justify-between mt-2 lg:mt-8 text-2xl lg:text-5xl relative ml-12 lg:ml-0 items-center lg:px-32 lg:ml-16",i.evalClass])},[s("div",$e,[s("div",Fe,[l(b,{path:i.backButtonPath},null,8,["path"])]),i.isPracticeMode?m("",!0):(n(),h("div",Te,[s("div",{class:M(["text-2xl lg:text-4xl flex justify-center w-8 text-yelloww
1hite",i.scoreClass])},[l(x,{value:i.currentScore,"transform-timing":i.numberFlowTransformTiming,"spin-timing":i.numberFlowTransformTiming,"opacity-timing":i.numberFlowOpacityTiming},null,8,["value","transform-timing","spin-timing","opacity-timing"])],2)]))]),i.isGameRunning?(n(),h("div",we,[s("div",{class:"flex justify-center",onClick:t[0]||(t[0]=(...L)=>i.onClick&&i.onClick(...L))},[l(S,{textValue:i.currentChallengeDisplayText},null,8,["textValue"])]),i.isPracticeMode?m("",!0):(n(),f(N,{key:0}))])):(n(),h("div",Ne,[t[1]||(t[1]=s("div",{class:"h-full bg-yellowgray600 px-8 py-4 border border-yellowgray400 rounded-lg challengeNote pixelatedflex justify-center"},"Gmin",-1)),i.isPracticeMode?m("",!0):(n(),f(N,{key:0}))])),i.isPracticeMode?m("",!0):(n(),f(j,{key:2})),i.isPracticeMode?(n(),f(D,{key:3,defaultState:i.allFiltersSetToDefault},null,8,["defaultState"])):m("",!0)],2)):m("",!0)],64)}const Pe=W(Se,[["render",Me]]),Ae={class:"fixed inset-0 overflow-hidden"},Oe={class:"absolute inset-0 overflow-hidden"},ke={class:"pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10"},Be={class:"flex h-full flex-col overflow-y-scroll bg-yellowgray200 py-6 shadow-xl"},Ge={class:"px-4 sm:px-6"},Ie={class:"flex items-start justify-between"},je={class:"ml-3 flex h-7 items-center"},De={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 5 5",width:"18",height:"18",style:{"image-rendering":"pixelated"}},Le={__name:"FilterSlideOverFBG422",setup(e){return(t,r)=>(n(),f(c(pe),{as:"template",show:c($)().showFilterWindow},{default:_(()=>[l(c(he),{as:"div",class:"relative z-[2147483645]",onClose:r[1]||(r[1]=o=>c($)().closeSlideOver())},{default:_(()=>[r[5]||(r[5]=s("div",{class:"fixed inset-0"},null,-1)),s("div",Ae,[s("div",Oe,[s("div",ke,[l(c(de),{as:"template",enter:"transform transition ease-out duration-300 sm:duration-500","enter-from":"translate-x-full","enter-to":"translate-x-0",leave:"transform transition ease-in-out duration-300 sm:duration-500","leave-from":"translate-x-0","leave-to":"translate-x-full"},{default:_(()=>[l(c(fe),{class:"pointer-events-auto w-screen max-w-md"},{default:_(()=>[s("div",Be,[s("div",Ge,[s("div",Ie,[r[3]||(r[3]=s("div",{class:"flex"},[s("div",{class:"text-3xl"},"Filters")],-1)),s("div",je,[s("button",{type:"button",class:"rounded-md text-white/50 hover:text-white transition-colors focus:outline-none",onClick:r[0]||(r[0]=o=>c($)().closeSlideOver())},[(n(),h("svg",De,r[2]||(r[2]=[s("rect",{fill:"currentColor",x:"0",y:"0",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"4",y:"0",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"1",y:"1",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"3",y:"1",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"2",y:"2",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"1",y:"3",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"3",y:"3",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"0",y:"4",width:"1",height:"1"},null,-1),s("rect",{fill:"currentColor",x:"4",y:"4",width:"1",height:"1"},null,-1)])))])])])]),r[4]||(r[4]=s("div",{class:"relative flex-1 px-4 sm:px-6"},[s("div",{class:"text-2xl mt-8 ml-3"},"No available filters")],-1))])]),_:1})]),_:1})])])])]),_:1})]),_:1},8,["show"]))}},He={class:"mx-auto max-w-7xl level1Game"},Re={data:function(){return{uuidOfPlayHistory:null}},mounted(){this.setCurrentGame(),Ce(),this.createPlayHistory(),this.clearConsecutiveCorrectAnswersStreak(),this.$route.query.practice==="true"&&p().enablePracticeMode(),w().reset(),I().reset(),d().reset(),g().reset(),k().completelyClearEverythingInCohortStore(),this.$bus.$emit("nextChallenge"),p().startGame(),ne().resetFailures(),this.$bus.$on("gameOver",async()=>{p().endGame(),F()&&(await O().addScore(this.level,this.uuidOfPlayHistory),k().savePercentageProgressInDatabase({activityId:this.$route.name,isPracticeMode:this.isPracticeMode})),Z(`/gameOver?gameId=${this.$route.name}`,{replace:!0})})},beforeUnmount(){this.$bus.$off("gameOver")},computed:{isPracticeMode(){return this.$route.query.practice==="true"},level(){return this.$route.name},options(){return{instrument:"Guitar",fretboardType:"multiNoteFretboard",headstock:!0,uuidOfPlayHistory:this.uuidOfPlayHistory}}},methods:{setCurrentGame(){oe().setGameId(this.$route.name)},async createPlayHistory(){if(!F()||this.$route.query.practice==="true")return;const{data:e,error:t}=await G().from("play_history").insert({user_id:T().value.id,game_id:this.level,name:O().getUserInfo().abbreviatedName,client_created_at:new Date().toISOString()}).select("id").single();if(t){console.error("Error creating play history:",t);return}this.uuidOfPlayHistory=e.id},clearConsecutiveCorrectAnswersStreak(){be().clearStreak()}}},rr=Object.assign(Re,{__name:"FBG-422",setup(e){return X({titleTemplate:()=>{var t;return((t=ye.find(r=>
1r.id==="FBG-422"&&r.type==="game"))==null?void 0:t.title)??"FBG-422"}}),(t,r)=>{const o=H,a=R,i=Pe,u=ie,b=Le,x=ge,S=_e;return n(),h("div",null,[t.isPracticeMode?m("",!0):(n(),f(o,{key:0})),s("div",He,[l(a),l(i,{options:t.options},null,8,["options"]),l(u,{options:t.options},null,8,["options"]),l(b,{options:{},instrument:t.options.instrument},null,8,["instrument"])]),l(x),l(S)])}}});export{rr as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.