PageSourceSearch

https://www.hachmolog.com/assets/CalendarView-wR5Qi78z.js

js hachmolog.com collected 2026-10-02 00:51:25 UTC 11,300 bytes, 1 lines download raw bytes

1import{a as O}from"./vendor-vuex-DawOPd79.js";import{_ as A,N as k,h as I,d as f,s as V,E as C}from"./index-D6gxZzcs.js";import{ak as l,I as d,N as W,G as w,H as S,ar as y,J as u,i as T,F as b,ap as g,aN as E,aP as N}from"./vendor-vue-runtime-core-O0r61XkH.js";import{q as _,Q as L}from"./vendor-vue-shared-C_oE6NXO.js";import{g as U}from"./vendor-vue-runtime-dom-ngu7FkgX.js";import{i as x,g as z}from"./vendor-lodash-es-Dr2nHDXK.js";import"./vendor-vue-devtools-api-Cow_pXkh.js";import"./vendor-vue-reactivity-_PYbVOMb.js";import"./vendor-vue-select-Cn2oH4dd.js";import"./vendor-vue-star-rating-D42Atl4Q.js";import"./vendor-vue-compiler-dom-BjqiHA0M.js";import"./vendor-vue-compiler-core-B_m9pfJg.js";import"./vendor-vue-BfDmC2hc.js";import"./vendor-ionic-vue-Cp6ESLlK.js";import"./vendor-ionic-core-DDVmzL1A.js";import"./vendor-ionicons-CnTsVUQ5.js";import"./vendor-gleap-C_nLUrYA.js";import"./vendor-posthog-js-BcP-dMRa.js";import"./vendor-vue-router-BrjMN5S_.js";import"./vendor-axios-D8dNGRK6.js";import"./vendor-err-code-Btjngwyv.js";import"./vendor-promise-retry-CvXhdAiW.js";import"./vendor-retry-Drt1HQ7J.js";import"./vendor-case-DCoxfN6b.js";import"./vendor-dayjs-CMAHqsIS.js";import"./vendor-exponential-backoff-CTCpx--5.js";import"./vendor-xstate-gZzxgXGH.js";import"./vendor-socket-io-client-DrXE8q1S.js";import"./vendor-engine-io-client-C-_nnA9b.js";import"./vendor-engine-io-parser-DPmA-eyr.js";import"./vendor-socket-io-component-emitter-Dkula2eQ.js";import"./vendor-socket-io-parser-SgV_gTLD.js";import"./vendor-validator-CzLPc2u2.js";import"./vendor-vueuse-core-C1QNX1u6.js";import"./vendor-vueuse-shared-DO1b_29_.js";import"./vendor-vuelidate-validators-H9iLFjxf.js";import"./vendor-vuelidate-core-Bd16nddI.js";import"./vendor-neoconfetti-vue-CCbt6K7L.js";import"./vendor-vue-draggable-resizable-X1h3rUy6.js";import"./vendor-vuetify-DDTyW1fq.js";const B={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"};function H(e,t){return l(),d("svg",B,[...t[0]||(t[0]=[W('<g fill="#ff0202"><g fill-rule="evenodd" clip-rule="evenodd"><path d="M6.286 15.075c.596.204.874.756.62 1.234l-1.653 3.118c-.253.478-.942.701-1.539.498-.596-.204-.874-.756-.62-1.234l1.653-3.118c.253-.478.942-.701 1.539-.498M13.715 15.075c-.597.204-.875.756-.621 1.234l1.653 3.118c.253.478.942.701 1.539.498.596-.204.874-.756.62-1.234l-1.653-3.118c-.253-.478-.942-.701-1.539-.498M10.038 6c.573 0 1.038.387 1.038.864v2.408h1.886c.573 0 1.038.387 1.038.864s-.465.864-1.038.864h-2.924C9.465 11 9 10.613 9 10.136V6.864C9 6.387 9.465 6 10.038 6"></path><path d="M10 16.012A6.004 6.004 0 0 0 15.996 10c0-3.335-2.7-6.012-5.996-6.012A6.004 6.004 0 0 0 4.004 10c0 3.335 2.7 6.012 5.996 6.012M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16"></path></g><path d="M2.548 8a3.8 3.8 0 0 1-1.103-1.304 4.017 4.017 0 0 1-.134-3.39 3.85 3.85 0 0 1 .996-1.396c.43-.38.936-.651 1.48-.794a3.5 3.5 0 0 1 1.663-.031c.55.122 1.065.374 1.507.738S7.756 2.65 8 3.179l-1.884.954c-.106-.23-.26-.43-.45-.586s-.414-.266-.651-.32a1.552 1.552 0 0 0-1.358.357c-.185.164-.332.37-.43.603a1.73 1.73 0 0 0 .058 1.464c.116.224.279.416.476.563zM17.452 8a3.8 3.8 0 0 0 1.103-1.304 4.017 4.017 0 0 0 .134-3.39 3.85 3.85 0 0 0-.996-1.396 3.6 3.6 0 0 0-1.48-.794 3.5 3.5 0 0 0-1.663-.031c-.55.122-1.065.374-1.507.738S12.244 2.65 12 3.179l1.884.954c.106-.23.26-.43.45-.586a1.56 1.56 0 0 1 .651-.32 1.552 1.552 0 0 1 1.358.357c.185.164.332.37.43.603a1.73 1.73 0 0 1-.058 1.464 1.64 1.64 0 0 1-.476.563z"></path></g>',1)])])}const M={render:H},$={name:"Cell",components:{ClockIcon:M},emits:["click"],props:{content:{type:String,default:""},selectable:{type:Boolean,default:!0},selected:{type:Boolean,default:!1},flagged:{type:Boolean,default:!1}},computed:{cellClasses(){const e=`Cell-${this.selectable?"selectable":"unselectable"}`;return{[e]:!0,[`${e}--selected`]:this.selected}}}};function F(e,t,s,r,n,a){const i=y("ClockIcon");return s.selectable?(l(),d("div",{key:0,class:_(a.cellClasses),onClick:t[0]||(t[0]=m=>e.$emit("click"))},[s.flagged?(l(),w(i,{key:0,class:"Cell-icon clock-icon"})):S("",!0)],2)):(l(),d("div",{key:1,class:_(a.cellClasses),onClick:t[1]||(t[1]=m=>e.$emit("click"))},L(s.content),3))}const G=A($,[["render",F],["__scopeId","data-v-bbb1bb0b"]]),P={name:"AvailabilityGrid",components:{Cell:G},props:{availability:Object,waitTimes:Object},emits:["select"],data(){return{threshold:900*1e3,timeRange:{"12 am":!1,"1 am":!1,"2 am":!1,"3 am":!1,"4 am"
1:!1,"5 am":!1,"6 am":!1,"7 am":!1,"8 am":!1,"9 am":!1,"10 am":!1,"11 am":!1,"12 pm":!1,"1 pm":!1,"2 pm":!1,"3 pm":!1,"4 pm":!1,"5 pm":!1,"6 pm":!1,"7 pm":!1,"8 pm":!1,"9 pm":!1,"10 pm":!1,"11 pm":!1}}},methods:{updateData(e,t){this.$emit("select",{day:e,hour:t})},readWaitTime(e,t){try{return this.waitTimes[e][t]}catch{return 0}}}},R={class:"AvailabilityGrid"},Y={class:"Column"};function q(e,t,s,r,n,a){const i=y("Cell");return l(),d("div",R,[u("div",Y,[T(i,{class:"Top Left TopLeft",selectable:!1,content:"(Start Times)"}),(l(!0),d(b,null,g(n.timeRange,(m,o)=>(l(),w(i,{class:"Left",key:"label"+o,content:o,selectable:!1},null,8,["content"]))),128))]),(l(!0),d(b,null,g(s.availability,(m,o)=>(l(),d("div",{class:"Column",key:o},[T(i,{class:"Top",content:o,selectable:!1},null,8,["content"]),(l(!0),d(b,null,g(m,(c,v)=>(l(),w(i,{key:o+v,selectable:!0,selected:c,flagged:a.readWaitTime(o,v)>n.threshold,onClick:p=>a.updateData(o,v),"data-testid":`${o.toLowerCase()}-${v}`},null,8,["selected","flagged","onClick","data-testid"]))),128))]))),128))])}const j=A(P,[["render",q],["__scopeId","data-v-234bc170"]]),D={updateSchedule(e,t,s){return e.$store.dispatch("user/updateAvailability",t),e.$store.dispatch("user/updateTimezone",s),k.updateSchedule({availability:t,tz:s})},getWaitTimes(){return k.getWaitTimes().then(e=>e.data.heatMap).catch(()=>({}))}},h={SAVED:"saved",UNSAVED:"unsaved",ERROR:"error",SAVING:"saving"},Z={components:{AvailabilityGrid:j,ClockIcon:M,LargeButton:I},data(){return{waitTimes:{},availability:{},tzList:Intl.supportedValuesOf("timeZone"),selectedTz:"",saveState:h.UNSAVED}},computed:{...O({user:e=>e.user.user}),saveButtonClass(){return["save-button","save-button--"+this.saveState]},saveLabel(){switch(this.saveState){case h.SAVED:return"Saved &#x2714;";case h.SAVING:return"Saving...";default:return"Save"}},hasUserSchedule(){return!z(this.availability)},hasWaitTimes(){return!z(this.waitTimes)},hasChangedSchedule(){const e=f.tz(Date.now(),"America/New_York").utcOffset(),t=f.tz(Date.now(),this.selectedTz).utcOffset(),s=(e-t)/60;return!x(this.availability,this.convertAvailability(this.user.availability,s))||this.selectedTz!==this.user.timezone}},created(){this.initScheduleData(),this.initWaitTimeData()},methods:{tzChanged(){this.updateLocalWaitTimes(),this.someThingChanged()},updateLocalAvailability(e){const t=this.availability[e.day][e.hour];this.availability[e.day][e.hour]=!t,this.someThingChanged()},async updateLocalWaitTimes(){const e=await D.getWaitTimes(),s=-1*f.tz(Date.now(),this.selectedTz).utcOffset()/60;this.waitTimes=this.convertAvailability(e,s)},someThingChanged(){this.saveState=h.UNSAVED},initScheduleData(){const e=this.user.timezone,t=e&&this.userTzInList(e);this.selectedTz=t?e:f.tz.guess();const s=this.user.availability,r=f.tz(Date.now(),"America/New_York").utcOffset(),n=f.tz(Date.now(),this.selectedTz).utcOffset(),a=(r-n)/60;this.availability=this.convertAvailability(s,a)},async initWaitTimeData(){const e=this.user.timezone,t=e&&this.userTzInList(e);this.selectedTz=t?e:f.tz.guess(),await this.updateLocalWaitTimes()},sortTimes(){const e={};for(const t in this.availability)if(Object.prototype.hasOwnProperty.call(this.availability,t)){const s=this.availability[t],r=[];for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&r.push(n);r[0]!=="12a"&&r.reverse(),e[t]=r}return e},userTzInList(e){return this.tzList.includes(e)},convertAMPMtoTwentyFourHrs(e){const t=/^(\d{1,2})([ap])$/,[,s,r]=e.match(t);return r==="a"?s==="12"?0:parseInt(s):s==="12"?12:parseInt(s)+12},convertTwentyFourHrsToAMPM(e){return e==0?"12a":e==12?"12p":e>12?e-12+"p":e+"a"},convertAvailability(e,t){const s=Math.floor(t),r={Sunday:"Monday",Monday:"Tuesday",Tuesday:"Wednesday",Wednesday:"Thursday",Thursday:"Friday",Friday:"Saturday",Saturday:"Sunday"},n={Sunday:"Saturday",Monday:"Sunday",Tuesday:"Monday",Wednesday:"Tuesday",Thursday:"Wednesday",Friday:"Thursday",Saturday:"Friday"},a={};for(const i in e){const m=e[i];a[i]={};for(const o in m)a[i][o]=!1}for(const i in e){const m=e[i];for(const o in m){let c=i,p=this.convertAMPMtoTwentyFourHrs(o)+s;p>=24?(p-=24,c=r[i]):p<0&&(p+=24,c=n[i]),a[c][this.convertTwentyFourHrsToAMPM(p)]=e[i][o]}}return a},save(){if(this.saveState=h.SAVING,!this.hasChangedSchedule){this.saveState=h.SAVED;return}
1const e=f.tz(Date.now(),"America/New_York").utcOffset(),s=(f.tz(Date.now(),this.selectedTz).utcOffset()-e)/60;D.updateSchedule(this,this.convertAvailability(this.availability,s),this.selectedTz).then(r=>{r.status==200?(this.saveState=h.SAVED,V.captureEvent(C.AVAILABILITY_UPDATED,{event:C.AVAILABILITY_UPDATED}),this.$store.dispatch("user/addToUser",{availabilityLastModifiedAt:new Date().toISOString()})):this.saveState=h.ERROR})}}},J={class:"calendar-container"},Q={class:"calendar"},K={class:"header"},X={class:"save-container"},ee={key:0,class:"clock-explanation-container"},te=["innerHTML"],se={key:0},ae={class:"tz-selector-container"},ie=["value"];function ne(e,t,s,r,n,a){const i=y("ClockIcon"),m=y("large-button"),o=y("AvailabilityGrid");return l(),d("div",J,[u("div",Q,[u("div",K,[t[4]||(t[4]=u("div",{class:"instructions-container"},[u("div",{class:"header-title"},"Tell us when to text you!"),u("p",{class:"instructions"}," The best way to help students is to wait on your dashboard for students who need help at any time you have 30 minutes free! However, to ensure we can match students' requests quickly even when there are no coaches waiting on the dashboard, we also send out text messages for requests that have not been picked up. You can help us ensure every student request gets matched by providing your availability below. You're not obligated to tutor every time we text you, but try and select times you're likely to want to help a student. ")],-1)),u("div",X,[a.hasWaitTimes?(l(),d("div",ee,[T(i,{class:"clock-explanation-icon"}),t[3]||(t[3]=u("p",{class:"clock-explanation"}," Times when students are currently waiting the longest for a tutor—try and include some of these if you can! ",-1))])):S("",!0),T(m,{class:_(a.saveButtonClass),type:"button","data-testid":"save-availability-button",onClick:t[0]||(t[0]=c=>a.save())},{default:E(()=>[u("span",{innerHTML:a.saveLabel},null,8,te)]),_:1},8,["class"])])]),a.hasUserSchedule?(l(),d("div",se,[u("div",ae,[t[5]||(t[5]=u("span",null,"Time Zone: ",-1)),N(u("select",{"onUpdate:modelValue":t[1]||(t[1]=c=>n.selectedTz=c),class:"tz-selector",onChange:t[2]||(t[2]=(...c)=>a.tzChanged&&a.tzChanged(...c)),"data-testid":"tz-selector",autocomplete:"off"},[(l(!0),d(b,null,g(n.tzList,c=>(l(),d("option",{key:c,value:c},L(c),9,ie))),128))],544),[[U,n.selectedTz]]),T(o,{availability:n.availability,waitTimes:n.waitTimes,onSelect:a.updateLocalAvailability},null,8,["availability","waitTimes","onSelect"])])])):S("",!0)])])}const Ye=A(Z,[["render",ne],["__scopeId","data-v-cd0c041f"]]);export{Ye as default};

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