diff --git a/assets/index-GKlnmpNM.js b/assets/index-GKlnmpNM.js deleted file mode 100644 index 456e8c0..0000000 --- a/assets/index-GKlnmpNM.js +++ /dev/null @@ -1,4 +0,0 @@ -var Ue=Object.defineProperty;var Je=(d,a,n)=>a in d?Ue(d,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):d[a]=n;var re=(d,a,n)=>(Je(d,typeof a!="symbol"?a+"":a,n),n);import{j as e,r as b,a as Ke}from"./react-rKaTJ6rC.js";import{c as Ve}from"./react-dom-6aGZtuvN.js";import{c as Ye,s as qe,S as He,T as X,B as Ze,M as j,a as Me,b as M,d as z,F as _,e as W,f as T,g as J,h as I,R as ee,i as B,j as O,k as Xe,A as ie,l as le,m as ce,n as ae,o as oe,p as $,q as C,r as ne,t as je,u as Ce,v as ve,L as we,C as ge,w as xe,x as Qe,y as et,D as tt,z as rt,E as at,I as E,H as ot,G as nt,J as st,K as it,N as lt,O as ct,P as ut,Q as dt,U as ht,V as pt,W as mt,X as Se,Y as gt,Z as xt,_ as ft,$ as bt,a0 as yt,a1 as jt}from"./@mui-KY3h_Vqr.js";import{v as A}from"./uuid-yQnnJER4.js";import{I as Ct}from"./imagekit-IXdsfQA1.js";import{u as vt,a as wt,b as G}from"./react-router-Qfa4vrje.js";import{B as St}from"./react-router-dom-RWL_fUCn.js";import"./@babel-1eI3ubiv.js";import"./scheduler-iwWdm5Ml.js";import"./@emotion-MmGlNCCc.js";import"./hoist-non-react-statics-ruMgn741.js";import"./stylis-UTZzoVRx.js";import"./react-is-q81m-9gd.js";import"./clsx-Zbgk8kpT.js";import"./react-transition-group-am-CiPuM.js";import"./@react-spring-WSCnDrwI.js";import"./d3-color-0OvjxriG.js";import"./d3-interpolate-E_NIlnYy.js";import"./d3-shape-JTn4KTFh.js";import"./d3-path-B_10WkFA.js";import"./d3-scale-aMHsSRTu.js";import"./internmap-Ts8DYYQa.js";import"./d3-array-wUFzFig2.js";import"./d3-format-9E78v3lr.js";import"./d3-time-format-0imObhOF.js";import"./d3-time-xXQrfqad.js";import"./d3-delaunay-aCXE4wJG.js";import"./delaunator-IGifLgEt.js";import"./robust-predicates-cFBOqhuN.js";import"./prop-types-i7IregA9.js";import"./reselect-SnMqv3yZ.js";import"./@popperjs-zyV4rJhQ.js";import"./lodash-Xr53mQ-n.js";import"./axios-d3lcUOYg.js";import"./hamming-distance-_tY3BPi_.js";import"./form-data-QPNVk4j9.js";import"./@remix-run-w2aNq8l3.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const p of i)if(p.type==="childList")for(const h of p.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function n(i){const p={};return i.integrity&&(p.integrity=i.integrity),i.referrerPolicy&&(p.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?p.credentials="include":i.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function r(i){if(i.ep)return;i.ep=!0;const p=n(i);fetch(i.href,p)}})();const Tt={none:{primary:"#696969",secondary:"#696969"},alpine:{primary:"#32ab64",secondary:"#5a9e76"},ocean:{primary:"#4852c7",secondary:"#364c87"},desert:{primary:"#b6bd5e",secondary:"#a1a662"},lavender:{primary:"#a33abd",secondary:"#993eb0"},volcano:{primary:"#e43606",secondary:"#dc5414"},sunset:{primary:"#e77e44",secondary:"#c97b55"}},At=["none","alpine","ocean","desert","lavender","volcano","sunset"];let Te,ue="none";class kt{constructor(){re(this,"themesList",At);if(Te)throw new Error("You can only create one instance!");Te=this}getInstance(){return this}getCurrentThemeData(){return Tt[ue]}setThemeId(a){ue=a}getThemeId(){return ue}}const x=Object.freeze(new kt),y={main:{primary:x.getCurrentThemeData().primary,2:x.getCurrentThemeData().primary,1:x.getCurrentThemeData().primary,0:"#414141"},black:{primary:"#151515",2:"#666",1:"#333",0:"#0A0A0A"},white:{primary:"#FFF",1:"#EEE",0:"#CCC"}},Dt=d=>({palette:{mode:d,...d==="light"?{primary:{main:y.main[2]},text:{primary:y.black[0],secondary:y.black[2],tertiary:y.main[1]}}:{primary:{main:y.main[1]},background:{default:y.black[1],paper:y.black.primary},text:{primary:y.white[1],secondary:y.white[0],tertiary:y.main[1]}}},components:{MuiAppBar:{styleOverrides:{colorPrimary:{backgroundColor:y.main[2],color:y.white.primary}}},MuiInputLabel:{styleOverrides:{root:{color:d==="light"?y.black[1]:y.white[1]}}},MuiInputBase:{styleOverrides:{root:{input:{height:"auto"}}}},MuiFormControlLabel:{styleOverrides:{root:{color:d==="light"?y.black[1]:y.white[1]}}},MuiOutlinedInput:{styleOverrides:{root:{fieldset:{borderColor:d==="light"?y.black[1]:y.white[1]}}}},MuiToolbar:{styleOverrides:{root:{backgroundColor:`${d==="light"?y.main[2]:y.black.primary} !important`}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:`${d==="light"?y.white[0]:y.black[0]} !important`}}}},typography:{fontFamily:"HelveticaNeueLight, sans-serif",fontWeightRegular:400},overrides:{MuiTypography:{styleOverrides:{root:{letterSpacing:"0.05em"}}},MuiCssBaseline:{"@global":{"@font-face":{fontFamily:"HelveticaNeueLight",fontStyle:"normal",fontWeight:400,src:` - local('HelveticaNeueLight'), - url(./fonts/HelveticaNeue-Light.otf) format('opentype') - `}}},MuiAccordion:{root:{"&$expanded":{margin:"auto"}}},MuiAccordionSummary:{content:{"&$expanded":{margin:"12px 0"}}},MuiAccordionDetails:{root:{padding:16}}}}),de=d=>Ye(Dt(d)),se={pageContainer:{"&::WebkitScrollbar":{width:0,height:0},width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"center",gap:"100px",overflowY:"scroll"},form:{width:"100%",height:"auto",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1rem"},teamSwitch:{width:"100%",height:"auto",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"20px"}},F="#821C1E",N="#3f51b5",Pe={scouterName:"",teamNum:0,intake:"",preferredAutoPos:"",canClimb:!1,FramePerimeter:0,weight:0,canGoUnderChain:!1,numBatteries:0,numBatteryChargers:0,ProgrammingLanguage:"",driveTrain:"",numMotors:0,motorType:"",image:"https://placehold.co/400x400?text=upload%20image",doLocktiteFalcons:!1},Nt=["Scouter Name","Team #","Intake Positions","Preferred Starting Position","Can Climb","Frame Perimeter","Weight","Under Chain","# of Batteries","# of Chargers","Programming Language","Drive Train","# of Motors","Are Falcons loctited"],Q={intake:["ground","station","both","none"],preferredAutoPos:["don't care","1","2","3"],ProgrammingLanguage:["Java","C++","LabVIEW","Python"],driveTrain:["West Coast Drive","Swerve Drive","2-Wheel Drive","4-Wheel Drive","Other 6-Wheel Drive","Car Drive","H-Drive","Holonomic Drive","Mecanum Drive","other"],motorType:["Talon-500 Motor","NEO motor","NEO 550 motor","Kraken Motor","Jaguar Motor","Venom Motor","Nidec Dynamo BLDC Motor","other"]},It=["Scouter Name","Alliance Color","Alliance Position","Team Number","match Number","auto Taxi","auto Amp","Auto Speaker","auto Misses","teleop Amp","teleop Speaker","teleop Shuttle","Teleop Climb","broken","spotlight","notes"],Le={uuid:A(),scouterName:"",color:"red",alliancePosition:1,teamNumber:NaN,matchNumber:NaN,autoTaxi:!1,autoAmp:0,autoSpeaker:0,autoMisses:0,teleopAmp:0,teleopSpeaker:0,teleopShuttle:0,teleopClimb:"",broken:!1,spotlight:!1,notes:""},Mt=15,Pt=135,Ae="3bf14c94cacb7b7bf51ecc306f3dad088a839ec16a99bdec3e4f2bbf6831c544",Fe="2024cmptx",Be=qe(d=>e.jsx(He,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...d}))(({theme:d})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:F,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:N,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:d.palette.mode==="light"?d.palette.grey[100]:d.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:d.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:N,opacity:1,transition:d.transitions.create(["background-color"],{duration:500})}})),Lt={appNameContainer:{width:"100%",height:"auto",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"end",gap:"20px"}},R=({title:d,children:a,sx:n={},hover:r=""})=>e.jsxs("div",{style:Lt.appNameContainer,children:[e.jsx(X,{variant:"h1",title:r,sx:Object.assign({},{color:x.getCurrentThemeData().primary,fontFamily:"Lexend",fontWeight:"bold",textTransform:"uppercase",paddingTop:"0px",marginTop:"0px",fontSize:"4em"},n),children:d}),a]}),Oe="1v7rt_tRsWAKDxGMnfeCTZNCB9mOycKVb5izpzJTe07Y",Ft="AIzaSyCtpEW-xu38_uBirzfKie_rsGpfkhlaaiY",Bt="test",Ot="A2:Z5000",ke=`https://sheets.googleapis.com/v4/spreadsheets/${Oe}/values/${Bt}!${Ot}?key=${Ft}`;let De,U;class Rt{constructor(){if(De)throw new Error("You can only create one instance!");De=this}getInstance(){return this}async getPitScouting(){return new Promise((a,n)=>{fetch(ke.replace(Oe,"1Em2CmfPw0XNbrP0T7f42goERnDkcGvJqQq5vJJb7GuI").replace("test","PitScouting")).then(r=>r.json()).then(r=>a(r.values)).catch(r=>n(r))})}updateSheetsJson(){fetch(ke).then(a=>a.json()).then(a=>U=a.values).catch(()=>{})}getSheetsRaw(){return this.updateSheetsJson(),U}async getAsyncData(){return U||await this.updateSheetsJson(),U}getInstancesByName(a){return U?U.filter(n=>n[0]===a).length:0}getInstancesByTeamNum(a){return U?U.filter(n=>n[3]===a):[]}}const K=Object.freeze(new Rt),be="H19M5A4ypIJMbzipmH6lZt0U38K5XihV9m6PpQi5cq2VRuUp84omcFbc3iRPDDiQ",Et="https://www.thebluealliance.com/api/v3/team/frc",Re="https://www.thebluealliance.com/api/v3/team/frc{team}/media/"+new Date().getFullYear();async function Ee(d){if(isNaN(parseFloat(d)))return"";try{return(await(await fetch(Et+d,{cache:"force-cache",headers:{"X-TBA-Auth-Key":be}})).json()).nickname}catch{return""}}async function Gt(d){if(isNaN(parseFloat(d)))return[];try{const n=await(await fetch(Re.replace("{team}",d),{cache:"force-cache",headers:{"X-TBA-Auth-Key":be}})).json();if(n.length===0)return[];let r=[];return n.forEach(i=>{i.type!=="instagram-image"&&(i.direct_url!==""&&r.push(i.direct_url),{}.propertyIsEnumerable.call(i.details,"base64Image")&&r.push("data:image/png;base64,"+i.details.base64Image))}),r}catch{return[]}}async function _t(d){if(isNaN(parseFloat(d)))return"";try{const n=await(await fetch(Re.replace("{team}",d),{cache:"force-cache",headers:{"X-TBA-Auth-Key":be}})).json();if(n.length===0)return"";let r="";return n.forEach(i=>{i.type!=="instagram-image"&&(i.direct_url!==""&&(r=i.direct_url),{}.propertyIsEnumerable.call(i.details,"base64Image")&&(r="data:image/png;base64,"+i.details.base64Image))}),r}catch{return""}}const Wt=({url:d,width:a})=>e.jsx("img",{src:d,width:a}),zt="H19M5A4ypIJMbzipmH6lZt0U38K5XihV9m6PpQi5cq2VRuUp84omcFbc3iRPDDiQ";let Ne;const $t=`https://www.thebluealliance.com/api/v3/event/${Fe}/matches`;let L=[];class Ut{constructor(){if(Ne)throw new Error("You can only create one instance!");Ne=this}getInstance(){return this}getData(){return L}getDataByMatch(a){for(let n=0;na.json()).then(a=>{const n=[];for(let r=0;r{const a=d.scoutingSetterGetter[1],[n,r]=b.useState(""),[i,p]=b.useState(""),h=d.scoutingSetterGetter[0],m=()=>{const c=fe.getDataByMatch(h.matchNumber),t=h.color,g=h.alliancePosition-1;if(!(c!=null&&c.alliances))return;const v=c==null?void 0:c.alliances[t].team_keys[g],S=structuredClone(h);S.teamNumber=parseInt(v.replace("frc","")),a(S)};b.useEffect(()=>{m()},[h.matchNumber,h.alliancePosition,h.color]),b.useEffect(()=>{async function c(){r(await Ee(h.teamNumber))}async function t(){isNaN(h.teamNumber)||p(await _t(h.teamNumber))}p(""),c(),t()},[h.teamNumber]);const s=d.navigation;function l(){return h.color==="red"?F:N}function o(c){return h.alliancePosition==c?"contained":"outlined"}function u(c){return o(c)=="contained"?{backgroundColor:l(),borderColor:l(),"&:hover":{backgroundColor:l(),borderColor:l()},"&:active":{backgroundColor:l(),borderColor:l()}}:{color:l(),borderColor:l(),"&:hover":{backgroundColor:l(),borderColor:l()},"&:active":{backgroundColor:l(),borderColor:l()}}}const f=()=>{const c=structuredClone(h);c.color==="red"?c.color="blue":c.color="red",a(c)};return e.jsxs("div",{style:se.pageContainer,children:[e.jsx(R,{title:"Falcon",children:e.jsx(X,{variant:"h2",sx:{color:"#CA3E47",fontFamily:"Montserrat-Normal",fontWeight:"bold",position:"absolute",top:"1em",left:"50%"},children:"Scouting"})}),e.jsxs("div",{style:se.form,children:[e.jsx(Ze,{badgeContent:K.getInstancesByName(h.scouterName),color:"primary",children:e.jsx(j,{label:"Scout Name",variant:"filled",onChange:c=>{const t=structuredClone(h);t.scouterName=c.target.value,a(t)},value:h.scouterName})}),e.jsx(j,{label:"Team Number",variant:"filled",type:"number",helperText:n,value:Number.isNaN(h.teamNumber)?"":h.teamNumber,onChange:c=>{const t=structuredClone(h);t.teamNumber=parseInt(c.target.value),a(t)}}),e.jsx(Wt,{url:i,width:128,height:128}),e.jsx(j,{label:"Match Number",variant:"filled",type:"number",value:Number.isNaN(h.matchNumber)?"":h.matchNumber,onChange:c=>{const t=structuredClone(h);t.matchNumber=parseInt(c.target.value),a(t)}}),e.jsxs("div",{style:se.teamSwitch,children:[e.jsx(X,{variant:"body1",sx:{color:l(),fontFamily:"Montserrat-Normal",fontWeight:"bold"},children:"Team Color"}),e.jsx(Be,{checked:h.color==="red",onChange:f})]}),e.jsxs(Me,{sx:{outlineColor:l()},children:[e.jsx(M,{sx:u(1),variant:o(1),onClick:()=>{const c=structuredClone(h);c.alliancePosition=1,a(c)},children:"One"}),e.jsx(M,{sx:u(2),variant:o(2),onClick:()=>{const c=structuredClone(h);c.alliancePosition=2,a(c)},children:"Two"}),e.jsx(M,{sx:u(3),variant:o(3),onClick:()=>{const c=structuredClone(h);c.alliancePosition=3,a(c)},children:"Three"})]}),e.jsx(M,{color:"success",variant:"contained",onClick:()=>{s(2)},children:"Submit"})]})]})},Y=({children:d,...a})=>{const n={height:"100%",width:"100%",background:x.getCurrentThemeData().secondary,"&:hover":{backgroundColor:x.getCurrentThemeData().secondary,borderColor:x.getCurrentThemeData().secondary},"&:active":{backgroundColor:x.getCurrentThemeData().secondary,borderColor:x.getCurrentThemeData().secondary},fontFamily:"Lexend",fontSize:"4.25em",fontWeight:"bold",color:"white",position:"relative"};return e.jsxs(M,{sx:n,...a,children:[d,e.jsx("div",{style:{position:"absolute",bottom:"0px",right:"0px",fontSize:"15px",marginRight:"15px"},children:a.minitext})]})},Ge=({duration:d,color:a,onFinish:n,title:r})=>{const i=l=>{const o=Math.floor(l/60),u=Math.floor(l-o*60);return`${("0"+o).slice(-2)}:${("0"+u).slice(-2)}`};let p=d,h=l=>{};[p,h]=b.useState(d);const[m,s]=b.useState(Date.now());return b.useEffect(()=>{p<=0&&n();const l=p>0&&setInterval(()=>{h(p-(Date.now()-m)/1e3),s(Date.now())},10);return()=>clearInterval(typeof l=="number"?l:0)},[p,n,m]),e.jsx(R,{title:r,hover:i(p),sx:{backgroundClip:"text",WebkitTextFillColor:"transparent",backgroundImage:`linear-gradient(to right, ${x.getCurrentThemeData().secondary} 0%,${x.getCurrentThemeData().secondary} ${p/d*100}%,${a} ${p/d*100}%,${a} 100%)`}})},he={buttonsContainer:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"50px"},buttonRowContainer:{paddingLeft:"100px",paddingRight:"100px",width:"100%",height:"30%",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"50px"}},_e=({children:d,...a})=>{var h;const n=a.scouterSetter;let r=[!1,!0];typeof a.scouterData=="string"&&(r=["","park","onstage","harmony"]);const[i,p]=b.useState(r.indexOf(a.start)??0);return e.jsx(Y,{minitext:(h=r[i])==null?void 0:h.toString(),onClick:()=>{p(()=>(i+1)%r.length),n(r[(i+1)%r.length])},children:d})},Kt=d=>{const a=d.scoutingSetterGetter[1],n=d.scoutingSetterGetter[0];return e.jsxs(z,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[e.jsx(Ge,{title:"Auto",color:"green",duration:Mt,onFinish:()=>{}}),e.jsxs("div",{style:he.buttonsContainer,children:[e.jsxs("div",{style:he.buttonRowContainer,children:[e.jsx(_e,{start:n.autoTaxi,scouterData:n.autoTaxi,scouterSetter:r=>{const i=structuredClone(n);typeof r=="boolean"&&(i.autoTaxi=r,a(i))},children:"Moved"}),e.jsx(Y,{onClick:()=>{const r=structuredClone(n);r.autoAmp++,a(r)},minitext:n.autoAmp,children:"AMP"})]}),e.jsxs("div",{style:he.buttonRowContainer,children:[e.jsx(Y,{onClick:()=>{const r=structuredClone(n);r.autoSpeaker++,a(r)},minitext:n.autoSpeaker,children:"SPEAKER"}),e.jsx(Y,{onClick:()=>{const r=structuredClone(n);r.autoMisses++,a(r)},minitext:n.autoMisses,children:"MISS"})]})]})]})},pe={buttonsContainer:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"50px"},buttonRowContainer:{paddingLeft:"100px",paddingRight:"100px",width:"100%",height:"30%",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"50px"}},Vt=d=>{const a=d.scoutingSetterGetter[1],n=d.scoutingSetterGetter[0];return e.jsxs(z,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[e.jsx(Ge,{title:"Teleop",color:"green",duration:Pt,onFinish:()=>{}}),e.jsxs("div",{style:pe.buttonsContainer,children:[e.jsxs("div",{style:pe.buttonRowContainer,children:[e.jsx(Y,{onClick:()=>{const r=structuredClone(n);r.teleopAmp++,a(r)},minitext:n.teleopAmp,children:"AMP"}),e.jsx(Y,{onClick:()=>{const r=structuredClone(n);r.teleopSpeaker++,a(r)},minitext:n.teleopSpeaker,children:"SPEAKER"})]}),e.jsxs("div",{style:pe.buttonRowContainer,children:[e.jsx(Y,{onClick:()=>{const r=structuredClone(n);r.teleopShuttle++,a(r)},minitext:n.teleopShuttle,children:"Shuttle"}),e.jsx(_e,{scouterData:n.teleopClimb,scouterSetter:r=>{const i=structuredClone(n);(r===""||r==="park"||r==="onstage"||r==="harmony")&&(i.teleopClimb=r,a(i))},start:n.teleopClimb,children:"CLIMB"})]})]})]})};async function We(){try{return await fetch("https://google.com",{mode:"no-cors"}),!0}catch{return!1}}const V=class V{constructor(){re(this,"db",null)}static getInstance(){return V.instance||(V.instance=new V),V.instance}async openDatabase(a,n,r,i){return new Promise((p,h)=>{const m=indexedDB.open(a,n);m.onerror=()=>{h(new Error("Failed to open IndexedDB"))},m.onsuccess=()=>{this.db=m.result,p()},m.onupgradeneeded=s=>{const l=s.target.result;l.objectStoreNames.contains(r)||l.createObjectStore(r,{keyPath:i})}})}async addData(a,n){return new Promise((r,i)=>{if(!this.db){i(new Error("Database is not open"));return}const m=this.db.transaction([a],"readwrite").objectStore(a).add(n);m.onerror=s=>{i(new Error(`Failed to add data to IndexedDB: ${s}`))},m.onsuccess=()=>{r()}})}async readAllData(a){return new Promise((n,r)=>{if(!this.db){r(new Error("Database is not open"));return}const h=this.db.transaction([a],"readonly").objectStore(a).getAll();h.onerror=()=>{r(new Error("Failed to read data from IndexedDB"))},h.onsuccess=()=>{const m=h.result;n(m)}})}async deleteAllData(a){return new Promise((n,r)=>{if(!this.db){r(new Error("Database is not open"));return}const h=this.db.transaction([a],"readwrite").objectStore(a).clear();h.onerror=()=>{r(new Error("Failed to delete data from IndexedDB"))},h.onsuccess=()=>{n()}})}};re(V,"instance");let te=V;const Yt=d=>{const a=d.navigation,n=d.scoutingSetterGetter[1],r=d.scoutingSetterGetter[0],i={themeColor:{color:x.getCurrentThemeData().primary},outline:{".MuiOutlinedInput-notchedOutline":{borderColor:r.color==="red"?F:N},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:r.color==="red"?F:N,borderWidth:"0.15rem"},span:{color:r.color==="red"?F:N},legend:{color:r.color==="red"?F:N}}};function p(){return r.color==="red"?F:N}function h(l){return r.alliancePosition==l?"contained":"outlined"}function m(l){return h(l)=="contained"?{color:x.getCurrentThemeData().primary,backgroundColor:p(),borderColor:p(),"&:hover":{backgroundColor:p(),borderColor:p()},"&:active":{backgroundColor:p(),borderColor:p()}}:{color:p(),borderColor:p(),"&:hover":{backgroundColor:p(),borderColor:p()},"&:active":{backgroundColor:p(),borderColor:p()}}}const s=()=>{const l=structuredClone(r);l.color==="red"?l.color="blue":l.color="red",n(l)};return e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Edits"}),e.jsx("div",{id:"end-1",children:e.jsxs("div",{id:"edit-container",style:se.form,children:[e.jsxs(_,{style:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"},children:[e.jsx(X,{variant:"body1",sx:{color:r.color==="red"?F:N,fontFamily:"Montserrat-Normal",fontWeight:"bold",textAlign:"center",width:"100%",marginBottom:"25px"},children:"Recap"}),e.jsx(j,{id:"autoAmp",label:"Auto Amp",sx:i.outline,style:{width:"calc(100% / 8)"},InputLabelProps:{sx:i.themeColor},value:Number.isNaN(r.autoAmp)?"":r.autoAmp,onChange:l=>{const o=structuredClone(r);o.autoAmp=parseInt(l.target.value),n(o)}}),e.jsx(j,{id:"autoSpeaker",label:"Auto Speaker",sx:i.outline,InputLabelProps:{sx:i.themeColor},style:{marginLeft:"10px",marginRight:"10px",width:"calc(100% / 8)"},value:Number.isNaN(r.autoSpeaker)?"":r.autoSpeaker,onChange:l=>{const o=structuredClone(r);o.autoSpeaker=parseInt(l.target.value),n(o)}}),e.jsx(j,{id:"autoMisses",label:"Auto Misses",sx:i.outline,InputLabelProps:{sx:i.themeColor},style:{marginRight:"10px",width:"calc(100% / 8)"},value:Number.isNaN(r.autoMisses)?"":r.autoMisses,onChange:l=>{const o=structuredClone(r);o.autoMisses=parseInt(l.target.value),n(o)}}),e.jsx(j,{id:"teleop Amp",label:"Teleop Amp",InputLabelProps:{sx:i.themeColor},sx:i.outline,style:{width:"calc(100% / 8)"},value:Number.isNaN(r.teleopAmp)?"":r.teleopAmp,onChange:l=>{const o=structuredClone(r);o.teleopAmp=parseInt(l.target.value),n(o)}}),e.jsx(j,{id:"teleopSpeaker",label:"Teleop Speaker",sx:i.outline,InputLabelProps:{sx:i.themeColor},style:{marginLeft:"10px",marginRight:"10px",width:"calc(100% / 8)"},value:Number.isNaN(r.teleopSpeaker)?"":r.teleopSpeaker,onChange:l=>{const o=structuredClone(r);o.teleopSpeaker=parseInt(l.target.value),n(o)}}),e.jsx(j,{id:"teleopShuttle",label:"Teleop Shuttle",sx:i.outline,InputLabelProps:{sx:i.themeColor},style:{width:"calc(100% / 8)"},value:Number.isNaN(r.teleopShuttle)?"":r.teleopShuttle,onChange:l=>{const o=structuredClone(r);o.teleopShuttle=parseInt(l.target.value),n(o)}}),e.jsxs(W,{sx:{width:"calc(100% / 8)",marginLeft:"10px"},children:[e.jsx(T,{id:"climbs",sx:i.themeColor,children:"Climb"}),e.jsxs(J,{label:"climb",labelId:"climbs",style:{color:x.getCurrentThemeData().primary},value:r.teleopClimb,sx:i.outline,onChange:l=>{const o=structuredClone(r);o.teleopClimb=l.target.value,n(o)},children:[e.jsx(I,{value:"",children:"None"}),e.jsx(I,{value:"park",children:"park"}),e.jsx(I,{value:"onstage",children:"onstage"}),e.jsx(I,{value:"harmony",children:"harmony"})]})]})]}),e.jsxs(_,{style:{display:"flex",flexDirection:"row"},children:[e.jsxs(_,{style:{marginRight:"20px"},children:[e.jsx(T,{id:"spotlight",sx:i.themeColor,children:"Spotlight?"}),e.jsxs(ee,{"aria-labelledby":"spotlight",value:r.spotlight,children:[e.jsx(B,{value:"true",control:e.jsx(O,{sx:i.outline,onChange:()=>{const l=structuredClone(r);l.spotlight=!0,n(l)}}),label:"yes",checked:r.spotlight===!0}),e.jsx(B,{value:"false",control:e.jsx(O,{sx:i.outline,onChange:()=>{const l=structuredClone(r);l.spotlight=!1,n(l)}}),label:"no",checked:r.spotlight===!1})]})]}),e.jsxs(_,{children:[e.jsx(T,{id:"oof",sx:i.themeColor,children:"Broken?"}),e.jsxs(ee,{"aria-labelledby":"oof",value:r.broken,children:[e.jsx(B,{value:"true",control:e.jsx(O,{sx:i.outline,onChange:()=>{const l=structuredClone(r);l.broken=!0,n(l)}}),label:"yes",checked:r.broken===!0}),e.jsx(B,{value:"false",control:e.jsx(O,{sx:i.outline,onChange:()=>{const l=structuredClone(r);l.broken=!1,n(l)}}),label:"no",checked:r.broken===!1})]})]})]}),e.jsxs(_,{style:{display:"flex",flexDirection:"row"},children:[e.jsx(j,{id:"scoutname",label:"Scout Name",InputLabelProps:{sx:i.themeColor},sx:i.outline,onChange:l=>{const o=structuredClone(r);o.scouterName=l.target.value,n(o)},value:r.scouterName}),e.jsx(j,{id:"teamnum",label:"Team Number",sx:i.outline,style:{marginLeft:"10px",marginRight:"10px"},InputLabelProps:{sx:i.themeColor},value:Number.isNaN(r.teamNumber)?"":r.teamNumber,onChange:l=>{const o=structuredClone(r);o.teamNumber=parseInt(l.target.value),n(o)}}),e.jsx(j,{id:"matchnum",label:"Match Number",sx:i.outline,InputLabelProps:{sx:i.themeColor},value:Number.isNaN(r.matchNumber)?"":r.matchNumber,onChange:l=>{const o=structuredClone(r);o.matchNumber=parseInt(l.target.value),n(o)}})]}),e.jsxs(W,{sx:{display:"flex",width:"100%",margin:"auto",flexDirection:"row",justifyContent:"center"},children:[e.jsx(X,{variant:"body1",sx:{color:r.color==="red"?F:N,fontFamily:"Montserrat-Normal",fontWeight:"bold",width:"150px"},children:"Team Color"}),e.jsx(Be,{checked:r.color==="red",onChange:s})]}),e.jsxs(Me,{sx:{outlineColor:p()},children:[e.jsx(M,{sx:m(1),variant:h(1),onClick:()=>{const l=structuredClone(r);l.alliancePosition=1,n(l)},children:"One"}),e.jsx(M,{sx:m(2),variant:h(2),onClick:()=>{const l=structuredClone(r);l.alliancePosition=2,n(l)},children:"Two"}),e.jsx(M,{sx:m(3),variant:h(3),onClick:()=>{const l=structuredClone(r);l.alliancePosition=3,n(l)},children:"Three"})]}),e.jsx(Xe,{placeholder:"notes",onChange:l=>{const o=structuredClone(r);o.notes=l.target.value,n(o)},style:{borderColor:r.color==="red"?F:N,color:x.getCurrentThemeData().primary,backgroundColor:(localStorage.getItem("theme")||"dark")==="dark"?"#333":"white"}}),e.jsx(M,{color:"success",variant:"contained",onClick:()=>{const l=structuredClone(r);l.broken=l.broken?"yes":"no",l.spotlight=l.spotlight?"yes":"no",l.autoTaxi=l.autoTaxi?"yes":"no",fetch("https://api.steinhq.com/v1/storages/661429064a642363121a7a44/test",{method:"POST",body:JSON.stringify([l]),mode:"cors",headers:{"Content-Type":"application/json"},cache:"no-store"}).then(o=>o.json()).then(async()=>{if(await We()){K.updateSheetsJson();const u=structuredClone(Le);u.scouterName=l.scouterName,u.matchNumber=l.matchNumber+1,u.uuid=A(),n(u),d.alert("Yay! We got your data saved."),a(1)}else{const u=te.getInstance();u.openDatabase("OfflineDataStorage",1,"OfflineScouterDataQueue","uuid").then(()=>u.addData("OfflineScouterDataQueue",r))}}).catch(()=>{const o=te.getInstance();o.openDatabase("OfflineDataStorage",1,"OfflineScouterDataQueue","uuid").then(()=>o.addData("OfflineScouterDataQueue",r))})},children:"Submit"})]})})]})},qt=d=>{const a=d.navigation;b.useEffect(()=>{localStorage.getItem("auth_code")===Ae&&a(1)});const n=r=>crypto.subtle.digest("SHA-256",new TextEncoder().encode(r)).then(i=>{const p=[],h=new DataView(i);for(let m=0;m{const i=await n(r.target.value);i===Ae&&(localStorage.setItem("auth_code",i),a(1))}})]})},Ht=new Ct({publicKey:"public_sjGSBBstq6tqeZwNnTDDaMwawW4=",privateKey:"private_dzG/Ko9cGOwJ8EVWkYsqQdCioTM=",urlEndpoint:"https://ik.imagekit.io/vavanu9av/"});let Ie,me=[];class Zt{constructor(){if(Ie)throw new Error("You can only create one instance!");Ie=this}getInstance(){return this}uploadFile(a,n,r){return new Promise((i,p)=>{Ht.upload({file:a,fileName:`${new Date().getTime()}-${n}.${r.split("/")[1]}`,useUniqueFileName:!1,tags:[`${n}`]},(h,m)=>{h&&p(h),m&&i(m.url)})})}async updateFilesJson(){const a=await K.getPitScouting(),n={};a.forEach(r=>{const i=parseFloat(r[1]);n[i]||(n[i]=[]),n[i].push({url:r[14],author:r[0],title:`A photo of the ${i} robot from the ${Fe} competition`})}),me=n}getFilesRaw(){return me}getInstancesByTeamNumber(a){this.updateFilesJson();try{return me[a]}catch{return[]}}}const ye=Object.freeze(new Zt),Xt=d=>{const[a,n]=d.pitSetterGetter,r=d.alert;function i(s,l){const o={...a};o[s]=l,n(o)}function p(s,l){const o={...a};o[s]=l,n(o)}function h(s,l){const o={...a};o[s]=l,n(o)}function m(s){return Number.isNaN(a[s])?"":a[s]}return e.jsxs(z,{sx:{width:"100%",display:"flex",flexDirection:window.innerWidth<1e3?"column":"row",flexWrap:"wrap",paddingTop:"50px"},children:[e.jsx(R,{title:"Pit Scouting",sx:{fontSize:"1.5em",width:"100%",textAlign:"center"}}),e.jsxs("div",{id:"column-1",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsx(j,{InputLabelProps:{sx:{color:x.getCurrentThemeData().primary}},id:"scoutername",label:"Name",onChange:s=>{i("scouterName",s.target.value)},value:a.scouterName}),e.jsx(j,{id:"teamNumber",label:"Team Number",InputLabelProps:{sx:{color:x.getCurrentThemeData().primary}},onChange:s=>{p("teamNum",parseInt(s.target.value))},value:m("teamNum")}),e.jsxs(W,{children:[e.jsx(T,{id:"intake",sx:{color:x.getCurrentThemeData().primary},children:"Intake"}),e.jsx(J,{label:"intake",labelId:"intake",value:a.intake,onChange:s=>i("intake",s.target.value),children:Q.intake.map(s=>e.jsx(I,{value:s,children:s},s))})]}),e.jsxs(W,{children:[e.jsx(T,{id:"autoPos",sx:{color:x.getCurrentThemeData().primary},children:"Preferred Auto Position"}),e.jsx(J,{label:"autoPos",labelId:"autoPos",value:a.preferredAutoPos,onChange:s=>i("preferredAutoPos",s.target.value),children:Q.preferredAutoPos.map(s=>e.jsx(I,{value:s,children:s},s))})]})]}),e.jsxs("div",{id:"column-2",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsxs(_,{children:[e.jsx(T,{id:"canclimb",sx:{color:x.getCurrentThemeData().primary},children:"Can Climb?"}),e.jsxs(ee,{"aria-labelledby":"canclimb",value:a.canClimb,sx:{display:"flex",flexDirection:"row"},children:[e.jsx(B,{value:"true",control:e.jsx(O,{onChange:()=>h("canClimb",!0)}),label:"yes",checked:a.canClimb===!0}),e.jsx(B,{value:"false",control:e.jsx(O,{onChange:()=>{h("canClimb",!1)}}),label:"no",checked:a.canClimb===!1})]})]}),e.jsx(j,{id:"FramePerimeter",label:"Frame Perimeter",InputLabelProps:{sx:{color:x.getCurrentThemeData().primary}},onChange:s=>{p("FramePerimeter",parseInt(s.target.value))},value:m("FramePerimeter")}),e.jsx(j,{id:"weight",label:"weight",InputLabelProps:{sx:{color:x.getCurrentThemeData().primary}},onChange:s=>{p("weight",parseInt(s.target.value))},value:m("weight")}),e.jsxs(_,{children:[e.jsx(T,{id:"canGoUnderChain",sx:{color:x.getCurrentThemeData().primary},children:"Can go under chain?"}),e.jsxs(ee,{"aria-labelledby":"canGoUnderChain",value:a.canGoUnderChain,sx:{display:"flex",flexDirection:"row"},children:[e.jsx(B,{value:"true",control:e.jsx(O,{onChange:()=>h("canGoUnderChain",!0)}),label:"yes",checked:a.canGoUnderChain===!0}),e.jsx(B,{value:"false",control:e.jsx(O,{onChange:()=>{h("canClimb",!1)}}),label:"no",checked:a.canGoUnderChain===!1})]})]})]}),e.jsxs("div",{id:"column-3",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsx(j,{id:"numBatteries",label:"Number of Batteries",InputLabelProps:{sx:{color:x.getCurrentThemeData().primary}},onChange:s=>{p("numBatteries",parseInt(s.target.value))},value:m("numBatteries")}),e.jsx(j,{id:"numBatteryChargers",label:"Number of Battery Chargers",InputLabelProps:{sx:{color:x.getCurrentThemeData().primary}},onChange:s=>{p("numBatteryChargers",parseInt(s.target.value))},value:m("numBatteryChargers")}),e.jsxs(W,{children:[e.jsx(T,{id:"ProgrammingLanguage",sx:{color:x.getCurrentThemeData().primary},children:"Programming Language"}),e.jsx(J,{label:"ProgrammingLanguage",labelId:"ProgrammingLanguage",value:a.ProgrammingLanguage,onChange:s=>i("ProgrammingLanguage",s.target.value),children:Q.ProgrammingLanguage.map(s=>e.jsx(I,{value:s,children:s},s))})]}),e.jsxs(W,{children:[e.jsx(T,{id:"driveTrain",sx:{color:x.getCurrentThemeData().primary},children:"Drive Train"}),e.jsx(J,{label:"driveTrain",labelId:"driveTrain",value:a.driveTrain,onChange:s=>i("driveTrain",s.target.value),children:Q.driveTrain.map(s=>e.jsx(I,{value:s,children:s},s))})]})]}),e.jsxs("div",{id:"column-4",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsx(j,{id:"numMotors",label:"Number of Motors",InputLabelProps:{sx:{color:x.getCurrentThemeData().primary}},onChange:s=>{p("numMotors",parseInt(s.target.value))},value:m("numMotors")}),e.jsxs(W,{children:[e.jsx(T,{id:"motorType",children:"Drivetrain Motor Type"}),e.jsx(J,{label:"motorType",labelId:"motorType",value:a.motorType,onChange:s=>i("motorType",s.target.value),children:Q.motorType.map(s=>e.jsx(I,{value:s,children:s},s))})]}),e.jsxs(_,{children:[e.jsx(T,{id:"doLocktiteFalcons",sx:{color:x.getCurrentThemeData().primary},children:"Do Falcons have Loctite?"}),e.jsxs(ee,{"aria-labelledby":"doLocktiteFalcons",value:a.doLocktiteFalcons,sx:{display:"flex",flexDirection:"row"},children:[e.jsx(B,{value:"true",control:e.jsx(O,{onChange:()=>h("doLocktiteFalcons",!0)}),label:"yes",checked:a.doLocktiteFalcons===!0}),e.jsx(B,{value:"false",control:e.jsx(O,{onChange:()=>{h("doLocktiteFalcons",!1)}}),label:"no",checked:a.doLocktiteFalcons===!1})]})]}),e.jsxs(_,{children:[e.jsx("input",{accept:"image/*",style:{display:"none"},id:"raised-button-file",type:"file",onChange:s=>{if(!s.target.files||s.target.files.length===0)return;const l=new FileReader;l.readAsDataURL(s.target.files[0]),l.onload=o=>{var u,f,c;((u=s.target)==null?void 0:u.files)!==null&&ye.uploadFile((f=o.target)==null?void 0:f.result,a.teamNum,(c=s.target)==null?void 0:c.files[0].type).then(t=>{i("image",t)})}}}),e.jsx("label",{htmlFor:"raised-button-file",children:e.jsx(M,{variant:"contained",component:"span",sx:{color:(localStorage.getItem("theme")??"dark")==="light"?"black":"white"},children:"Upload robot photo"})}),e.jsx("img",{src:a.image,style:{width:"64px"}})]})]}),e.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:e.jsx(M,{color:"success",variant:"contained",onClick:()=>{const s=structuredClone(a);fetch("https://api.steinhq.com/v1/storages/66142af84a642363121a7a83/PitScouting",{method:"POST",body:JSON.stringify([s]),mode:"cors",headers:{"Content-Type":"application/json"},cache:"no-store"}).then(o=>o.json()).then(()=>{r("You submitted a pit scouting report");const o=structuredClone(Pe);o.scouterName=s.scouterName,n(o)})},children:"Submit"})})]})};function Qt(d){const a=d.itemData,n=b.useRef(null);return a?e.jsx("div",{style:{width:"100%"},children:e.jsx("div",{className:"images-container",style:{display:"flex",maxWidth:"500px",width:`calc(128px * ${a.length})`,overflow:"scroll",scrollBehavior:"smooth",transition:"scroll 0.3s ease-in-out",overflowY:"hidden"},ref:n,children:Array.from(a).map(r=>e.jsxs("div",{style:{width:"128px",display:"flex",flexDirection:"column-reverse"},children:[e.jsxs("span",{style:{width:"100%",fontSize:"0.5em",backgroundColor:"GrayText",display:"block",height:"50px"},children:[r.title,e.jsx("br",{}),"-",r.author]},A()),e.jsx("img",{className:"image",alt:"sliderImage",src:r.url,width:"128px"},A())]},A()))})}):e.jsx("div",{})}const er=()=>{const[d,a]=b.useState("Enter a team number"),[n,r]=b.useState(0),[i,p]=b.useState([]),[h,m]=b.useState([]),[s,l]=b.useState([]);async function o(t){let g=await K.getPitScouting();g=g.filter(v=>v[1]==t.toString()),m(()=>g)}const u=t=>{let g=parseInt(t);return isNaN(g)&&(g=0),g};async function f(){const t=await Ee(n.toString());a(t),l(()=>{const g=K.getInstancesByTeamNum(n.toString());return g.sort((v,S)=>parseInt(v[4])-parseInt(S[4])),g})}const c=async()=>{let t=await ye.getInstancesByTeamNumber(n);t||(t=[]);const g=(await Gt(n.toString())).map(v=>({url:v,author:"Team "+n.toString(),title:"Photo of the "+n.toString()+" robot"}));try{p(()=>t.concat(g))}catch{console.log("Team Doesn't exist")}};return b.useEffect(()=>{f(),c(),o(n)},[n]),e.jsxs(z,{sx:{width:"100%",height:"100%",display:"flex",flexWrap:"wrap",paddingTop:"50px",alignItems:"start",scrollbarWidth:"none",padding:"10px",overflow:"scroll",overflowX:"scroll"},children:[e.jsx(R,{title:"Team Lookup",sx:{fontSize:"1.5em",width:"100%",textAlign:"center"}}),e.jsx(j,{id:"team_lookup",placeholder:"search",sx:{width:"calc(100% - 55px)",margin:"25px"},value:Number.isNaN(n)?"":n,onChange:t=>{r(parseInt(t.target.value))}}),e.jsxs("div",{id:"results",style:{width:"100%"},children:[e.jsx(R,{title:d,sx:{fontSize:"2em"}}),e.jsx(Qt,{itemData:i})," ",e.jsxs(ie,{children:[e.jsx(le,{children:e.jsx(R,{title:"Pit Scouting",sx:{fontSize:"1em",width:"100%",textAlign:"center"}})}),e.jsx(ce,{children:e.jsxs(ae,{children:[e.jsx(oe,{children:e.jsxs($,{children:[...Nt.map(t=>e.jsx(C,{children:t},A()))]})}),e.jsxs(ne,{children:[...h.map(t=>{const g=/(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?/g;return t.slice(0,-1),e.jsxs($,{children:[...t.filter(v=>!g.test(v)).map(v=>e.jsx(C,{children:v},A()))]},A())})]})]})})]}),e.jsxs(ie,{children:[e.jsx(le,{children:e.jsx(R,{title:"Match Scouting",sx:{fontSize:"1em",width:"100%",textAlign:"center",flex:"1 1 auto"}})}),e.jsx(ce,{children:e.jsxs(ae,{sx:{},children:[e.jsx(oe,{children:e.jsxs($,{children:[...It.map(t=>e.jsx(C,{children:t},A())),e.jsx(C,{children:"Trap"})]})}),e.jsxs(ne,{children:[...s.map(t=>e.jsxs($,{children:[...t.map(g=>e.jsx(C,{children:g},A())),e.jsx(C,{children:t.length>0&&(()=>{const g=t[t.length-1],v=/Trap[:]? ?\d+/,S=g.match(v),H=(S?S[0]:"").replace(/Trap[:]? ?/,"");return H?e.jsx("p",{children:H}):e.jsx("p",{})})()})]},A()))]})]})})]}),e.jsxs(ie,{children:[e.jsx(le,{children:e.jsx(R,{title:"Analysis",sx:{fontSize:"1em"}})}),e.jsxs(ce,{children:[e.jsxs(ae,{children:[e.jsx(oe,{children:e.jsxs($,{children:[...["Avg. Auto Pieces","Avg. Auto Amp","Max Auto Amp","Avg. Auto Speaker","Max Auto Speaker"].map(t=>e.jsx(C,{children:t},A()))]})}),e.jsx(ne,{children:e.jsxs($,{children:[e.jsx(C,{children:(s.map(t=>u(t[6])+u(t[7])).reduce((t,g)=>t+g,0)/s.length).toFixed(2)}),e.jsx(C,{children:(s.map(t=>u(t[6])).reduce((t,g)=>t+g,0)/s.length).toFixed(2)}),e.jsx(C,{children:Math.max(...s.map(t=>u(t[6])))}),e.jsx(C,{children:(s.map(t=>u(t[7])).reduce((t,g)=>t+g,0)/s.length).toFixed(2)}),e.jsx(C,{children:Math.max(...s.map(t=>u(t[7])))})]})})]}),e.jsxs(ae,{children:[e.jsx(oe,{children:e.jsxs($,{children:[...["Avg. Telop Pieces","Avg. Telop Amp","Max Telop Amp","Avg. Telop Speaker","Max Telop Speaker","Avg. Telop Shuttle","Max Telop Shuttle"].map(t=>e.jsx(C,{children:t},A()))]})}),e.jsx(ne,{children:e.jsxs($,{children:[e.jsx(C,{children:(s.map(t=>u(t[9])+u(t[10])).reduce((t,g)=>t+g,0)/s.length).toFixed(2)}),e.jsx(C,{children:(s.map(t=>u(t[9])).reduce((t,g)=>t+g,0)/s.length).toFixed(2)}),e.jsx(C,{children:Math.max(...s.map(t=>u(t[9])))}),e.jsx(C,{children:(s.map(t=>u(t[10])).reduce((t,g)=>t+g,0)/s.length).toFixed(2)}),e.jsx(C,{children:Math.max(...s.map(t=>u(t[10])))}),e.jsx(C,{children:(s.map(t=>u(t[11])).reduce((t,g)=>t+g,0)/s.length).toFixed(2)}),e.jsx(C,{children:Math.max(...s.map(t=>u(t[11])))})]})})]}),s.length>0?e.jsxs("div",{style:{display:"flex",flexWrap:"wrap"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"500px"},children:[e.jsx("h3",{style:{marginLeft:"auto",marginRight:"auto"},children:"Auto Pieces"}),e.jsxs(je,{title:"Auto",sx:{width:"100%"},colors:Ce,yAxis:[{id:"notes"}],xAxis:[{scaleType:"band",data:s.map(t=>"M. "+t[4]),id:"xAxis"}],series:[{label:"Auto Amp",data:s.map(t=>u(t[6])),type:"bar"},{label:"Auto Speaker",data:s.map(t=>u(t[7])),type:"bar"},{label:"Auto Notes",data:s.map(t=>u(t[6])+u(t[7])),type:"line",curve:"linear"}],width:500,height:300,children:[e.jsx(ve,{}),e.jsx(we,{}),e.jsx(ge,{label:"Match #",position:"bottom",axisId:"xAxis"}),e.jsx(xe,{label:"Notes",position:"left",axisId:"notes"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"500px"},children:[e.jsx("h3",{style:{marginLeft:"auto",marginRight:"auto"},children:"Teleop Pieces"}),e.jsxs(je,{title:"Teleop",sx:{width:"100%"},colors:Ce,yAxis:[{id:"notes"}],xAxis:[{scaleType:"band",data:s.map(t=>"M. "+t[4]),id:"xAxis"}],series:[{label:"Teleop Amp",data:s.map(t=>u(t[9])),type:"bar"},{label:"Teleop Speaker",data:s.map(t=>u(t[10])),type:"bar"},{label:"Teleop Shuttle",data:s.map(t=>u(t[11])),type:"bar"},{label:"Auto Notes",data:s.map(t=>u(t[9])+u(t[10])),type:"line",curve:"linear"}],width:500,height:300,children:[e.jsx(ve,{}),e.jsx(we,{}),e.jsx(ge,{label:"Match #",position:"bottom",axisId:"xAxis"}),e.jsx(xe,{label:"Notes",position:"left",axisId:"notes"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"500px"},children:[e.jsx("h3",{style:{marginLeft:"auto",marginRight:"auto"},children:"End Climb"}),e.jsx(Qe,{slotProps:{legend:{hidden:!0}},xAxis:[{scaleType:"band",data:s.map(t=>"M. "+t[4])}],yAxis:[{tickInterval:t=>t===1||t===2||t===3,valueFormatter:t=>t===1?"🅿️":t===2?"🪜":t===3?"🎶":""}],width:500,height:300,series:[{data:s.map(t=>{const g=t[12];return g==="park"?1:g==="onstage"?2:g==="harmony"?3:0})}]})]})]}):""]})]}),e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{})]})]})},tr=()=>{const[d,a]=b.useState([]),[n,r]=b.useState([]),[i,p]=b.useState("Average Notes Auto"),[h,m]=b.useState("Average Notes Auto"),s=window.innerWidth,l=["#808080","#c0c0c0","#2f4f4f","#556b2f","#8b4513","#6b8e23","#a52a2a","#2e8b57","#006400","#483d8b","#b8860b","#008b8b","#4682b4","#000080","#d2691e","#9acd32","#32cd32","#7f007f","#8fbc8f","#b03060","#ff4500","#00ced1","#ffa500","#ffd700","#deb887","#00ff00","#9400d3","#00fa9a","#4169e1","#dc143c","#00bfff","#f4a460","#0000ff","#f08080","#adff2f","#ff6347","#ff00ff","#f0e68c","#ffff54","#6495ed","#dda0dd","#87ceeb","#ff1493","#ee82ee","#98fb98","#7fffd4","#fafad2","#ff69b4","#e0ffff","#ffb6c1"],o=c=>{const t=parseInt(c);return isNaN(t)?0:t};b.useEffect(()=>{async function c(){const t=await K.getAsyncData();a(()=>t)}c()},[i,h]);const u={"Average Notes Auto":[[6,7],c=>c.reduce((t,g)=>t+o(g[0])+o(g[1]),0)/c.length],"Max Auto Notes":[[6,7],c=>Math.max(...c.map(t=>o(t[0])+o(t[1])))],"Average Amp Notes Auto":[[6],c=>c.reduce((t,g)=>t+o(g[0]),0)/c.length],"Average Speaker Notes Auto":[[7],c=>c.reduce((t,g)=>t+o(g[0]),0)/c.length],"Max Speaker Auto":[[7],c=>Math.max(...c.map(t=>o(t[0])))],"Max Amp Auto":[[6],c=>Math.max(...c.map(t=>o(t[0])))],"Average Notes Teleop":[[9,10],c=>c.reduce((t,g)=>t+o(g[0])+o(g[1]),0)/c.length],"Average Amp Notes Teleop":[[9],c=>c.reduce((t,g)=>t+o(g[0]),0)/c.length],"Max Amp Teleop":[[9],c=>Math.max(...c.map(t=>o(t[0])))],"Average Speaker Notes Teleop":[[10],c=>c.reduce((t,g)=>t+o(g[0]),0)/c.length],"Max Speaker Teleop":[[10],c=>Math.max(...c.map(t=>o(t[0])))],"Average Shuttle Notes Teleop":[[10],c=>c.reduce((t,g)=>t+o(g[0]),0)/c.length],"Max Shuttle Teleop":[[11],c=>Math.max(...c.map(t=>o(t[0])))],"Average Climb Points":[[12,14],c=>c.map(t=>t[0]==="none"?0:t[0]==="park"?1:t[0]==="onstage"||t[1]==="no"?3:t[0]==="onstage"||t[1]==="yes"?4:t[0]==="harmony"||t[1]==="no"?5:t[0]==="harmony"||t[1]==="yes"?6:0).reduce((t,g)=>t+g,0)/c.length],"Max Climb Points":[[12,14],c=>Math.max(...c.map(t=>t[0]==="none"?0:t[0]==="park"?1:t[0]==="onstage"||t[1]==="no"?3:t[0]==="onstage"||t[1]==="yes"?4:t[0]==="harmony"||t[1]==="no"?5:t[0]==="harmony"||t[1]==="yes"?6:0))]};b.useEffect(()=>{const c=()=>d?d.length===0?[]:Array.from(new Set(d.map(t=>o(t[3])))):[];r(()=>c())},[d]);const f=(c,t)=>{if(d.length===0||!(t in u))return 0;const g=d.filter(q=>o(q[3])===c),v=u[t][0],S=g.map(q=>v.map(H=>q[H]));return u[t][1](S)};return e.jsxs(z,{sx:{width:"100%",height:"100%",display:"flex",flexWrap:"wrap",paddingTop:"50px",alignItems:"start",scrollbarWidth:"none",padding:"10px",overflow:"scroll",overflowX:"scroll"},children:[e.jsxs(et,{colors:l,width:s,height:500,sx:{marginBottom:0},series:n.map(c=>({label:c.toString(),data:[{x:parseFloat(f(c,i).toFixed(2)),y:parseFloat(f(c,h).toFixed(2)),id:c}]})),slotProps:{legend:{labelStyle:{display:"none"},itemMarkHeight:0,itemMarkWidth:0}},yAxis:[{id:"leftAxis"}],xAxis:[{id:"bottomAxis"}],children:[e.jsx(xe,{axisId:"leftAxis",position:"left",label:h}),e.jsx(ge,{axisId:"bottomAxis",position:"bottom",label:i})]}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",rowGap:"2px"},children:[...n.map((c,t)=>e.jsxs("div",{style:{display:"flex",padding:"5px"},children:[e.jsx("div",{style:{display:"inline-block",width:"20px",height:"20px",backgroundColor:l[t%l.length],marginRight:"10px"}}),e.jsx(X,{variant:"caption",sx:{color:x.getCurrentThemeData().primary},children:c})]}))]}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[e.jsxs(W,{sx:{width:"50%"},children:[e.jsx(T,{id:"xAxis",sx:{color:x.getCurrentThemeData().primary},children:"X Axis"}),e.jsxs(J,{sx:{color:x.getCurrentThemeData().primary},label:"X Axis",labelId:"xAxis",onChange:c=>{p(()=>c.target.value)},value:i,children:[...Object.keys(u).map(c=>e.jsx(I,{value:c,children:c}))]})]}),e.jsxs(W,{sx:{width:"50%"},children:[e.jsx(T,{id:"yAxis",sx:{color:x.getCurrentThemeData().primary},children:"Y Axis"}),e.jsxs(J,{sx:{color:x.getCurrentThemeData().primary},label:"Y Axis",labelId:"yAxis",onChange:c=>{m(()=>c.target.value)},value:h,children:[...Object.keys(u).map(c=>e.jsx(I,{value:c,children:c}))]})]})]}),e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{})]})},rr=()=>{const d={"Max (ALL)":o=>Math.max(...o.map(u=>m(u[6])+m(u[7])+m(u[9])+m(u[10])+m(u[11]),0)),"Max (shuttle)":o=>Math.max(...o.map(u=>m(u[11]))),"Max (amp)":o=>Math.max(...o.map(u=>m(u[9]))),"Max (speaker)":o=>Math.max(...o.map(u=>m(u[10]))),"Average notes scored (total)":o=>o.reduce((u,f)=>u+(m(f[6])+m(f[7])+m(f[9])+m(f[10])+m(f[11])),0)/o.length,"Average notes scored (Auto)":o=>o.reduce((u,f)=>u+(m(f[6])+m(f[7])),0)/o.length,"Average notes scored (Teleop)":o=>o.reduce((u,f)=>u+(m(f[9])+m(f[10])+m(f[11])),0)/o.length,"Average Amp (Auto)":o=>o.reduce((u,f)=>u+m(f[6]),0)/o.length,"Average Speaker (Auto)":o=>o.reduce((u,f)=>u+m(f[7]),0)/o.length,"Average Amp (Teleop)":o=>o.reduce((u,f)=>u+m(f[9]),0)/o.length,"Average Speaker (Teleop)":o=>o.reduce((u,f)=>u+m(f[10]),0)/o.length,"Average Shuttle":o=>o.reduce((u,f)=>u+m(f[11]),0)/o.length},[a,n]=b.useState([]),[r,i]=b.useState([]),[p,h]=b.useState([]),m=o=>{const u=parseInt(o);return isNaN(u)?0:u};async function s(){const o=await K.getAsyncData();n(()=>o)}const l=(o,u)=>{if(a){if(a.length===0||!(u in d))return 0;const f=a.filter(c=>parseInt(c[3])===o);return d[u](f)}};return b.useEffect(()=>{s()},[]),b.useEffect(()=>{const o=()=>a?a.length===0?[]:Array.from(new Set(a.map(u=>parseInt(u[3])))).filter(u=>!isNaN(u)):[];i(()=>o())},[a]),b.useEffect(()=>{h(r.map(o=>{const u={id:o,teamnum:o};return Object.keys(d).forEach(f=>{u[f]=l(o,f)}),u}))},[r]),e.jsx(z,{sx:{width:"100%",height:"100%",display:"flex",WebkitAlignItems:"center",paddingTop:"50px",alignItems:"start",scrollbarWidth:"none",padding:"10px",overflow:"scroll",overflowX:"scroll"},children:e.jsx(tt,{rows:p,columns:[{field:"teamnum",headerName:"Team #",width:250},...Object.keys(d).map(o=>({field:o,headerName:o,width:250,valueFormatter:u=>isNaN(u)?"":u.toFixed(2)}))],pageSizeOptions:[5,10,20,50,100],sx:{height:"90%",color:x.getCurrentThemeData().primary}})})},D={0:"/",1:"/info",2:"/auto",3:"/teleop",4:"/endscreen1",6:"/pit-scouting",7:"/lookup",8:"/graphs",9:"/leaderboard"};function ar(){const[d,a]=b.useState(!1),[n,r]=b.useState(""),[i,p]=b.useState(!1),[h,m]=b.useState(de(localStorage.getItem("theme")??"dark")),[s,l]=b.useState(x.themesList.indexOf(localStorage.getItem("customtheme")??"none"));x.setThemeId(localStorage.getItem("customtheme")??"none");const[o,u]=b.useState(1),f=b.useState(Le),c=b.useState(Pe),t=te.getInstance(),g=vt();async function v(){if(d)return;a(!0),P("You are now online"),await We()?t.openDatabase("OfflineDataStorage",1,"OfflineScouterDataQueue","uuid").then(()=>{t.readAllData("OfflineScouterDataQueue").then(Z=>{Z.length!==0&&fetch("https://api.steinhq.com/v1/storages/661429064a642363121a7a44/test",{method:"POST",body:JSON.stringify(Z),headers:{"Content-Type":"application/json"},cache:"no-store"}).then(()=>{P(`Uploaded ${Z.length} matches that were saved offline`),t.deleteAllData("OfflineScouterDataQueue")})})}):(a(!1),P("You think you are online, but you are not connected to the internet"))}function S(){P("You are now offline (matches will be saved locally until you reconnect)"),a(!1)}b.useEffect(()=>{const w=()=>{fe.updateJSON(),window.removeEventListener("load",w,!0),a(navigator.onLine),navigator.onLine||S(),window.addEventListener("online",v),window.addEventListener("offline",S)};window.addEventListener("load",w,{once:!0})},[v,S]),b.useEffect(()=>{ye.updateFilesJson(),K.updateSheetsJson()},[f[0].scouterName]),b.useEffect(()=>{fe.updateJSON()},[f[0].matchNumber]);const q=()=>{l((s+1)%x.themesList.length),x.setThemeId(x.themesList[(s+1)%x.themesList.length]),localStorage.setItem("customtheme",x.themesList[(s+1)%x.themesList.length])},H=()=>{const w=h.palette.mode==="dark"?de("light"):de("dark");m(w),localStorage.setItem("theme",w.palette.mode)},k=w=>{D[w]&&(u(w),g(D[w],{replace:!0}))},ze=()=>{p(!1)},P=w=>{p(!0),r(w)},$e=()=>{const w=x.getThemeId(),Z={alpine:e.jsx(gt,{}),ocean:e.jsx(xt,{}),desert:e.jsx(ft,{}),lavender:e.jsx(bt,{}),volcano:e.jsx(yt,{}),sunset:e.jsx(jt,{}),none:e.jsx(Se,{})};return w in Z?Z[w]:e.jsx(Se,{})};return e.jsx(e.Fragment,{children:e.jsx(z,{sx:{width:"100vw",height:"100vh"},children:e.jsx(rt,{children:e.jsx(at,{theme:h,children:e.jsxs(z,{sx:{width:"100%",height:"100%",backgroundColor:w=>w.palette.mode==="light"?w.palette.grey[100]:w.palette.grey[900]},children:[e.jsx(E,{style:{color:x.getCurrentThemeData().primary},"aria-label":"Home",sx:{position:"fixed",top:"0px",left:"0px"},onClick:()=>{k(1)},children:e.jsx(ot,{})}),e.jsxs(wt,{children:[e.jsx(G,{path:D[0],element:e.jsx(qt,{navigation:k,scoutingSetterGetter:f,alert:P})}),e.jsx(G,{path:D[1],element:e.jsx(Jt,{navigation:k,scoutingSetterGetter:f,alert:P})}),e.jsx(G,{path:D[2],element:e.jsx(Kt,{navigation:k,scoutingSetterGetter:f,alert:P})}),e.jsx(G,{path:D[3],element:e.jsx(Vt,{navigation:k,scoutingSetterGetter:f,alert:P})}),e.jsx(G,{path:D[4],element:e.jsx(Yt,{navigation:k,scoutingSetterGetter:f,alert:P})}),e.jsx(G,{path:D[6],element:e.jsx(Xt,{pitSetterGetter:c,alert:P})}),e.jsx(G,{path:D[7],element:e.jsx(er,{})}),e.jsx(G,{path:D[8],element:e.jsx(tr,{})}),e.jsx(G,{path:D[9],element:e.jsx(rr,{})})]}),e.jsx("div",{id:"notifications",children:e.jsx(nt,{open:i,autoHideDuration:1e4,onClose:ze,children:e.jsx(st,{message:n,sx:{backgroundColor:h.palette.mode==="light"?h.palette.grey[100]:h.palette.grey[900],color:h.palette.mode==="light"?h.palette.grey[900]:h.palette.grey[100]}})})}),e.jsxs("div",{id:"themeToggle",style:{position:"fixed",bottom:"20px",left:"20px"},children:[e.jsx(E,{"aria-label":"Theme Selector",onClick:q,title:"theme selector",style:{color:x.getCurrentThemeData().primary},children:$e()}),e.jsx(E,{"aria-label":"Color Mode",onClick:H,title:"dark mode",style:{color:x.getCurrentThemeData().primary},children:h.palette.mode==="dark"?e.jsx(it,{}):e.jsx(lt,{})}),e.jsx(E,{"aria-label":"Pit Scouting",style:{color:x.getCurrentThemeData().primary},onClick:()=>{k(6)},title:"Pit Scouting",children:e.jsx(ct,{})}),e.jsx(E,{"aria-label":"Team Search",style:{color:x.getCurrentThemeData().primary},onClick:()=>{k(7)},title:"search teams",children:e.jsx(ut,{})}),e.jsx(E,{"aria-label":"Graph",style:{color:x.getCurrentThemeData().primary},onClick:()=>{k(8)},title:"Graph View",children:e.jsx(dt,{})}),e.jsx(E,{"aria-label":"Leaderboard",title:"Leaderboard",style:{color:x.getCurrentThemeData().primary},onClick:()=>{k(9)},children:e.jsx(ht,{})})]}),e.jsxs("div",{id:"themeToggle",style:{position:"fixed",bottom:"20px",right:"20px",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"10px"},children:[e.jsx(E,{"aria-label":"Back 1 page",style:{color:x.getCurrentThemeData().primary},onClick:()=>{k(o-1)},children:e.jsx(pt,{})}),e.jsx(E,{"aria-label":"Forward 1 page",style:{color:x.getCurrentThemeData().primary},onClick:()=>{k(o+1)},children:e.jsx(mt,{})})]})]})})})})})}Ve.createRoot(document.getElementById("root")).render(e.jsx(Ke.StrictMode,{children:e.jsxs(St,{children:[e.jsx(ar,{})," "]})})); diff --git a/assets/index-HtrBu3a2.js b/assets/index-HtrBu3a2.js new file mode 100644 index 0000000..eea3f31 --- /dev/null +++ b/assets/index-HtrBu3a2.js @@ -0,0 +1,6 @@ +var Je=Object.defineProperty;var Ke=(d,r,s)=>r in d?Je(d,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):d[r]=s;var ae=(d,r,s)=>(Ke(d,typeof r!="symbol"?r+"":r,s),s);import{j as e,r as y,a as Ve}from"./react-rKaTJ6rC.js";import{c as qe}from"./react-dom-6aGZtuvN.js";import{c as Ye,s as He,S as Ze,T as Q,B as Qe,M as v,a as Pe,b as M,d as $,F as W,e as R,f as A,g as z,h as D,R as te,i as O,j as B,k as Xe,A as le,l as ce,m as ue,n as oe,o as ne,p as U,q as w,r as se,t as Ce,u as ve,v as we,L as Se,C as xe,w as fe,x as et,y as tt,D as rt,z as at,E as ot,I as G,H as nt,G as st,J as it,K as lt,N as ct,O as ut,P as dt,Q as ht,U as pt,V as mt,W as gt,X as Ae,Y as xt,Z as ft,_ as bt,$ as yt,a0 as jt,a1 as Ct}from"./@mui-KY3h_Vqr.js";import{v as T}from"./uuid-yQnnJER4.js";import{I as vt}from"./imagekit-IXdsfQA1.js";import{u as wt,a as St,b as _}from"./react-router-Qfa4vrje.js";import{B as At}from"./react-router-dom-RWL_fUCn.js";import"./@babel-1eI3ubiv.js";import"./scheduler-iwWdm5Ml.js";import"./@emotion-MmGlNCCc.js";import"./hoist-non-react-statics-ruMgn741.js";import"./stylis-UTZzoVRx.js";import"./react-is-q81m-9gd.js";import"./clsx-Zbgk8kpT.js";import"./react-transition-group-am-CiPuM.js";import"./@react-spring-WSCnDrwI.js";import"./d3-color-0OvjxriG.js";import"./d3-interpolate-E_NIlnYy.js";import"./d3-shape-JTn4KTFh.js";import"./d3-path-B_10WkFA.js";import"./d3-scale-aMHsSRTu.js";import"./internmap-Ts8DYYQa.js";import"./d3-array-wUFzFig2.js";import"./d3-format-9E78v3lr.js";import"./d3-time-format-0imObhOF.js";import"./d3-time-xXQrfqad.js";import"./d3-delaunay-aCXE4wJG.js";import"./delaunator-IGifLgEt.js";import"./robust-predicates-cFBOqhuN.js";import"./prop-types-i7IregA9.js";import"./reselect-SnMqv3yZ.js";import"./@popperjs-zyV4rJhQ.js";import"./lodash-Xr53mQ-n.js";import"./axios-d3lcUOYg.js";import"./hamming-distance-_tY3BPi_.js";import"./form-data-QPNVk4j9.js";import"./@remix-run-w2aNq8l3.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))l(h);new MutationObserver(h=>{for(const g of h)if(g.type==="childList")for(const p of g.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function s(h){const g={};return h.integrity&&(g.integrity=h.integrity),h.referrerPolicy&&(g.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?g.credentials="include":h.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function l(h){if(h.ep)return;h.ep=!0;const g=s(h);fetch(h.href,g)}})();const Tt={none:{primary:"#696969",secondary:"#696969"},alpine:{primary:"#32ab64",secondary:"#5a9e76"},ocean:{primary:"#4852c7",secondary:"#364c87"},desert:{primary:"#b6bd5e",secondary:"#a1a662"},lavender:{primary:"#a33abd",secondary:"#993eb0"},volcano:{primary:"#e43606",secondary:"#dc5414"},sunset:{primary:"#e77e44",secondary:"#c97b55"}},kt=["none","alpine","ocean","desert","lavender","volcano","sunset"];let Te,de="none";class Dt{constructor(){ae(this,"themesList",kt);if(Te)throw new Error("You can only create one instance!");Te=this}getInstance(){return this}getCurrentThemeData(){return Tt[de]}setThemeId(r){de=r}getThemeId(){return de}}const f=Object.freeze(new Dt),C={main:{primary:f.getCurrentThemeData().primary,2:f.getCurrentThemeData().primary,1:f.getCurrentThemeData().primary,0:"#414141"},black:{primary:"#151515",2:"#666",1:"#333",0:"#0A0A0A"},white:{primary:"#FFF",1:"#EEE",0:"#CCC"}},Nt=d=>({palette:{mode:d,...d==="light"?{primary:{main:C.main[2]},text:{primary:C.black[0],secondary:C.black[2],tertiary:C.main[1]}}:{primary:{main:C.main[1]},background:{default:C.black[1],paper:C.black.primary},text:{primary:C.white[1],secondary:C.white[0],tertiary:C.main[1]}}},components:{MuiAppBar:{styleOverrides:{colorPrimary:{backgroundColor:C.main[2],color:C.white.primary}}},MuiInputLabel:{styleOverrides:{root:{color:d==="light"?C.black[1]:C.white[1]}}},MuiInputBase:{styleOverrides:{root:{input:{height:"auto"}}}},MuiFormControlLabel:{styleOverrides:{root:{color:d==="light"?C.black[1]:C.white[1]}}},MuiOutlinedInput:{styleOverrides:{root:{fieldset:{borderColor:d==="light"?C.black[1]:C.white[1]}}}},MuiToolbar:{styleOverrides:{root:{backgroundColor:`${d==="light"?C.main[2]:C.black.primary} !important`}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:`${d==="light"?C.white[0]:C.black[0]} !important`}}}},typography:{fontFamily:"HelveticaNeueLight, sans-serif",fontWeightRegular:400},overrides:{MuiTypography:{styleOverrides:{root:{letterSpacing:"0.05em"}}},MuiCssBaseline:{"@global":{"@font-face":{fontFamily:"HelveticaNeueLight",fontStyle:"normal",fontWeight:400,src:` + local('HelveticaNeueLight'), + url(./fonts/HelveticaNeue-Light.otf) format('opentype') + `}}},MuiAccordion:{root:{"&$expanded":{margin:"auto"}}},MuiAccordionSummary:{content:{"&$expanded":{margin:"12px 0"}}},MuiAccordionDetails:{root:{padding:16}}}}),he=d=>Ye(Nt(d)),ie={pageContainer:{"&::WebkitScrollbar":{width:0,height:0},width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"center",gap:"100px",overflowY:"scroll"},form:{width:"100%",height:"auto",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1rem"},teamSwitch:{width:"100%",height:"auto",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"20px"}},F="#821C1E",I="#3f51b5",Le={scouterName:"",teamNum:0,intake:"",preferredAutoPos:"",canClimb:!1,FramePerimeter:0,weight:0,canGoUnderChain:!1,numBatteries:0,numBatteryChargers:0,ProgrammingLanguage:"",driveTrain:"",numMotors:0,motorType:"",image:"https://placehold.co/400x400?text=upload%20image",doLocktiteFalcons:!1},It=["Scouter Name","Team #","Intake Positions","Preferred Starting Position","Can Climb","Frame Perimeter","Weight","Under Chain","# of Batteries","# of Chargers","Programming Language","Drive Train","# of Motors","Are Falcons loctited"],X={intake:["ground","station","both","none"],preferredAutoPos:["don't care","1","2","3"],ProgrammingLanguage:["Java","C++","LabVIEW","Python"],driveTrain:["West Coast Drive","Swerve Drive","2-Wheel Drive","4-Wheel Drive","Other 6-Wheel Drive","Car Drive","H-Drive","Holonomic Drive","Mecanum Drive","other"],motorType:["Talon-500 Motor","NEO motor","NEO 550 motor","Kraken Motor","Jaguar Motor","Venom Motor","Nidec Dynamo BLDC Motor","other"]},Mt=["Scouter Name","Alliance Color","Alliance Position","Team Number","match Number","auto Taxi","auto Amp","Auto Speaker","auto Misses","teleop Amp","teleop Speaker","teleop Shuttle","Teleop Climb","broken","spotlight","notes"],Fe={uuid:T(),scouterName:"",color:"red",alliancePosition:1,teamNumber:NaN,matchNumber:NaN,autoTaxi:!1,autoAmp:0,autoSpeaker:0,autoMisses:0,teleopAmp:0,teleopSpeaker:0,teleopShuttle:0,teleopClimb:"",broken:!1,spotlight:!1,notes:""},Pt=15,Lt=135,ke="3bf14c94cacb7b7bf51ecc306f3dad088a839ec16a99bdec3e4f2bbf6831c544",Oe="2024cmptx",Be=He(d=>e.jsx(Ze,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...d}))(({theme:d})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:F,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:I,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:d.palette.mode==="light"?d.palette.grey[100]:d.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:d.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:I,opacity:1,transition:d.transitions.create(["background-color"],{duration:500})}})),Ft={appNameContainer:{width:"100%",height:"auto",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"end",gap:"20px"}},E=({title:d,children:r,sx:s={},hover:l=""})=>e.jsxs("div",{style:Ft.appNameContainer,children:[e.jsx(Q,{variant:"h1",title:l,sx:Object.assign({},{color:f.getCurrentThemeData().primary,fontFamily:"Lexend",fontWeight:"bold",textTransform:"uppercase",paddingTop:"0px",marginTop:"0px",fontSize:"4em"},s),children:d}),r]}),Re="1v7rt_tRsWAKDxGMnfeCTZNCB9mOycKVb5izpzJTe07Y",Ot="AIzaSyCtpEW-xu38_uBirzfKie_rsGpfkhlaaiY",Bt="test",Rt="A2:Z5000",De=`https://sheets.googleapis.com/v4/spreadsheets/${Re}/values/${Bt}!${Rt}?key=${Ot}`;let Ne,J;class Et{constructor(){if(Ne)throw new Error("You can only create one instance!");Ne=this}getInstance(){return this}async getPitScouting(){return new Promise((r,s)=>{fetch(De.replace(Re,"1Em2CmfPw0XNbrP0T7f42goERnDkcGvJqQq5vJJb7GuI").replace("test","PitScouting")).then(l=>l.json()).then(l=>r(l.values)).catch(l=>s(l))})}updateSheetsJson(){fetch(De).then(r=>r.json()).then(r=>J=r.values).catch(()=>{})}getSheetsRaw(){return this.updateSheetsJson(),J}async getAsyncData(){return J||await this.updateSheetsJson(),J}getInstancesByName(r){return J?J.filter(s=>s[0]===r).length:0}getInstancesByTeamNum(r){return J?J.filter(s=>s[3]===r):[]}}const K=Object.freeze(new Et),ye="H19M5A4ypIJMbzipmH6lZt0U38K5XihV9m6PpQi5cq2VRuUp84omcFbc3iRPDDiQ",Gt="https://www.thebluealliance.com/api/v3/team/frc",Ee="https://www.thebluealliance.com/api/v3/team/frc{team}/media/"+new Date().getFullYear();async function Ge(d){if(isNaN(parseFloat(d)))return"";try{return(await(await fetch(Gt+d,{cache:"force-cache",headers:{"X-TBA-Auth-Key":ye}})).json()).nickname}catch{return""}}async function _t(d){if(isNaN(parseFloat(d)))return[];try{const s=await(await fetch(Ee.replace("{team}",d),{cache:"force-cache",headers:{"X-TBA-Auth-Key":ye}})).json();if(s.length===0)return[];let l=[];return s.forEach(h=>{h.type!=="instagram-image"&&(h.direct_url!==""&&l.push(h.direct_url),{}.propertyIsEnumerable.call(h.details,"base64Image")&&l.push("data:image/png;base64,"+h.details.base64Image))}),l}catch{return[]}}async function Wt(d){if(isNaN(parseFloat(d)))return"";try{const s=await(await fetch(Ee.replace("{team}",d),{cache:"force-cache",headers:{"X-TBA-Auth-Key":ye}})).json();if(s.length===0)return"";let l="";return s.forEach(h=>{h.type!=="instagram-image"&&(h.direct_url!==""&&(l=h.direct_url),{}.propertyIsEnumerable.call(h.details,"base64Image")&&(l="data:image/png;base64,"+h.details.base64Image))}),l}catch{return""}}const zt=({url:d,width:r})=>e.jsx("img",{src:d,width:r}),$t="H19M5A4ypIJMbzipmH6lZt0U38K5XihV9m6PpQi5cq2VRuUp84omcFbc3iRPDDiQ";let Ie;const Ut=`https://www.thebluealliance.com/api/v3/event/${Oe}/matches`;let L=[];class Jt{constructor(){if(Ie)throw new Error("You can only create one instance!");Ie=this}getInstance(){return this}getData(){return L}getDataByMatch(r){for(let s=0;sr.json()).then(r=>{const s=[];for(let l=0;l{const r=d.scoutingSetterGetter[1],[s,l]=y.useState(""),[h,g]=y.useState(""),p=d.scoutingSetterGetter[0],x=()=>{const i=be.getDataByMatch(p.matchNumber),t=p.color,a=p.alliancePosition-1;if(!(i!=null&&i.alliances))return;const m=i==null?void 0:i.alliances[t].team_keys[a],j=structuredClone(p);j.teamNumber=parseInt(m.replace("frc","")),r(j)};y.useEffect(()=>{x()},[p.matchNumber,p.alliancePosition,p.color]),y.useEffect(()=>{async function i(){l(await Ge(p.teamNumber))}async function t(){isNaN(p.teamNumber)||g(await Wt(p.teamNumber))}g(""),i(),t()},[p.teamNumber]);const o=d.navigation;function c(){return p.color==="red"?F:I}function n(i){return p.alliancePosition==i?"contained":"outlined"}function u(i){return n(i)=="contained"?{backgroundColor:c(),borderColor:c(),"&:hover":{backgroundColor:c(),borderColor:c()},"&:active":{backgroundColor:c(),borderColor:c()}}:{color:c(),borderColor:c(),"&:hover":{backgroundColor:c(),borderColor:c()},"&:active":{backgroundColor:c(),borderColor:c()}}}const b=()=>{const i=structuredClone(p);i.color==="red"?i.color="blue":i.color="red",r(i)};return e.jsxs("div",{style:ie.pageContainer,children:[e.jsx(E,{title:"Falcon",children:e.jsx(Q,{variant:"h2",sx:{color:"#CA3E47",fontFamily:"Montserrat-Normal",fontWeight:"bold",position:"absolute",top:"1em",left:"50%"},children:"Scouting"})}),e.jsxs("div",{style:ie.form,children:[e.jsx(Qe,{badgeContent:K.getInstancesByName(p.scouterName),color:"primary",children:e.jsx(v,{label:"Scout Name",variant:"filled",onChange:i=>{const t=structuredClone(p);t.scouterName=i.target.value,r(t)},value:p.scouterName})}),e.jsx(v,{label:"Team Number",variant:"filled",type:"number",helperText:s,value:Number.isNaN(p.teamNumber)?"":p.teamNumber,onChange:i=>{const t=structuredClone(p);t.teamNumber=parseInt(i.target.value),r(t)}}),e.jsx(zt,{url:h,width:128,height:128}),e.jsx(v,{label:"Match Number",variant:"filled",type:"number",value:Number.isNaN(p.matchNumber)?"":p.matchNumber,onChange:i=>{const t=structuredClone(p);t.matchNumber=parseInt(i.target.value),r(t)}}),e.jsxs("div",{style:ie.teamSwitch,children:[e.jsx(Q,{variant:"body1",sx:{color:c(),fontFamily:"Montserrat-Normal",fontWeight:"bold"},children:"Team Color"}),e.jsx(Be,{checked:p.color==="red",onChange:b})]}),e.jsxs(Pe,{sx:{outlineColor:c()},children:[e.jsx(M,{sx:u(1),variant:n(1),onClick:()=>{const i=structuredClone(p);i.alliancePosition=1,r(i)},children:"One"}),e.jsx(M,{sx:u(2),variant:n(2),onClick:()=>{const i=structuredClone(p);i.alliancePosition=2,r(i)},children:"Two"}),e.jsx(M,{sx:u(3),variant:n(3),onClick:()=>{const i=structuredClone(p);i.alliancePosition=3,r(i)},children:"Three"})]}),e.jsx(M,{color:"success",variant:"contained",onClick:()=>{o(2)},children:"Submit"})]})]})},q=({children:d,...r})=>{const s={height:"100%",width:"100%",background:f.getCurrentThemeData().secondary,"&:hover":{backgroundColor:f.getCurrentThemeData().secondary,borderColor:f.getCurrentThemeData().secondary},"&:active":{backgroundColor:f.getCurrentThemeData().secondary,borderColor:f.getCurrentThemeData().secondary},fontFamily:"Lexend",fontSize:"4.25em",fontWeight:"bold",color:"white",position:"relative"};return e.jsxs(M,{sx:s,...r,children:[d,e.jsx("div",{style:{position:"absolute",bottom:"0px",right:"0px",fontSize:"15px",marginRight:"15px"},children:r.minitext})]})},_e=({duration:d,color:r,onFinish:s,title:l})=>{const h=c=>{const n=Math.floor(c/60),u=Math.floor(c-n*60);return`${("0"+n).slice(-2)}:${("0"+u).slice(-2)}`};let g=d,p=c=>{};[g,p]=y.useState(d);const[x,o]=y.useState(Date.now());return y.useEffect(()=>{g<=0&&s();const c=g>0&&setInterval(()=>{p(g-(Date.now()-x)/1e3),o(Date.now())},10);return()=>clearInterval(typeof c=="number"?c:0)},[g,s,x]),e.jsx(E,{title:l,hover:h(g),sx:{backgroundClip:"text",WebkitTextFillColor:"transparent",backgroundImage:`linear-gradient(to right, ${f.getCurrentThemeData().secondary} 0%,${f.getCurrentThemeData().secondary} ${g/d*100}%,${r} ${g/d*100}%,${r} 100%)`}})},pe={buttonsContainer:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"50px"},buttonRowContainer:{paddingLeft:"100px",paddingRight:"100px",width:"100%",height:"30%",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"50px"}},We=({children:d,...r})=>{var p;const s=r.scouterSetter;let l=[!1,!0];typeof r.scouterData=="string"&&(l=["","park","onstage","harmony"]);const[h,g]=y.useState(l.indexOf(r.start)??0);return e.jsx(q,{minitext:(p=l[h])==null?void 0:p.toString(),onClick:()=>{g(()=>(h+1)%l.length),s(l[(h+1)%l.length])},children:d})},Vt=d=>{const r=d.scoutingSetterGetter[1],s=d.scoutingSetterGetter[0];return e.jsxs($,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[e.jsx(_e,{title:"Auto",color:"green",duration:Pt,onFinish:()=>{}}),e.jsxs("div",{style:pe.buttonsContainer,children:[e.jsxs("div",{style:pe.buttonRowContainer,children:[e.jsx(We,{start:s.autoTaxi,scouterData:s.autoTaxi,scouterSetter:l=>{const h=structuredClone(s);typeof l=="boolean"&&(h.autoTaxi=l,r(h))},children:"Moved"}),e.jsx(q,{onClick:()=>{const l=structuredClone(s);l.autoAmp++,r(l)},minitext:s.autoAmp,children:"AMP"})]}),e.jsxs("div",{style:pe.buttonRowContainer,children:[e.jsx(q,{onClick:()=>{const l=structuredClone(s);l.autoSpeaker++,r(l)},minitext:s.autoSpeaker,children:"SPEAKER"}),e.jsx(q,{onClick:()=>{const l=structuredClone(s);l.autoMisses++,r(l)},minitext:s.autoMisses,children:"MISS"})]})]})]})},me={buttonsContainer:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"50px"},buttonRowContainer:{paddingLeft:"100px",paddingRight:"100px",width:"100%",height:"30%",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"50px"}},qt=d=>{const r=d.scoutingSetterGetter[1],s=d.scoutingSetterGetter[0];return e.jsxs($,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[e.jsx(_e,{title:"Teleop",color:"green",duration:Lt,onFinish:()=>{}}),e.jsxs("div",{style:me.buttonsContainer,children:[e.jsxs("div",{style:me.buttonRowContainer,children:[e.jsx(q,{onClick:()=>{const l=structuredClone(s);l.teleopAmp++,r(l)},minitext:s.teleopAmp,children:"AMP"}),e.jsx(q,{onClick:()=>{const l=structuredClone(s);l.teleopSpeaker++,r(l)},minitext:s.teleopSpeaker,children:"SPEAKER"})]}),e.jsxs("div",{style:me.buttonRowContainer,children:[e.jsx(q,{onClick:()=>{const l=structuredClone(s);l.teleopShuttle++,r(l)},minitext:s.teleopShuttle,children:"Shuttle"}),e.jsx(We,{scouterData:s.teleopClimb,scouterSetter:l=>{const h=structuredClone(s);(l===""||l==="park"||l==="onstage"||l==="harmony")&&(h.teleopClimb=l,r(h))},start:s.teleopClimb,children:"CLIMB"})]})]})]})};async function ze(){try{return await fetch("https://google.com",{mode:"no-cors"}),!0}catch{return!1}}const V=class V{constructor(){ae(this,"db",null)}static getInstance(){return V.instance||(V.instance=new V),V.instance}async openDatabase(r,s,l,h){return new Promise((g,p)=>{const x=indexedDB.open(r,s);x.onerror=()=>{p(new Error("Failed to open IndexedDB"))},x.onsuccess=()=>{this.db=x.result,g()},x.onupgradeneeded=o=>{const c=o.target.result;c.objectStoreNames.contains(l)||c.createObjectStore(l,{keyPath:h})}})}async addData(r,s){return new Promise((l,h)=>{if(!this.db){h(new Error("Database is not open"));return}const x=this.db.transaction([r],"readwrite").objectStore(r).add(s);x.onerror=o=>{h(new Error(`Failed to add data to IndexedDB: ${o}`))},x.onsuccess=()=>{l()}})}async readAllData(r){return new Promise((s,l)=>{if(!this.db){l(new Error("Database is not open"));return}const p=this.db.transaction([r],"readonly").objectStore(r).getAll();p.onerror=()=>{l(new Error("Failed to read data from IndexedDB"))},p.onsuccess=()=>{const x=p.result;s(x)}})}async deleteAllData(r){return new Promise((s,l)=>{if(!this.db){l(new Error("Database is not open"));return}const p=this.db.transaction([r],"readwrite").objectStore(r).clear();p.onerror=()=>{l(new Error("Failed to delete data from IndexedDB"))},p.onsuccess=()=>{s()}})}};ae(V,"instance");let re=V;const ee=d=>d.toString(),Yt=d=>{const r={"Driving Speed":[...Array(11).keys()].map(ee),"Driving Skill":[...Array(11).keys()].map(ee),Defense:[...Array(11).keys()].map(ee),"Climbing Speed":[...Array(11).keys()].map(ee),"Shooting Distance":["Short","Medium","Long"],"Shooting Consistency":[...Array(11).keys()].map(ee)},s=Object.keys(r).reduce((a,m)=>({...a,[m]:r[m][0]}),{}),[l,h]=y.useState(s),[g,p]=y.useState(""),x=d.navigation,o=d.scoutingSetterGetter[1],c=d.scoutingSetterGetter[0],n={themeColor:{color:f.getCurrentThemeData().primary},outline:{".MuiOutlinedInput-notchedOutline":{borderColor:c.color==="red"?F:I},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:c.color==="red"?F:I,borderWidth:"0.15rem"},span:{color:c.color==="red"?F:I},legend:{color:c.color==="red"?F:I}}};function u(){return c.color==="red"?F:I}function b(a){return c.alliancePosition==a?"contained":"outlined"}function i(a){return b(a)=="contained"?{color:f.getCurrentThemeData().primary,backgroundColor:u(),borderColor:u(),"&:hover":{backgroundColor:u(),borderColor:u()},"&:active":{backgroundColor:u(),borderColor:u()}}:{color:u(),borderColor:u(),"&:hover":{backgroundColor:u(),borderColor:u()},"&:active":{backgroundColor:u(),borderColor:u()}}}const t=()=>{const a=structuredClone(c);a.color==="red"?a.color="blue":a.color="red",o(a)};return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"Edits"}),e.jsx("div",{id:"end-1",children:e.jsxs("div",{id:"edit-container",style:ie.form,children:[e.jsxs(W,{style:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"},children:[e.jsx(Q,{variant:"body1",sx:{color:c.color==="red"?F:I,fontFamily:"Montserrat-Normal",fontWeight:"bold",textAlign:"center",width:"100%",marginBottom:"25px"},children:"Recap"}),e.jsx(v,{id:"autoAmp",label:"Auto Amp",sx:n.outline,style:{width:"calc(100% / 8)"},InputLabelProps:{sx:n.themeColor},value:Number.isNaN(c.autoAmp)?"":c.autoAmp,onChange:a=>{const m=structuredClone(c);m.autoAmp=parseInt(a.target.value),o(m)}}),e.jsx(v,{id:"autoSpeaker",label:"Auto Speaker",sx:n.outline,InputLabelProps:{sx:n.themeColor},style:{marginLeft:"10px",marginRight:"10px",width:"calc(100% / 8)"},value:Number.isNaN(c.autoSpeaker)?"":c.autoSpeaker,onChange:a=>{const m=structuredClone(c);m.autoSpeaker=parseInt(a.target.value),o(m)}}),e.jsx(v,{id:"autoMisses",label:"Auto Misses",sx:n.outline,InputLabelProps:{sx:n.themeColor},style:{marginRight:"10px",width:"calc(100% / 8)"},value:Number.isNaN(c.autoMisses)?"":c.autoMisses,onChange:a=>{const m=structuredClone(c);m.autoMisses=parseInt(a.target.value),o(m)}}),e.jsx(v,{id:"teleop Amp",label:"Teleop Amp",InputLabelProps:{sx:n.themeColor},sx:n.outline,style:{width:"calc(100% / 8)"},value:Number.isNaN(c.teleopAmp)?"":c.teleopAmp,onChange:a=>{const m=structuredClone(c);m.teleopAmp=parseInt(a.target.value),o(m)}}),e.jsx(v,{id:"teleopSpeaker",label:"Teleop Speaker",sx:n.outline,InputLabelProps:{sx:n.themeColor},style:{marginLeft:"10px",marginRight:"10px",width:"calc(100% / 8)"},value:Number.isNaN(c.teleopSpeaker)?"":c.teleopSpeaker,onChange:a=>{const m=structuredClone(c);m.teleopSpeaker=parseInt(a.target.value),o(m)}}),e.jsx(v,{id:"teleopShuttle",label:"Teleop Shuttle",sx:n.outline,InputLabelProps:{sx:n.themeColor},style:{width:"calc(100% / 8)"},value:Number.isNaN(c.teleopShuttle)?"":c.teleopShuttle,onChange:a=>{const m=structuredClone(c);m.teleopShuttle=parseInt(a.target.value),o(m)}}),e.jsxs(R,{sx:{width:"calc(100% / 8)",marginLeft:"10px"},children:[e.jsx(A,{id:"climbs",sx:n.themeColor,children:"Climb"}),e.jsxs(z,{label:"climb",labelId:"climbs",style:{color:f.getCurrentThemeData().primary},value:c.teleopClimb,sx:n.outline,onChange:a=>{const m=structuredClone(c);m.teleopClimb=a.target.value,o(m)},children:[e.jsx(D,{value:"",children:"None"}),e.jsx(D,{value:"park",children:"park"}),e.jsx(D,{value:"onstage",children:"onstage"}),e.jsx(D,{value:"harmony",children:"harmony"})]})]})]}),e.jsxs(W,{style:{display:"flex",flexDirection:"row"},children:[e.jsxs(W,{style:{marginRight:"20px"},children:[e.jsx(A,{id:"spotlight",sx:n.themeColor,children:"Spotlight?"}),e.jsxs(te,{"aria-labelledby":"spotlight",value:c.spotlight,children:[e.jsx(O,{value:"true",control:e.jsx(B,{sx:n.outline,onChange:()=>{const a=structuredClone(c);a.spotlight=!0,o(a)}}),label:"yes",checked:c.spotlight===!0}),e.jsx(O,{value:"false",control:e.jsx(B,{sx:n.outline,onChange:()=>{const a=structuredClone(c);a.spotlight=!1,o(a)}}),label:"no",checked:c.spotlight===!1})]})]}),e.jsxs(W,{children:[e.jsx(A,{id:"oof",sx:n.themeColor,children:"Broken?"}),e.jsxs(te,{"aria-labelledby":"oof",value:c.broken,children:[e.jsx(O,{value:"true",control:e.jsx(B,{sx:n.outline,onChange:()=>{const a=structuredClone(c);a.broken=!0,o(a)}}),label:"yes",checked:c.broken===!0}),e.jsx(O,{value:"false",control:e.jsx(B,{sx:n.outline,onChange:()=>{const a=structuredClone(c);a.broken=!1,o(a)}}),label:"no",checked:c.broken===!1})]})]})]}),e.jsxs(W,{style:{display:"flex",flexDirection:"row"},children:[e.jsx(v,{id:"scoutname",label:"Scout Name",InputLabelProps:{sx:n.themeColor},sx:n.outline,onChange:a=>{const m=structuredClone(c);m.scouterName=a.target.value,o(m)},value:c.scouterName}),e.jsx(v,{id:"teamnum",label:"Team Number",sx:n.outline,style:{marginLeft:"10px",marginRight:"10px"},InputLabelProps:{sx:n.themeColor},value:Number.isNaN(c.teamNumber)?"":c.teamNumber,onChange:a=>{const m=structuredClone(c);m.teamNumber=parseInt(a.target.value),o(m)}}),e.jsx(v,{id:"matchnum",label:"Match Number",sx:n.outline,InputLabelProps:{sx:n.themeColor},value:Number.isNaN(c.matchNumber)?"":c.matchNumber,onChange:a=>{const m=structuredClone(c);m.matchNumber=parseInt(a.target.value),o(m)}})]}),e.jsxs(R,{sx:{display:"flex",width:"100%",margin:"auto",flexDirection:"row",justifyContent:"center"},children:[e.jsx(Q,{variant:"body1",sx:{color:c.color==="red"?F:I,fontFamily:"Montserrat-Normal",fontWeight:"bold",width:"150px"},children:"Team Color"}),e.jsx(Be,{checked:c.color==="red",onChange:t})]}),e.jsxs(Pe,{sx:{outlineColor:u()},children:[e.jsx(M,{sx:i(1),variant:b(1),onClick:()=>{const a=structuredClone(c);a.alliancePosition=1,o(a)},children:"One"}),e.jsx(M,{sx:i(2),variant:b(2),onClick:()=>{const a=structuredClone(c);a.alliancePosition=2,o(a)},children:"Two"}),e.jsx(M,{sx:i(3),variant:b(3),onClick:()=>{const a=structuredClone(c);a.alliancePosition=3,o(a)},children:"Three"})]}),e.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:Object.keys(r).map(a=>e.jsxs(R,{sx:{width:`${100/Object.keys(r).length}%`},children:[e.jsx(A,{id:a,sx:n.themeColor,children:a}),e.jsx(z,{style:{color:f.getCurrentThemeData().primary},label:a,sx:n.outline,labelId:a,value:l[a],onChange:m=>{const j=structuredClone(l);j[a]=m.target.value,h(j)},children:r[a].map(m=>e.jsx(D,{value:m,children:m},a))})]}))}),e.jsx(Xe,{placeholder:"More Notes",value:g,onChange:a=>{p(a.target.value)},style:{borderColor:c.color==="red"?F:I,color:f.getCurrentThemeData().primary,backgroundColor:(localStorage.getItem("theme")||"dark")==="dark"?"#333":"white"}}),e.jsxs("div",{style:{color:f.getCurrentThemeData().primary},children:[Object.entries(l).map(a=>a[0]+": "+a[1]).toString(),e.jsx("br",{}),e.jsx("br",{}),g]}),e.jsx(M,{color:"success",variant:"contained",onClick:()=>{const a=structuredClone(c);a.broken=a.broken?"yes":"no",a.spotlight=a.spotlight?"yes":"no",a.autoTaxi=a.autoTaxi?"yes":"no",a.notes=Object.entries(l).map(m=>m[0]+": "+m[1]).toString()+` + +`+g,fetch("https://api.steinhq.com/v1/storages/661429064a642363121a7a44/test",{method:"POST",body:JSON.stringify([a]),mode:"cors",headers:{"Content-Type":"application/json"},cache:"no-store"}).then(m=>m.json()).then(async()=>{if(await ze()){K.updateSheetsJson();const j=structuredClone(Fe);j.scouterName=a.scouterName,j.matchNumber=a.matchNumber+1,j.uuid=T(),o(j),d.alert("Yay! We got your data saved."),x(1)}else{const j=re.getInstance();j.openDatabase("OfflineDataStorage",1,"OfflineScouterDataQueue","uuid").then(()=>j.addData("OfflineScouterDataQueue",c))}}).catch(()=>{const m=re.getInstance();m.openDatabase("OfflineDataStorage",1,"OfflineScouterDataQueue","uuid").then(()=>m.addData("OfflineScouterDataQueue",c))})},children:"Submit"})]})})]})},Ht=d=>{const r=d.navigation;y.useEffect(()=>{localStorage.getItem("auth_code")===ke&&r(1)});const s=l=>crypto.subtle.digest("SHA-256",new TextEncoder().encode(l)).then(h=>{const g=[],p=new DataView(h);for(let x=0;x{const h=await s(l.target.value);h===ke&&(localStorage.setItem("auth_code",h),r(1))}})]})},Zt=new vt({publicKey:"public_sjGSBBstq6tqeZwNnTDDaMwawW4=",privateKey:"private_dzG/Ko9cGOwJ8EVWkYsqQdCioTM=",urlEndpoint:"https://ik.imagekit.io/vavanu9av/"});let Me,ge=[];class Qt{constructor(){if(Me)throw new Error("You can only create one instance!");Me=this}getInstance(){return this}uploadFile(r,s,l){return new Promise((h,g)=>{Zt.upload({file:r,fileName:`${new Date().getTime()}-${s}.${l.split("/")[1]}`,useUniqueFileName:!1,tags:[`${s}`]},(p,x)=>{p&&g(p),x&&h(x.url)})})}async updateFilesJson(){const r=await K.getPitScouting(),s={};r.forEach(l=>{const h=parseFloat(l[1]);s[h]||(s[h]=[]),s[h].push({url:l[14],author:l[0],title:`A photo of the ${h} robot from the ${Oe} competition`})}),ge=s}getFilesRaw(){return ge}getInstancesByTeamNumber(r){this.updateFilesJson();try{return ge[r]}catch{return[]}}}const je=Object.freeze(new Qt),Xt=d=>{const[r,s]=d.pitSetterGetter,l=d.alert;function h(o,c){const n={...r};n[o]=c,s(n)}function g(o,c){const n={...r};n[o]=c,s(n)}function p(o,c){const n={...r};n[o]=c,s(n)}function x(o){return Number.isNaN(r[o])?"":r[o]}return e.jsxs($,{sx:{width:"100%",display:"flex",flexDirection:window.innerWidth<1e3?"column":"row",flexWrap:"wrap",paddingTop:"50px"},children:[e.jsx(E,{title:"Pit Scouting",sx:{fontSize:"1.5em",width:"100%",textAlign:"center"}}),e.jsxs("div",{id:"column-1",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsx(v,{InputLabelProps:{sx:{color:f.getCurrentThemeData().primary}},id:"scoutername",label:"Name",onChange:o=>{h("scouterName",o.target.value)},value:r.scouterName}),e.jsx(v,{id:"teamNumber",label:"Team Number",InputLabelProps:{sx:{color:f.getCurrentThemeData().primary}},onChange:o=>{g("teamNum",parseInt(o.target.value))},value:x("teamNum")}),e.jsxs(R,{children:[e.jsx(A,{id:"intake",sx:{color:f.getCurrentThemeData().primary},children:"Intake"}),e.jsx(z,{label:"intake",labelId:"intake",value:r.intake,onChange:o=>h("intake",o.target.value),children:X.intake.map(o=>e.jsx(D,{value:o,children:o},o))})]}),e.jsxs(R,{children:[e.jsx(A,{id:"autoPos",sx:{color:f.getCurrentThemeData().primary},children:"Preferred Auto Position"}),e.jsx(z,{label:"autoPos",labelId:"autoPos",value:r.preferredAutoPos,onChange:o=>h("preferredAutoPos",o.target.value),children:X.preferredAutoPos.map(o=>e.jsx(D,{value:o,children:o},o))})]})]}),e.jsxs("div",{id:"column-2",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsxs(W,{children:[e.jsx(A,{id:"canclimb",sx:{color:f.getCurrentThemeData().primary},children:"Can Climb?"}),e.jsxs(te,{"aria-labelledby":"canclimb",value:r.canClimb,sx:{display:"flex",flexDirection:"row"},children:[e.jsx(O,{value:"true",control:e.jsx(B,{onChange:()=>p("canClimb",!0)}),label:"yes",checked:r.canClimb===!0}),e.jsx(O,{value:"false",control:e.jsx(B,{onChange:()=>{p("canClimb",!1)}}),label:"no",checked:r.canClimb===!1})]})]}),e.jsx(v,{id:"FramePerimeter",label:"Frame Perimeter",InputLabelProps:{sx:{color:f.getCurrentThemeData().primary}},onChange:o=>{g("FramePerimeter",parseInt(o.target.value))},value:x("FramePerimeter")}),e.jsx(v,{id:"weight",label:"weight",InputLabelProps:{sx:{color:f.getCurrentThemeData().primary}},onChange:o=>{g("weight",parseInt(o.target.value))},value:x("weight")}),e.jsxs(W,{children:[e.jsx(A,{id:"canGoUnderChain",sx:{color:f.getCurrentThemeData().primary},children:"Can go under chain?"}),e.jsxs(te,{"aria-labelledby":"canGoUnderChain",value:r.canGoUnderChain,sx:{display:"flex",flexDirection:"row"},children:[e.jsx(O,{value:"true",control:e.jsx(B,{onChange:()=>p("canGoUnderChain",!0)}),label:"yes",checked:r.canGoUnderChain===!0}),e.jsx(O,{value:"false",control:e.jsx(B,{onChange:()=>{p("canClimb",!1)}}),label:"no",checked:r.canGoUnderChain===!1})]})]})]}),e.jsxs("div",{id:"column-3",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsx(v,{id:"numBatteries",label:"Number of Batteries",InputLabelProps:{sx:{color:f.getCurrentThemeData().primary}},onChange:o=>{g("numBatteries",parseInt(o.target.value))},value:x("numBatteries")}),e.jsx(v,{id:"numBatteryChargers",label:"Number of Battery Chargers",InputLabelProps:{sx:{color:f.getCurrentThemeData().primary}},onChange:o=>{g("numBatteryChargers",parseInt(o.target.value))},value:x("numBatteryChargers")}),e.jsxs(R,{children:[e.jsx(A,{id:"ProgrammingLanguage",sx:{color:f.getCurrentThemeData().primary},children:"Programming Language"}),e.jsx(z,{label:"ProgrammingLanguage",labelId:"ProgrammingLanguage",value:r.ProgrammingLanguage,onChange:o=>h("ProgrammingLanguage",o.target.value),children:X.ProgrammingLanguage.map(o=>e.jsx(D,{value:o,children:o},o))})]}),e.jsxs(R,{children:[e.jsx(A,{id:"driveTrain",sx:{color:f.getCurrentThemeData().primary},children:"Drive Train"}),e.jsx(z,{label:"driveTrain",labelId:"driveTrain",value:r.driveTrain,onChange:o=>h("driveTrain",o.target.value),children:X.driveTrain.map(o=>e.jsx(D,{value:o,children:o},o))})]})]}),e.jsxs("div",{id:"column-4",style:{display:"flex",flexDirection:"column",width:window.innerWidth<1e3?"100%":"25%",flexWrap:"wrap",padding:"10px",rowGap:"15px"},children:[e.jsx(v,{id:"numMotors",label:"Number of Motors",InputLabelProps:{sx:{color:f.getCurrentThemeData().primary}},onChange:o=>{g("numMotors",parseInt(o.target.value))},value:x("numMotors")}),e.jsxs(R,{children:[e.jsx(A,{id:"motorType",children:"Drivetrain Motor Type"}),e.jsx(z,{label:"motorType",labelId:"motorType",value:r.motorType,onChange:o=>h("motorType",o.target.value),children:X.motorType.map(o=>e.jsx(D,{value:o,children:o},o))})]}),e.jsxs(W,{children:[e.jsx(A,{id:"doLocktiteFalcons",sx:{color:f.getCurrentThemeData().primary},children:"Do Falcons have Loctite?"}),e.jsxs(te,{"aria-labelledby":"doLocktiteFalcons",value:r.doLocktiteFalcons,sx:{display:"flex",flexDirection:"row"},children:[e.jsx(O,{value:"true",control:e.jsx(B,{onChange:()=>p("doLocktiteFalcons",!0)}),label:"yes",checked:r.doLocktiteFalcons===!0}),e.jsx(O,{value:"false",control:e.jsx(B,{onChange:()=>{p("doLocktiteFalcons",!1)}}),label:"no",checked:r.doLocktiteFalcons===!1})]})]}),e.jsxs(W,{children:[e.jsx("input",{accept:"image/*",style:{display:"none"},id:"raised-button-file",type:"file",onChange:o=>{if(!o.target.files||o.target.files.length===0)return;const c=new FileReader;c.readAsDataURL(o.target.files[0]),c.onload=n=>{var u,b,i;((u=o.target)==null?void 0:u.files)!==null&&je.uploadFile((b=n.target)==null?void 0:b.result,r.teamNum,(i=o.target)==null?void 0:i.files[0].type).then(t=>{h("image",t)})}}}),e.jsx("label",{htmlFor:"raised-button-file",children:e.jsx(M,{variant:"contained",component:"span",sx:{color:(localStorage.getItem("theme")??"dark")==="light"?"black":"white"},children:"Upload robot photo"})}),e.jsx("img",{src:r.image,style:{width:"64px"}})]})]}),e.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:e.jsx(M,{color:"success",variant:"contained",onClick:()=>{const o=structuredClone(r);fetch("https://api.steinhq.com/v1/storages/66142af84a642363121a7a83/PitScouting",{method:"POST",body:JSON.stringify([o]),mode:"cors",headers:{"Content-Type":"application/json"},cache:"no-store"}).then(n=>n.json()).then(()=>{l("You submitted a pit scouting report");const n=structuredClone(Le);n.scouterName=o.scouterName,s(n)})},children:"Submit"})})]})};function er(d){const r=d.itemData,s=y.useRef(null);return r?e.jsx("div",{style:{width:"100%"},children:e.jsx("div",{className:"images-container",style:{display:"flex",maxWidth:"500px",width:`calc(128px * ${r.length})`,overflow:"scroll",scrollBehavior:"smooth",transition:"scroll 0.3s ease-in-out",overflowY:"hidden"},ref:s,children:Array.from(r).map(l=>e.jsxs("div",{style:{width:"128px",display:"flex",flexDirection:"column-reverse"},children:[e.jsxs("span",{style:{width:"100%",fontSize:"0.5em",backgroundColor:"GrayText",display:"block",height:"50px"},children:[l.title,e.jsx("br",{}),"-",l.author]},T()),e.jsx("img",{className:"image",alt:"sliderImage",src:l.url,width:"128px"},T())]},T()))})}):e.jsx("div",{})}const tr=()=>{const[d,r]=y.useState("Enter a team number"),[s,l]=y.useState(0),[h,g]=y.useState([]),[p,x]=y.useState([]),[o,c]=y.useState([]);async function n(t){let a=await K.getPitScouting();a=a.filter(m=>m[1]==t.toString()),x(()=>a)}const u=t=>{let a=parseInt(t);return isNaN(a)&&(a=0),a};async function b(){const t=await Ge(s.toString());r(t),c(()=>{const a=K.getInstancesByTeamNum(s.toString());return a.sort((m,j)=>parseInt(m[4])-parseInt(j[4])),a})}const i=async()=>{let t=await je.getInstancesByTeamNumber(s);t||(t=[]);const a=(await _t(s.toString())).map(m=>({url:m,author:"Team "+s.toString(),title:"Photo of the "+s.toString()+" robot"}));try{g(()=>t.concat(a))}catch{console.log("Team Doesn't exist")}};return y.useEffect(()=>{b(),i(),n(s)},[s]),e.jsxs($,{sx:{width:"100%",height:"100%",display:"flex",flexWrap:"wrap",paddingTop:"50px",alignItems:"start",scrollbarWidth:"none",padding:"10px",overflow:"scroll",overflowX:"scroll"},children:[e.jsx(E,{title:"Team Lookup",sx:{fontSize:"1.5em",width:"100%",textAlign:"center"}}),e.jsx(v,{id:"team_lookup",placeholder:"search",sx:{width:"calc(100% - 55px)",margin:"25px"},value:Number.isNaN(s)?"":s,onChange:t=>{l(parseInt(t.target.value))}}),e.jsxs("div",{id:"results",style:{width:"100%"},children:[e.jsx(E,{title:d,sx:{fontSize:"2em"}}),e.jsx(er,{itemData:h})," ",e.jsxs(le,{children:[e.jsx(ce,{children:e.jsx(E,{title:"Pit Scouting",sx:{fontSize:"1em",width:"100%",textAlign:"center"}})}),e.jsx(ue,{children:e.jsxs(oe,{children:[e.jsx(ne,{children:e.jsxs(U,{children:[...It.map(t=>e.jsx(w,{children:t},T()))]})}),e.jsxs(se,{children:[...p.map(t=>{const a=/(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?/g;return t.slice(0,-1),e.jsxs(U,{children:[...t.filter(m=>!a.test(m)).map(m=>e.jsx(w,{children:m},T()))]},T())})]})]})})]}),e.jsxs(le,{children:[e.jsx(ce,{children:e.jsx(E,{title:"Match Scouting",sx:{fontSize:"1em",width:"100%",textAlign:"center",flex:"1 1 auto"}})}),e.jsx(ue,{children:e.jsxs(oe,{sx:{},children:[e.jsx(ne,{children:e.jsxs(U,{children:[...Mt.map(t=>e.jsx(w,{children:t},T())),e.jsx(w,{children:"Trap"})]})}),e.jsxs(se,{children:[...o.map(t=>e.jsxs(U,{children:[...t.map(a=>e.jsx(w,{children:a},T())),e.jsx(w,{children:t.length>0&&(()=>{const a=t[t.length-1],m=/Trap[:]? ?\d+/,j=a.match(m),H=(j?j[0]:"").replace(/Trap[:]? ?/,"");return H?e.jsx("p",{children:H}):e.jsx("p",{})})()})]},T()))]})]})})]}),e.jsxs(le,{children:[e.jsx(ce,{children:e.jsx(E,{title:"Analysis",sx:{fontSize:"1em"}})}),e.jsxs(ue,{children:[e.jsxs(oe,{children:[e.jsx(ne,{children:e.jsxs(U,{children:[...["Avg. Auto Pieces","Avg. Auto Amp","Max Auto Amp","Avg. Auto Speaker","Max Auto Speaker"].map(t=>e.jsx(w,{children:t},T()))]})}),e.jsx(se,{children:e.jsxs(U,{children:[e.jsx(w,{children:(o.map(t=>u(t[6])+u(t[7])).reduce((t,a)=>t+a,0)/o.length).toFixed(2)}),e.jsx(w,{children:(o.map(t=>u(t[6])).reduce((t,a)=>t+a,0)/o.length).toFixed(2)}),e.jsx(w,{children:Math.max(...o.map(t=>u(t[6])))}),e.jsx(w,{children:(o.map(t=>u(t[7])).reduce((t,a)=>t+a,0)/o.length).toFixed(2)}),e.jsx(w,{children:Math.max(...o.map(t=>u(t[7])))})]})})]}),e.jsxs(oe,{children:[e.jsx(ne,{children:e.jsxs(U,{children:[...["Avg. Telop Pieces","Avg. Telop Amp","Max Telop Amp","Avg. Telop Speaker","Max Telop Speaker","Avg. Telop Shuttle","Max Telop Shuttle"].map(t=>e.jsx(w,{children:t},T()))]})}),e.jsx(se,{children:e.jsxs(U,{children:[e.jsx(w,{children:(o.map(t=>u(t[9])+u(t[10])).reduce((t,a)=>t+a,0)/o.length).toFixed(2)}),e.jsx(w,{children:(o.map(t=>u(t[9])).reduce((t,a)=>t+a,0)/o.length).toFixed(2)}),e.jsx(w,{children:Math.max(...o.map(t=>u(t[9])))}),e.jsx(w,{children:(o.map(t=>u(t[10])).reduce((t,a)=>t+a,0)/o.length).toFixed(2)}),e.jsx(w,{children:Math.max(...o.map(t=>u(t[10])))}),e.jsx(w,{children:(o.map(t=>u(t[11])).reduce((t,a)=>t+a,0)/o.length).toFixed(2)}),e.jsx(w,{children:Math.max(...o.map(t=>u(t[11])))})]})})]}),o.length>0?e.jsxs("div",{style:{display:"flex",flexWrap:"wrap"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"500px"},children:[e.jsx("h3",{style:{marginLeft:"auto",marginRight:"auto"},children:"Auto Pieces"}),e.jsxs(Ce,{title:"Auto",sx:{width:"100%"},colors:ve,yAxis:[{id:"notes"}],xAxis:[{scaleType:"band",data:o.map(t=>"M. "+t[4]),id:"xAxis"}],series:[{label:"Auto Amp",data:o.map(t=>u(t[6])),type:"bar"},{label:"Auto Speaker",data:o.map(t=>u(t[7])),type:"bar"},{label:"Auto Notes",data:o.map(t=>u(t[6])+u(t[7])),type:"line",curve:"linear"}],width:500,height:300,children:[e.jsx(we,{}),e.jsx(Se,{}),e.jsx(xe,{label:"Match #",position:"bottom",axisId:"xAxis"}),e.jsx(fe,{label:"Notes",position:"left",axisId:"notes"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"500px"},children:[e.jsx("h3",{style:{marginLeft:"auto",marginRight:"auto"},children:"Teleop Pieces"}),e.jsxs(Ce,{title:"Teleop",sx:{width:"100%"},colors:ve,yAxis:[{id:"notes"}],xAxis:[{scaleType:"band",data:o.map(t=>"M. "+t[4]),id:"xAxis"}],series:[{label:"Teleop Amp",data:o.map(t=>u(t[9])),type:"bar"},{label:"Teleop Speaker",data:o.map(t=>u(t[10])),type:"bar"},{label:"Teleop Shuttle",data:o.map(t=>u(t[11])),type:"bar"},{label:"Auto Notes",data:o.map(t=>u(t[9])+u(t[10])),type:"line",curve:"linear"}],width:500,height:300,children:[e.jsx(we,{}),e.jsx(Se,{}),e.jsx(xe,{label:"Match #",position:"bottom",axisId:"xAxis"}),e.jsx(fe,{label:"Notes",position:"left",axisId:"notes"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"500px"},children:[e.jsx("h3",{style:{marginLeft:"auto",marginRight:"auto"},children:"End Climb"}),e.jsx(et,{slotProps:{legend:{hidden:!0}},xAxis:[{scaleType:"band",data:o.map(t=>"M. "+t[4])}],yAxis:[{tickInterval:t=>t===1||t===2||t===3,valueFormatter:t=>t===1?"🅿️":t===2?"🪜":t===3?"🎶":""}],width:500,height:300,series:[{data:o.map(t=>{const a=t[12];return a==="park"?1:a==="onstage"?2:a==="harmony"?3:0})}]})]})]}):""]})]}),e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{})]})]})},rr=()=>{const[d,r]=y.useState([]),[s,l]=y.useState([]),[h,g]=y.useState("Average Notes Auto"),[p,x]=y.useState("Average Notes Auto"),o=window.innerWidth,c=["#808080","#c0c0c0","#2f4f4f","#556b2f","#8b4513","#6b8e23","#a52a2a","#2e8b57","#006400","#483d8b","#b8860b","#008b8b","#4682b4","#000080","#d2691e","#9acd32","#32cd32","#7f007f","#8fbc8f","#b03060","#ff4500","#00ced1","#ffa500","#ffd700","#deb887","#00ff00","#9400d3","#00fa9a","#4169e1","#dc143c","#00bfff","#f4a460","#0000ff","#f08080","#adff2f","#ff6347","#ff00ff","#f0e68c","#ffff54","#6495ed","#dda0dd","#87ceeb","#ff1493","#ee82ee","#98fb98","#7fffd4","#fafad2","#ff69b4","#e0ffff","#ffb6c1"],n=i=>{const t=parseInt(i);return isNaN(t)?0:t};y.useEffect(()=>{async function i(){const t=await K.getAsyncData();r(()=>t)}i()},[h,p]);const u={"Average Notes Auto":[[6,7],i=>i.reduce((t,a)=>t+n(a[0])+n(a[1]),0)/i.length],"Max Auto Notes":[[6,7],i=>Math.max(...i.map(t=>n(t[0])+n(t[1])))],"Average Amp Notes Auto":[[6],i=>i.reduce((t,a)=>t+n(a[0]),0)/i.length],"Average Speaker Notes Auto":[[7],i=>i.reduce((t,a)=>t+n(a[0]),0)/i.length],"Max Speaker Auto":[[7],i=>Math.max(...i.map(t=>n(t[0])))],"Max Amp Auto":[[6],i=>Math.max(...i.map(t=>n(t[0])))],"Average Notes Teleop":[[9,10],i=>i.reduce((t,a)=>t+n(a[0])+n(a[1]),0)/i.length],"Average Amp Notes Teleop":[[9],i=>i.reduce((t,a)=>t+n(a[0]),0)/i.length],"Max Amp Teleop":[[9],i=>Math.max(...i.map(t=>n(t[0])))],"Average Speaker Notes Teleop":[[10],i=>i.reduce((t,a)=>t+n(a[0]),0)/i.length],"Max Speaker Teleop":[[10],i=>Math.max(...i.map(t=>n(t[0])))],"Average Shuttle Notes Teleop":[[10],i=>i.reduce((t,a)=>t+n(a[0]),0)/i.length],"Max Shuttle Teleop":[[11],i=>Math.max(...i.map(t=>n(t[0])))],"Average Climb Points":[[12,14],i=>i.map(t=>t[0]==="none"?0:t[0]==="park"?1:t[0]==="onstage"||t[1]==="no"?3:t[0]==="onstage"||t[1]==="yes"?4:t[0]==="harmony"||t[1]==="no"?5:t[0]==="harmony"||t[1]==="yes"?6:0).reduce((t,a)=>t+a,0)/i.length],"Max Climb Points":[[12,14],i=>Math.max(...i.map(t=>t[0]==="none"?0:t[0]==="park"?1:t[0]==="onstage"||t[1]==="no"?3:t[0]==="onstage"||t[1]==="yes"?4:t[0]==="harmony"||t[1]==="no"?5:t[0]==="harmony"||t[1]==="yes"?6:0))]};y.useEffect(()=>{const i=()=>d?d.length===0?[]:Array.from(new Set(d.map(t=>n(t[3])))):[];l(()=>i())},[d]);const b=(i,t)=>{if(d.length===0||!(t in u))return 0;const a=d.filter(Y=>n(Y[3])===i),m=u[t][0],j=a.map(Y=>m.map(H=>Y[H]));return u[t][1](j)};return e.jsxs($,{sx:{width:"100%",height:"100%",display:"flex",flexWrap:"wrap",paddingTop:"50px",alignItems:"start",scrollbarWidth:"none",padding:"10px",overflow:"scroll",overflowX:"scroll"},children:[e.jsxs(tt,{colors:c,width:o,height:500,sx:{marginBottom:0},series:s.map(i=>({label:i.toString(),data:[{x:parseFloat(b(i,h).toFixed(2)),y:parseFloat(b(i,p).toFixed(2)),id:i}]})),slotProps:{legend:{labelStyle:{display:"none"},itemMarkHeight:0,itemMarkWidth:0}},yAxis:[{id:"leftAxis"}],xAxis:[{id:"bottomAxis"}],children:[e.jsx(fe,{axisId:"leftAxis",position:"left",label:p}),e.jsx(xe,{axisId:"bottomAxis",position:"bottom",label:h})]}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",rowGap:"2px"},children:[...s.map((i,t)=>e.jsxs("div",{style:{display:"flex",padding:"5px"},children:[e.jsx("div",{style:{display:"inline-block",width:"20px",height:"20px",backgroundColor:c[t%c.length],marginRight:"10px"}}),e.jsx(Q,{variant:"caption",sx:{color:f.getCurrentThemeData().primary},children:i})]}))]}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[e.jsxs(R,{sx:{width:"50%"},children:[e.jsx(A,{id:"xAxis",sx:{color:f.getCurrentThemeData().primary},children:"X Axis"}),e.jsxs(z,{sx:{color:f.getCurrentThemeData().primary},label:"X Axis",labelId:"xAxis",onChange:i=>{g(()=>i.target.value)},value:h,children:[...Object.keys(u).map(i=>e.jsx(D,{value:i,children:i}))]})]}),e.jsxs(R,{sx:{width:"50%"},children:[e.jsx(A,{id:"yAxis",sx:{color:f.getCurrentThemeData().primary},children:"Y Axis"}),e.jsxs(z,{sx:{color:f.getCurrentThemeData().primary},label:"Y Axis",labelId:"yAxis",onChange:i=>{x(()=>i.target.value)},value:p,children:[...Object.keys(u).map(i=>e.jsx(D,{value:i,children:i}))]})]})]}),e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{})]})},ar=()=>{const d={"Max (ALL)":n=>Math.max(...n.map(u=>x(u[6])+x(u[7])+x(u[9])+x(u[10])+x(u[11]),0)),"Max (shuttle)":n=>Math.max(...n.map(u=>x(u[11]))),"Max (amp)":n=>Math.max(...n.map(u=>x(u[9]))),"Max (speaker)":n=>Math.max(...n.map(u=>x(u[10]))),"Average notes scored (total)":n=>n.reduce((u,b)=>u+(x(b[6])+x(b[7])+x(b[9])+x(b[10])+x(b[11])),0)/n.length,"Average notes scored (Auto)":n=>n.reduce((u,b)=>u+(x(b[6])+x(b[7])),0)/n.length,"Average notes scored (Teleop)":n=>n.reduce((u,b)=>u+(x(b[9])+x(b[10])+x(b[11])),0)/n.length,"Average Amp (Auto)":n=>n.reduce((u,b)=>u+x(b[6]),0)/n.length,"Average Speaker (Auto)":n=>n.reduce((u,b)=>u+x(b[7]),0)/n.length,"Average Amp (Teleop)":n=>n.reduce((u,b)=>u+x(b[9]),0)/n.length,"Average Speaker (Teleop)":n=>n.reduce((u,b)=>u+x(b[10]),0)/n.length,"Average Shuttle":n=>n.reduce((u,b)=>u+x(b[11]),0)/n.length},[r,s]=y.useState([]),[l,h]=y.useState([]),[g,p]=y.useState([]),x=n=>{const u=parseInt(n);return isNaN(u)?0:u};async function o(){const n=await K.getAsyncData();s(()=>n)}const c=(n,u)=>{if(r){if(r.length===0||!(u in d))return 0;const b=r.filter(i=>parseInt(i[3])===n);return d[u](b)}};return y.useEffect(()=>{o()},[]),y.useEffect(()=>{const n=()=>r?r.length===0?[]:Array.from(new Set(r.map(u=>parseInt(u[3])))).filter(u=>!isNaN(u)):[];h(()=>n())},[r]),y.useEffect(()=>{p(l.map(n=>{const u={id:n,teamnum:n};return Object.keys(d).forEach(b=>{u[b]=c(n,b)}),u}))},[l]),e.jsx($,{sx:{width:"100%",height:"100%",display:"flex",WebkitAlignItems:"center",paddingTop:"50px",alignItems:"start",scrollbarWidth:"none",padding:"10px",overflow:"scroll",overflowX:"scroll"},children:e.jsx(rt,{rows:g,columns:[{field:"teamnum",headerName:"Team #",width:250},...Object.keys(d).map(n=>({field:n,headerName:n,width:250,valueFormatter:u=>isNaN(u)?"":u.toFixed(2)}))],pageSizeOptions:[5,10,20,50,100],sx:{height:"90%",color:f.getCurrentThemeData().primary}})})},N={0:"/",1:"/info",2:"/auto",3:"/teleop",4:"/endscreen1",6:"/pit-scouting",7:"/lookup",8:"/graphs",9:"/leaderboard"};function or(){const[d,r]=y.useState(!1),[s,l]=y.useState(""),[h,g]=y.useState(!1),[p,x]=y.useState(he(localStorage.getItem("theme")??"dark")),[o,c]=y.useState(f.themesList.indexOf(localStorage.getItem("customtheme")??"none"));f.setThemeId(localStorage.getItem("customtheme")??"none");const[n,u]=y.useState(1),b=y.useState(Fe),i=y.useState(Le),t=re.getInstance(),a=wt();async function m(){if(d)return;r(!0),P("You are now online"),await ze()?t.openDatabase("OfflineDataStorage",1,"OfflineScouterDataQueue","uuid").then(()=>{t.readAllData("OfflineScouterDataQueue").then(Z=>{Z.length!==0&&fetch("https://api.steinhq.com/v1/storages/661429064a642363121a7a44/test",{method:"POST",body:JSON.stringify(Z),headers:{"Content-Type":"application/json"},cache:"no-store"}).then(()=>{P(`Uploaded ${Z.length} matches that were saved offline`),t.deleteAllData("OfflineScouterDataQueue")})})}):(r(!1),P("You think you are online, but you are not connected to the internet"))}function j(){P("You are now offline (matches will be saved locally until you reconnect)"),r(!1)}y.useEffect(()=>{const S=()=>{be.updateJSON(),window.removeEventListener("load",S,!0),r(navigator.onLine),navigator.onLine||j(),window.addEventListener("online",m),window.addEventListener("offline",j)};window.addEventListener("load",S,{once:!0})},[m,j]),y.useEffect(()=>{je.updateFilesJson(),K.updateSheetsJson()},[b[0].scouterName]),y.useEffect(()=>{be.updateJSON()},[b[0].matchNumber]);const Y=()=>{c((o+1)%f.themesList.length),f.setThemeId(f.themesList[(o+1)%f.themesList.length]),localStorage.setItem("customtheme",f.themesList[(o+1)%f.themesList.length])},H=()=>{const S=p.palette.mode==="dark"?he("light"):he("dark");x(S),localStorage.setItem("theme",S.palette.mode)},k=S=>{N[S]&&(u(S),a(N[S],{replace:!0}))},$e=()=>{g(!1)},P=S=>{g(!0),l(S)},Ue=()=>{const S=f.getThemeId(),Z={alpine:e.jsx(xt,{}),ocean:e.jsx(ft,{}),desert:e.jsx(bt,{}),lavender:e.jsx(yt,{}),volcano:e.jsx(jt,{}),sunset:e.jsx(Ct,{}),none:e.jsx(Ae,{})};return S in Z?Z[S]:e.jsx(Ae,{})};return e.jsx(e.Fragment,{children:e.jsx($,{sx:{width:"100vw",height:"100vh"},children:e.jsx(at,{children:e.jsx(ot,{theme:p,children:e.jsxs($,{sx:{width:"100%",height:"100%",backgroundColor:S=>S.palette.mode==="light"?S.palette.grey[100]:S.palette.grey[900]},children:[e.jsx(G,{style:{color:f.getCurrentThemeData().primary},"aria-label":"Home",sx:{position:"fixed",top:"0px",left:"0px"},onClick:()=>{k(1)},children:e.jsx(nt,{})}),e.jsxs(St,{children:[e.jsx(_,{path:N[0],element:e.jsx(Ht,{navigation:k,scoutingSetterGetter:b,alert:P})}),e.jsx(_,{path:N[1],element:e.jsx(Kt,{navigation:k,scoutingSetterGetter:b,alert:P})}),e.jsx(_,{path:N[2],element:e.jsx(Vt,{navigation:k,scoutingSetterGetter:b,alert:P})}),e.jsx(_,{path:N[3],element:e.jsx(qt,{navigation:k,scoutingSetterGetter:b,alert:P})}),e.jsx(_,{path:N[4],element:e.jsx(Yt,{navigation:k,scoutingSetterGetter:b,alert:P})}),e.jsx(_,{path:N[6],element:e.jsx(Xt,{pitSetterGetter:i,alert:P})}),e.jsx(_,{path:N[7],element:e.jsx(tr,{})}),e.jsx(_,{path:N[8],element:e.jsx(rr,{})}),e.jsx(_,{path:N[9],element:e.jsx(ar,{})})]}),e.jsx("div",{id:"notifications",children:e.jsx(st,{open:h,autoHideDuration:1e4,onClose:$e,children:e.jsx(it,{message:s,sx:{backgroundColor:p.palette.mode==="light"?p.palette.grey[100]:p.palette.grey[900],color:p.palette.mode==="light"?p.palette.grey[900]:p.palette.grey[100]}})})}),e.jsxs("div",{id:"themeToggle",style:{position:"fixed",bottom:"20px",left:"20px"},children:[e.jsx(G,{"aria-label":"Theme Selector",onClick:Y,title:"theme selector",style:{color:f.getCurrentThemeData().primary},children:Ue()}),e.jsx(G,{"aria-label":"Color Mode",onClick:H,title:"dark mode",style:{color:f.getCurrentThemeData().primary},children:p.palette.mode==="dark"?e.jsx(lt,{}):e.jsx(ct,{})}),e.jsx(G,{"aria-label":"Pit Scouting",style:{color:f.getCurrentThemeData().primary},onClick:()=>{k(6)},title:"Pit Scouting",children:e.jsx(ut,{})}),e.jsx(G,{"aria-label":"Team Search",style:{color:f.getCurrentThemeData().primary},onClick:()=>{k(7)},title:"search teams",children:e.jsx(dt,{})}),e.jsx(G,{"aria-label":"Graph",style:{color:f.getCurrentThemeData().primary},onClick:()=>{k(8)},title:"Graph View",children:e.jsx(ht,{})}),e.jsx(G,{"aria-label":"Leaderboard",title:"Leaderboard",style:{color:f.getCurrentThemeData().primary},onClick:()=>{k(9)},children:e.jsx(pt,{})})]}),e.jsxs("div",{id:"themeToggle",style:{position:"fixed",bottom:"20px",right:"20px",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"10px"},children:[e.jsx(G,{"aria-label":"Back 1 page",style:{color:f.getCurrentThemeData().primary},onClick:()=>{k(n-1)},children:e.jsx(mt,{})}),e.jsx(G,{"aria-label":"Forward 1 page",style:{color:f.getCurrentThemeData().primary},onClick:()=>{k(n+1)},children:e.jsx(gt,{})})]})]})})})})})}qe.createRoot(document.getElementById("root")).render(e.jsx(Ve.StrictMode,{children:e.jsxs(At,{children:[e.jsx(or,{})," "]})})); diff --git a/index.html b/index.html index b3fba8e..7af504d 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - + diff --git a/service-worker.js b/service-worker.js index 125b072..b92af88 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1,2 +1,2 @@ try{self["workbox:core:7.0.0"]&&_()}catch{}const G=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},Q=G;class l extends Error{constructor(e,t){const n=Q(e,t);super(n),this.name=e,this.details=t}}const j=new Set;function z(s){j.add(s)}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),J=s=>{for(const e of Object.keys(d))s(e)},x={updateDetails:s=>{J(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function K(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function X(s,e,t,n){const a=K(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=K(c.url,t);if(a===o)return s.match(c,n)}}let m;function Y(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}function q(s){s.then(()=>{})}class Z{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function ee(){for(const s of j)await s()}const te=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function se(s){return new Promise(e=>setTimeout(e,s))}function A(s,e){const t=e();return s.waitUntil(t),t}async function ne(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),a={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=e?e(a):a,i=Y()?n.body:await n.blob();return new Response(i,r)}function ae(){self.addEventListener("activate",()=>self.clients.claim())}const re=(s,e)=>e.some(t=>s instanceof t);let O,S;function ie(){return O||(O=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ce(){return S||(S=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const F=new WeakMap,P=new WeakMap,H=new WeakMap,D=new WeakMap,I=new WeakMap;function oe(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&F.set(t,s)}).catch(()=>{}),I.set(e,s),e}function he(s){if(P.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});P.set(s,e)}let k={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return P.get(s);if(e==="objectStoreNames")return s.objectStoreNames||H.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function le(s){k=s(k)}function ue(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(L(this),e,...t);return H.set(n,e.sort?e.sort():[e]),f(n)}:ce().includes(s)?function(...e){return s.apply(L(this),e),f(F.get(this))}:function(...e){return f(s.apply(L(this),e))}}function de(s){return typeof s=="function"?ue(s):(s instanceof IDBTransaction&&he(s),re(s,ie())?new Proxy(s,k):s)}function f(s){if(s instanceof IDBRequest)return oe(s);if(D.has(s))return D.get(s);const e=de(s);return e!==s&&(D.set(s,e),I.set(e,s)),e}const L=s=>I.get(s);function fe(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction),o)}),t&&i.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),c}function pe(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",n=>e(n.oldVersion,n)),f(t).then(()=>{})}const ge=["get","getKey","getAll","getAllKeys","count"],me=["put","add","delete","clear"],U=new Map;function W(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(U.get(e))return U.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=me.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||ge.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return U.set(e,r),r}le(s=>({...s,get:(e,t,n)=>W(e,t)||s.get(e,t,n),has:(e,t)=>!!W(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.0.0"]&&_()}catch{}const ye="workbox-expiration",y="cache-entries",B=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class we{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&pe(this._cacheName)}async setTimestamp(e,t){e=B(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+B(e)}async getDb(){return this._db||(this._db=await fe(ye,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class _e{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new we(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,q(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);q(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&z(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===x.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new _e(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:precaching:7.0.0"]&&_()}catch{}const be="__WB_REVISION__";function Ce(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(be,e),{cacheKey:n.href,url:a.href}}class xe{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class Ee{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}try{self["workbox:strategies:7.0.0"]&&_()}catch{}function b(s){return typeof s=="string"?new Request(s):s}class De{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new Z,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=b(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=b(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=b(e);await se(0);const a=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:te(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),g=h?await X(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await ee(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:g,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=b(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class V{constructor(e={}){this.cacheName=x.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new De(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class p extends V{constructor(e={}){e.cacheName=x.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||r:void 0})),r&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await ne(s):s}};class Le{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:x.getPrecacheName(e),plugins:[...t,new Ee({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=Ce(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return A(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return A(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let T;const M=()=>(T||(T=new Le),T);try{self["workbox:routing:7.0.0"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class Ue extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class Te{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const g=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(N){N instanceof Error&&(u=N)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const Pe=()=>(w||(w=new Te,w.addFetchListener(),w.addCacheListener()),w);function v(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new Ue(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Pe().registerRoute(n),n}function ke(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=ke(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Me extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function ve(s){const e=M(),t=new Me(e,s);v(t)}function Ne(s){return M().createHandlerBoundToURL(s)}function Ke(s){M().precache(s)}function Ae(s,e){Ke(s),ve(e)}const Oe={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Se extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Oe)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}ae();Ae([{"revision":null,"url":"assets/@babel-1eI3ubiv.js"},{"revision":null,"url":"assets/@emotion-MmGlNCCc.js"},{"revision":null,"url":"assets/@floating-ui-8G6zW2om.js"},{"revision":null,"url":"assets/@mui-KY3h_Vqr.js"},{"revision":null,"url":"assets/@popperjs-zyV4rJhQ.js"},{"revision":null,"url":"assets/@react-spring-WSCnDrwI.js"},{"revision":null,"url":"assets/@remix-run-w2aNq8l3.js"},{"revision":null,"url":"assets/axios-d3lcUOYg.js"},{"revision":null,"url":"assets/clsx-Zbgk8kpT.js"},{"revision":null,"url":"assets/d3-array-wUFzFig2.js"},{"revision":null,"url":"assets/d3-color-0OvjxriG.js"},{"revision":null,"url":"assets/d3-delaunay-aCXE4wJG.js"},{"revision":null,"url":"assets/d3-format-9E78v3lr.js"},{"revision":null,"url":"assets/d3-interpolate-E_NIlnYy.js"},{"revision":null,"url":"assets/d3-path-B_10WkFA.js"},{"revision":null,"url":"assets/d3-scale-aMHsSRTu.js"},{"revision":null,"url":"assets/d3-shape-JTn4KTFh.js"},{"revision":null,"url":"assets/d3-time-format-0imObhOF.js"},{"revision":null,"url":"assets/d3-time-xXQrfqad.js"},{"revision":null,"url":"assets/delaunator-IGifLgEt.js"},{"revision":null,"url":"assets/dom-helpers-w40geAFS.js"},{"revision":null,"url":"assets/form-data-QPNVk4j9.js"},{"revision":null,"url":"assets/hamming-distance-_tY3BPi_.js"},{"revision":null,"url":"assets/hoist-non-react-statics-ruMgn741.js"},{"revision":null,"url":"assets/imagekit-IXdsfQA1.js"},{"revision":null,"url":"assets/index-GKlnmpNM.js"},{"revision":null,"url":"assets/index-I-Lx9fYy.css"},{"revision":null,"url":"assets/internmap-Ts8DYYQa.js"},{"revision":null,"url":"assets/lodash-Xr53mQ-n.js"},{"revision":null,"url":"assets/prop-types-i7IregA9.js"},{"revision":null,"url":"assets/react-dom-6aGZtuvN.js"},{"revision":null,"url":"assets/react-is-q81m-9gd.js"},{"revision":null,"url":"assets/react-rKaTJ6rC.js"},{"revision":null,"url":"assets/react-router-dom-RWL_fUCn.js"},{"revision":null,"url":"assets/react-router-Qfa4vrje.js"},{"revision":null,"url":"assets/react-transition-group-am-CiPuM.js"},{"revision":null,"url":"assets/reselect-SnMqv3yZ.js"},{"revision":null,"url":"assets/robust-predicates-cFBOqhuN.js"},{"revision":null,"url":"assets/scheduler-iwWdm5Ml.js"},{"revision":null,"url":"assets/stylis-UTZzoVRx.js"},{"revision":null,"url":"assets/uuid-yQnnJER4.js"},{"revision":"bedffe5d22e98d7c88263ecad554b313","url":"index.html"},{"revision":"be6aad568a9de402ad83ef7601f9d6ce","url":"registerSW.js"}]);const We=new RegExp("/[^/?]+\\.[^/]+$");v(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(We)),Ne("/index.html"));v(({url:s})=>s.origin===self.location.origin&&(s.pathname.endsWith(".png")||s.pathname.endsWith(".ttf")||s.pathname.endsWith(".jpg")),new Se({cacheName:"media",plugins:[new Re({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}); +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return A(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return A(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let T;const M=()=>(T||(T=new Le),T);try{self["workbox:routing:7.0.0"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class Ue extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class Te{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const g=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(N){N instanceof Error&&(u=N)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const Pe=()=>(w||(w=new Te,w.addFetchListener(),w.addCacheListener()),w);function v(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new Ue(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Pe().registerRoute(n),n}function ke(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=ke(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Me extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function ve(s){const e=M(),t=new Me(e,s);v(t)}function Ne(s){return M().createHandlerBoundToURL(s)}function Ke(s){M().precache(s)}function Ae(s,e){Ke(s),ve(e)}const Oe={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Se extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Oe)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}ae();Ae([{"revision":null,"url":"assets/@babel-1eI3ubiv.js"},{"revision":null,"url":"assets/@emotion-MmGlNCCc.js"},{"revision":null,"url":"assets/@floating-ui-8G6zW2om.js"},{"revision":null,"url":"assets/@mui-KY3h_Vqr.js"},{"revision":null,"url":"assets/@popperjs-zyV4rJhQ.js"},{"revision":null,"url":"assets/@react-spring-WSCnDrwI.js"},{"revision":null,"url":"assets/@remix-run-w2aNq8l3.js"},{"revision":null,"url":"assets/axios-d3lcUOYg.js"},{"revision":null,"url":"assets/clsx-Zbgk8kpT.js"},{"revision":null,"url":"assets/d3-array-wUFzFig2.js"},{"revision":null,"url":"assets/d3-color-0OvjxriG.js"},{"revision":null,"url":"assets/d3-delaunay-aCXE4wJG.js"},{"revision":null,"url":"assets/d3-format-9E78v3lr.js"},{"revision":null,"url":"assets/d3-interpolate-E_NIlnYy.js"},{"revision":null,"url":"assets/d3-path-B_10WkFA.js"},{"revision":null,"url":"assets/d3-scale-aMHsSRTu.js"},{"revision":null,"url":"assets/d3-shape-JTn4KTFh.js"},{"revision":null,"url":"assets/d3-time-format-0imObhOF.js"},{"revision":null,"url":"assets/d3-time-xXQrfqad.js"},{"revision":null,"url":"assets/delaunator-IGifLgEt.js"},{"revision":null,"url":"assets/dom-helpers-w40geAFS.js"},{"revision":null,"url":"assets/form-data-QPNVk4j9.js"},{"revision":null,"url":"assets/hamming-distance-_tY3BPi_.js"},{"revision":null,"url":"assets/hoist-non-react-statics-ruMgn741.js"},{"revision":null,"url":"assets/imagekit-IXdsfQA1.js"},{"revision":null,"url":"assets/index-HtrBu3a2.js"},{"revision":null,"url":"assets/index-I-Lx9fYy.css"},{"revision":null,"url":"assets/internmap-Ts8DYYQa.js"},{"revision":null,"url":"assets/lodash-Xr53mQ-n.js"},{"revision":null,"url":"assets/prop-types-i7IregA9.js"},{"revision":null,"url":"assets/react-dom-6aGZtuvN.js"},{"revision":null,"url":"assets/react-is-q81m-9gd.js"},{"revision":null,"url":"assets/react-rKaTJ6rC.js"},{"revision":null,"url":"assets/react-router-dom-RWL_fUCn.js"},{"revision":null,"url":"assets/react-router-Qfa4vrje.js"},{"revision":null,"url":"assets/react-transition-group-am-CiPuM.js"},{"revision":null,"url":"assets/reselect-SnMqv3yZ.js"},{"revision":null,"url":"assets/robust-predicates-cFBOqhuN.js"},{"revision":null,"url":"assets/scheduler-iwWdm5Ml.js"},{"revision":null,"url":"assets/stylis-UTZzoVRx.js"},{"revision":null,"url":"assets/uuid-yQnnJER4.js"},{"revision":"676c53eda7a0f42c460e186427c02506","url":"index.html"},{"revision":"be6aad568a9de402ad83ef7601f9d6ce","url":"registerSW.js"}]);const We=new RegExp("/[^/?]+\\.[^/]+$");v(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(We)),Ne("/index.html"));v(({url:s})=>s.origin===self.location.origin&&(s.pathname.endsWith(".png")||s.pathname.endsWith(".ttf")||s.pathname.endsWith(".jpg")),new Se({cacheName:"media",plugins:[new Re({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()});