(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["4c492844"],{"37c4":function(t,n,e){"use strict";var i=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("q-card",{staticClass:"column col-12 text-center"},[e("q-card-section",{staticClass:"bg-primary text-white"},[e("div",{staticClass:"text-h6"},[t.atStart?e("span",[t._v(" Welcome! ")]):t._e(),t.atStart||null==t.expression?t._e():e("span",[t._v(" Try "),e("b",[t._v(t._s(t.expression))])]),t.atStart||null!=t.expression?t._e():e("span",[t._v(" You are ready for the next level! ")])]),e("div",{staticClass:"text-subtitle2"},[t.atStart?e("span",[t._v(" Click start when you are ready to begin. ")]):t._e(),t.atStart||null==t.expression?t._e():e("span",[t._v(" "+t._s(t.feedback)+" ")]),t.atStart||null!=t.expression?t._e():e("span",[t._v(" Amazing! ")])])]),e("q-card-actions",{attrs:{align:"around"}},[t.atStart?e("q-btn",{staticStyle:{width:"100%"},attrs:{"no-caps":"",color:"secondary"},on:{click:function(n){return t.start()}}},[t._v("Start")]):t._e(),t.atStart||null==t.expression?t._e():e("q-btn",{staticStyle:{width:"100%"},attrs:{"no-caps":"",icon:"fas fa-check",color:"secondary"},on:{click:function(n){return t.done()}}}),t.atStart||null!=t.expression?t._e():e("q-btn",{staticStyle:{width:"100%"},attrs:{"no-caps":"",color:"secondary"},on:{click:function(n){return t.go()}}},[t._v("Go")])],1),e("q-card-section",{staticClass:"col"},[e("EelCanvas",{ref:"whiteboard",attrs:{active:t.isCanvasActive},on:{animationcomplete:function(n){return t.demoComplete()}}})],1)],1)},s=[],a=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("canvas",{ref:"mainCanvas",staticStyle:{"touch-action":"none"},attrs:{"touch-action":"none",id:"mainCanvas"}})},o=[];e("6c7b");function r(t){return Math.pow(h(t),.5)}function h(t){return t.x*t.x+t.y*t.y}function c(t,n){return{x:t.x-n.x,y:t.y-n.y}}function u(t){var n={x:0,y:0},e={x:0,y:0};return null!==t&&t.length>0&&(n=t.reduce((function(t,n){return{x:Math.min(t.x,n.x),y:Math.min(t.y,n.y)}})),e=t.reduce((function(t,n){return{x:Math.max(t.x,n.x),y:Math.max(t.y,n.y)}}))),{h:e.y-n.y,w:e.x-n.x,ar:(e.x-n.x)/(e.y-n.y),c:{x:.5*(n.x+e.x),y:.5*(n.y+e.y)},min:n,max:e}}function d(t,n){for(var e=t.slice(0,t.length),i=e.length-n,s=e.length/i,a=e.length-1;a>0;a-=s){var o=Math.floor(a);"start"!==e[o].type&&"end"!==e[o].type&&"critical"!==e[o].type&&e.splice(o,1)}return e}function l(t){var n=t.length;return t.map((function(t,e,i){if(e>n-2)return 0;var s=c(i[e+1],t);return r(s)})).reduce((function(t,n){return t+n}))}function p(t,n){return t.map((function(t){return{x:t.x+n.x,y:t.y+n.y,type:t.type}}))}function f(t,n){return t.map((function(t){return{x:t.x*n,y:t.y*n,type:t.type}}))}var v=5/85,m=5/85,y=30/85,x=55/85,g=80/85,b={name:"EelCanvas",props:{active:Boolean},data:function(){return{recordedPoints:[]}},mounted:function(){this.canvas=this.$refs.mainCanvas,this.context=this.canvas.getContext("2d"),this.configureListeners(),this.clear()},methods:{onResize:function(){this.canvas},record:function(){this.recordedPoints=[],this.isRecording=!0},getRecording:function(){return this.isRecording=!1,{boundary:this.boundary,path:this.recordedPoints}},configureSize:function(){var t=1;if(this.canvas.style.width="100%",this.canvas.style.height="98%",null!==this.aspectRatio&&0!==this.aspectRatio){var n=this.canvas.clientWidth/this.canvas.clientHeight;if(nthis.timePerPoint){if(this.then=this.now,this.animationSegment>=this.animationPoints.length)this.setStrokeStyle("USER"),this.isAnimating=!1,this.$emit("animationcomplete");else if("start"===this.animationPoints[this.animationSegment].type)this.setStrokeStyle("START_CIRCLE"),this.paintCircle(this.animationPoints[this.animationSegment],13);else if("end"===this.animationPoints[this.animationSegment].type)this.setStrokeStyle("END_CIRCLE"),this.paintCircle(this.animationPoints[this.animationSegment],13);else{this.setStrokeStyle("EEL");var n=this.animationPoints[this.animationSegment+1]||this.animationPoints[this.animationSegment];this.paintLine(this.animationPoints[this.animationSegment],n)}this.animationSegment++}}}},w=b,S=e("2877"),L=e("fe09"),E=Object(S["a"])(w,a,o,!1,null,null,null),P=E.exports;function C(t){var n=100,e=t.boundary.baseLine-t.boundary.capLine,i=n/e,s={top:t.boundary.top*i,ascenderLine:t.boundary.ascenderLine*i,capLine:t.boundary.capLine*i,meanLine:t.boundary.meanLine*i,baseLine:t.boundary.baseLine*i,beardLine:t.boundary.beardLine*i,bottom:t.boundary.bottom*i},a=f(t.path,i),o=u(a),r=p(a,{x:-1*o.min.x,y:0});return{letter:t.letter,boundary:s,path:r}}function _(t){for(var n=15,e=t.map((function(t){return C(t)})),i=[],s="",a=0;ai?t=d(t,i):n=d(n,e);var s=l(t),a=l(n),o=Math.abs(s-a)/s;return!(o>.125)}function R(t,n,e){for(var i=t.filter((function(t){return t.type===e})),s=n.filter((function(t){return t.type===e})),a=u(t),o=Math.max(a.w,a.h),h=0;h.1)return!1}return!0}function A(t,n){var e=u(t),i=u(n),s=Math.max(e.w,e.h),a=Math.abs(e.w-i.w)/s;if(a>.125)return!1;var o=Math.abs(e.h-i.h)/s;if(o>.125)return!1;var r=Math.abs(e.c.x-i.c.x)/s;if(r>.1)return!1;var h=Math.abs(e.c.y-i.c.y)/s;return!(h>.1)}E.options.components=Object.assign({QResizeObserver:L["p"]},E.options.components||{});var D={name:"EelPractice",components:{EelCanvas:P},data:function(){return{isCanvasActive:!1,atStart:!0,feedback:"Have fun!"}},computed:{expression:{get:function(){return this.$store.state.common.expression}}},methods:{start:function(){this.atStart=!1,this.$store.dispatch("common/startPractice"),this.refresh()},done:function(){var t=this.$refs.whiteboard.getRecording(),n={success:this.validateSuccess(),expression:this.expression,pattern:{expression:this.expression,dimensions:t.dimensions,path:t.path}};n.success?this.feedback="Great job!":this.feedback="Try again!",this.$store.dispatch("common/practiceAttempted",n),this.refresh()},refresh:function(){this.$refs.whiteboard.clear(),this.demonstrateExpression()},generatePattern:function(){for(var t=[],n=0;n0){var t=this.generatePattern();this.$refs.whiteboard.draw(t,this.$store.state.common.user.technique)}},demoComplete:function(t){this.feedback="Begin",this.$refs.whiteboard.record(),this.isCanvasActive=!0},go:function(){this.$store.dispatch("common/completedTechnique")}}},T=D,$=Object(S["a"])(T,i,s,!1,null,null,null);n["a"]=$.exports;$.options.components=Object.assign({QCard:L["b"],QCardSection:L["d"],QCardActions:L["c"],QBtn:L["a"]},$.options.components||{})},d345:function(t,n,e){"use strict";e.r(n);var i=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("q-page",{staticClass:"row items-stretch",attrs:{padding:""}},[e("EelPractice")],1)},s=[],a=e("37c4"),o={name:"PageWord",components:{EelPractice:a["a"]},created:function(){this.$store.dispatch("common/changeLevel","word")}},r=o,h=e("2877"),c=e("fe09"),u=Object(h["a"])(r,i,s,!1,null,null,null);n["default"]=u.exports;u.options.components=Object.assign({QPage:c["n"]},u.options.components||{})}}]);