From 245421a09dd99c9548782437f227e482353f024d Mon Sep 17 00:00:00 2001 From: Peter Toth Date: Fri, 15 Mar 2019 16:20:31 +0000 Subject: [PATCH] OE-8261 Keratic precipitate (KP) doodle location is saved --- assets/js/dist/eyedraw.js | 2 +- assets/js/dist/eyedraw.min.js | 4 +- assets/js/dist/oe-eyedraw.js | 2 +- assets/js/dist/oe-eyedraw.min.js | 2 +- package-lock.json | 399 ++++++++-------------- src/ED/Doodles/Oph/KeraticPrecipitates.js | 2 +- src/ED/Views/templates.js | 2 +- 7 files changed, 158 insertions(+), 255 deletions(-) diff --git a/assets/js/dist/eyedraw.js b/assets/js/dist/eyedraw.js index 8c77bd38..fbc5de24 100644 --- a/assets/js/dist/eyedraw.js +++ b/assets/js/dist/eyedraw.js @@ -34072,7 +34072,7 @@ ED.KeraticPrecipitates = function(_drawing, _parameterJSON) { this.className = "KeraticPrecipitates"; // Saved parameters - this.savedParameterArray = ['apexX', 'apexY', 'scaleX', 'scaleY']; + this.savedParameterArray = ['apexX', 'apexY', 'scaleX', 'scaleY', 'originX', 'originY']; // Call superclass constructor ED.Doodle.call(this, _drawing, _parameterJSON); diff --git a/assets/js/dist/eyedraw.min.js b/assets/js/dist/eyedraw.min.js index 863beaf9..5acc93f9 100644 --- a/assets/js/dist/eyedraw.min.js +++ b/assets/js/dist/eyedraw.min.js @@ -1,4 +1,4 @@ -/*! eyedraw 04-03-2019 */ +/*! eyedraw 15-03-2019 */ var ED=ED||{};ED.handleRadius=15,ED.arrowDelta=4,ED.squiggleWidth={Thin:4,Medium:12,Thick:20},ED.squiggleStyle={Outline:0,Solid:1},ED.recentClick=!1,ED.eye={Right:0,Left:1},ED.drawFunctionMode={Draw:0,HitTest:1},ED.Mode={None:0,Move:1,Scale:2,Arc:3,Rotate:4,Apex:5,Handles:6,Draw:7,Select:8,Size:9},ED.handleRing={Inner:0,Outer:1},ED.modified=!1,ED.findOffset=function(a,b,c){if(a.offsetParent){do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent);return{left:b,top:c}}},ED.findPosition=function(a,b){var c;return c="undefined"!=typeof jQuery?jQuery(a).offset():ED.findOffset(a,0,0),{x:b.pageX-c.left,y:b.pageY-c.top}},ED.objectIsEmpty=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},ED.isFirefox=function(){var a=0,b=window.navigator.userAgent;return a=b.indexOf("Firefox"),a>0},ED.isNumeric=function(a){return a-0==a&&a.length>0},ED.Mod=function(a,b){return a-Math.floor(a/b)*b},ED.positiveAngle=function(a){for(var b=2*Math.PI;a<0;)a+=b;return a%b},ED.errorHandler=function(a,b,c){console.trace("EYEDRAW ERROR! class: ["+a+"] method: ["+b+"] message: ["+c+"]")},ED.firstLetterToUpperCase=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},ED.firstLetterToLowerCase=function(a){var b=a.charAt(1);return b===b.toUpperCase()?a:a.charAt(0).toLowerCase()+a.slice(1)},ED.addAndAfterLastComma=function(a){for(var b=!1,c=a.length-1;c>=0;c--)if(","===a.charAt(c)){b=!0;break}return b?a.substring(0,c)+", and"+a.substring(c+1,a.length):a},ED.titles={},ED.setTitles=function(a){$.extend(this.titles,a)},ED.randomArray=[.657,.2886,.7388,.1621,.9896,.0434,.1695,.9099,.1948,.4433,.158,.7392,.873,.2165,.7138,.6316,.3425,.2838,.4551,.4153,.7421,.3364,.6087,.1986,.5764,.1952,.6179,.6699,.0903,.2968,.2684,.9383,.2488,.4579,.2921,.9085,.7951,.45,.2255,.3366,.667,.73,.5511,.5623,.1376,.5553,.9898,.4317,.5922,.6452,.5008,.7077,.0704,.2293,.5697,.7415,.1557,.2944,.4566,.4129,.2449,.562,.4105,.5486,.8917,.9346,.0921,.7998,.7717,.0357,.1179,.0168,.152,.5187,.3466,.1663,.5935,.7524,.841,.1859,.6012,.8171,.9272,.3367,.8133,.4868,.3665,.9625,.7839,.3052,.1651,.6414,.7361,.0065,.3267,.0554,.3389,.8967,.8777,.0557,.9201,.6015,.2676,.3365,.2606,.0989,.2085,.3526,.8476,.0146,.019,.6896,.5198,.9871,.0288,.8037,.6741,.2148,.2584,.8447,.848,.5557,.248,.4736,.8869,.1867,.3869,.6871,.1011,.7561,.734,.1525,.9968,.8179,.7103,.5462,.415,.4187,.0478,.6511,.0386,.5243,.7271,.9093,.4461,.1264,.0756,.9405,.7287,.0684,.282,.4059,.3694,.7641,.4188,.0498,.7841,.9136,.621,.2249,.9935,.9709,.0741,.6218,.3166,.2237,.7754,.4191,.2195,.2935,.4529,.9112,.9183,.3275,.1856,.8345,.0442,.6297,.903,.4689,.9512,.2219,.9993,.8981,.1018,.9362,.6426,.4563,.1267,.7889,.5057,.8588,.4669,.0687,.6623,.3681,.8152,.9004,.0822,.3652];var ED=ED||{};if(ED.Drawing=function(a,b,c,d,e){if(!(a&&a instanceof HTMLCanvasElement))return void ED.errorHandler("ED.Drawing","constructor","Invalid canvas element");var f=0,g=0,h=!1,i=1,j=0;if(this.graphicsPath="assets/img",this.scaleOn="height","undefined"!=typeof e&&(e.offsetX&&(f=e.offsetX),e.offsetY&&(g=e.offsetY),e.toImage&&(h=e.toImage),e.graphicsPath&&(this.graphicsPath=e.graphicsPath),e.scaleOn&&(this.scaleOn=e.scaleOn),e.scale&&(i=e.scale),e.toggleScale&&(j=e.toggleScale)),this.drawingName=e.drawingName,this.canvas=a,this.eye=b,this.idSuffix=c,this.isEditable=d,this.hoverTimer=null,this.convertToImage=!(!h||this.isEditable),this.context=this.canvas.getContext("2d"),this.doodleArray=new Array,this.bindingArray=new Array,this.listenerArray=new Array,this.transform=new ED.AffineTransform,this.inverseTransform=new ED.AffineTransform,this.selectedDoodle=null,this.mouseIsDown=!1,this.doubleClick=!1,this.mode=ED.Mode.None,this.lastMousePosition=new ED.Point(0,0),this.doubleClickMilliSeconds=250,this.readyNotificationSent=!1,this.newPointOnClick=!1,this.completeLine=!1,this.globalScaleFactor=i,this.toggleScaleFactor=j,this.origScaleLevel=i,this.scrollValue=0,this.lastDoodleId=0,this.isActive=!1,this.isNew=!0,this.isReady=!1,this.showDoodleControls=!1,this.onReadyCommands=[],this.resetDoodleSet=!1,this.lastTouchPoint=void 0,this.boundElementDeleteValueArray=new Array,this.canvasParent=this.canvas.parentElement,this.notificationArray=new Array,this.canvasTooltip=document.getElementById(this.canvas.id+"Tooltip"),"height"==this.scaleOn?this.scale=this.canvas.height/1001:this.scale=this.canvas.width/1001,this.doodlePlaneWidth=this.canvas.width/this.scale,this.doodlePlaneHeight=this.canvas.height/this.scale,this.imageArray=new Array,this.imageArray.LatticePattern=new Image,this.imageArray.CribriformPattern=new Image,this.imageArray.CribriformPatternSmall=new Image,this.imageArray.CryoPattern=new Image,this.imageArray.AntPVRPattern=new Image,this.imageArray.LaserPattern=new Image,this.imageArray.FuchsPattern=new Image,this.imageArray.PSCPattern=new Image,this.imageArray.MeshworkPatternLight=new Image,this.imageArray.MeshworkPatternMedium=new Image,this.imageArray.MeshworkPatternHeavy=new Image,this.imageArray.NewVesselPattern=new Image,this.imageArray.OedemaPattern=new Image,this.imageArray.OedemaPatternBullous=new Image,this.imageArray.BrownSpotPattern=new Image,this.imageArray.TranslucentPattern=new Image,this.transform.translate(this.canvas.width/2,this.canvas.height/2),this.transform.scale(this.scale,this.scale),this.inverseTransform=this.transform.createInverse(),this.clear(),this.selectionRectangleIsBeingDragged=!1,this.selectionRectangleStart=new ED.Point(0,0),this.selectionRectangleEnd=new ED.Point(0,0),this.isEditable){var k=this;this.canvas.addEventListener("mousedown",function(a){var b=ED.findPosition(this,a),c=new ED.Point(b.x,b.y);k.mousedown(c)},!1),this.canvas.addEventListener("mouseup",function(a){var b=ED.findPosition(this,a),c=new ED.Point(b.x,b.y);k.mouseup(c)},!1),this.canvas.addEventListener("mousemove",function(a){var b=ED.findPosition(this,a),c=new ED.Point(b.x,b.y);k.mousemove(c)},!1),this.canvas.addEventListener("mouseover",function(a){var b=ED.findPosition(this,a),c=new ED.Point(b.x,b.y);k.mouseover(c)},!1),this.canvas.addEventListener("mouseout",function(a){var b=ED.findPosition(this,a),c=new ED.Point(b.x,b.y);k.mouseout(c)},!1),document.body.addEventListener("mousedown",function(a){var b=a.target,c=!1,d="("+["ed-doodle-popup","ed-button","ed-canvas","ed_canvas","ed-selected-doodle-select"].join(")|(")+")";do c=new RegExp(d).test(b.className);while((b=b.parentNode)&&b!==document.body&&!c);c||k.deselectDoodles()},!1),this.canvas.addEventListener("touchstart",function(a){if(void 0!==a.targetTouches[0]){var b=k.getPositionOfElement(k.canvas),c=new ED.Point(a.targetTouches[0].pageX-b[0]-this.offsetLeft,a.targetTouches[0].pageY-b[1]);a.preventDefault()}else ED.errorHandler("ED.Drawing","Class","Touches undefined: ");this.lastTouchPoint=c,k.mousedown(c)},!1),this.canvas.addEventListener("touchend",function(a){void 0!==this.lastTouchPoint&&(k.mouseup(this.lastTouchPoint),this.lastTouchPoint=void 0)},!1),this.canvas.addEventListener("touchmove",function(a){if(void 0!==a.targetTouches[0]){var b=k.getPositionOfElement(k.canvas),c=new ED.Point(a.targetTouches[0].pageX-b[0]-this.offsetLeft,a.targetTouches[0].pageY-b[1]);this.lastTouchPoint=c,k.mousemove(c)}},!1),window.addEventListener("keydown",function(b){document.activeElement===a&&k.keydown(b)},!0),this.canvas.onselectstart=function(){return!1}}},ED.Drawing.prototype.getPositionOfElement=function(a){for(var b=0,c=0;;){if(b+=a.offsetLeft,c+=a.offsetTop,null===a.offsetParent)break;a=a.offsetParent}return[b,c]},ED.Drawing.prototype.init=function(){this.preLoadImagesFrom(this.graphicsPath+"/patterns/")},ED.Drawing.prototype.replaceWithImage=function(){var a=document.createElement("img");if(a.setAttribute("src",this.canvas.toDataURL("image/png")),this.canvasParent.hasChildNodes())for(;this.canvasParent.childNodes.length>=1;)this.canvasParent.removeChild(this.canvasParent.firstChild);this.canvasParent.appendChild(a)},ED.Drawing.prototype.preLoadImagesFrom=function(a){var b=this;for(var c in this.imageArray)this.imageArray[c].onload=function(){b.checkAllLoaded()},this.imageArray[c].onerror=function(b){return function(){ED.errorHandler("ED.Drawing","preLoadImagesFrom",'Error loading image file "'+b+'.gif" from directory: "'+a+'"')}}(c),this.imageArray[c].src=a+c+".gif"},ED.Drawing.prototype.checkAllLoaded=function(){var a=!0;for(var b in this.imageArray){var c=!1;this.imageArray[b].width>0&&(c=!0),a=a&&c}a&&(this.readyNotificationSent||(this.readyNotificationSent=!0,this.notify("ready")))},ED.Drawing.prototype.registerForNotifications=function(a,b,c){"undefined"==typeof b&&(b="notificationHandler"),"undefined"==typeof c&&(c=new Array),this.notificationArray.push({object:a,methodName:b,notificationList:c})},ED.Drawing.prototype.unRegisterForNotifications=function(a){var b=this.notificationArray.indexOf(a);b>=0&&this.notificationArray.splice(b,1)},ED.Drawing.prototype.notify=function(a,b){for(var c={eventName:a,selectedDoodle:this.selectedDoodle,object:b},d=0;d=0)&&("undefined"!=typeof f[g]?f[g].apply(f,[c]):ED.errorHandler("ED.Drawing","notify","Attempt to call undefined notification handler method"))}},ED.Drawing.prototype.loadDoodles=function(a){var b=document.getElementById(a);if(b&&b.value.length>0){var c=window.JSON.parse(b.value);this.resetDoodleSet=c,this.load(c),this.isNew=!1,this.notify("doodlesLoaded")}},ED.Drawing.prototype.load=function(a){for(var b=0;b-1;c--)b?(this.doodleArray[c].isSelected=!1,this.doodleArray[c].isForDrawing=!1):(this.context.save(),this.doodleArray[c].draw(a)?this.doodleArray[c].isSelectable&&(this.doubleClick&&this.doodleArray[c].isSelected&&this.doodleArray[c].isDrawable&&(this.doodleArray[c].isForDrawing=!0),b=!0,this.selectDoodle(this.doodleArray[c]),!this.doubleClick&&this.doodleArray[c].isForDrawing&&this.doodleArray[c].addSquiggle()):(this.doodleArray[c].isSelected=!1,this.doodleArray[c].isForDrawing=!1),this.context.restore()),this.doodleArray[c].isBeingDragged=!1;if(this.selectedDoodle||this.lastSelectedDoodle&&this.lastSelectedDoodle.onDeselection(),this.lastSelectedDoodle&&this.lastSelectedDoodle!=this.selectedDoodle&&this.notify("doodleDeselected"),this.newPointOnClick&&!b){var d=this.inverseTransform.transformPoint(a),e=this.addDoodle("PointInLine");e.originX=d.x,e.originY=d.y}this.repaint(),this.notify("mousedown",{drawing:this,point:a})},ED.Drawing.prototype.click=function(a){this.notify("click",{drawing:this,point:a})},ED.Drawing.prototype.mousemove=function(a){this.notify("mousemove",{drawing:this,point:a});var b=this.selectedDoodle;if(!b||!this.selectedDoodle.isLocked){var c="";if(this.startHoverTimer(a),this.mouseIsDown&&null!=b){if(b.isBeingDragged){var d=this.inverseTransform.transformPoint(a),e=this.inverseTransform.transformPoint(this.lastMousePosition),f=b.inverseTransform.transformPoint(a),g=b.inverseTransform.transformPoint(this.lastMousePosition),h=new ED.Point(a.x-this.canvas.width/2,a.y-this.canvas.height/2),i=new ED.Point(this.lastMousePosition.x-this.canvas.width/2,this.lastMousePosition.y-this.canvas.height/2),j=new ED.Point(0,0),k=new ED.Point(0,(-100)),l=new ED.Point(b.originX,b.originY),m=new ED.Point(b.originX,b.originY-100);switch(this.mode){case ED.Mode.None:break;case ED.Mode.Move:if(b.isMoveable){var n=b.originX,o=b.originY;if(b.snapToGrid){var p=d.x-b.gridDisplacementX,q=Math.floor(p/b.gridSpacing),r=ED.Mod(p,b.gridSpacing);n=b.gridDisplacementX+b.gridSpacing*(q+Math.round(r/b.gridSpacing));var s=d.y-b.gridDisplacementY,t=Math.floor(s/b.gridSpacing),u=ED.Mod(s,b.gridSpacing);o=b.gridDisplacementY+b.gridSpacing*(t+Math.round(u/b.gridSpacing)),b.move(n-b.originX,o-b.originY)}else b.snapToQuadrant?(0!=d.x&&(n=b.quadrantPoint.x*d.x/Math.abs(d.x)),0!=d.y&&(o=b.quadrantPoint.y*d.y/Math.abs(d.y)),b.move(n-b.originX,o-b.originY)):b.snapToPoints?(n=b.nearestPointTo(d).x,o=b.nearestPointTo(d).y,b.move(n-b.originX,o-b.originY)):b.move(d.x-e.x,d.y-e.y);c="move"}else if(b.isRotatable){var v=this.innerAngle(k,j,i),w=this.innerAngle(k,j,h),x=w-v;if(b.snapToAngles)var y=b.nearestAngleTo(w);else var y=ED.Mod(b.rotation+x,2*Math.PI);b.setSimpleParameter("rotation",b.parameterValidationArray.rotation.range.constrainToAngularRange(y,!1)),b.updateDependentParameters("rotation");var z=Math.sqrt(e.x*e.x+e.y*e.y),A=Math.sqrt(d.x*d.x+d.y*d.y),B=b.radius+(A-z);b.setSimpleParameter("radius",b.parameterValidationArray.radius.range.constrain(B)),b.updateDependentParameters("radius")}break;case ED.Mode.Scale:if(b.isScaleable){var C=b.scaleX/Math.abs(b.scaleX),D=b.scaleY/Math.abs(b.scaleY),E=f.x/g.x,F=f.y/g.y;b.isSqueezable||(F=E>F?E:E),E>0&&F>0?(newScaleX=b.scaleX*E,newScaleY=b.scaleY*F,newScaleX=b.parameterValidationArray.scaleX.range.constrain(Math.abs(newScaleX),this.globalScaleFactor),newScaleY=b.parameterValidationArray.scaleY.range.constrain(Math.abs(newScaleY),this.globalScaleFactor),b.setSimpleParameter("scaleX",newScaleX*C),b.setSimpleParameter("scaleY",newScaleY*D),b.updateDependentParameters("scaleX"),b.updateDependentParameters("scaleY")):this.mode=ED.Mode.None}break;case ED.Mode.Arc:var w=this.innerAngle(m,l,f),v=this.innerAngle(m,l,g),G=w-v;b.isArcSymmetrical&&(G=2*G),rotationCorrection=1,b.draggingHandleIndex<2&&(G=-G,rotationCorrection=-1),b.snapToArc?(rotationCorrection<0&&(w=2*Math.PI-ED.positiveAngle(w)),b.setSimpleParameter("arc",b.nearestArcTo(b.arc/2+w))):b.parameterValidationArray.arc.range.isBelow(b.arc+G)?(G=b.parameterValidationArray.arc.range.min-b.arc,b.setSimpleParameter("arc",b.parameterValidationArray.arc.range.min),this.mode=ED.Mode.None):b.parameterValidationArray.arc.range.isAbove(b.arc+G)?(G=b.parameterValidationArray.arc.range.max-b.arc,b.setSimpleParameter("arc",b.parameterValidationArray.arc.range.max),this.mode=ED.Mode.None):b.setSimpleParameter("arc",b.arc+G),b.updateDependentParameters("arc"),b.isArcSymmetrical||(rotationCorrection=rotationCorrection*G/2,b.setSimpleParameter("rotation",b.rotation+rotationCorrection),b.updateDependentParameters("rotation"));break;case ED.Mode.Rotate:if(b.isRotatable){var v=this.innerAngle(m,l,e),w=this.innerAngle(m,l,d),G=w-v,y=b.rotation+G;y=ED.positiveAngle(y),b.setSimpleParameter("rotation",b.parameterValidationArray.rotation.range.constrainToAngularRange(y,!1)),b.updateDependentParameters("rotation")}break;case ED.Mode.Apex:var H=b.apexX+(f.x-g.x),I=b.apexY+(f.y-g.y);b.setSimpleParameter("apexX",b.parameterValidationArray.apexX.range.constrain(H)),b.setSimpleParameter("apexY",b.parameterValidationArray.apexY.range.constrain(I)),b.updateDependentParameters("apexX"),b.updateDependentParameters("apexY");break;case ED.Mode.Size:var J=b.width+2*(f.x-g.x),K=b.height-2*(f.y-g.y);b.setSimpleParameter("width",b.parameterValidationArray.width.range.constrain(J)),b.setSimpleParameter("height",b.parameterValidationArray.height.range.constrain(K)),b.updateDependentParameters("width"),b.updateDependentParameters("height");break;case ED.Mode.Handles:var L=b.draggingHandleIndex,M=new ED.Point(0,0);if(M.x=b.squiggleArray[0].pointsArray[L].x+(f.x-g.x),M.y=b.squiggleArray[0].pointsArray[L].y+(f.y-g.y),"undefined"!=typeof b.handleCoordinateRangeArray&&(M.x=b.handleCoordinateRangeArray[L].x.constrain(M.x),M.y=b.handleCoordinateRangeArray[L].y.constrain(M.y)),"undefined"!=typeof b.handleVectorRangeArray){var N=b.handleVectorRangeArray[L].length.constrain(M.length()),O=b.handleVectorRangeArray[L].angle.constrainToAngularRange(M.direction(),!1);M.setWithPolars(N,O)}b.squiggleArray[0].pointsArray[L].x=M.x,b.squiggleArray[0].pointsArray[L].y=M.y,b.updateDependentParameters("handles");break;case ED.Mode.Draw:var P=new ED.Point(f.x,f.y);b.addPointToSquiggle(P);break;case ED.Mode.Select:var P=new ED.Point(f.x,f.y)}}else b.isBeingDragged=!0;this.lastMousePosition=a,this.notify("mousedragged",{point:a,action:c}),this.repaint()}}},ED.Drawing.prototype.mouseup=function(a){this.mouseIsDown=!1,this.doubleClick=!1,this.mode=ED.Mode.None,this.selectionRectangleIsBeingDragged=!1,null!=this.selectedDoodle&&(this.selectedDoodle.isBeingDragged=!1,this.selectedDoodle.isDrawable&&(this.selectedDoodle.completeSquiggle(),this.drawAllDoodles()),this.selectedDoodle.willStaySelected||(this.selectedDoodle.isSelected=!1,this.selectedDoodle=null)),this.repaint(),this.notify("mouseup",a)},ED.Drawing.prototype.mouseover=function(a){this.isActive=!0,this.notify("mouseover",a)},ED.Drawing.prototype.mouseout=function(a){this.isActive=!1,this.stopHoverTimer(),this.mouseIsDown=!1,this.mode=ED.Mode.None,null!=this.selectedDoodle&&(this.selectedDoodle.isBeingDragged=!1,this.selectedDoodle.isDrawable&&(this.selectedDoodle.completeSquiggle(),this.drawAllDoodles())),this.notify("mouseout",a)},ED.Drawing.prototype.keydown=function(a){if(null!=this.selectedDoodle){switch(a.keyCode){case 8:"Label"!=this.selectedDoodle.className&&this.deleteSelectedDoodle();break;case 37:this.selectedDoodle.move(-ED.arrowDelta,0);break;case 38:this.selectedDoodle.move(0,-ED.arrowDelta);break;case 39:this.selectedDoodle.move(ED.arrowDelta,0);break;case 40:this.selectedDoodle.move(0,ED.arrowDelta)}this.repaint(),a.stopPropagation(),a.preventDefault(),this.notify("keydown",a.keyCode)}},ED.Drawing.prototype.startHoverTimer=function(a){if(this.isEditable&&null!=this.canvasTooltip){this.stopHoverTimer();var b=this;this.hoverTimer=setTimeout(function(){b.hover(a)},1e3)}},ED.Drawing.prototype.stopHoverTimer=function(){null!=this.canvasTooltip&&(clearTimeout(this.hoverTimer),this.canvasTooltip.innerHTML="",this.hideTooltip())},ED.Drawing.prototype.hover=function(a){this.showTooltip(a),this.notify("hover",a)},ED.Drawing.prototype.showTooltip=function(a){return},ED.Drawing.prototype.hideTooltip=function(){this.canvasTooltip.style.display="none"},ED.Drawing.prototype.moveToFront=function(){if(null!=this.selectedDoodle){if(this.selectedDoodle.isLocked)return;this.selectedDoodle.order=1e3,this.doodleArray.sort(function(a,b){return a.order-b.order});for(var a=0;a0,c=96;if(this.scrollValue>c||this.scrollValue<-c){this.scrollValue=0;for(var d=-1,e=0;e=0&&(b?(d++,d==this.doodleArray.length&&(d=0)):(d--,d<0&&(d=this.doodleArray.length-1)),d==this.doodleArray.length,this.doodleArray[d].isSelected=!0,this.selectedDoodle=this.doodleArray[d]),this.repaint()}},ED.Drawing.prototype.setDoodleAsSelected=function(a){for(var b=-1,c=0;c=0){var d=this.doodleArray[b];this.selectDoodle(d)}},ED.Drawing.prototype.selectDoodle=function(a){this.deselectDoodles(),a.isSelected=!0,this.selectedDoodle=a,this.lastSelectedDoodle&&this.lastSelectedDoodle.onDeselection(),this.notify("doodleSelected"),this.selectedDoodle.onSelection(),this.repaint()},ED.Drawing.prototype.isReady=function(){this.modified=!1,this.convertToImage&&this.replaceWithImage()},ED.Drawing.prototype.addDoodle=function(a,b,c){var d=this.hasDoodleOfClass(a);if(!ED.hasOwnProperty(a))return ED.errorHandler("ED.Drawing","addDoodle","Unable to find definition for subclass "+a),null;var e=new ED[a](this);if(e.isUnique&&this.hasDoodleOfClass(a))return ED.errorHandler("ED.Drawing","addDoodle","Attempt to add a second unique doodle of class "+a),null;for(var f=0;f-1&&(j=m.options[m.selectedIndex].getAttribute(l)):j=m.value;break;default:j=l?m.getAttribute(l):m.value}j==this.boundElementDeleteValueArray[k]&&(j=e[i]);var n=e.validateParameter(i,j);n.valid?(e.setParameterFromString(i,n.value),e.updateDependentParameters(i)):(j=e[i],ED.errorHandler("ED.Drawing","addDoodle","Invalid value for parameter: "+i)),e.addBinding(i,this.bindingArray[a][i]),e.setParameterFromString(i,n.value),e.updateDependentParameters(i),this.updateBindings(e)}if("undefined"!=typeof c)for(var g in c)e.addBinding(g,c[g]);return e.addAtBack?this.moveToBack():this.repaint(),this.notify("doodleAdded",e),this.selectedDoodle&&this.selectedDoodle.onSelection(),e},ED.Drawing.prototype.addBindings=function(a){this.bindingArray=a;var b=this;for(var c in a){var d=this.firstDoodleOfClass(c);for(var e in a[c]){var f=a[c][e].id,g=document.getElementById(f);g?(g.addEventListener("change",function(a){return function(c){b.hasDoodleOfClass(a)||(b.addDoodle(a),b.deselectDoodles())}}(c),!1),d&&d.addBinding(e,a[c][e])):ED.errorHandler("ED.Drawing","addBindings","Attempt to add binding for an element that does not exist for parameter: "+e+" with id "+f)}}},ED.Drawing.prototype.addDeleteValues=function(a){for(elementId in a)this.boundElementDeleteValueArray[elementId]=a[elementId]},ED.Drawing.prototype.eventHandler=function(a,b,c,d,e){switch(a){case"oninput":case"onchange":var f=this.doodleOfId(b);if(f)if(this.boundElementDeleteValueArray[d]==e)this.deleteDoodleOfId(b);else{f.drawing.isActive=!0;var g;for(var h in f.bindingArray)f.bindingArray[h].id==d&&(g=h);var i=f.validateParameter(g,e,"onchange"===a);if(i.valid){var j=!1;f.setParameterWithAnimation(g,i.value,j)}else ED.errorHandler("ED.Drawing","eventHandler","Attempt to change HTML element value to an invalid value for parameter "+g);if(e!=i.value){var k=document.getElementById(d),l=f.bindingArray[g].attribute;switch(k.type){case"checkbox":l?ED.errorHandler("ED.Drawing","eventHandler","Binding to a checkbox with a non-standard attribute not yet supported"):(console.log("setting checkbox - needs testing with a suitable doodle"),"true"==value?k.setAttribute("checked","checked"):k.removeAttribute("checked"));break;case"select-one":if(l){for(var m=0;m=0;c--)if(this.doodleArray[c].className==a){b=this.doodleArray[c];break}return b},ED.Drawing.prototype.allDoodlesOfClass=function(a){for(var b=[],c=this.doodleArray.length-1;c>=0;c--)this.doodleArray[c].className==a&&b.push(this.doodleArray[c]);return b},ED.Drawing.prototype.setParameterValueForClass=function(a,b,c){for(var d=this.doodleArray.length-1;d>=0;d--)if(this.doodleArray[d].className==c){var e=this.doodleArray[d];e.setParameterWithAnimation(a,b)}this.repaint()},ED.Drawing.prototype.doodleOfId=function(a){for(var b=!1,c=0;c=0;b--)(a||this.doodleArray[b].isDeletable)&&this.deleteDoodle(this.doodleArray[b],a)},ED.Drawing.prototype.deleteDoodlesOfClass=function(a){for(var b=this.doodleArray.length-1;b>=0;b--)this.doodleArray[b].className==a&&this.deleteDoodle(this.doodleArray[b],!1); },ED.Drawing.prototype.setParameterForDoodle=function(a,b,c){"undefined"!=typeof a[b]?a[b]=+c:a.setParameterFromString(b,c),"undefined"!=typeof this.saveToInputElement&&this.saveToInputElement(),this.repaint()},ED.Drawing.prototype.setParameterForDoodleOfClass=function(a,b,c){var d=this.firstDoodleOfClass(a);d.setParameterWithAnimation(b,c),"undefined"!=typeof this.saveToInputElement&&this.saveToInputElement(),this.repaint()},ED.Drawing.prototype.totalDegreesExtent=function(a){for(var b=0,c=0;c360&&(b=360),b},ED.Drawing.prototype.suppressReports=function(){for(var a=0;a0?("undefined"==typeof b[d.className]&&(b[d.className]={start:f,descriptions:[],end:d.groupDescriptionEnd()}),b[d.className].descriptions.push(e)):e.length&&a.push(e)}}for(var g in b){var h="";b.hasOwnProperty(g)&&(h=b[g].start,h+=ED.addAndAfterLastComma(b[g].descriptions.join(", ")),h+=b[g].end,a.push(h))}return a},ED.Drawing.prototype.report=function(){for(var a="",b=this.doodleArray,c=this.reportData(),d=0;d0){var h=e[f][1];h>a?(a=h,b.push(g)):h==a&&b.indexOf(g)<0&&b.push(g)}}return b},ED.Drawing.prototype.setEye=function(a){"Right"==a&&(this.eye=ED.eye.Right),"Left"==a&&(this.eye=ED.eye.Left),this.repaint()},ED.Drawing.prototype.clear=function(){this.canvas.width=this.canvas.width,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.translate(this.canvas.width/2,this.canvas.height/2),this.context.scale(this.scale,this.scale)},ED.Drawing.prototype.repaint=function(){if(this.clear(),"undefined"!=typeof this.image)if(this.image.width>=this.image.height){var a=1e3*this.image.height/this.image.width;this.context.drawImage(this.image,-500,-a/2,1e3,a)}else{var b=1e3*this.image.width/this.image.height;this.context.drawImage(this.image,-b/2,-500,b,1e3)}this.drawAllDoodles();for(var c=0;c=0&&(f=!0);break;case"float":ED.isNumeric(e)&&(e=parseFloat(e),e=d.range.constrain(e),e=e.toFixed(d.precision),f=!0);break;case"int":ED.isNumeric(e)&&(e=parseInt(e),e=d.range.constrain(e),e=e.toFixed(0),f=!0);break;case"mod":ED.isNumeric(e)&&(e=parseInt(e),e=d.range.constrain(e),"top"==d.clock?e==d.range.min&&(e=d.range.max):"bottom"==d.clock&&e==d.range.max&&(e=d.range.min),e=e.toFixed(0),f=!0);break;case"bool":"true"!=b&&"false"!=b||(e=b,f=!0);break;case"colourString":f=!0;break;case"freeText":f=!0,d.validate&&"function"==typeof d.validate?f=d.validate(b):void 0!==d.maxLength&&(f=b.length<=d.maxLength);break;default:ED.errorHandler("ED.Drawing","eventHandler","Illegal validation type")}}else ED.errorHandler("ED.Doodle","validateParameter","Unknown parameter name: "+a+" with value: "+b);f||(e=this.getParameter(a),ED.errorHandler("ED.Doodle","validateParameter","Validation failure for parameter: "+a+" with value: "+b)),this.showControlValidationMsg(a,f);var g=new Array;return g.valid=f,g.value=e,g},ED.Doodle.prototype.parameterControlElementId=function(a){return this.drawing.canvas.id+"_"+a+"_control"},ED.Doodle.prototype.onSelection=function(){this.drawing.showDoodleControls&&this.showDoodleControls()},ED.Doodle.prototype.onDeselection=function(){this.drawing.showDoodleControls&&this.removeDoodleControls()},ED.Doodle.prototype.getControlElements=function(){var a=[];for(var b in this.controlParameterArray)a.push(this.parameterElement(b));return a},ED.Doodle.prototype.addControlBindings=function(){for(var a in this.controlParameterArray)if(!(!a in this.parameterValidationArray))if("combo"==this.parameterValidationArray[a].type)for(var b in this.parameterValidationArray[a].list){var c=this.parameterValidationArray[a].list[b];this.addBinding(c,{id:this.parameterControlElementId(c)})}else this.addBinding(a,{id:this.parameterControlElementId(a)})},ED.Doodle.prototype.showControlValidationMsg=function(a,b){if(a in this.controlParameterArray){var c=this.parameterControlElementId(a),d=document.querySelector("[for="+c+"]");if(d){var e=d.querySelector(".validation-msg");e&&(b?e&&e.parentNode.removeChild(e):(e||(e=document.createElement("span"),d.appendChild(e),e.classList.add("validation-msg")),e.textContent="*"))}}},ED.Doodle.prototype.showDoodleControls=function(a){if(!a){var b=this.drawing.canvas.id+"_controls",a=document.getElementById(b);if(!a)return ED.errorHandler("ED.Doodle","showDoodleControls","Unable to create doodle controls: element with id "+b+" does not exist")}this.getControlElements().forEach(function(b){a.appendChild(b)}),this.addControlBindings()},ED.Doodle.prototype.removeDoodleControls=function(a){if(!a){var b=this.drawing.canvas.id+"_controls",a=document.getElementById(b);if(!a)return ED.errorHandler("ED.Doodle","removeDoodleControls","Unable to remove doodle controls: element with id "+b+" does not exist")}for(var c in this.controlParameterArray)this.removeBinding(c);for(;a.hasChildNodes();)a.removeChild(a.lastChild)},ED.Doodle.prototype.parameterElement=function(a,b){void 0===b&&(b=!0);var c;switch(this.parameterValidationArray[a].type){case"combo":c=document.createElement("span"),c.setAttribute("class","combo");for(var d in this.parameterValidationArray[a].list)c.appendChild(this.parameterElement(this.parameterValidationArray[a].list[d],!1));break;case"string":c=document.createElement("select"),c.setAttribute("id",this.parameterControlElementId(a));for(var d in this.parameterValidationArray[a].list){var e=document.createElement("option");e.innerText=this.parameterValidationArray[a].list[d],c.appendChild(e)}break;case"bool":c=document.createElement("input"),c.type="checkbox",c.setAttribute("id",this.parameterControlElementId(a));break;case"colourString":c=document.createElement("select"),c.setAttribute("id",this.parameterControlElementId(a));for(var d in this.parameterValidationArray[a].list){var e=document.createElement("option");"FF0000FF"==this.parameterValidationArray[a].list[d]?e.innerText="Red":"00FF00FF"==this.parameterValidationArray[a].list[d]?e.innerText="Green":e.innerText="Blue",e.value=this.parameterValidationArray[a].list[d],c.appendChild(e)}break;case"float":c=document.createElement("input"),c.type="text",c.setAttribute("id",this.parameterControlElementId(a));break;case"int":c=document.createElement("input"),c.type="text",c.setAttribute("id",this.parameterControlElementId(a));break;case"mod":c=document.createElement("input"),c.type="text",c.setAttribute("id",this.parameterControlElementId(a));break;case"freeText":c=document.createElement("input"),c.type="text",c.setAttribute("id",this.parameterControlElementId(a));break;default:ED.errorHandler("ED.Doodle","parameterElement","Unexpected type: "+this.parameterValidationArray[a].type+" for parameter: "+a)}var f=document.createElement("div");if(b){var g=document.createElement("label");g.innerText=this.controlParameterArray[a],g.setAttribute("for",this.parameterControlElementId(a)),f.appendChild(g)}return f.appendChild(c),f},ED.Doodle.prototype.setParameterWithAnimation=function(a,b,c){var d=this.dependentParameterValues(a,b);if(this.parameterValidationArray[a].animate&&!ED.objectIsEmpty(d))for(var e in d){var f=this.parameterValidationArray[e].delta,g=d[e]-this[e];if("rotation"==e){var h=(Math.PI-Math.abs(g))*g<0?-1:1;g*=h,g<0&&(g+=2*Math.PI),g>3.141&&this.rotation0?this.increment(e,d[e],c):(this.setSimpleParameter(e,d[e]),this.updateDependentParameters(e,c),this.drawing.repaint())}else this.setParameterFromString(a,b.toString(),c);this.drawing.notify("setParameterWithAnimationComplete")},ED.Doodle.prototype.setSimpleParameter=function(a,b){var c=new Object;c.doodle=this,c.parameter=a,c.value=b,c.oldValue=this[a],this[a]=b,this.drawing.notify("parameterChanged",c)},ED.Doodle.prototype.setParameterFromString=function(a,b,c){var d=typeof b;"string"!=d&&ED.errorHandler("ED.Doodle","setParameterFromString","_value parameter should be of type string, not "+d);var e=this.parameterValidationArray[a];if(e){switch(e.type){case"string":this[a]=b;break;case"float":this[a]=parseFloat(b);break;case"int":this[a]=parseInt(b);break;case"mod":this[a]=parseInt(b);break;case"bool":this[a]="true"==b;break;case"colourString":this[a]=b;break;case"freeText":this[a]=b;break;default:ED.errorHandler("ED.Doodle","setParameterFromString","Illegal validation type: "+e.type)}if(this.updateDependentParameters(a,c),"derived"==this.parameterValidationArray[a].kind){var f=this.dependentParameterValues(a,b);for(var g in f)this.updateDependentParameters(g,c)}var h=new Object;h.doodle=this,h.parameter=a,h.value=b,h.oldValue=this[a],this.drawing.notify("parameterChanged",h)}else ED.errorHandler("ED.Doodle","setParameterFromString","No item in parameterValidationArray corresponding to parameter: "+a);this.drawing.repaint()},ED.Doodle.prototype.setOriginWithDisplacements=function(a,b){if(this.originX=this.drawing.eye==ED.eye.Right?-a:a,this.originY=-a,this.addAtBack)var c=this.drawing.firstDoodleOfClass(this.className);else var c=this.drawing.lastDoodleOfClass(this.className);if(c){var d=c.originX-b,e=c.originY-b;this.originX=this.parameterValidationArray.originX.range.constrain(d),this.originY=this.parameterValidationArray.originY.range.constrain(e)}},ED.Doodle.prototype.setOriginWithRotations=function(a,b,c){var d=this.drawing.eye==ED.eye.Right?-1:1,e=new ED.Point(0,0);if(e.setWithPolars(a,d*b*Math.PI/180),this.addAtBack)var f=this.drawing.firstDoodleOfClass(this.className);else var f=this.drawing.lastDoodleOfClass(this.className);if(f){var g=new ED.Point(f.originX,f.originY);e.setWithPolars(a,g.direction()+d*c*Math.PI/180)}this.originX=e.x,this.originY=e.y},ED.Doodle.prototype.setRotationWithDisplacements=function(a,b){var c,d,e=this.drawing.eye==ED.eye.Right?-1:1;d=this.addAtBack?this.drawing.firstDoodleOfClass(this.className):this.drawing.lastDoodleOfClass(this.className),c=d?(180*d.rotation/Math.PI+e*b+360)%360*Math.PI/180:(e*a+360)%360*Math.PI/180,this.rotation=this.parameterValidationArray.rotation.range.constrain(c)},ED.Doodle.prototype.deselect=function(){this.isSelected=!1,this.drawing.selectedDoodle=null,this.drawing.repaint()},ED.Doodle.prototype.getParameter=function(a){var b=this.parameterValidationArray[a],c="";if(b)switch(b.type){case"string":c=this[a];break;case"float":c=this[a].toFixed(b.precision);break;case"int":c=this[a].toFixed(0);break;case"mod":c=Math.round(this[a]),"top"==b.clock?c==b.range.min&&(c=b.range.max):"bottom"==b.clock&&c==b.range.max&&(c=b.range.min),c=c.toFixed(0);break;case"bool":c=this[a].toString();break;case"colourString":c=this[a];break;case"freeText":c=this[a];break;default:ED.errorHandler("ED.Doodle","getParameter","Illegal validation type")}else ED.errorHandler("ED.Doodle","getParameter","No entry in parameterValidationArray corresponding to parameter: "+a);return c},ED.Doodle.prototype.increment=function(a,b,c){var d=this[a];this.animationDataArray[a].frameCounter++;var e=1e3/this.animationFrameRate;if(this.animationDataArray[a].frameCounter>=this.animationDataArray[a].frames)this.setSimpleParameter(a,b),this.updateDependentParameters(a,c),clearTimeout(this.animationDataArray[a].timer);else{this.setSimpleParameter(a,d+this.animationDataArray[a].delta),this.updateDependentParameters(a,c);var f=this;this.animationDataArray[a].timer=setTimeout(function(){f.increment(a,b,c)},e)}this.drawing.repaint()},ED.Doodle.prototype.addBinding=function(a,b){var c=b.id,d=b.attribute;if("undefined"!=typeof this[a]){var e=document.getElementById(c);if(null!=e){this.bindingArray[a]={id:c,attribute:d};var f,g=this.drawing,h=this.id,i=this.className;switch(e.type){case"checkbox":d?ED.errorHandler("ED.Doodle","addBinding","Binding to a checkbox with a non-standard attribute not yet supported"):(this.savedParameterArray.indexOf(a)<0?this.setParameterFromString(a,e.checked.toString()):this.drawing.updateBindings(this),e.addEventListener("change",f=function(a){g.eventHandler("onchange",h,i,this.id,this.checked.toString())},!1));break;case"select-one":d?(e.selectedIndex>-1&&this.savedParameterArray.indexOf(a)<0&&this.setParameterFromString(a,e.options[e.selectedIndex].getAttribute(d)),e.addEventListener("change",f=function(a){g.eventHandler("onchange",h,i,this.id,this.options[this.selectedIndex].getAttribute(d))},!1)):(this.savedParameterArray.indexOf(a)<0?this.setParameterFromString(a,e.value):this.drawing.updateBindings(this),e.addEventListener("change",f=function(a){g.eventHandler("onchange",h,i,this.id,this.value)},!1));break;case"text":d?ED.errorHandler("ED.Doodle","addBinding","Binding to a text field with a non-standard attribute not yet supported"):(this.savedParameterArray.indexOf(a)<0?this.setParameterFromString(a,e.value):this.drawing.updateBindings(this),e.addEventListener("change",f=function(a){g.eventHandler("onchange",h,i,this.id,this.value)},!1));break;default:d?(this.setParameterFromString(a,e.getAttribute(d)),e.addEventListener("change",f=function(a){g.eventHandler("onchange",h,i,this.id,this.getAttribute(d))},!1)):(this.setParameterFromString(a,e.value),e.addEventListener("change",f=function(a){g.eventHandler("onchange",h,i,this.id,this.value)},!1))}this.drawing.listenerArray[this.id][a]=f}else ED.errorHandler("ED.Doodle","addBinding","Failed to add binding. DOM has no element with id: "+c)}else ED.errorHandler("ED.Doodle","addBinding","Failed to add binding. Doodle of class: "+this.className+" has no parameter of name: "+a)},ED.Doodle.prototype.removeBinding=function(a){var b;for(var c in this.bindingArray)c==a&&(b=this.bindingArray[a].id);delete this.bindingArray[a];var d=document.getElementById(b);d&&d.removeEventListener("change",this.drawing.listenerArray[this.id][a],!1),delete this.drawing.listenerArray[this.id][a]},ED.Doodle.prototype.clockHour=function(a){var b,c;if(c="undefined"!=typeof a?a:0,this.isRotatable&&!this.isMoveable)b=(6*this.rotation/Math.PI+12+c)%12;else{var d=new ED.Point(0,(-100)),e=new ED.Point(this.originX,this.originY);b=(6*d.clockwiseAngleTo(e)/Math.PI+12+c)%12}return b=b.toFixed(0),0==b&&(b=12),b},ED.Doodle.prototype.quadrant=function(){var a="";return a+=this.originY<0?"supero":"infero",a+=this.drawing.eye==ED.eye.Right?this.originX<0?"temporal":"nasal":this.originX<0?"nasal":"temporal",a+=" quadrant"},ED.Doodle.prototype.degrees=function(){var a;if(this.isRotatable&&!this.isMoveable)a=(180*this.rotation/Math.PI+360)%360;else{var b=new ED.Point(0,(-100)),c=new ED.Point(this.originX,this.originY);a=(180*b.clockwiseAngleTo(c)/Math.PI+360)%360}return a=a.toFixed(0),0==a&&(a=0),a},ED.Doodle.prototype.clockHourExtent=function(a){a=void 0===a?"":" "+a;var b,c;if(this.isRotatable&&!this.isMoveable)b=(6*(this.rotation-this.arc/2)/Math.PI+12)%12,c=(6*(this.rotation+this.arc/2)/Math.PI+12)%12;else{var d=new ED.Point(0,(-100)),e=new ED.Point(this.originX,this.originY);(6*d.clockwiseAngleTo(e)/Math.PI+12)%12}return b=b.toFixed(0),0==b&&(b=12),c=c.toFixed(0),0==c&&(c=12),"from "+b+a+" to "+c+a},ED.Doodle.prototype.degreesExtent=function(){var a=180*this.arc/Math.PI,b=Math.round(a);return b},ED.Doodle.prototype.locationRelativeToDisc=function(){var a="";return this.drawing.eye==ED.eye.Right?this.originX>180&&this.originX<420&&this.originY>-120&&this.originY<120?a="at the disc":(a+=this.originY<=0?"supero":"infero",a+=this.originX<=300?"temporally":"nasally"):this.originX<-180&&this.originX>-420&&this.originY>-120&&this.originY<120?a="at the disc":(a+=this.originY<=0?"supero":"infero",a+=this.originX>=-300?"temporally":"nasally"),a},ED.Doodle.prototype.locationRelativeToFovea=function(){var a="";return this.drawing.eye==ED.eye.Right?this.originX>-10&&this.originX<10&&this.originY>-10&&this.originY<10?a="at the fovea":(a+=this.originY<=0?"supero":"infero",a+=this.originX<=0?"temporal":"nasal",a+=" to the fovea"):this.originX>-10&&this.originX<10&&this.originY>-10&&this.originY<10?a="at the fovea":(a+=this.originY<=0?"supero":"infero",a+=this.originX>=0?"temporally":"nasally",a+=" to the fovea"),a},ED.Doodle.prototype.addSquiggle=function(){var a=new ED.Colour(0,0,0,1);a.setWithHexString(this.colourString);var b;switch(this.thickness){case"Thin":b=ED.squiggleWidth.Thin;break;case"Medium":b=ED.squiggleWidth.Medium;break;case"Thick":b=ED.squiggleWidth.Thick;break;default:b=ED.squiggleWidth.Thin}var c=new ED.Squiggle(this,a,b,this.filled);this.squiggleArray.push(c)},ED.Doodle.prototype.addPointToSquiggle=function(a){if(this.squiggleArray.length>0){var b=this.squiggleArray.length-1,c=this.squiggleArray[b];c.addPoint(a)}},ED.Doodle.prototype.completeSquiggle=function(){if(this.squiggleArray.length>0){var a=this.squiggleArray.length-1,b=this.squiggleArray[a];b.complete=!0}},ED.Doodle.prototype.calculateArc=function(){var a=new ED.Point(this.leftExtremity.x-this.drawing.canvas.width/2,this.leftExtremity.y-this.drawing.canvas.height/2),b=new ED.Point(this.rightExtremity.x-this.drawing.canvas.width/2,this.rightExtremity.y-this.drawing.canvas.height/2);return a.clockwiseAngleTo(b)},ED.Doodle.prototype.nearestPointTo=function(a){if(this.pointsArray.length>0){for(var b=1e7,c=0,d=0;d0){for(var b=2*Math.PI,c=0,d=0;d0){for(var b=2*Math.PI,c=0,d=0;d0)for(var b=0;b0){a+='"squiggleArray":[';for(var e=0;e1&&(a+=",");a+="],"}return a=a+'"order":'+this.order.toFixed(0),a+="}"},ED.Doodle.prototype.drawSpot=function(a,b,c,d,e){a.save(),a.beginPath(),a.arc(b,c,d,0,2*Math.PI,!0),a.fillStyle=e,a.strokeStyle=e,a.lineWidth=0,a.fill(),a.stroke(),a.restore()},ED.Doodle.prototype.drawCircle=function(a,b,c,d,e,f,g){a.save(),a.beginPath(),a.arc(b,c,d,0,2*Math.PI,!0),a.fillStyle=e,a.fill(),a.lineWidth=f,a.strokeStyle=g,a.stroke(),a.restore()},ED.Doodle.prototype.drawLine=function(a,b,c,d,e,f,g){a.save(),a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.lineWidth=f,a.strokeStyle=g,a.stroke(),a.restore()},ED.Doodle.prototype.drawLaserSpot=function(a,b,c){this.drawCircle(a,b,c,15,"Yellow",10,"rgba(255, 128, 0, 1)")},ED.Doodle.prototype.drawNFLHaem=function(a,b,c){var d=10,e=new ED.Point(b,c),f=e.direction()+Math.PI/2,g=e.direction()+3*Math.PI/2,h=new ED.Point(0,0);h.setWithPolars(d,f);var i=new ED.Point(0,0);i.setWithPolars(d,g),a.beginPath(),a.moveTo(b+h.x,c+h.y),a.lineTo(b+i.x,c+i.y),a.lineWidth=16,a.lineCap="round",a.strokeStyle="rgba(255,0,0,0.5)",a.stroke()},ED.Doodle.prototype.addEllipseToPath=function(a,b,c,d,e){var f=.5522848,g=d/2*f,h=e/2*f;a.moveTo(-d/2,0),a.bezierCurveTo(b-d/2,c-h,b-g,c-e/2,b,c-e/2), a.bezierCurveTo(b+g,c-e/2,b+d/2,c-h,b+d/2,c),a.bezierCurveTo(b+d/2,c+h,b+g,c+e/2,b,c+e/2),a.bezierCurveTo(b-g,c+e/2,b-d/2,c+h,b-d/2,c)},ED.Doodle.prototype.xForY=function(a,b){return Math.sqrt(a*a-b*b)},ED.Doodle.prototype.setScaleLevel=function(a){var b=a/this.scaleLevel;this.adjustScaleAndPosition(b),this.scaleLevel=a},ED.Doodle.prototype.adjustScaleAndPosition=function(a){this.scaleX*=a,this.scaleY*=a,this.originX*=a,this.originY*=a,this.lastOriginX&&(this.lastOriginX*=a),this.lastOriginY&&(this.lastOriginY*=a)},ED.Doodle.prototype.getLinkedParameters=function(a){if("undefined"!=typeof this.linkedDoodleParameters[a])return this.linkedDoodleParameters[a]},ED.Doodle.prototype.debug=function(){console.log("org: "+this.originX+" : "+this.originY),console.log("apx: "+this.apexX+" : "+this.apexY),console.log("rot: "+180*this.rotation/Math.PI),console.log("arc: "+180*this.arc/Math.PI)},ED.Doodle.Handle=function(a,b,c,d){null==a?this.location=new ED.Point(0,0):this.location=a,this.isVisible=b,this.mode=c,this.isRotatable=d},ED.Report=function(a){this.drawing=a,this.breaksInAttached=0,this.breaksInDetached=0,this.largestBreakType="Not found",this.largestBreakSize=0,this.lowestBreakPosition=12,this.pvrType="None",this.pvrCClockHours=0,this.antPvrClockHours=0;var b=0,c=0,d=180,e=new Array;e.UTear="U tear",e.RoundHole="Round hole",e.Dialysis="Dialysis",e.GRT="GRT",e.MacularHole="Macular hole",e.OuterLeafBreak="Outer Leaf Break",this.rrdArray=new Array;var f,g;for(f=0;fthis.largestBreakSize&&(this.largestBreakSize=g.arc,this.largestBreakType=e[g.className]);var j=Math.abs(h-180);if(i&&j6&&(this.alpha=parseInt(a.charAt(6)+a.charAt(7),16))},ED.Colour.prototype.hexString=function(){return this.red>0?"FF0000FF":"00FF00FF"},ED.Colour.prototype.rgba=function(){return"rgba("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},ED.Colour.prototype.json=function(){return'{"red":'+this.red+',"green":'+this.green+',"blue":'+this.blue+',"alpha":'+this.alpha+"}"},ED.Point=function(a,b){this.x=Math.round(+a),this.y=Math.round(+b),this.components=[this.x,this.y,1]},ED.Point.prototype.setWithPolars=function(a,b){this.x=Math.round(a*Math.sin(b)),this.y=Math.round(-a*Math.cos(b))},ED.Point.prototype.setCoordinates=function(a,b){this.x=a,this.y=b},ED.Point.prototype.distanceTo=function(a){return Math.sqrt(Math.pow(this.x-a.x,2)+Math.pow(this.y-a.y,2))},ED.Point.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y},ED.Point.prototype.crossProduct=function(a){return this.x*a.y-this.y*a.x},ED.Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},ED.Point.prototype.direction=function(){var a=new ED.Point(0,(-100));return a.clockwiseAngleTo(this)},ED.Point.prototype.clockwiseAngleTo=function(a){var b=this.length()*a.length();if(0==b)return 0;var c=this.dotProduct(a)/b;c>1&&(c=1);var d=Math.acos(c);return this.crossProduct(a)<0?2*Math.PI-d:d},ED.Point.prototype.pointAtRadiusAndClockwiseAngle=function(a,b){var c=this.direction(),d=new ED.Point(0,0);return d.setWithPolars(a,c+b),d},ED.Point.prototype.pointAtAngleToLineToPointAtProportion=function(a,b,c){var d=new ED.Point((b.x-this.x)*c,(b.y-this.y)*c);r=d.length();var e=d.pointAtRadiusAndClockwiseAngle(r,a);return e.x+=this.x,e.y+=this.y,e},ED.Point.prototype.clockHour=function(a){var b=new ED.Point(0,(-100)),c=(6*b.clockwiseAngleTo(this)/Math.PI+12)%12;return c=c.toFixed(0),0==c&&(c=12),c},ED.Point.prototype.tangentialControlPoint=function(a){var b=this.length(),c=this.direction(),d=b/Math.cos(a),e=new ED.Point(0,0);return e.setWithPolars(d,c+a),e},ED.Point.prototype.pointAtPercentageFromPointToPoint=function(a,b){var c=(b.x-this.x)*a/100,d=(b.y-this.y)*a/100,e=new ED.Point(this.x+c,this.y+d);return e},ED.Point.prototype.bezierPointAtParameter=function(a,b,c,d){var e=a*a,f=e*a,g=1-a,h=g*g,i=h*g,j=this.x*i+3*b.x*h*a+3*c.x*g*e+d.x*f,k=this.y*i+3*b.y*h*a+3*c.y*g*e+d.y*f;return new ED.Point(j,k)},ED.Point.prototype.json=function(){return'{"x":'+this.x.toFixed(2)+',"y":'+this.y.toFixed(2)+"}"},ED.Range=function(a,b){this.min=a,this.max=b},ED.Range.prototype.setMinAndMax=function(a,b){this.min=a,this.max=b},ED.Range.prototype.isBelow=function(a){return athis.max},ED.Range.prototype.includes=function(a){return!(athis.max)},ED.Range.prototype.constrain=function(a,b){b=void 0===b?1:b;var c=this.min*b,d=this.max*b;return ad?d:a},ED.Range.prototype.includesInAngularRange=function(a,b){var c=100,d=new ED.Point(0,0),e=new ED.Point(0,0),f=new ED.Point(0,0);return b?(d.setWithPolars(c,this.min*Math.PI/180),e.setWithPolars(c,this.max*Math.PI/180),f.setWithPolars(c,a*Math.PI/180)):(d.setWithPolars(c,this.min),e.setWithPolars(c,this.max),f.setWithPolars(c,a)),d.clockwiseAngleTo(f)<=d.clockwiseAngleTo(e)},ED.Range.prototype.constrainToAngularRange=function(a,b){if(this.max-this.min<(b?360:2*Math.PI)){var c=100,d=new ED.Point(0,0),e=new ED.Point(0,0),f=new ED.Point(0,0);return b?(d.setWithPolars(c,this.min*Math.PI/180),e.setWithPolars(c,this.max*Math.PI/180),f.setWithPolars(c,a*Math.PI/180)):(d.setWithPolars(c,this.min),e.setWithPolars(c,this.max),f.setWithPolars(c,a)),d.clockwiseAngleTo(f)<=d.clockwiseAngleTo(e)?a:f.clockwiseAngleTo(d)1&&(a+=",");return a+="]",a+="}"},null==ED||"object"!=typeof ED)var ED=new Object;if(ED.Categories=new Object,ED.Categories.EntrySiteBreak={complication:"Entry site break"},ED.Categories.RetinalTouch={complication:"Retinal touch"},ED.Categories.IatrogenicBreak={complication:"Iatrogenic break"},ED.Categories.SubretinalPFCL={complication:"Subretinal PFCL"},ED.FamilyMember=function(a,b){this.className="FamilyMember",this.node=null,this.dimension=32,this.gender="Male",this.drawStub=!1,this.affected=!1,this.deceased=!1,this.isProband=!1,this.condition="",this.savedParameterArray=["gender","affected","deceased","condition"],this.controlParameterArray={gender:"Gender",affected:"Affected",deceased:"Deceased",condition:"Text"},ED.Doodle.call(this,a,b)},ED.FamilyMember.prototype=new ED.Doodle,ED.FamilyMember.prototype.constructor=ED.FamilyMember,ED.FamilyMember.superclass=ED.Doodle.prototype,ED.FamilyMember.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isRotatable=!1,this.parameterValidationArray.dimension={kind:"derived",type:"int",range:new ED.Range(0,1e3),animate:!0},this.parameterValidationArray.gender={kind:"derived",type:"string",list:["Male","Female","Unknown"],animate:!0},this.parameterValidationArray.drawStub={kind:"derived",type:"bool",display:!0},this.parameterValidationArray.affected={kind:"derived",type:"bool",display:!0},this.parameterValidationArray.deceased={kind:"derived",type:"bool",display:!0},this.parameterValidationArray.isProband={kind:"derived",type:"bool",display:!0},this.parameterValidationArray.condition={kind:"derived",type:"freeText",animate:!0}},ED.FamilyMember.prototype.setParameterDefaults=function(){},ED.FamilyMember.prototype.dependentParameterValues=function(a,b){var c=new Array;switch(a){case"gender":this.node&&(this.node.member.gender=b.charAt(0)),updateMemberSet(this.node.member.name,"gender",this.node.member.gender);break;case"affected":this.node&&(this.node.member.affected="true"==b),updateMemberSet(this.node.member.name,"affected",this.node.member.affected);break;case"deceased":this.node&&(this.node.member.deceased="true"==b),updateMemberSet(this.node.member.name,"deceased",this.node.member.deceased)}return c},ED.FamilyMember.prototype.draw=function(a){var b=this.drawing.context;switch(ED.FamilyMember.superclass.draw.call(this,a),b.beginPath(),this.gender){case"Male":b.rect(-this.dimension,-this.dimension,2*this.dimension,2*this.dimension);break;case"Female":b.arc(0,0,this.dimension,0,2*Math.PI,!0);break;case"Unknown":b.moveTo(0,-this.dimension),b.lineTo(-this.dimension,0),b.lineTo(0,this.dimension),b.lineTo(this.dimension,0),b.lineTo(0,-this.dimension)}if(b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.75)",this.affected?b.fillStyle="rgba(150,150,150,0.75)":b.fillStyle="rgba(255,255,255,0.75)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){if(this.drawStub&&(b.beginPath(),b.moveTo(0,-this.dimension),b.lineTo(0,2*-this.dimension),b.stroke()),this.deceased){var c=1.2*this.dimension;b.beginPath(),b.moveTo(-c,c),b.lineTo(c,-c),b.stroke()}if(this.isProband){var c=1.3*this.dimension,d=5;b.beginPath(),b.moveTo(-d,c),b.lineTo(d,c),b.lineTo(0,c-d),b.closePath(),b.fillStyle="rgba(150,150,150,0.75)",b.fill(),b.stroke()}b.font="24px sans-serif",b.fillStyle="rgba(100,100,100,0.75)";var e=b.measureText(this.condition).width+20;b.fillText(this.condition,-e/2+10,64)}return this.isClicked},ED.FamilyMember.prototype.setNode=function(a){this.node=a,this.node.type==PD.NodeType.Female&&(this.gender="Female"),this.node.type==PD.NodeType.Male&&(this.gender="Male"),this.node.type==PD.NodeType.Unknown&&(this.gender="Unknown"),this.isProband=this.node.member.isProband,this.affected=this.node.member.affected,this.deceased=this.node.member.deceased,this.condition=this.node.member.condition},ED.Freehand=function(a,b){this.className="Freehand",this.labelWidth=0,this.labelHeight=80,this.labelFont="60px sans-serif",this.colourString="00FF00FF",this.filled=!0,this.thickness="Thin",this.labelText="",this.savedParameterArray=["originX","originY","colourString","filled","thickness","labelText"],this.controlParameterArray={colourString:"Colour",filled:"Fill",thickness:"Thickness",labelText:"Label"},ED.Doodle.call(this,a,b)},ED.Freehand.prototype=new ED.Doodle,ED.Freehand.prototype.constructor=ED.Freehand,ED.Freehand.superclass=ED.Doodle.prototype,ED.Freehand.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!0))},ED.Freehand.prototype.setPropertyDefaults=function(){this.isDrawable=!0,this.parameterValidationArray.colourString={kind:"derived",type:"colourString",list:["FF0000FF","00FF00FF","0000FFFF"],animate:!0},this.parameterValidationArray.filled={kind:"derived",type:"bool",display:!0},this.parameterValidationArray.thickness={kind:"derived",type:"string",list:["Thin","Medium","Thick"],animate:!0},this.parameterValidationArray.labelText={kind:"derived",type:"freeText",animate:!0}},ED.Freehand.prototype.setParameterDefaults=function(){this.setOriginWithDisplacements(0,100)},ED.Freehand.prototype.draw=function(a){var b=this.drawing.context;ED.Freehand.superclass.draw.call(this,a),b.beginPath();var c=200;b.rect(-c,-c,2*c,2*c),b.closePath();var d=new ED.Colour(0,0,0,1);if(d.setWithHexString(this.colourString),b.lineWidth=2,this.isFilled=!1,b.strokeStyle="rgba(255, 255, 255, 0)",this.isSelected&&(b.strokeStyle="gray"),this.isForDrawing&&(b.strokeStyle="blue"),this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){for(var e=0;e0&&(b.font=this.labelFont,this.labelWidth=b.measureText(this.labelText).width,b.fillStyle="black",b.fillText(this.labelText,-this.labelWidth/2,this.labelHeight/6))}return this.handleArray[2].location=this.transform.transformPoint(new ED.Point(c,(-c))),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.MouseTest=function(a,b){this.className="MouseTest",ED.Doodle.call(this,a,b)},ED.MouseTest.prototype=new ED.Doodle,ED.MouseTest.prototype.constructor=ED.MouseTest,ED.MouseTest.superclass=ED.Doodle.prototype,ED.MouseTest.prototype.setPropertyDefaults=function(){this.isMoveable=!1},ED.MouseTest.prototype.draw=function(a){var b=this.drawing.context;ED.MouseTest.superclass.draw.call(this,a),b.beginPath();var c=200;return b.rect(-c/2,-c/2,c,c),b.closePath(),b.lineWidth=1,b.fillStyle="white",b.strokeStyle="blue",this.drawBoundary(a),this.isClicked&&console.log(a.x,a.y),this.drawFunctionMode==ED.drawFunctionMode.Draw,this.isClicked},ED.GraphAxes=function(a,b){this.className="GraphAxes",ED.Doodle.call(this,a,b)},ED.GraphAxes.prototype=new ED.Doodle,ED.GraphAxes.prototype.constructor=ED.GraphAxes,ED.GraphAxes.superclass=ED.Doodle.prototype,ED.GraphAxes.prototype.setPropertyDefaults=function(){this.isSelectable=!1},ED.GraphAxes.prototype.draw=function(a){var b=this.drawing.context;ED.GraphAxes.superclass.draw.call(this,a),b.beginPath();var c=400;if(b.moveTo(0,-c),b.lineTo(0,c),b.moveTo(-c,0),b.lineTo(c,0),b.moveTo(0,-c),b.closePath(),b.lineWidth=4,b.strokeStyle="gray",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){b.beginPath();for(var d=-c;d<=c;d+=100)0!=d&&(b.moveTo(-20,d),b.lineTo(20,d));for(var e=-c;e<=c;e+=100)0!=e&&(b.moveTo(e,-20),b.lineTo(e,20));b.stroke(),b.font="80px sans-serif",b.fillStyle="gray",b.textAlign="center",b.fillText("+Sph",0,-440),b.fillText("-Sph",0,480),b.fillText("+Cyl",400,-40),b.fillText("-Cyl",-400,-40)}return this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.Label=function(a,b){this.className="Label",this.labelText="",this.lastOriginX=0,this.lastOriginY=0,this.labelWidth=0,this.labelHeight=80;var c=1;a.globalScaleFactor&&(c=a.globalScaleFactor);var d=60*(1/c);this.labelFont=d.toString()+"px sans-serif",this.padding=10,this.maximumLength=20,this.isEdited=!1,this.savedParameterArray=["originX","originY","apexX","apexY","labelText","lastOriginX","lastOriginY"],this.controlParameterArray={labelText:"Text"},ED.Doodle.call(this,a,b)},ED.Label.prototype=new ED.Doodle,ED.Label.prototype.constructor=ED.Label,ED.Label.superclass=ED.Doodle.prototype,ED.Label.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.Label.prototype.setPropertyDefaults=function(){this.parameterValidationArray.apexX.range.setMinAndMax(-1e3,1e3),this.parameterValidationArray.apexY.range.setMinAndMax(-1e3,1e3),this.parameterValidationArray.labelText={kind:"derived",type:"freeText",animate:!1,validate:this.validateValue.bind(this)},this.storeOriginalParams()},ED.Label.prototype.validateValue=function(a){if(a.length=1&&(d.x=0,d.y=-this.labelHeight/2),this.apexX<=0&&c<1&&(d.x=-this.labelWidth/2,d.y=0),this.apexY>0&&c>=1&&(d.x=0,d.y=this.labelHeight/2),this.apexX>0&&c<1&&(d.x=this.labelWidth/2,d.y=0);var e=new ED.Point(this.apexX,this.apexY);b.beginPath(),b.moveTo(d.x,d.y),b.lineTo(e.x,e.y),b.strokeStyle="Gray",b.lineWidth=4,b.stroke()}return this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.Label.prototype.onSelection=function(){ED.Label.superclass.onSelection.call(this),document.getElementById(this.parameterControlElementId("labelText")).focus()},ED.MemberConnector=function(a,b){this.className="MemberConnector",this.node=null,this.length=0,this.type="Pair",ED.Doodle.call(this,a,b)},ED.MemberConnector.prototype=new ED.Doodle,ED.MemberConnector.prototype.constructor=ED.MemberConnector,ED.MemberConnector.superclass=ED.Doodle.prototype,ED.MemberConnector.prototype.setPropertyDefaults=function(){this.parameterValidationArray.length={kind:"derived",type:"int",range:new ED.Range(0,1e3),animate:!0},this.parameterValidationArray.type={kind:"derived",type:"string",list:["Pair","Sibling"],animate:!0}},ED.MemberConnector.prototype.setParameterDefaults=function(){},ED.MemberConnector.prototype.draw=function(a){var b=this.drawing.context;switch(ED.MemberConnector.superclass.draw.call(this,a),b.beginPath(),this.type){case"Pair":b.moveTo(-this.length/2,0),b.lineTo(this.length/2,0),b.moveTo(0,0),b.lineTo(0,this.length);break;case"Sibling":b.moveTo(-this.length/2,0),b.lineTo(this.length/2,0)}return b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.75)",this.drawBoundary(a),this.isClicked},ED.OperatingTable=function(a,b){this.className="OperatingTable",ED.Doodle.call(this,a,b)},ED.OperatingTable.prototype=new ED.Doodle,ED.OperatingTable.prototype.constructor=ED.OperatingTable,ED.OperatingTable.superclass=ED.Doodle.prototype,ED.OperatingTable.prototype.setPropertyDefaults=function(){this.isSelectable=!1},ED.OperatingTable.prototype.draw=function(a){var b=this.drawing.context;return ED.OperatingTable.superclass.draw.call(this,a),b.beginPath(),b.arc(0,-0,60,0,2*Math.PI,!0),b.lineWidth=30,b.strokeStyle="rgba(120,120,120,1)",b.fillStyle="rgba(220,220,220,1)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(b.beginPath(),b.rect(-100,20,200,400),b.lineWidth=8,b.strokeStyle="rgba(120,120,120,1)",b.fillStyle="rgba(220,220,220,1)",b.fill(),b.stroke()),this.isClicked},ED.Patient=function(a,b){this.className="Patient",this.recliningAngle=0,this.savedParameterArray=["rotation"],ED.Doodle.call(this,a,b)},ED.Patient.prototype=new ED.Doodle,ED.Patient.prototype.constructor=ED.Patient,ED.Patient.superclass=ED.Doodle.prototype,ED.Patient.prototype.setPropertyDefaults=function(){this.isScaleable=!1,this.isMoveable=!1,this.isDeletable=!1,this.willStaySelected=!1,this.parameterValidationArray.rotation.range=new ED.Range(270*Math.PI/180,360*Math.PI/180),this.parameterValidationArray.recliningAngle={kind:"derived",type:"mod",range:new ED.Range(0,91),clock:"bottom",animate:!0}},ED.Patient.prototype.setParameterDefaults=function(){this.scaleX=.65,this.scaleY=.7,this.recliningAngle=0},ED.Patient.prototype.dependentParameterValues=function(a,b){var c=new Array;switch(a){case"rotation":var d=360-180*b/Math.PI;d>300&&(d=0),d>90&&(d=90),c.recliningAngle=d;break;case"recliningAngle":var d=(360-b)*Math.PI/180;c.rotation=d}return c},ED.Patient.prototype.draw=function(a){var b=this.drawing.context;ED.Patient.superclass.draw.call(this,a),b.beginPath(),b.moveTo(-642,41),b.bezierCurveTo(-653,-91,-522,-146,-496,-148),b.bezierCurveTo(-470,-150,-221,-159,-199,-166),b.bezierCurveTo(-177,-174,-168,-201,-126,-221),b.bezierCurveTo(-95,-232,-71,-223,-54,-214),b.bezierCurveTo(-38,-205,-32,-170,-16,-168),b.bezierCurveTo(1,-166,21,-184,37,-166),b.bezierCurveTo(54,-148,21,-137,36,-126),b.bezierCurveTo(50,-115,58,-130,83,-122),b.bezierCurveTo(109,-115,169,-91,190,-82),b.bezierCurveTo(210,-73,232,-64,270,-67),b.bezierCurveTo(309,-71,301,-87,318,-106),b.bezierCurveTo(334,-124,316,-130,343,-155),b.bezierCurveTo(362,-170,395,-166,395,-166),b.lineTo(406,-177),b.lineTo(420,-168),b.lineTo(441,-175),b.bezierCurveTo(441,-175,441,-201,453,-203),b.bezierCurveTo(466,-205,492,-170,510,-168),b.bezierCurveTo(529,-166,508,-181,538,-181),b.bezierCurveTo(567,-181,617,-150,640,-137),b.bezierCurveTo(662,-108,651,-120,662,-90),b.bezierCurveTo(673,-60,677,-16,666,12),b.bezierCurveTo(655,39,642,52,618,61),b.bezierCurveTo(595,70,529,74,549,74),b.bezierCurveTo(569,74,442,74,463,72),b.bezierCurveTo(371,79,389,78,365,100),b.bezierCurveTo(342,122,354,158,336,191),b.bezierCurveTo(318,224,305,228,266,253),b.bezierCurveTo(125,279,-56,336,-106,296),b.bezierCurveTo(-122,270,-118,266,-139,224),b.bezierCurveTo(-175,221,-357,234,-446,236),b.bezierCurveTo(-536,239,-631,173,-642,41),b.closePath(),b.lineWidth=4,b.strokeStyle="rgba(120,120,120,1)";var c=new ED.Colour(0,0,0,1);return c.setWithHexString("3AFEFA"),b.fillStyle=c.rgba(),this.drawBoundary(a),this.isClicked},ED.Signature=function(a,b){this.className="Signature",this.colourString="00FF00FF",this.savedParameterArray=[],ED.Doodle.call(this,a,b)},ED.Signature.prototype=new ED.Doodle,ED.Signature.prototype.constructor=ED.Signature,ED.Signature.superclass=ED.Doodle.prototype,ED.Signature.prototype.setHandles=function(){},ED.Signature.prototype.setPropertyDefaults=function(){this.isDrawable=!0,this.isMoveable=!1,this.isRotatable=!1,this.isFilled=!1},ED.Signature.prototype.setParameterDefaults=function(){},ED.Signature.prototype.draw=function(a){var b=this.drawing.context;ED.Signature.superclass.draw.call(this,a),b.beginPath();var c=this.drawing.canvas.height/this.drawing.scale*.99,d=this.drawing.canvas.width/this.drawing.scale*.99,e=d/2,f=c/2;if(b.rect(-e,-f,d,c),b.closePath(),b.lineWidth=2,b.strokeStyle="rgba(255, 255, 255, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var g=40,h=parseInt(.85*d/g);b.beginPath(),b.moveTo(.85*-e,.75*f-40),b.lineTo(.85*-e+50,.75*f+10),b.moveTo(.85*-e,.75*f+10),b.lineTo(.85*-e+50,.75*f-40);for(var i=2;i0?c.sphereSign="-":b<0?c.sphereSign="+":c.sphereSign="=",c.sphereInteger=Math.floor(Math.abs(b/20));var d=Math.abs(b/20)-Math.floor(Math.abs(b/20));0==d&&(c.sphereFractional=".00"),.25==d&&(c.sphereFractional=".25"),.5==d&&(c.sphereFractional=".50"), @@ -12,7 +12,7 @@ kind:"derived",type:"string",list:["Mild","Moderate","Severe"],animate:!1},this. qa.EP=new ED.Point(-120+120*W/100,380-this.originY)):(pa.SP=new ED.Point((-320),-0-this.originY),pa.CP1=new ED.Point((-320),160-this.originY),pa.CP2=new ED.Point((-240),260-this.originY),pa.EP=new ED.Point((-120),380-this.originY),qa.SP=new ED.Point(-320+100*W/100,-0-this.originY),qa.CP1=new ED.Point(-320+100*W/100,160-this.originY),qa.CP2=new ED.Point(-240+160*W/100,260-this.originY),qa.EP=new ED.Point(-120+120*W/100,380-this.originY)),ra>0){var ba=new ED.Point(0,0);ba.y=(1-ra)*(1-ra)*(1-ra)*pa.SP.y+3*(1-ra)*(1-ra)*ra*pa.CP1.y+3*(1-ra)*ra*ra*pa.CP2.y+ra*ra*ra*pa.EP.y,ba.x=(1-ra)*(1-ra)*(1-ra)*pa.SP.x+3*(1-ra)*(1-ra)*ra*pa.CP1.x+3*(1-ra)*ra*ra*pa.CP2.x+ra*ra*ra*pa.EP.x;var va=new ED.Point(0,0);va.x=pa.CP1.x+ra*(pa.CP2.x-pa.CP1.x),va.y=pa.CP1.y+ra*(pa.CP2.y-pa.CP1.y);var wa=new ED.Point(0,0);wa.x=pa.CP2.x+ra*(pa.EP.x-pa.CP2.x),wa.y=pa.CP2.y+ra*(pa.EP.y-pa.CP2.y);var xa=new ED.Point(0,0);xa.x=va.x+ra*(wa.x-va.x),xa.y=va.y+ra*(wa.y-va.y),pa.SP=ba,pa.CP1=xa,pa.CP2=wa}if(ta>0){var fa=new ED.Point(0,0);fa.y=(1-ta)*(1-ta)*(1-ta)*qa.SP.y+3*(1-ta)*(1-ta)*ta*qa.CP1.y+3*(1-ta)*ta*ta*qa.CP2.y+ta*ta*ta*qa.EP.y,fa.x=(1-ta)*(1-ta)*(1-ta)*qa.SP.x+3*(1-ta)*(1-ta)*ta*qa.CP1.x+3*(1-ta)*ta*ta*qa.CP2.x+ta*ta*ta*qa.EP.x;var ya=new ED.Point(0,0);ya.x=qa.CP1.x+ta*(qa.CP2.x-qa.CP1.x),ya.y=qa.CP1.y+ta*(qa.CP2.y-qa.CP1.y);var za=new ED.Point(0,0);za.x=qa.CP2.x+ta*(qa.EP.x-qa.CP2.x),za.y=qa.CP2.y+ta*(qa.EP.y-qa.CP2.y);var Aa=new ED.Point(0,0);Aa.x=ya.x+ta*(za.x-ya.x),Aa.y=ya.y+ta*(za.y-ya.y),qa.SP=fa,qa.CP1=Aa,qa.CP2=za}if(sa<1){var Ba=new ED.Point(0,0);Ba.y=(1-sa)*(1-sa)*(1-sa)*pa.SP.y+3*(1-sa)*(1-sa)*sa*pa.CP1.y+3*(1-sa)*sa*sa*pa.CP2.y+sa*sa*sa*pa.EP.y,Ba.x=(1-sa)*(1-sa)*(1-sa)*pa.SP.x+3*(1-sa)*(1-sa)*sa*pa.CP1.x+3*(1-sa)*sa*sa*pa.CP2.x+sa*sa*sa*pa.EP.x;var Ca=new ED.Point(0,0);Ca.x=pa.SP.x+sa*(pa.CP1.x-pa.SP.x),Ca.y=pa.SP.y+sa*(pa.CP1.y-pa.SP.y);var va=new ED.Point(0,0);va.x=pa.CP1.x+sa*(pa.CP2.x-pa.CP1.x),va.y=pa.CP1.y+sa*(pa.CP2.y-pa.CP1.y);var Da=new ED.Point(0,0);Da.x=Ca.x+sa*(va.x-Ca.x),Da.y=Ca.y+sa*(va.y-Ca.y),pa.CP1=Ca,pa.CP2=Da,pa.EP=Ba;var Ea=new ED.Point(0,0);Ea.y=(1-ua)*(1-ua)*(1-ua)*qa.SP.y+3*(1-ua)*(1-ua)*ua*qa.CP1.y+3*(1-ua)*ua*ua*qa.CP2.y+ua*ua*ua*qa.EP.y,Ea.x=(1-ua)*(1-ua)*(1-ua)*qa.SP.x+3*(1-ua)*(1-ua)*ua*qa.CP1.x+3*(1-ua)*ua*ua*qa.CP2.x+ua*ua*ua*qa.EP.x;var Fa=new ED.Point(0,0);Fa.x=qa.SP.x+ua*(qa.CP1.x-qa.SP.x),Fa.y=qa.SP.y+ua*(qa.CP1.y-qa.SP.y);var ya=new ED.Point(0,0);ya.x=qa.CP1.x+ua*(qa.CP2.x-qa.CP1.x),ya.y=qa.CP1.y+ua*(qa.CP2.y-qa.CP1.y);var Ga=new ED.Point(0,0);Ga.x=Fa.x+ua*(ya.x-Fa.x),Ga.y=Fa.y+ua*(ya.y-Fa.y),qa.CP1=Fa,qa.CP2=Ga,qa.EP=Ea}}b.beginPath(),pa&&(b.moveTo(qa.EP.x,qa.EP.y),b.bezierCurveTo(qa.CP2.x,qa.CP2.y,qa.CP1.x,qa.CP1.y,qa.SP.x,qa.SP.y)),Y&&Y.EP.y>=Y.SP.y?(b.moveTo(Y.EP.x,Y.EP.y),b.bezierCurveTo(Y.CP2.x,Y.CP2.y,Y.CP1.x,Y.CP1.y,Y.SP.x,Y.SP.y),b.lineTo(X.SP.x,X.SP.y),b.bezierCurveTo(X.CP1.x,X.CP1.y,X.CP2.x,X.CP2.y,X.EP.x,X.EP.y)):X&&(b.lineTo(X.SP.x,X.SP.y),b.bezierCurveTo(X.CP1.x,X.CP1.y,X.CP2.x,X.CP2.y,X.EP.x,X.EP.y)),pa&&(b.lineTo(pa.SP.x,pa.SP.y),b.bezierCurveTo(pa.CP1.x,pa.CP1.y,pa.CP2.x,pa.CP2.y,pa.EP.x,pa.EP.y)),qa&&qa.EP.y>=qa.SP.y?b.lineTo(qa.EP.x,qa.EP.y):b.lineTo(Y.EP.x,Y.EP.y),b.fillStyle="rgba(0,0,0,0.2)",b.fill(),b.beginPath(),A&&(b.moveTo(B.EP.x,B.EP.y),b.bezierCurveTo(B.CP2.x,B.CP2.y,B.CP1.x,B.CP1.y,B.SP.x,B.SP.y),b.lineTo(A.SP.x,A.SP.y),b.bezierCurveTo(A.CP1.x,A.CP1.y,A.CP2.x,A.CP2.y,A.EP.x,A.EP.y)),i&&(b.moveTo(j.EP.x,j.EP.y),b.bezierCurveTo(j.CP2.x,j.CP2.y,j.CP1.x,j.CP1.y,j.SP.x,j.SP.y),b.lineTo(i.SP.x,i.SP.y),b.bezierCurveTo(i.CP1.x,i.CP1.y,i.CP2.x,i.CP2.y,i.EP.x,i.EP.y)),b.fillStyle="gray",b.fill()}return this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.CornealPigmentation=function(a,b){this.className="CornealPigmentation",this.savedParameterArray=["originX","originY","apexY","apexX","scaleX","scaleY","rotation","level","type"],this.controlParameterArray={level:"Level",type:"Type"},ED.Doodle.call(this,a,b)},ED.CornealPigmentation.prototype=new ED.Doodle,ED.CornealPigmentation.prototype.constructor=ED.CornealPigmentation,ED.CornealPigmentation.superclass=ED.Doodle.prototype,ED.CornealPigmentation.prototype.setHandles=function(){this.handleArray[0]=new ED.Doodle.Handle(null,(!0),ED.Mode.Handles,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1)),this.handleArray[4].isRotatable=!0},ED.CornealPigmentation.prototype.setPropertyDefaults=function(){this.isSqueezable=!0,this.parameterValidationArray.apexX.range.setMinAndMax(-400,400),this.parameterValidationArray.apexY.range.setMinAndMax(-400,400),this.parameterValidationArray.level={kind:"derived",type:"string",list:["Endothelium","Epithelial","Subepithelial","Anterior stromal","Mid stromal","Posterior stromal","Descemet's"],animate:!0},this.parameterValidationArray.type={kind:"derived",type:"string",list:["Iron","Melanin","Blood","Copper","Lead","Organic","Unknown"],animate:!0},this.handleVectorRangeArray=new Array;var a=new Object;a.length=new ED.Range(1,150),a.angle=new ED.Range(.5*Math.PI,.5*Math.PI),this.handleVectorRangeArray[0]=a},ED.CornealPigmentation.prototype.setParameterDefaults=function(){this.setParameterFromString("level","Endothelium"),this.setParameterFromString("type","Melanin"),this.apexY=-150,this.apexX=30;var a=new ED.Squiggle(this,new ED.Colour(100,100,100,1),4,(!0));this.squiggleArray.push(a);var b=new ED.Point(40,0);this.addPointToSquiggle(b)},ED.CornealPigmentation.prototype.draw=function(a){var b=this.drawing.context;if(ED.CornealPigmentation.superclass.draw.call(this,a),b.beginPath(),b.ellipse(0,0,Math.abs(this.apexY),Math.abs(this.apexX),.5*Math.PI,0,2*Math.PI),b.lineWidth=1,b.strokeStyle="rgba(0, 0, 0, 0)",b.fillStyle="rgba(0,0,0,0)",this.drawBoundary(a),this.handleArray[0].location=this.transform.transformPoint(this.squiggleArray[0].pointsArray[0]),this.drawFunctionMode==ED.drawFunctionMode.Draw){for(var c="brown",d=this.squiggleArray[0].pointsArray[0].x,e=2,f=Math.PI*Math.abs(this.apexX*this.apexY),g=f/250*(d/30),h=new ED.Point(0,0),i=0;i-100&&(a="Moderate numbers of "),this.apexY>-50&&(a="Several "),a+this.drusenType.toLowerCase()+" drusen"},ED.EncirclingBand=function(a,b){this.className="EncirclingBand",this.savedParameterArray=["rotation"],ED.Doodle.call(this,a,b)},ED.EncirclingBand.prototype=new ED.Doodle,ED.EncirclingBand.prototype.constructor=ED.EncirclingBand,ED.EncirclingBand.superclass=ED.Doodle.prototype,ED.EncirclingBand.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.addAtBack=!0,this.isUnique=!0},ED.EncirclingBand.prototype.setParameterDefaults=function(){this.rotation=-45*Math.PI/180},ED.EncirclingBand.prototype.draw=function(a){var b=this.drawing.context;ED.EncirclingBand.superclass.draw.call(this,a);var c=270,d=this.drawing.lastDoodleOfClass("CircumferentialBuckle");if(d){var e=d.apexY;-350>e&&e>-380?c=286:e<-380&&(c=315)}var f=c+15,g=c-15;if(b.beginPath(),b.arc(0,0,f,0,2*Math.PI,!0),b.arc(0,0,g,2*Math.PI,0,!1),b.closePath(),b.lineWidth=4,b.fillStyle="rgba(200,200,200,0.75)",b.strokeStyle="gray",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){b.beginPath();var h=Math.PI/16;b.arc(0,0,f+10,h,-h,!0),b.arc(0,0,g-10,-h,h,!1),b.closePath(),b.lineWidth=6,b.stroke()}return this.isClicked},ED.EncirclingBand.prototype.description=function(){var a="Encircling band, with Watzke in ";if(this.drawing.eye==ED.eye.Right)var b=!0;else var b=!1;var c=this.rotation+Math.PI/2;return a+=Math.cos(c)>0?"supero":"infero",a+=Math.sin(c)>0?b?"nasal":"temporal":b?"temporal":"nasal",a+=" quadrant"},ED.EntrySiteBreak=function(a,b){this.className="EntrySiteBreak",this.savedParameterArray=["arc","rotation"],ED.Doodle.call(this,a,b)},ED.EntrySiteBreak.prototype=new ED.Doodle,ED.EntrySiteBreak.prototype.constructor=ED.EntrySiteBreak,ED.EntrySiteBreak.superclass=ED.Doodle.prototype,ED.EntrySiteBreak.prototype.setHandles=function(){this.handleArray[0]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1)),this.handleArray[3]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1))},ED.EntrySiteBreak.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isArcSymmetrical=!0,this.parameterValidationArray.arc.range.setMinAndMax(Math.PI/16,3*Math.PI/16)},ED.EntrySiteBreak.prototype.setParameterDefaults=function(){this.arc=Math.PI/8,this.setRotationWithDisplacements(60,-120)},ED.EntrySiteBreak.prototype.draw=function(a){var b=this.drawing.context;ED.EntrySiteBreak.superclass.draw.call(this,a);var c=460,d=400,e=this.arc/2,f=-Math.PI/2+e,g=-Math.PI/2-e,h=c*Math.sin(e),i=-c*Math.cos(e),j=-c*Math.sin(e),k=i;return b.beginPath(),b.arc(0,0,c,f,g,!0),b.bezierCurveTo(0,-d,0,-d,h,i),b.lineWidth=4,b.fillStyle="red",b.strokeStyle="blue",this.drawBoundary(a),this.handleArray[0].location=this.transform.transformPoint(new ED.Point(j,k)),this.handleArray[3].location=this.transform.transformPoint(new ED.Point(h,i)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.EpiretinalMembrane=function(a,b){this.className="EpiretinalMembrane",this.savedParameterArray=["originX","originY","scaleX","scaleY","rotation"],ED.Doodle.call(this,a,b)},ED.EpiretinalMembrane.prototype=new ED.Doodle,ED.EpiretinalMembrane.prototype.constructor=ED.EpiretinalMembrane,ED.EpiretinalMembrane.superclass=ED.Doodle.prototype,ED.EpiretinalMembrane.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!0))},ED.EpiretinalMembrane.prototype.setPropertyDefaults=function(){this.isSqueezable=!0,this.parameterValidationArray.scaleX.range.setMinAndMax(.5,1.5),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,1.5)},ED.EpiretinalMembrane.prototype.setParameterDefaults=function(){this.drawing.hasDoodleOfClass("Fundus")&&(this.scaleX=.5,this.scaleY=this.scaleX,this.originX=this.drawing.eye==ED.eye.Right?-100:100)},ED.EpiretinalMembrane.prototype.draw=function(a){var b=this.drawing.context;ED.EpiretinalMembrane.superclass.draw.call(this,a),b.beginPath();var c=120;if(b.arc(0,0,c,0,2*Math.PI,!0),b.closePath(),b.lineWidth=0,b.fillStyle="rgba(0, 0, 0, 0)",b.strokeStyle="rgba(0, 0, 0, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){b.strokeStyle="rgba(0, 255, 0, 0.7)",b.beginPath(),b.moveTo(-c,0),b.lineTo(c,0);var d=.9*c,e=-c/2,f=.3;b.moveTo(-d,e),b.bezierCurveTo(-d*f,e*f,d*f,e*f,d,e),e=c/2,b.moveTo(-d,e),b.bezierCurveTo(-d*f,e*f,d*f,e*f,d,e),d=.6*c,e=.8*-c,f=.5,b.moveTo(-d,e),b.bezierCurveTo(-d*f,e*f,d*f,e*f,d,e),e=.8*c,b.moveTo(-d,e),b.bezierCurveTo(-d*f,e*f,d*f,e*f,d,e),b.lineWidth=18,b.lineCap="round",b.stroke()}return this.handleArray[2].location=this.transform.transformPoint(new ED.Point(.7*c,.7*-c)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.EpiretinalMembrane.prototype.description=function(){var a="Epiretinal membrane";return a},ED.EpiretinalMembrane.prototype.snomedCode=function(){return 367649002},ED.EpiretinalMembrane.prototype.diagnosticHierarchy=function(){return 2},ED.Episcleritis=function(a,b){this.className="Episcleritis",this.severity="Medium",this.savedParameterArray=["arc","rotation","severity"],this.controlParameterArray={severity:"Severity"},ED.Doodle.call(this,a,b)},ED.Episcleritis.prototype=new ED.Doodle,ED.Episcleritis.prototype.constructor=ED.Episcleritis,ED.Episcleritis.superclass=ED.Doodle.prototype,ED.Episcleritis.prototype.setHandles=function(){this.handleArray[0]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1)),this.handleArray[3]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1))},ED.Episcleritis.prototype.setPropertyDefaults=function(){this.isScaleable=!1,this.isMoveable=!1,this.isRotatable=!0,this.isArcSymmetrical=!0,this.parameterValidationArray.arc.range.setMinAndMax(20*Math.PI/180,2*Math.PI),this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-334,-300),this.parameterValidationArray.radius.range.setMinAndMax(250,450),this.parameterValidationArray.severity={kind:"other",type:"string",list:["Severe","Medium","Mild"],animate:!1}},ED.Episcleritis.prototype.setParameterDefaults=function(){this.arc=20*Math.PI/180,this.setRotationWithDisplacements(90,-90);var a=this.drawing.lastDoodleOfClass(this.className);a&&(this.arc=a.arc,this.severity=a.severity)},ED.Episcleritis.prototype.draw=function(a){var b=this.drawing.context;ED.Episcleritis.superclass.draw.call(this,a);var c=495,d=420,e=d+(c-d)/2,f=this.arc/2,g=(-Math.PI/2+f,-Math.PI/2-f),h=e*Math.sin(f),i=-e*Math.cos(f),j=-e*Math.sin(f),k=i;if(b.beginPath(),b.arc(0,0,c,-Math.PI/2+f,-Math.PI/2-f,!0),b.arc(0,0,d,-Math.PI/2-f,-Math.PI/2+f,!1),b.closePath(),b.fillStyle="rgba(218,230,241,0)",b.lineWidth=4,b.strokeStyle="rgba(218,230,241,0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var l=120,m=2*Math.PI/l,n=Math.floor(this.arc/m),o=new ED.Point(0,0),p=new ED.Point(0,0);b.beginPath();for(var q=0;q0?"supero":"infero",a+=Math.sin(this.rotation)>0?this.drawing.eye==ED.eye.Right?"nasally":"temporally":this.drawing.eye==ED.eye.Right?"temporally":"nasally"),a},ED.Episcleritis.prototype.drawSoftLine=function(a,b,c,d,e,f,g,h,i){var j=this.drawing.context,k=c-a,l=d-b,m=Math.sqrt(k*k+l*l),n=k/m*e,o=l/m*e,p=j.createLinearGradient(a-o/2,b+n/2,a+o/2,b-n/2);p.addColorStop(0,"rgba("+f+","+g+","+h+",0)"),p.addColorStop(.43,"rgba("+f+","+g+","+h+","+i+")"),p.addColorStop(.57,"rgba("+f+","+g+","+h+","+i+")"),p.addColorStop(1,"rgba("+f+","+g+","+h+",0)"),j.save(),j.beginPath(),j.lineWidth=e,j.strokeStyle=p,j.moveTo(a,b),j.lineTo(c,d),j.stroke(),j.restore()},ED.Episcleritis.prototype.snomedCode=function(){"use strict";return 815008},ED.Eyeball=function(a,b){this.className="Eyeball",ED.Doodle.call(this,a,b)},ED.Eyeball.prototype=new ED.Doodle,ED.Eyeball.prototype.constructor=ED.Eyeball,ED.Eyeball.superclass=ED.Doodle.prototype,ED.Eyeball.prototype.setHandles=function(){},ED.Eyeball.prototype.setPropertyDefaults=function(){this.isSelectable=!1,this.isFilled=!1},ED.Eyeball.prototype.setParameterDefaults=function(){this.isDeletable=!1,this.isMoveable=!1,this.isScalable=!1,this.isRotatable=!1,this.isShowHighlight=!1},ED.Eyeball.prototype.draw=function(a){var b=this.drawing.context;ED.Eyeball.superclass.draw.call(this,a);var c=250;if(b.beginPath(),b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.closePath(),b.lineWidth=4,b.strokeStyle="black",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var d=120;b.beginPath(),b.moveTo(0+d,0),b.arc(0,0,d,0,2*Math.PI),b.fillStyle="gray",b.fill(),b.stroke(),b.closePath();var e=45;b.beginPath(),b.moveTo(0+e,0),b.arc(0,0,e,0,2*Math.PI),b.fillStyle="black",b.stroke(),b.fill(),b.closePath()}return this.isClicked},ED.FibrousProliferation=function(a,b){this.className="FibrousProliferation",this.savedParameterArray=["originX","originY","scaleX","scaleY","rotation"],ED.Doodle.call(this,a,b)},ED.FibrousProliferation.prototype=new ED.Doodle,ED.FibrousProliferation.prototype.constructor=ED.FibrousProliferation,ED.FibrousProliferation.superclass=ED.Doodle.prototype,ED.FibrousProliferation.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!0))},ED.FibrousProliferation.prototype.setPropertyDefaults=function(){this.isSqueezable=!0,this.parameterValidationArray.scaleX.range.setMinAndMax(.5,2),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,2)},ED.FibrousProliferation.prototype.setParameterDefaults=function(){this.setOriginWithDisplacements(-200,150),this.rotation=this.drawing.eye==ED.eye.Right?-Math.PI/4:Math.PI/4},ED.FibrousProliferation.prototype.draw=function(a){var b=this.drawing.context;ED.FibrousProliferation.superclass.draw.call(this,a);var c=180,d=70,e=.6*c,f=.2*d;return b.beginPath(),b.moveTo(-c,-d),b.bezierCurveTo(-e,-f,e,-f,c,-d),b.bezierCurveTo(e,-f,e,f,c,d),b.bezierCurveTo(e,f,-e,f,-c,d),b.bezierCurveTo(-e,f,-e,-f,-c,-d),b.closePath(),b.lineWidth=1,b.strokeStyle="rgba(120,120,120,0.5)",b.fillStyle="rgba(120,120,120,0.5)",this.drawBoundary(a),this.handleArray[2].location=this.transform.transformPoint(new ED.Point(c,(-d))),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.FibrousProliferation.prototype.description=function(){return"Fibrous proliferation"},ED.FibrovascularScar=function(a,b){this.className="FibrovascularScar",this.savedParameterArray=["originX","originY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.FibrovascularScar.prototype=new ED.Doodle,ED.FibrovascularScar.prototype.constructor=ED.FibrovascularScar,ED.FibrovascularScar.superclass=ED.Doodle.prototype,ED.FibrovascularScar.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.FibrovascularScar.prototype.setPropertyDefaults=function(){this.isRotatable=!1,this.parameterValidationArray.scaleX.range.setMinAndMax(.5,2),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,2)},ED.FibrovascularScar.prototype.setParameterDefaults=function(){this.setOriginWithDisplacements(0,-100)},ED.FibrovascularScar.prototype.draw=function(a){var b=this.drawing.context;ED.FibrovascularScar.superclass.draw.call(this,a),b.beginPath();var c=80,d=16,e=2*Math.PI/d,f=.5*Math.PI/d,g=4,h=new ED.Point(0,0),i=new ED.Point(0,0);i.setWithPolars(c,0),b.moveTo(i.x,i.y);for(var j=c,k=0;k-100&&(a="Moderate numbers of "),this.apexY>-50&&(a="Several "),a+"hard drusen"},ED.HardExudate=function(a,b){this.className="HardExudate",this.savedParameterArray=["originX","originY"],ED.Doodle.call(this,a,b)},ED.HardExudate.prototype=new ED.Doodle,ED.HardExudate.prototype.constructor=ED.HardExudate,ED.HardExudate.superclass=ED.Doodle.prototype,ED.HardExudate.prototype.setParameterDefaults=function(){this.setOriginWithDisplacements(50,30)},ED.HardExudate.prototype.draw=function(a){var b=this.drawing.context;ED.HardExudate.superclass.draw.call(this,a);var c=14;return b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.lineWidth=1,b.strokeStyle="rgba(220,220,0,1)",b.fillStyle="rgba(220,220,0,1)",this.drawBoundary(a),this.isClicked},ED.HardExudate.prototype.groupDescription=function(){return"Hard exudates"},ED.HVT=function(a,b){this.className="HVT",this.hor="None",this.ver="None",this.tor="None",this.horValue=0,this.verValue=0,this.torValue=0,ED.Doodle.call(this,a,b)},ED.HVT.prototype=new ED.Doodle,ED.HVT.prototype.constructor=ED.HVT,ED.HVT.superclass=ED.Doodle.prototype,ED.HVT.prototype.setHandles=function(){this.handleArray[1]=new ED.Doodle.Handle(null,(!0),ED.Mode.Rotate,(!1))},ED.HVT.prototype.setPropertyDefaults=function(){this.isDeletable=!1,this.isShowHighlight=!1,this.parameterValidationArray.originX.range=new ED.Range((-350),(-150)),this.parameterValidationArray.originY.range=new ED.Range((-100),100),this.parameterValidationArray.rotation.range=new ED.Range(0,Math.PI/2),this.parameterValidationArray.hor={kind:"derived",type:"string",list:["XT","None","ET"],animate:!0},this.parameterValidationArray.ver={kind:"derived",type:"string",list:["R/L","None","L/R"],animate:!0},this.parameterValidationArray.tor={kind:"derived",type:"string",list:["Excyclotorsion","None","Incyclotorsion"],animate:!0},this.parameterValidationArray.horValue={kind:"derived",type:"int",range:new ED.Range(0,50),animate:!0},this.parameterValidationArray.verValue={kind:"derived",type:"int",range:new ED.Range(0,50),animate:!0},this.parameterValidationArray.torValue={kind:"derived",type:"int",range:new ED.Range(0,20),animate:!0}},ED.HVT.prototype.setParameterDefaults=function(){},ED.HVT.prototype.dependentParameterValues=function(a,b){var c=new Array,d=-250;switch(a){case"originX":var e=20;bd+e?c.hor="ET":c.hor="None",c.horValue=Math.abs(Math.round((d-b)/2));break;case"originY":var e=20;b<0-e?c.ver="R/L":b>0+e?c.ver="L/R":c.ver="None",c.verValue=Math.abs(Math.round(-b/2));break;case"rotation":var e=Math.PI/16;bMath.PI/4+e?c.tor="Incyclotorsion":c.tor="None",c.torValue=Math.abs(Math.round(80*(b-Math.PI/4)/Math.PI));break;case"hor":switch(b){case"XT":c.originX=d-100;break;case"ET":c.originX=d+100;break;default:c.originX=d}break;case"ver":switch(b){case"R/L":c.originY=-100;break;case"L/R":c.originY=100;break;default:c.originY=0}break;case"tor":switch(b){case"Excyclotorsion":c.rotation=0;break;case"Incyclotorsion":c.rotation=Math.PI/2;break;default:c.rotation=Math.PI/4}break;case"horValue":switch(this.hor){case"XT":c.originX=d-2*b;break;case"None":c.originX=d;break;case"ET":c.originX=d+2*b}break;case"verValue":switch(this.ver){case"R/L":c.originY=2*-b;break;case"None":c.originY=Math.PI/4;break;case"L/R":c.originY=2*b}break;case"torValue":switch(this.tor){case"Excyclotorsion":c.rotation=-b*Math.PI/80+Math.PI/4;break;case"None":c.rotation=Math.PI/4;break;case"Incyclotorsion":c.rotation=b*Math.PI/80+Math.PI/4}}return c},ED.HVT.prototype.draw=function(a){var b=this.drawing.context;ED.HVT.superclass.draw.call(this,a);var c=125,d=40,e=1.75*Math.PI,f=new ED.Point(0,0);if(b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.moveTo(d,0),b.arc(0,0,d,2*Math.PI,0,!1),b.lineWidth=4,b.fillStyle=b.fillStyle="rgba(100, 200, 250, 0.5)",b.strokeStyle="gray",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var g=5;b.beginPath(),f.setWithPolars(c-g,e),b.moveTo(f.x,f.y),f.setWithPolars(d+g,e),b.lineTo(f.x,f.y),f.setWithPolars(-c+g,e),b.moveTo(f.x,f.y),f.setWithPolars(-d-g,e),b.lineTo(f.x,f.y),b.lineWidth=20,this.originX>0?b.strokeStyle="rgba(255, 0, 0, 0.8)":b.strokeStyle="rgba(0, 155, 0, 0.8)",b.stroke()}return f.setWithPolars(c,e),this.handleArray[1].location=this.transform.transformPoint(f),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.HVTGrid=function(a,b){this.className="HVTGrid",ED.Doodle.call(this,a,b)},ED.HVTGrid.prototype=new ED.Doodle,ED.HVTGrid.prototype.constructor=ED.HVTGrid,ED.HVTGrid.superclass=ED.Doodle.prototype,ED.HVTGrid.prototype.setPropertyDefaults=function(){this.isDeletable=!1,this.isShowHighlight=!1,this.isSelectable=!1},ED.HVTGrid.prototype.draw=function(a){var b=this.drawing.context;ED.HVTGrid.superclass.draw.call(this,a),b.beginPath();var c=125,d=2*c;return b.moveTo(-2*d,0),b.lineTo(2*d,0),b.moveTo(-d,-d),b.lineTo(-d,+d),b.moveTo(+d,-d),b.lineTo(+d,+d),b.lineWidth=4,b.strokeStyle="gray",this.drawBoundary(a),this.isClicked},ED.Hyphaema=function(a,b){this.className="Hyphaema",this.ro=380,this.minimum=304,this.csOriginY=0,this.csOriginX=50,this.csApexX=0,this.savedParameterArray=["apexX","apexY","csOriginY","csApexX","csOriginX"],ED.Doodle.call(this,a,b)},ED.Hyphaema.prototype=new ED.Doodle,ED.Hyphaema.prototype.constructor=ED.Hyphaema,ED.Hyphaema.superclass=ED.Doodle.prototype,ED.Hyphaema.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.Hyphaema.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isRotatable=!1,this.isUnique=!0,this.parameterValidationArray.apexX.range.setMinAndMax(-50,50),this.parameterValidationArray.apexY.range.setMinAndMax(-380,this.minimum)},ED.Hyphaema.prototype.setParameterDefaults=function(){this.apexY=152},ED.Hyphaema.prototype.draw=function(a){var b=this.drawing.context;ED.Hyphaema.superclass.draw.call(this,a);var c=Math.asin(this.apexY/this.ro);b.beginPath(),b.arc(0,0,this.ro,c,Math.PI-c,!1),b.closePath();var d=(.1+(this.apexX+50)/111).toFixed(2);return b.fillStyle="rgba(255,0,0,"+d+")",b.lineWidth=1,b.strokeStyle=b.fillStyle,this.drawBoundary(a),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.Hyphaema.prototype.description=function(){var a=10*Math.round(10*(this.ro-this.apexY)/(2*this.ro));return a+"% hyphaema"},ED.Hyphaema.prototype.snomedCode=function(){"use strict";return 75229002},ED.HyphaemaCrossSection=function(a,b){this.className="HyphaemaCrossSection",this.initialRadius=360,this.ro=380,this.savedParameterArray=["originY","apexX","apexY","originX"],this.controlParameterArray={},ED.Doodle.call(this,a,b),this.linkedDoodleParameters={Hyphaema:{source:["apexY"],store:[["originY","csOriginY"],["apexX","csApexX"],["originX","csOriginX"]]}}},ED.HyphaemaCrossSection.prototype=new ED.Doodle,ED.HyphaemaCrossSection.prototype.constructor=ED.HyphaemaCrossSection,ED.HyphaemaCrossSection.superclass=ED.Doodle.prototype,ED.HyphaemaCrossSection.prototype.setHandles=function(){},ED.HyphaemaCrossSection.prototype.setPropertyDefaults=function(){this.isSelectable=!1,this.addAtBack=!0,this.parameterValidationArray.apexX.range.setMinAndMax(-50,50),this.parameterValidationArray.apexY.range.setMinAndMax(-380,304)},ED.HyphaemaCrossSection.prototype.dependentParameterValues=function(a,b){var c=new Array;return c},ED.HyphaemaCrossSection.prototype.setParameterDefaults=function(){this.originX=50,this.apexY=152},ED.HyphaemaCrossSection.prototype.draw=function(a){var b=this.drawing.context,c=this.drawing.lastDoodleOfClass("CorneaCrossSection"),d=c.pachymetry/5;ED.HyphaemaCrossSection.superclass.draw.call(this,a),b.beginPath();var e=this.apexY-this.apexY/12,f=(e+380)/760;f<0&&(f=0);var g=1;if(f<.5){var h=new Object,i=2*f,j=g<.5?2*g:1;if(c&&"Keratoconus"==c.shape?(h.SP=new ED.Point(0,-380-this.originY),h.CP1=new ED.Point((-80),-260-this.originY),h.CP2=new ED.Point(c.apexX+d,c.apexY-120-this.originY),h.EP=new ED.Point(c.apexX+d,c.apexY-this.originY)):c&&"Keratoglobus"==c.shape?(h.SP=new ED.Point(0,-380-this.originY),h.CP1=new ED.Point((-120),-200-this.originY),h.CP2=new ED.Point((-280),-140-this.originY),h.EP=new ED.Point((-280),100-this.originY)):(h.SP=new ED.Point(0,-380-this.originY),h.CP1=new ED.Point((-80),-260-this.originY),h.CP2=new ED.Point((-220),-160-this.originY),h.EP=new ED.Point((-220),0-this.originY)),i>0){var k=new ED.Point(0,0);k.y=(1-i)*(1-i)*(1-i)*h.SP.y+3*(1-i)*(1-i)*i*h.CP1.y+3*(1-i)*i*i*h.CP2.y+i*i*i*h.EP.y,k.x=(1-i)*(1-i)*(1-i)*h.SP.x+3*(1-i)*(1-i)*i*h.CP1.x+3*(1-i)*i*i*h.CP2.x+i*i*i*h.EP.x;var l=new ED.Point(0,0);l.x=h.CP1.x+i*(h.CP2.x-h.CP1.x),l.y=h.CP1.y+i*(h.CP2.y-h.CP1.y);var m=new ED.Point(0,0);m.x=h.CP2.x+i*(h.EP.x-h.CP2.x),m.y=h.CP2.y+i*(h.EP.y-h.CP2.y);var n=new ED.Point(0,0);n.x=l.x+i*(m.x-l.x),n.y=l.y+i*(m.y-l.y),h.SP=k,h.CP1=n,h.CP2=m}if(j<1){var o=new ED.Point(0,0);o.y=(1-j)*(1-j)*(1-j)*h.SP.y+3*(1-j)*(1-j)*j*h.CP1.y+3*(1-j)*j*j*h.CP2.y+j*j*j*h.EP.y,o.x=(1-j)*(1-j)*(1-j)*h.SP.x+3*(1-j)*(1-j)*j*h.CP1.x+3*(1-j)*j*j*h.CP2.x+j*j*j*h.EP.x;var p=new ED.Point(0,0);p.x=h.SP.x+j*(h.CP1.x-h.SP.x),p.y=h.SP.y+j*(h.CP1.y-h.SP.y);var l=new ED.Point(0,0);l.x=h.CP1.x+j*(h.CP2.x-h.CP1.x),l.y=h.CP1.y+j*(h.CP2.y-h.CP1.y);var q=new ED.Point(0,0);q.x=p.x+j*(l.x-p.x),q.y=p.y+j*(l.y-p.y),h.CP1=p,h.CP2=q,h.EP=o}}if(g>.5){var r=new Object,s=f>.5?2*(f-.5):0,t=2*(g-.5);if(c&&"Keratoconus"==c.shape?(r.SP=new ED.Point(c.apexX+d,c.apexY-this.originY),r.CP1=new ED.Point(c.apexX+d,c.apexY+120-this.originY),r.CP2=new ED.Point((-80),260-this.originY),r.EP=new ED.Point(0,380-this.originY)):c&&"Keratoglobus"==c.shape?(r.SP=new ED.Point((-280),100-this.originY),r.CP1=new ED.Point((-260),220-this.originY),r.CP2=new ED.Point((-80),260-this.originY),r.EP=new ED.Point(0,380-this.originY)):(r.SP=new ED.Point((-220),-0-this.originY),r.CP1=new ED.Point((-220),160-this.originY),r.CP2=new ED.Point((-80),260-this.originY),r.EP=new ED.Point(0,380-this.originY)),s>0){var k=new ED.Point(0,0);k.y=(1-s)*(1-s)*(1-s)*r.SP.y+3*(1-s)*(1-s)*s*r.CP1.y+3*(1-s)*s*s*r.CP2.y+s*s*s*r.EP.y,k.x=(1-s)*(1-s)*(1-s)*r.SP.x+3*(1-s)*(1-s)*s*r.CP1.x+3*(1-s)*s*s*r.CP2.x+s*s*s*r.EP.x;var u=new ED.Point(0,0);u.x=r.CP1.x+s*(r.CP2.x-r.CP1.x),u.y=r.CP1.y+s*(r.CP2.y-r.CP1.y);var v=new ED.Point(0,0);v.x=r.CP2.x+s*(r.EP.x-r.CP2.x),v.y=r.CP2.y+s*(r.EP.y-r.CP2.y);var w=new ED.Point(0,0);w.x=u.x+s*(v.x-u.x),w.y=u.y+s*(v.y-u.y),r.SP=k,r.CP1=w,r.CP2=v}if(t<1){var x=new ED.Point(0,0);x.y=(1-t)*(1-t)*(1-t)*r.SP.y+3*(1-t)*(1-t)*t*r.CP1.y+3*(1-t)*t*t*r.CP2.y+t*t*t*r.EP.y,x.x=(1-t)*(1-t)*(1-t)*r.SP.x+3*(1-t)*(1-t)*t*r.CP1.x+3*(1-t)*t*t*r.CP2.x+t*t*t*r.EP.x;var y=new ED.Point(0,0);y.x=r.SP.x+t*(r.CP1.x-r.SP.x),y.y=r.SP.y+t*(r.CP1.y-r.SP.y);var u=new ED.Point(0,0);u.x=r.CP1.x+t*(r.CP2.x-r.CP1.x),u.y=r.CP1.y+t*(r.CP2.y-r.CP1.y);var z=new ED.Point(0,0);z.x=y.x+t*(u.x-y.x),z.y=y.y+t*(u.y-y.y),r.CP1=y,r.CP2=z,r.EP=x}}var A=this.drawing.lastDoodleOfClass("LensCrossSection"),B=this.drawing.lastDoodleOfClass("AntSegCrossSection"),C=B?B.apexX:-20;if(A){var D=100,E=Math.asin(.8),F=300*Math.cos(E);B?A.originX+D+F-300-this.originX0){var k=new ED.Point(0,0);k.y=(1-i)*(1-i)*(1-i)*h.SP.y+3*(1-i)*(1-i)*i*h.CP1.y+3*(1-i)*i*i*h.CP2.y+i*i*i*h.EP.y,k.x=(1-i)*(1-i)*(1-i)*h.SP.x+3*(1-i)*(1-i)*i*h.CP1.x+3*(1-i)*i*i*h.CP2.x+i*i*i*h.EP.x;var l=new ED.Point(0,0);l.x=h.CP1.x+i*(h.CP2.x-h.CP1.x),l.y=h.CP1.y+i*(h.CP2.y-h.CP1.y);var m=new ED.Point(0,0);m.x=h.CP2.x+i*(h.EP.x-h.CP2.x),m.y=h.CP2.y+i*(h.EP.y-h.CP2.y);var n=new ED.Point(0,0);n.x=l.x+i*(m.x-l.x),n.y=l.y+i*(m.y-l.y),h.SP=k,h.CP1=n,h.CP2=m}if(j<1){var o=new ED.Point(0,0);o.y=(1-j)*(1-j)*(1-j)*h.SP.y+3*(1-j)*(1-j)*j*h.CP1.y+3*(1-j)*j*j*h.CP2.y+j*j*j*h.EP.y,o.x=(1-j)*(1-j)*(1-j)*h.SP.x+3*(1-j)*(1-j)*j*h.CP1.x+3*(1-j)*j*j*h.CP2.x+j*j*j*h.EP.x;var p=new ED.Point(0,0);p.x=h.SP.x+j*(h.CP1.x-h.SP.x),p.y=h.SP.y+j*(h.CP1.y-h.SP.y);var l=new ED.Point(0,0);l.x=h.CP1.x+j*(h.CP2.x-h.CP1.x),l.y=h.CP1.y+j*(h.CP2.y-h.CP1.y);var q=new ED.Point(0,0);q.x=p.x+j*(l.x-p.x),q.y=p.y+j*(l.y-p.y),h.CP1=p,h.CP2=q,h.EP=o}}if(g>.5){var r=new Object,s=f>.5?2*(f-.5):0,t=2*(g-.5);if(c&&"Keratoconus"==c.shape?(r.SP=new ED.Point(c.apexX+d,c.apexY-this.originY),r.CP1=new ED.Point(c.apexX+d,c.apexY+120-this.originY),r.CP2=new ED.Point((-80),260-this.originY),r.EP=new ED.Point(0,380-this.originY)):c&&"Keratoglobus"==c.shape?(r.SP=new ED.Point((-280),100-this.originY),r.CP1=new ED.Point((-260),220-this.originY),r.CP2=new ED.Point((-80),260-this.originY),r.EP=new ED.Point(0,380-this.originY)):(r.SP=new ED.Point((-220),-0-this.originY),r.CP1=new ED.Point((-220),160-this.originY),r.CP2=new ED.Point((-80),260-this.originY),r.EP=new ED.Point(0,380-this.originY)),s>0){var k=new ED.Point(0,0);k.y=(1-s)*(1-s)*(1-s)*r.SP.y+3*(1-s)*(1-s)*s*r.CP1.y+3*(1-s)*s*s*r.CP2.y+s*s*s*r.EP.y,k.x=(1-s)*(1-s)*(1-s)*r.SP.x+3*(1-s)*(1-s)*s*r.CP1.x+3*(1-s)*s*s*r.CP2.x+s*s*s*r.EP.x;var u=new ED.Point(0,0);u.x=r.CP1.x+s*(r.CP2.x-r.CP1.x),u.y=r.CP1.y+s*(r.CP2.y-r.CP1.y);var v=new ED.Point(0,0);v.x=r.CP2.x+s*(r.EP.x-r.CP2.x),v.y=r.CP2.y+s*(r.EP.y-r.CP2.y);var w=new ED.Point(0,0);w.x=u.x+s*(v.x-u.x),w.y=u.y+s*(v.y-u.y),r.SP=k,r.CP1=w,r.CP2=v}if(t<1){var x=new ED.Point(0,0);x.y=(1-t)*(1-t)*(1-t)*r.SP.y+3*(1-t)*(1-t)*t*r.CP1.y+3*(1-t)*t*t*r.CP2.y+t*t*t*r.EP.y,x.x=(1-t)*(1-t)*(1-t)*r.SP.x+3*(1-t)*(1-t)*t*r.CP1.x+3*(1-t)*t*t*r.CP2.x+t*t*t*r.EP.x;var y=new ED.Point(0,0);y.x=r.SP.x+t*(r.CP1.x-r.SP.x),y.y=r.SP.y+t*(r.CP1.y-r.SP.y);var u=new ED.Point(0,0);u.x=r.CP1.x+t*(r.CP2.x-r.CP1.x),u.y=r.CP1.y+t*(r.CP2.y-r.CP1.y);var z=new ED.Point(0,0);z.x=y.x+t*(u.x-y.x),z.y=y.y+t*(u.y-y.y),r.CP1=y,r.CP2=z,r.EP=x}}var A=this.drawing.lastDoodleOfClass("LensCrossSection"),B=this.drawing.lastDoodleOfClass("AntSegCrossSection"),c=this.drawing.lastDoodleOfClass("CorneaCrossSection"),C=B?B.apexX:-20;if(c&&this.setSimpleParameter("originX",c.originX),A){var D=100,E=Math.asin(.8),F=300*Math.cos(E);A.originX+D+F-300-this.originXB.apexX&&(G=B.apexX),b.lineTo(G,B.apexY),b.lineTo(B.apexX,B.apexY))}else b.lineTo(C,h.SP.y);if(B){var H=CB.apexX&&(H=B.apexX),b.lineTo(H,r.SP.y),this.apexY<-B.apexY&&(H1.5&&(a="Large "),a+="inner leaf break ",a+=this.clockHour()+" o'clock"},ED.IOL=function(a,b){this.className="IOL",this.type="PC",this.savedParameterArray=["originX","originY","rotation","type"],this.controlParameterArray={type:"Type"},ED.Doodle.call(this,a,b)},ED.IOL.prototype=new ED.Doodle,ED.IOL.prototype.constructor=ED.IOL,ED.IOL.superclass=ED.Doodle.prototype,ED.IOL.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!0))},ED.IOL.prototype.setPropertyDefaults=function(){this.addAtBack="PC"==this.type,this.isUnique=!0,this.parameterValidationArray.originX.range.setMinAndMax(-125,125),this.parameterValidationArray.originY.range.setMinAndMax(-125,125),this.parameterValidationArray.type={kind:"other",type:"string",list:["PC","AC","Iris Clip"],animate:!1}},ED.IOL.prototype.setParameterDefaults=function(){this.setParameterFromString("type","PC")},ED.IOL.prototype.dependentParameterValues=function(a,b){var c=new Array;return c},ED.IOL.prototype.draw=function(a){var b=this.drawing.context;switch(ED.IOL.superclass.draw.call(this,a),b.beginPath(),this.type){case"PC":var c=180;b.arc(0,0,c,0,2*Math.PI,!1),b.moveTo(112.5,-142.5),b.bezierCurveTo(120,-150,142.5,-262.5,120,-285),b.bezierCurveTo(67.5,-330,-112.5,-307.5,-165,-277.5),b.bezierCurveTo(-187.5,-262.5,-195,-300,-150,-322.5),b.bezierCurveTo(-82.5,-360,97.5,-352.5,150,-322.5),b.bezierCurveTo(202.5,-292.5,165,-105,165,-75),b.moveTo(-112.5,142.5),b.bezierCurveTo(-120,150,-142.5,262.5,-120,285),b.bezierCurveTo(-67.5,330,112.5,307.5,165,277.5),b.bezierCurveTo(187.5,262.5,195,300,150,322.5),b.bezierCurveTo(82.5,360,-97.5,352.5,-150,322.5),b.bezierCurveTo(-202.5,292.5,-165,105,-165,75);break;case"AC":var c=192;b.arc(0,0,c,0,2*Math.PI,!1),b.moveTo(120,-152),b.bezierCurveTo(128,-160,136,-168,128,-184),b.bezierCurveTo(120,-200,80,-224,40,-232),b.bezierCurveTo(0,-240,-176,-264,-184,-272),b.bezierCurveTo(-200,-288,-176,-336,-160,-344),b.bezierCurveTo(-144,-352,-144,-352,-120,-360),b.bezierCurveTo(-96,-368,-104,-344,-96,-336),b.bezierCurveTo(-88,-328,88,-328,96,-336),b.bezierCurveTo(104,-344,96,-368,120,-360),b.bezierCurveTo(144,-352,144,-352,160,-344),b.bezierCurveTo(176,-336,144,-320,120,-312),b.bezierCurveTo(96,-304,-96,-304,-120,-312),b.bezierCurveTo(-144,-320,-152,-296,-136,-288),b.bezierCurveTo(-120,-280,16,-264,56,-256),b.bezierCurveTo(96,-248,152,-224,168,-200),b.bezierCurveTo(184,-176,176,-112,176,-80),b.moveTo(-120,152),b.bezierCurveTo(-128,160,-136,168,-128,184),b.bezierCurveTo(-120,200,-80,224,-40,232),b.bezierCurveTo(0,240,176,264,184,272),b.bezierCurveTo(200,288,176,336,160,344),b.bezierCurveTo(144,352,144,352,120,360),b.bezierCurveTo(96,368,104,344,96,336),b.bezierCurveTo(88,328,-88,328,-96,336),b.bezierCurveTo(-104,344,-96,368,-120,360),b.bezierCurveTo(-144,352,-144,352,-160,344),b.bezierCurveTo(-176,336,-144,320,-120,312),b.bezierCurveTo(-96,304,96,304,120,312),b.bezierCurveTo(144,320,152,296,136,288),b.bezierCurveTo(120,280,-16,264,-56,256),b.bezierCurveTo(-96,248,-152,224,-168,200),b.bezierCurveTo(-184,176,-176,112,-176,80);break;case"Iris Clip":var c=240;b.moveTo(-260,0),b.bezierCurveTo(-260,-100,-220,-220,0,-220),b.bezierCurveTo(220,-220,260,-100,260,0),b.bezierCurveTo(260,100,220,220,0,220),b.bezierCurveTo(-220,220,-260,100,-260,0),b.moveTo(-330,-10),b.bezierCurveTo(-335,-10,-335,-15,-335,-25),b.bezierCurveTo(-335,-43,-332,-86,-312,-106),b.bezierCurveTo(-292,-125,-265,-125,-252,-125),b.bezierCurveTo(-239,-125,-196,-125,-191,-116),b.bezierCurveTo(-187,-110,-189,-104,-194,-93),b.bezierCurveTo(-198,-82,-218,-50,-218,0),b.bezierCurveTo(-218,50,-198,82,-194,93),b.bezierCurveTo(-189,104,-187,110,-191,116),b.bezierCurveTo(-196,125,-239,125,-252,125),b.bezierCurveTo(-265,125,-292,125,-312,106),b.bezierCurveTo(-332,86,-335,43,-335,25),b.bezierCurveTo(-335,15,-335,10,-330,10),b.bezierCurveTo(-325,10,-320,20,-320,25),b.bezierCurveTo(-321,22,-320,33,-319,47),b.bezierCurveTo(-319,54,-314,61,-308,66),b.bezierCurveTo(-302,71,-288,77,-273,77),b.bezierCurveTo(-258,77,-250,74,-243,66),b.bezierCurveTo(-237,58,-239,0,-239,0),b.bezierCurveTo(-239,0,-237,-58,-243,-66),b.bezierCurveTo(-250,-74,-258,-77,-273,-77),b.bezierCurveTo(-288,-77,-302,-71,-308,-66),b.bezierCurveTo(-314,-61,-319,-54,-319,-47),b.bezierCurveTo(-320,-33,-321,-22,-320,-25),b.bezierCurveTo(-320,-20,-325,-10,-330,-10),b.moveTo(330,10),b.bezierCurveTo(335,10,335,15,335,25),b.bezierCurveTo(335,43,332,86,312,106),b.bezierCurveTo(292,125,265,125,252,125),b.bezierCurveTo(239,125,196,125,191,116),b.bezierCurveTo(187,110,189,104,194,93),b.bezierCurveTo(198,82,218,50,218,0),b.bezierCurveTo(218,-50,198,-82,194,-93),b.bezierCurveTo(189,-104,187,-110,191,-116),b.bezierCurveTo(196,-125,239,-125,252,-125),b.bezierCurveTo(265,-125,292,-125,312,-106),b.bezierCurveTo(332,-86,335,-43,335,-25),b.bezierCurveTo(335,-15,335,-10,330,-10),b.bezierCurveTo(325,-10,320,-20,320,-25),b.bezierCurveTo(321,-22,314,-61,319,-47),b.bezierCurveTo(319,-54,314,-61,308,-66),b.bezierCurveTo(302,-71,288,-77,273,-77),b.bezierCurveTo(258,-77,250,-74,243,-66),b.bezierCurveTo(237,-58,239,0,239,0),b.bezierCurveTo(239,0,237,58,243,66),b.bezierCurveTo(250,74,258,77,273,77),b.bezierCurveTo(288,77,302,71,308,66),b.bezierCurveTo(314,61,319,54,319,47),b.bezierCurveTo(320,33,321,22,320,25),b.bezierCurveTo(320,20,325,10,330,10)}b.fillStyle="rgba(255,255,255,0.75)",b.lineWidth=4,b.strokeStyle="darkgray",this.drawBoundary(a);var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IOL.prototype.description=function(){var a="";switch(this.type){case"PC":a="Posterior Chamber IOL";break;case"AC":a="Anterior Chamber IOL";break;case"Iris Clip":a="Iris clip IOL"}var b=40,c="";return this.originY<-b&&(c.length>0&&(c+=" and"),c+=" superiorly"),this.originY>b&&(c.length>0&&(c+=" and"),c+=" inferiorly"),this.originX<-b&&(c.length>0&&(c+=" and"),c+=this.drawing.eye==ED.eye.Right?" temporally":" nasally"),this.originX>b&&(c.length>0&&(c+=" and"),c+=this.drawing.eye==ED.eye.Right?" nasally":" temporally"),c.length>0&&(a+=" displaced"+c),a},ED.IOLCrossSection=function(a,b){this.className="IOLCrossSection",ED.Doodle.call(this,a,b)},ED.IOLCrossSection.prototype=new ED.Doodle,ED.IOLCrossSection.prototype.constructor=ED.IOLCrossSection,ED.IOLCrossSection.superclass=ED.Doodle.prototype,ED.IOLCrossSection.prototype.setPropertyDefaults=function(){this.isUnique=!0,this.addAtBack=!0,this.parameterValidationArray.originX.range.setMinAndMax(-150,200),this.parameterValidationArray.originY.range.setMinAndMax(-140,140)},ED.IOLCrossSection.prototype.setParameterDefaults=function(){this.originX=44},ED.IOLCrossSection.prototype.draw=function(a){var b=this.drawing.context;ED.IOLCrossSection.superclass.draw.call(this,a);var c=240,d=420,e=100,f=Math.asin(c/d),g=d*Math.cos(f),h=d-60;Math.acos(g/h);return b.beginPath(),b.arc(e-g,0,d,f,-f,!0),b.arc(e+g,0,d,Math.PI+f,Math.PI-f,!0),b.lineWidth=4,b.fillStyle="rgba(255, 255, 255, 0)",b.strokeStyle="rgba(255, 255, 255, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(b.beginPath(),b.arc(e-g,0,d,f,-f,!0),b.arc(e+g,0,d,Math.PI+f,Math.PI+.6*f,!0),b.moveTo(e,240),b.arc(e+g,0,d,Math.PI-f,Math.PI-.6*f,!1),b.strokeStyle="gray",b.stroke(),b.beginPath(),b.ellipse(100,0,160,20,.5*Math.PI,0,2*Math.PI),b.strokeStyle="rgba(0, 0, 0, 0.7)",b.lineWidth=5,b.stroke(),b.beginPath(),b.ellipse(100,0,227,20,.5*Math.PI,.5*Math.PI,1.2*Math.PI),b.moveTo(120,0),b.ellipse(100,0,227,20,.5*Math.PI,1.5*Math.PI,.2*Math.PI),b.strokeStyle="rgba(0, 0, 0, 0.6)",b.stroke(),b.beginPath(),b.moveTo(44-this.originX+80,-this.originY-349),b.lineTo(80,-207),b.moveTo(44-this.originX+80,-this.originY-349),b.lineTo(120,-207),b.moveTo(44-this.originX+120,-this.originY-349),b.lineTo(80,-207),b.moveTo(44-this.originX+120,-this.originY-349),b.lineTo(120,-207),b.moveTo(44-this.originX+80,-this.originY+349),b.lineTo(80,207),b.moveTo(44-this.originX+80,-this.originY+349),b.lineTo(120,207),b.moveTo(44-this.originX+120,-this.originY+349),b.lineTo(80,207),b.moveTo(44-this.originX+120,-this.originY+349),b.lineTo(120,207),b.lineWidth=2,b.strokeStyle="gray",b.stroke()),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IrisHook=function(a,b){this.className="IrisHook",this.savedParameterArray=["rotation"],ED.Doodle.call(this,a,b)},ED.IrisHook.prototype=new ED.Doodle,ED.IrisHook.prototype.constructor=ED.IrisHook,ED.IrisHook.superclass=ED.Doodle.prototype,ED.IrisHook.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isScaleable=!1},ED.IrisHook.prototype.setParameterDefaults=function(){this.setRotationWithDisplacements(45,90)},ED.IrisHook.prototype.draw=function(a){var b=this.drawing.context;ED.IrisHook.superclass.draw.call(this,a),b.beginPath();var c=260,d=this.drawing.lastDoodleOfClass("AntSeg");return d&&(c=-d.apexY),b.rect(-25,-440,50,180+c),b.closePath(),b.fillStyle="rgba(255,255,255,0)",b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(b.beginPath(),b.moveTo(10,-430),b.lineTo(10,-c+10),b.lineTo(-10,-c),b.lineWidth=12,b.strokeStyle="rgba(120,120,120,0.75)",b.stroke(),b.beginPath(),b.moveTo(-20,-400),b.lineTo(40,-400),b.lineWidth=24,b.strokeStyle="rgba(255,120,0,0.75)",b.stroke()),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IrisHook.prototype.groupDescription=function(){return"Iris hooks used at "},ED.IrisHook.prototype.description=function(){var a="";return a+=this.clockHour()},ED.IrisHook.prototype.groupDescriptionEnd=function(){return" o'clock"},ED.IrisNaevus=function(a,b){this.className="IrisNaevus",this.savedParameterArray=["originX","originY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.IrisNaevus.prototype=new ED.Doodle,ED.IrisNaevus.prototype.constructor=ED.IrisNaevus,ED.IrisNaevus.superclass=ED.Doodle.prototype,ED.IrisNaevus.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.IrisNaevus.prototype.setPropertyDefaults=function(){this.isSqueezable=!0,this.isOrientated=!0},ED.IrisNaevus.prototype.setParameterDefaults=function(){this.originY=-320,this.scaleX=1.8},ED.IrisNaevus.prototype.draw=function(a){var b=this.drawing.context;ED.IrisNaevus.superclass.draw.call(this,a),b.beginPath();var c=50;b.arc(0,0,c,0,2*Math.PI,!1),b.closePath(),b.fillStyle="brown",b.strokeStyle="rgba(100,100,100,0.9)",this.drawBoundary(a);var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IrisNaevus.prototype.description=function(){return"Iris naevus"},ED.IRMA=function(a,b){this.className="IRMA",this.savedParameterArray=["originX","originY","scaleX","scaleY","rotation"],ED.Doodle.call(this,a,b)},ED.IRMA.prototype=new ED.Doodle,ED.IRMA.prototype.constructor=ED.IRMA,ED.IRMA.superclass=ED.Doodle.prototype,ED.IRMA.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!0))},ED.IRMA.prototype.setPropertyDefaults=function(){this.parameterValidationArray.scaleX.range.setMinAndMax(1,1.5),this.parameterValidationArray.scaleY.range.setMinAndMax(1,1.5)},ED.IRMA.prototype.setParameterDefaults=function(){this.setOriginWithDisplacements(100,100)},ED.IRMA.prototype.draw=function(a){var b=this.drawing.context;return ED.IRMA.superclass.draw.call(this,a),b.beginPath(),b.moveTo(0,30),b.bezierCurveTo(-30,30,-70,0,-50,-20),b.bezierCurveTo(-30,-40,-20,-10,0,-10),b.bezierCurveTo(20,-10,30,-40,50,-20),b.bezierCurveTo(70,0,30,30,0,30),b.fillStyle="rgba(100, 100, 100, 0)",b.lineWidth=3,b.strokeStyle="red",this.drawBoundary(a),this.handleArray[2].location=this.transform.transformPoint(new ED.Point(50,(-40))),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IRMA.prototype.groupDescription=function(){return"Intraretinal microvascular abnormalities "},ED.IRMA.prototype.description=function(){return this.locationRelativeToFovea()},ED.KeraticPrecipitates=function(a,b){this.className="KeraticPrecipitates",this.savedParameterArray=["apexX","apexY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.KeraticPrecipitates.prototype=new ED.Doodle,ED.KeraticPrecipitates.prototype.constructor=ED.KeraticPrecipitates,ED.KeraticPrecipitates.superclass=ED.Doodle.prototype,ED.KeraticPrecipitates.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.KeraticPrecipitates.prototype.setPropertyDefaults=function(){this.isRotatable=!1,this.isUnique=!0,this.parameterValidationArray.apexX.range.setMinAndMax(-0,40),this.parameterValidationArray.apexY.range.setMinAndMax(-160,0),this.parameterValidationArray.scaleX.range.setMinAndMax(.5,1.5),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,1.5)},ED.KeraticPrecipitates.prototype.setParameterDefaults=function(){this.drawing.hasDoodleOfClass("Fundus")&&(this.originX=this.drawing.eye==ED.eye.Right?-100:100,this.scaleX=.5,this.scaleY=.5)},ED.KeraticPrecipitates.prototype.draw=function(a){var b=this.drawing.context;ED.KeraticPrecipitates.superclass.draw.call(this,a),b.beginPath();var c=200;if(b.arc(0,0,c,0,2*Math.PI,!0),b.closePath(),b.lineWidth=0,b.fillStyle="rgba(0, 0, 0, 0)",b.strokeStyle="rgba(0, 0, 0, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw)for(var d="rgba(110, 110, 110, 0.5)",e=10*((this.apexX+20)/20)/this.scaleX,f=new ED.Point(0,0),g=40+Math.abs(Math.floor(this.apexY/2)),h=0;h20?"Mutton fat keratic precipitates":"Keratic precipitates"},ED.KoeppeNodule=function(a,b){this.className="KoeppeNodule",this.savedParameterArray=["rotation"],ED.Doodle.call(this,a,b)},ED.KoeppeNodule.prototype=new ED.Doodle,ED.KoeppeNodule.prototype.constructor=ED.KoeppeNodule,ED.KoeppeNodule.superclass=ED.Doodle.prototype,ED.KoeppeNodule.prototype.setPropertyDefaults=function(){this.isScaleable=!1,this.isMoveable=!1},ED.KoeppeNodule.prototype.setParameterDefaults=function(){this.setRotationWithDisplacements(30,30)},ED.KoeppeNodule.prototype.draw=function(a){var b=this.drawing.context;ED.KoeppeNodule.superclass.draw.call(this,a);var c=260,d=this.drawing.lastDoodleOfClass("AntSeg");return d&&(c=-d.apexY),b.beginPath(),b.arc(0,-c,20,0,2*Math.PI,!1),b.fillStyle="rgba(150,100,50,1)",b.lineWidth=1,b.strokeStyle=b.fillStyle,this.drawBoundary(a),this.isClicked},ED.KoeppeNodule.prototype.groupDescription=function(){return"Koeppe nodules"},ED.KrukenbergSpindle=function(a,b){this.className="KrukenbergSpindle",this.savedParameterArray=["originX","originY","apexX","apexY"],ED.Doodle.call(this,a,b)},ED.KrukenbergSpindle.prototype=new ED.Doodle,ED.KrukenbergSpindle.prototype.constructor=ED.KrukenbergSpindle,ED.KrukenbergSpindle.superclass=ED.Doodle.prototype,ED.KrukenbergSpindle.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.KrukenbergSpindle.prototype.setPropertyDefaults=function(){this.isRotatable=!1,this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-380,-80)},ED.KrukenbergSpindle.prototype.setParameterDefaults=function(){this.apexY=-150,this.originY=200},ED.KrukenbergSpindle.prototype.draw=function(a){var b=this.drawing.context;return ED.KrukenbergSpindle.superclass.draw.call(this,a),b.beginPath(),this.addEllipseToPath(b,0,0,-this.apexY/2,2*-this.apexY),b.fillStyle=b.createPattern(this.drawing.imageArray.BrownSpotPattern,"repeat"),b.strokeStyle="rgba(255,128,0,0.5)",this.drawBoundary(a),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.KrukenbergSpindle.prototype.description=function(){return"Krukenberg spindle"},ED.LaserCircle=function(a,b){this.className="LaserCircle",this.savedParameterArray=["originX","originY","apexX","apexY","rotation"],ED.Doodle.call(this,a,b)},ED.LaserCircle.prototype=new ED.Doodle,ED.LaserCircle.prototype.constructor=ED.LaserCircle,ED.LaserCircle.superclass=ED.Doodle.prototype,ED.LaserCircle.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!0))},ED.LaserCircle.prototype.setPropertyDefaults=function(){this.parameterValidationArray.apexX.range.setMinAndMax(50,400),this.parameterValidationArray.apexY.range.setMinAndMax(-400,-50)},ED.LaserCircle.prototype.setParameterDefaults=function(){this.apexX=84,this.apexY=-84;var a=this.drawing.lastDoodleOfClass(this.className);if(a){var b=new ED.Point(a.originX,a.originY),c=new ED.Point(0,0);c.setWithPolars(b.length(),b.direction()+Math.PI/6),this.move(c.x,c.y)}else this.move(200*(this.drawing.eye==ED.eye.Right?-1:1),-300)},ED.LaserCircle.prototype.draw=function(a){var b=this.drawing.context;if(ED.LaserCircle.superclass.draw.call(this,a),b.beginPath(),b.moveTo(this.apexX,this.apexY),b.lineTo(this.apexX,-this.apexY),b.lineTo(-this.apexX,-this.apexY),b.lineTo(-this.apexX,this.apexY),b.lineTo(this.apexX,this.apexY),b.closePath(),b.lineWidth=0,b.fillStyle="rgba(0, 0, 0, 0)",b.strokeStyle="rgba(0, 0, 0, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var c=25,d=new ED.Point(0,0),e=this.apexX+this.apexY;if(e<0)var f=this.apexX;else var f=-this.apexY;for(var g=Math.round(Math.PI/(c/f)),h=0;h1.9*Math.PI&&(a+="360 degree "),a+="laser demarcation"},ED.LaserSpot=function(a,b){this.className="LaserSpot",this.savedParameterArray=["originX","originY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.LaserSpot.prototype=new ED.Doodle,ED.LaserSpot.prototype.constructor=ED.LaserSpot,ED.LaserSpot.superclass=ED.Doodle.prototype,ED.LaserSpot.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.LaserSpot.prototype.setPropertyDefaults=function(){this.parameterValidationArray.scaleX.range.setMinAndMax(.5,3),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,3)},ED.LaserSpot.prototype.setParameterDefaults=function(){this.scaleX=.75,this.scaleY=.75,this.setOriginWithDisplacements(100,80)},ED.LaserSpot.prototype.draw=function(a){var b=this.drawing.context;ED.LaserSpot.superclass.draw.call(this,a);var c=30;b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.closePath(),b.lineWidth=2*c/3,b.fillStyle="yellow",b.strokeStyle="rgba(255, 128, 0, 1)",this.drawBoundary(a);var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.LaserSpot.prototype.groupDescription=function(){return"Laser spots"},ED.LasikFlap=function(a,b){this.className="LasikFlap",this.hinge="",this.diameter=6,this.femtoLaser="",this.depth=80,this.angle=30,this.spotSeparation="",this.lineSeparation="",this.energyLevel="",this.OBLGrade="",this.savedParameterArray=["scaleX","scaleY","rotation","femtoLaser","diameter","depth","angle","spotSeparation","lineSeparation","energyLevel","OBLGrade"],this.controlParameterArray={hinge:"Hinge",femtoLaser:"Femto laser",diameter:"Diameter",depth:"Depth",angle:"Sidecut angle",spotSeparation:"Spot separation",lineSeparation:"Line separation",energyLevel:"Energy level",OBLGrade:"OBL grade"},ED.Doodle.call(this,a,b)},ED.LasikFlap.prototype=new ED.Doodle,ED.LasikFlap.prototype.constructor=ED.LasikFlap,ED.LasikFlap.superclass=ED.Doodle.prototype,ED.LasikFlap.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.LasikFlap.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.snapToAngles=!0,this.isUnique=!0;Math.PI/4;this.anglesArray=[0,this.drawing.eye==ED.eye.Right?Math.PI/2:3*Math.PI/2],this.parameterValidationArray.scaleX.range.setMinAndMax(.6,1),this.parameterValidationArray.scaleY.range.setMinAndMax(.6,1),this.parameterValidationArray.hinge={kind:"other",type:"string",list:["Superior","Nasal"],animate:!0},this.parameterValidationArray.diameter={kind:"derived",type:"float",range:new ED.Range(6,10),precision:1,animate:!0},this.parameterValidationArray.femtoLaser={kind:"other",type:"string",list:["DDL AMO iFS","Zeiss Visumax","Zeimer Z7"],animate:!0},this.parameterValidationArray.depth={kind:"other",type:"int",range:new ED.Range(80,200),animate:!1},this.parameterValidationArray.angle={kind:"other",type:"int",range:new ED.Range(30,150),animate:!1},this.parameterValidationArray.spotSeparation={kind:"other",type:"string",list:["0.5um","0.6um","0.7um","0.8um","0.9um","1.0um"],animate:!1},this.parameterValidationArray.lineSeparation={kind:"other",type:"string",list:["0.5um","0.6um","0.7um","0.8um","0.9um","1.0um"],animate:!1},this.parameterValidationArray.energyLevel={kind:"other",type:"string",list:["0.50uJ","0.55uJ","0.60uJ","0.65uJ","0.70uJ","0.75uJ","0.80uJ","0.85uJ","0.90uJ","0.95uJ","1.00uJ"],animate:!1},this.parameterValidationArray.OBLGrade={kind:"other",type:"string",list:["None","Trace outside pupillary axis","In pupillary axis"],animate:!1}},ED.LasikFlap.prototype.setParameterDefaults=function(){this.setParameterFromString("hinge","Superior"),this.setParameterFromString("femtoLaser","DDL AMO iFS"),this.setParameterFromString("diameter","8.5"),this.setParameterFromString("depth","110"),this.setParameterFromString("angle","90"),this.setParameterFromString("spotSeparation","0.6um"),this.setParameterFromString("lineSeparation","0.6um"),this.setParameterFromString("energyLevel","0.75uJ"),this.setParameterFromString("OBLGrade","None")},ED.LasikFlap.prototype.dependentParameterValues=function(a,b){var c=new Array;switch(a){case"scaleX":c.diameter=10*b;break;case"rotation":0==b?c.hinge="Superior":c.hinge="Nasal";break;case"diameter":c.scaleX=parseFloat(b)/10,c.scaleY=parseFloat(b)/10;break;case"hinge":"Superior"==b?c.rotation=0:c.rotation=this.drawing.eye==ED.eye.Right?Math.PI/2:3*Math.PI/2}return c},ED.LasikFlap.prototype.draw=function(a){var b=this.drawing.context;ED.LasikFlap.superclass.draw.call(this,a);var c=320,d=Math.PI/6,e=-Math.PI/2-d,f=-Math.PI/2+d;if(b.beginPath(),b.arc(0,0,c,e,f,!0),b.closePath(),b.fillStyle="rgba(155,255,255,0)",b.lineWidth=2,b.strokeStyle="rgba(100,100,100,0.9)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){switch(b.beginPath(),b.arc(0,0,c/2,0,2*Math.PI,!0),this.gradeDLK){case"None":b.fillStyle="rgba(155,255,255,0)";break;case"Grade 1":b.fillStyle="rgba(155,255,255,0.4)";break;case"Grade 2":b.fillStyle="rgba(155,255,255,0.6)";break;case"Grade 3":b.fillStyle="rgba(155,255,255,0.8)"}b.fill()}var g=new ED.Point(0,0);return g.setWithPolars(c,d),this.handleArray[2].location=this.transform.transformPoint(g),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.LasikFlap.prototype.description=function(){var a="";if(this.drawing.eye==ED.eye.Right)var b=!0;else var b=!1;var c=Math.cos(this.rotation),d=Math.sin(this.rotation),e=Math.abs(c),f=Math.abs(d),g="";return d>c&&f>e&&(g=b?"nasal":"temporal"),d>c&&fe&&(g=b?"temporal":"nasal"),d1.5&&(a="Large "),a+="inner leaf break ",a+=this.clockHour()+" o'clock"},ED.IOL=function(a,b){this.className="IOL",this.type="PC",this.savedParameterArray=["originX","originY","rotation","type"],this.controlParameterArray={type:"Type"},ED.Doodle.call(this,a,b)},ED.IOL.prototype=new ED.Doodle,ED.IOL.prototype.constructor=ED.IOL,ED.IOL.superclass=ED.Doodle.prototype,ED.IOL.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!0))},ED.IOL.prototype.setPropertyDefaults=function(){this.addAtBack="PC"==this.type,this.isUnique=!0,this.parameterValidationArray.originX.range.setMinAndMax(-125,125),this.parameterValidationArray.originY.range.setMinAndMax(-125,125),this.parameterValidationArray.type={kind:"other",type:"string",list:["PC","AC","Iris Clip"],animate:!1}},ED.IOL.prototype.setParameterDefaults=function(){this.setParameterFromString("type","PC")},ED.IOL.prototype.dependentParameterValues=function(a,b){var c=new Array;return c},ED.IOL.prototype.draw=function(a){var b=this.drawing.context;switch(ED.IOL.superclass.draw.call(this,a),b.beginPath(),this.type){case"PC":var c=180;b.arc(0,0,c,0,2*Math.PI,!1),b.moveTo(112.5,-142.5),b.bezierCurveTo(120,-150,142.5,-262.5,120,-285),b.bezierCurveTo(67.5,-330,-112.5,-307.5,-165,-277.5),b.bezierCurveTo(-187.5,-262.5,-195,-300,-150,-322.5),b.bezierCurveTo(-82.5,-360,97.5,-352.5,150,-322.5),b.bezierCurveTo(202.5,-292.5,165,-105,165,-75),b.moveTo(-112.5,142.5),b.bezierCurveTo(-120,150,-142.5,262.5,-120,285),b.bezierCurveTo(-67.5,330,112.5,307.5,165,277.5),b.bezierCurveTo(187.5,262.5,195,300,150,322.5),b.bezierCurveTo(82.5,360,-97.5,352.5,-150,322.5),b.bezierCurveTo(-202.5,292.5,-165,105,-165,75);break;case"AC":var c=192;b.arc(0,0,c,0,2*Math.PI,!1),b.moveTo(120,-152),b.bezierCurveTo(128,-160,136,-168,128,-184),b.bezierCurveTo(120,-200,80,-224,40,-232),b.bezierCurveTo(0,-240,-176,-264,-184,-272),b.bezierCurveTo(-200,-288,-176,-336,-160,-344),b.bezierCurveTo(-144,-352,-144,-352,-120,-360),b.bezierCurveTo(-96,-368,-104,-344,-96,-336),b.bezierCurveTo(-88,-328,88,-328,96,-336),b.bezierCurveTo(104,-344,96,-368,120,-360),b.bezierCurveTo(144,-352,144,-352,160,-344),b.bezierCurveTo(176,-336,144,-320,120,-312),b.bezierCurveTo(96,-304,-96,-304,-120,-312),b.bezierCurveTo(-144,-320,-152,-296,-136,-288),b.bezierCurveTo(-120,-280,16,-264,56,-256),b.bezierCurveTo(96,-248,152,-224,168,-200),b.bezierCurveTo(184,-176,176,-112,176,-80),b.moveTo(-120,152),b.bezierCurveTo(-128,160,-136,168,-128,184),b.bezierCurveTo(-120,200,-80,224,-40,232),b.bezierCurveTo(0,240,176,264,184,272),b.bezierCurveTo(200,288,176,336,160,344),b.bezierCurveTo(144,352,144,352,120,360),b.bezierCurveTo(96,368,104,344,96,336),b.bezierCurveTo(88,328,-88,328,-96,336),b.bezierCurveTo(-104,344,-96,368,-120,360),b.bezierCurveTo(-144,352,-144,352,-160,344),b.bezierCurveTo(-176,336,-144,320,-120,312),b.bezierCurveTo(-96,304,96,304,120,312),b.bezierCurveTo(144,320,152,296,136,288),b.bezierCurveTo(120,280,-16,264,-56,256),b.bezierCurveTo(-96,248,-152,224,-168,200),b.bezierCurveTo(-184,176,-176,112,-176,80);break;case"Iris Clip":var c=240;b.moveTo(-260,0),b.bezierCurveTo(-260,-100,-220,-220,0,-220),b.bezierCurveTo(220,-220,260,-100,260,0),b.bezierCurveTo(260,100,220,220,0,220),b.bezierCurveTo(-220,220,-260,100,-260,0),b.moveTo(-330,-10),b.bezierCurveTo(-335,-10,-335,-15,-335,-25),b.bezierCurveTo(-335,-43,-332,-86,-312,-106),b.bezierCurveTo(-292,-125,-265,-125,-252,-125),b.bezierCurveTo(-239,-125,-196,-125,-191,-116),b.bezierCurveTo(-187,-110,-189,-104,-194,-93),b.bezierCurveTo(-198,-82,-218,-50,-218,0),b.bezierCurveTo(-218,50,-198,82,-194,93),b.bezierCurveTo(-189,104,-187,110,-191,116),b.bezierCurveTo(-196,125,-239,125,-252,125),b.bezierCurveTo(-265,125,-292,125,-312,106),b.bezierCurveTo(-332,86,-335,43,-335,25),b.bezierCurveTo(-335,15,-335,10,-330,10),b.bezierCurveTo(-325,10,-320,20,-320,25),b.bezierCurveTo(-321,22,-320,33,-319,47),b.bezierCurveTo(-319,54,-314,61,-308,66),b.bezierCurveTo(-302,71,-288,77,-273,77),b.bezierCurveTo(-258,77,-250,74,-243,66),b.bezierCurveTo(-237,58,-239,0,-239,0),b.bezierCurveTo(-239,0,-237,-58,-243,-66),b.bezierCurveTo(-250,-74,-258,-77,-273,-77),b.bezierCurveTo(-288,-77,-302,-71,-308,-66),b.bezierCurveTo(-314,-61,-319,-54,-319,-47),b.bezierCurveTo(-320,-33,-321,-22,-320,-25),b.bezierCurveTo(-320,-20,-325,-10,-330,-10),b.moveTo(330,10),b.bezierCurveTo(335,10,335,15,335,25),b.bezierCurveTo(335,43,332,86,312,106),b.bezierCurveTo(292,125,265,125,252,125),b.bezierCurveTo(239,125,196,125,191,116),b.bezierCurveTo(187,110,189,104,194,93),b.bezierCurveTo(198,82,218,50,218,0),b.bezierCurveTo(218,-50,198,-82,194,-93),b.bezierCurveTo(189,-104,187,-110,191,-116),b.bezierCurveTo(196,-125,239,-125,252,-125),b.bezierCurveTo(265,-125,292,-125,312,-106),b.bezierCurveTo(332,-86,335,-43,335,-25),b.bezierCurveTo(335,-15,335,-10,330,-10),b.bezierCurveTo(325,-10,320,-20,320,-25),b.bezierCurveTo(321,-22,314,-61,319,-47),b.bezierCurveTo(319,-54,314,-61,308,-66),b.bezierCurveTo(302,-71,288,-77,273,-77),b.bezierCurveTo(258,-77,250,-74,243,-66),b.bezierCurveTo(237,-58,239,0,239,0),b.bezierCurveTo(239,0,237,58,243,66),b.bezierCurveTo(250,74,258,77,273,77),b.bezierCurveTo(288,77,302,71,308,66),b.bezierCurveTo(314,61,319,54,319,47),b.bezierCurveTo(320,33,321,22,320,25),b.bezierCurveTo(320,20,325,10,330,10)}b.fillStyle="rgba(255,255,255,0.75)",b.lineWidth=4,b.strokeStyle="darkgray",this.drawBoundary(a);var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IOL.prototype.description=function(){var a="";switch(this.type){case"PC":a="Posterior Chamber IOL";break;case"AC":a="Anterior Chamber IOL";break;case"Iris Clip":a="Iris clip IOL"}var b=40,c="";return this.originY<-b&&(c.length>0&&(c+=" and"),c+=" superiorly"),this.originY>b&&(c.length>0&&(c+=" and"),c+=" inferiorly"),this.originX<-b&&(c.length>0&&(c+=" and"),c+=this.drawing.eye==ED.eye.Right?" temporally":" nasally"),this.originX>b&&(c.length>0&&(c+=" and"),c+=this.drawing.eye==ED.eye.Right?" nasally":" temporally"),c.length>0&&(a+=" displaced"+c),a},ED.IOLCrossSection=function(a,b){this.className="IOLCrossSection",ED.Doodle.call(this,a,b)},ED.IOLCrossSection.prototype=new ED.Doodle,ED.IOLCrossSection.prototype.constructor=ED.IOLCrossSection,ED.IOLCrossSection.superclass=ED.Doodle.prototype,ED.IOLCrossSection.prototype.setPropertyDefaults=function(){this.isUnique=!0,this.addAtBack=!0,this.parameterValidationArray.originX.range.setMinAndMax(-150,200),this.parameterValidationArray.originY.range.setMinAndMax(-140,140)},ED.IOLCrossSection.prototype.setParameterDefaults=function(){this.originX=44},ED.IOLCrossSection.prototype.draw=function(a){var b=this.drawing.context;ED.IOLCrossSection.superclass.draw.call(this,a);var c=240,d=420,e=100,f=Math.asin(c/d),g=d*Math.cos(f),h=d-60;Math.acos(g/h);return b.beginPath(),b.arc(e-g,0,d,f,-f,!0),b.arc(e+g,0,d,Math.PI+f,Math.PI-f,!0),b.lineWidth=4,b.fillStyle="rgba(255, 255, 255, 0)",b.strokeStyle="rgba(255, 255, 255, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(b.beginPath(),b.arc(e-g,0,d,f,-f,!0),b.arc(e+g,0,d,Math.PI+f,Math.PI+.6*f,!0),b.moveTo(e,240),b.arc(e+g,0,d,Math.PI-f,Math.PI-.6*f,!1),b.strokeStyle="gray",b.stroke(),b.beginPath(),b.ellipse(100,0,160,20,.5*Math.PI,0,2*Math.PI),b.strokeStyle="rgba(0, 0, 0, 0.7)",b.lineWidth=5,b.stroke(),b.beginPath(),b.ellipse(100,0,227,20,.5*Math.PI,.5*Math.PI,1.2*Math.PI),b.moveTo(120,0),b.ellipse(100,0,227,20,.5*Math.PI,1.5*Math.PI,.2*Math.PI),b.strokeStyle="rgba(0, 0, 0, 0.6)",b.stroke(),b.beginPath(),b.moveTo(44-this.originX+80,-this.originY-349),b.lineTo(80,-207),b.moveTo(44-this.originX+80,-this.originY-349),b.lineTo(120,-207),b.moveTo(44-this.originX+120,-this.originY-349),b.lineTo(80,-207),b.moveTo(44-this.originX+120,-this.originY-349),b.lineTo(120,-207),b.moveTo(44-this.originX+80,-this.originY+349),b.lineTo(80,207),b.moveTo(44-this.originX+80,-this.originY+349),b.lineTo(120,207),b.moveTo(44-this.originX+120,-this.originY+349),b.lineTo(80,207),b.moveTo(44-this.originX+120,-this.originY+349),b.lineTo(120,207),b.lineWidth=2,b.strokeStyle="gray",b.stroke()),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IrisHook=function(a,b){this.className="IrisHook",this.savedParameterArray=["rotation"],ED.Doodle.call(this,a,b)},ED.IrisHook.prototype=new ED.Doodle,ED.IrisHook.prototype.constructor=ED.IrisHook,ED.IrisHook.superclass=ED.Doodle.prototype,ED.IrisHook.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isScaleable=!1},ED.IrisHook.prototype.setParameterDefaults=function(){this.setRotationWithDisplacements(45,90)},ED.IrisHook.prototype.draw=function(a){var b=this.drawing.context;ED.IrisHook.superclass.draw.call(this,a),b.beginPath();var c=260,d=this.drawing.lastDoodleOfClass("AntSeg");return d&&(c=-d.apexY),b.rect(-25,-440,50,180+c),b.closePath(),b.fillStyle="rgba(255,255,255,0)",b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(b.beginPath(),b.moveTo(10,-430),b.lineTo(10,-c+10),b.lineTo(-10,-c),b.lineWidth=12,b.strokeStyle="rgba(120,120,120,0.75)",b.stroke(),b.beginPath(),b.moveTo(-20,-400),b.lineTo(40,-400),b.lineWidth=24,b.strokeStyle="rgba(255,120,0,0.75)",b.stroke()),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IrisHook.prototype.groupDescription=function(){return"Iris hooks used at "},ED.IrisHook.prototype.description=function(){var a="";return a+=this.clockHour()},ED.IrisHook.prototype.groupDescriptionEnd=function(){return" o'clock"},ED.IrisNaevus=function(a,b){this.className="IrisNaevus",this.savedParameterArray=["originX","originY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.IrisNaevus.prototype=new ED.Doodle,ED.IrisNaevus.prototype.constructor=ED.IrisNaevus,ED.IrisNaevus.superclass=ED.Doodle.prototype,ED.IrisNaevus.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.IrisNaevus.prototype.setPropertyDefaults=function(){this.isSqueezable=!0,this.isOrientated=!0},ED.IrisNaevus.prototype.setParameterDefaults=function(){this.originY=-320,this.scaleX=1.8},ED.IrisNaevus.prototype.draw=function(a){var b=this.drawing.context;ED.IrisNaevus.superclass.draw.call(this,a),b.beginPath();var c=50;b.arc(0,0,c,0,2*Math.PI,!1),b.closePath(),b.fillStyle="brown",b.strokeStyle="rgba(100,100,100,0.9)",this.drawBoundary(a);var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IrisNaevus.prototype.description=function(){return"Iris naevus"},ED.IRMA=function(a,b){this.className="IRMA",this.savedParameterArray=["originX","originY","scaleX","scaleY","rotation"],ED.Doodle.call(this,a,b)},ED.IRMA.prototype=new ED.Doodle,ED.IRMA.prototype.constructor=ED.IRMA,ED.IRMA.superclass=ED.Doodle.prototype,ED.IRMA.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!0))},ED.IRMA.prototype.setPropertyDefaults=function(){this.parameterValidationArray.scaleX.range.setMinAndMax(1,1.5),this.parameterValidationArray.scaleY.range.setMinAndMax(1,1.5)},ED.IRMA.prototype.setParameterDefaults=function(){this.setOriginWithDisplacements(100,100)},ED.IRMA.prototype.draw=function(a){var b=this.drawing.context;return ED.IRMA.superclass.draw.call(this,a),b.beginPath(),b.moveTo(0,30),b.bezierCurveTo(-30,30,-70,0,-50,-20),b.bezierCurveTo(-30,-40,-20,-10,0,-10),b.bezierCurveTo(20,-10,30,-40,50,-20),b.bezierCurveTo(70,0,30,30,0,30),b.fillStyle="rgba(100, 100, 100, 0)",b.lineWidth=3,b.strokeStyle="red",this.drawBoundary(a),this.handleArray[2].location=this.transform.transformPoint(new ED.Point(50,(-40))),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.IRMA.prototype.groupDescription=function(){return"Intraretinal microvascular abnormalities "},ED.IRMA.prototype.description=function(){return this.locationRelativeToFovea()},ED.KeraticPrecipitates=function(a,b){this.className="KeraticPrecipitates",this.savedParameterArray=["apexX","apexY","scaleX","scaleY","originX","originY"],ED.Doodle.call(this,a,b)},ED.KeraticPrecipitates.prototype=new ED.Doodle,ED.KeraticPrecipitates.prototype.constructor=ED.KeraticPrecipitates,ED.KeraticPrecipitates.superclass=ED.Doodle.prototype,ED.KeraticPrecipitates.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.KeraticPrecipitates.prototype.setPropertyDefaults=function(){this.isRotatable=!1,this.isUnique=!0,this.parameterValidationArray.apexX.range.setMinAndMax(-0,40),this.parameterValidationArray.apexY.range.setMinAndMax(-160,0),this.parameterValidationArray.scaleX.range.setMinAndMax(.5,1.5),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,1.5)},ED.KeraticPrecipitates.prototype.setParameterDefaults=function(){this.drawing.hasDoodleOfClass("Fundus")&&(this.originX=this.drawing.eye==ED.eye.Right?-100:100,this.scaleX=.5,this.scaleY=.5)},ED.KeraticPrecipitates.prototype.draw=function(a){var b=this.drawing.context;ED.KeraticPrecipitates.superclass.draw.call(this,a),b.beginPath();var c=200;if(b.arc(0,0,c,0,2*Math.PI,!0),b.closePath(),b.lineWidth=0,b.fillStyle="rgba(0, 0, 0, 0)",b.strokeStyle="rgba(0, 0, 0, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw)for(var d="rgba(110, 110, 110, 0.5)",e=10*((this.apexX+20)/20)/this.scaleX,f=new ED.Point(0,0),g=40+Math.abs(Math.floor(this.apexY/2)),h=0;h20?"Mutton fat keratic precipitates":"Keratic precipitates"},ED.KoeppeNodule=function(a,b){this.className="KoeppeNodule",this.savedParameterArray=["rotation"],ED.Doodle.call(this,a,b)},ED.KoeppeNodule.prototype=new ED.Doodle,ED.KoeppeNodule.prototype.constructor=ED.KoeppeNodule,ED.KoeppeNodule.superclass=ED.Doodle.prototype,ED.KoeppeNodule.prototype.setPropertyDefaults=function(){this.isScaleable=!1,this.isMoveable=!1},ED.KoeppeNodule.prototype.setParameterDefaults=function(){this.setRotationWithDisplacements(30,30)},ED.KoeppeNodule.prototype.draw=function(a){var b=this.drawing.context;ED.KoeppeNodule.superclass.draw.call(this,a);var c=260,d=this.drawing.lastDoodleOfClass("AntSeg");return d&&(c=-d.apexY),b.beginPath(),b.arc(0,-c,20,0,2*Math.PI,!1),b.fillStyle="rgba(150,100,50,1)",b.lineWidth=1,b.strokeStyle=b.fillStyle,this.drawBoundary(a),this.isClicked},ED.KoeppeNodule.prototype.groupDescription=function(){return"Koeppe nodules"},ED.KrukenbergSpindle=function(a,b){this.className="KrukenbergSpindle",this.savedParameterArray=["originX","originY","apexX","apexY"],ED.Doodle.call(this,a,b)},ED.KrukenbergSpindle.prototype=new ED.Doodle,ED.KrukenbergSpindle.prototype.constructor=ED.KrukenbergSpindle,ED.KrukenbergSpindle.superclass=ED.Doodle.prototype,ED.KrukenbergSpindle.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.KrukenbergSpindle.prototype.setPropertyDefaults=function(){this.isRotatable=!1,this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-380,-80)},ED.KrukenbergSpindle.prototype.setParameterDefaults=function(){this.apexY=-150,this.originY=200},ED.KrukenbergSpindle.prototype.draw=function(a){var b=this.drawing.context;return ED.KrukenbergSpindle.superclass.draw.call(this,a),b.beginPath(),this.addEllipseToPath(b,0,0,-this.apexY/2,2*-this.apexY),b.fillStyle=b.createPattern(this.drawing.imageArray.BrownSpotPattern,"repeat"),b.strokeStyle="rgba(255,128,0,0.5)",this.drawBoundary(a),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.KrukenbergSpindle.prototype.description=function(){return"Krukenberg spindle"},ED.LaserCircle=function(a,b){this.className="LaserCircle",this.savedParameterArray=["originX","originY","apexX","apexY","rotation"],ED.Doodle.call(this,a,b)},ED.LaserCircle.prototype=new ED.Doodle,ED.LaserCircle.prototype.constructor=ED.LaserCircle,ED.LaserCircle.superclass=ED.Doodle.prototype,ED.LaserCircle.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!0))},ED.LaserCircle.prototype.setPropertyDefaults=function(){this.parameterValidationArray.apexX.range.setMinAndMax(50,400),this.parameterValidationArray.apexY.range.setMinAndMax(-400,-50)},ED.LaserCircle.prototype.setParameterDefaults=function(){this.apexX=84,this.apexY=-84;var a=this.drawing.lastDoodleOfClass(this.className);if(a){var b=new ED.Point(a.originX,a.originY),c=new ED.Point(0,0);c.setWithPolars(b.length(),b.direction()+Math.PI/6),this.move(c.x,c.y)}else this.move(200*(this.drawing.eye==ED.eye.Right?-1:1),-300)},ED.LaserCircle.prototype.draw=function(a){var b=this.drawing.context;if(ED.LaserCircle.superclass.draw.call(this,a),b.beginPath(),b.moveTo(this.apexX,this.apexY),b.lineTo(this.apexX,-this.apexY),b.lineTo(-this.apexX,-this.apexY),b.lineTo(-this.apexX,this.apexY),b.lineTo(this.apexX,this.apexY),b.closePath(),b.lineWidth=0,b.fillStyle="rgba(0, 0, 0, 0)",b.strokeStyle="rgba(0, 0, 0, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var c=25,d=new ED.Point(0,0),e=this.apexX+this.apexY;if(e<0)var f=this.apexX;else var f=-this.apexY;for(var g=Math.round(Math.PI/(c/f)),h=0;h1.9*Math.PI&&(a+="360 degree "),a+="laser demarcation"},ED.LaserSpot=function(a,b){this.className="LaserSpot",this.savedParameterArray=["originX","originY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.LaserSpot.prototype=new ED.Doodle,ED.LaserSpot.prototype.constructor=ED.LaserSpot,ED.LaserSpot.superclass=ED.Doodle.prototype,ED.LaserSpot.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.LaserSpot.prototype.setPropertyDefaults=function(){this.parameterValidationArray.scaleX.range.setMinAndMax(.5,3),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,3)},ED.LaserSpot.prototype.setParameterDefaults=function(){this.scaleX=.75,this.scaleY=.75,this.setOriginWithDisplacements(100,80)},ED.LaserSpot.prototype.draw=function(a){var b=this.drawing.context;ED.LaserSpot.superclass.draw.call(this,a);var c=30;b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.closePath(),b.lineWidth=2*c/3,b.fillStyle="yellow",b.strokeStyle="rgba(255, 128, 0, 1)",this.drawBoundary(a);var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.LaserSpot.prototype.groupDescription=function(){return"Laser spots"},ED.LasikFlap=function(a,b){this.className="LasikFlap",this.hinge="",this.diameter=6,this.femtoLaser="",this.depth=80,this.angle=30,this.spotSeparation="",this.lineSeparation="",this.energyLevel="",this.OBLGrade="",this.savedParameterArray=["scaleX","scaleY","rotation","femtoLaser","diameter","depth","angle","spotSeparation","lineSeparation","energyLevel","OBLGrade"],this.controlParameterArray={hinge:"Hinge",femtoLaser:"Femto laser",diameter:"Diameter",depth:"Depth",angle:"Sidecut angle",spotSeparation:"Spot separation",lineSeparation:"Line separation",energyLevel:"Energy level",OBLGrade:"OBL grade"},ED.Doodle.call(this,a,b)},ED.LasikFlap.prototype=new ED.Doodle,ED.LasikFlap.prototype.constructor=ED.LasikFlap,ED.LasikFlap.superclass=ED.Doodle.prototype,ED.LasikFlap.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.LasikFlap.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.snapToAngles=!0,this.isUnique=!0;Math.PI/4;this.anglesArray=[0,this.drawing.eye==ED.eye.Right?Math.PI/2:3*Math.PI/2],this.parameterValidationArray.scaleX.range.setMinAndMax(.6,1),this.parameterValidationArray.scaleY.range.setMinAndMax(.6,1),this.parameterValidationArray.hinge={kind:"other",type:"string",list:["Superior","Nasal"],animate:!0},this.parameterValidationArray.diameter={kind:"derived",type:"float",range:new ED.Range(6,10),precision:1,animate:!0},this.parameterValidationArray.femtoLaser={kind:"other",type:"string",list:["DDL AMO iFS","Zeiss Visumax","Zeimer Z7"],animate:!0},this.parameterValidationArray.depth={kind:"other",type:"int",range:new ED.Range(80,200),animate:!1},this.parameterValidationArray.angle={kind:"other",type:"int",range:new ED.Range(30,150),animate:!1},this.parameterValidationArray.spotSeparation={kind:"other",type:"string",list:["0.5um","0.6um","0.7um","0.8um","0.9um","1.0um"],animate:!1},this.parameterValidationArray.lineSeparation={kind:"other",type:"string",list:["0.5um","0.6um","0.7um","0.8um","0.9um","1.0um"],animate:!1},this.parameterValidationArray.energyLevel={kind:"other",type:"string",list:["0.50uJ","0.55uJ","0.60uJ","0.65uJ","0.70uJ","0.75uJ","0.80uJ","0.85uJ","0.90uJ","0.95uJ","1.00uJ"],animate:!1},this.parameterValidationArray.OBLGrade={kind:"other",type:"string",list:["None","Trace outside pupillary axis","In pupillary axis"],animate:!1}},ED.LasikFlap.prototype.setParameterDefaults=function(){this.setParameterFromString("hinge","Superior"),this.setParameterFromString("femtoLaser","DDL AMO iFS"),this.setParameterFromString("diameter","8.5"),this.setParameterFromString("depth","110"),this.setParameterFromString("angle","90"),this.setParameterFromString("spotSeparation","0.6um"),this.setParameterFromString("lineSeparation","0.6um"),this.setParameterFromString("energyLevel","0.75uJ"),this.setParameterFromString("OBLGrade","None")},ED.LasikFlap.prototype.dependentParameterValues=function(a,b){var c=new Array;switch(a){case"scaleX":c.diameter=10*b;break;case"rotation":0==b?c.hinge="Superior":c.hinge="Nasal";break;case"diameter":c.scaleX=parseFloat(b)/10,c.scaleY=parseFloat(b)/10;break;case"hinge":"Superior"==b?c.rotation=0:c.rotation=this.drawing.eye==ED.eye.Right?Math.PI/2:3*Math.PI/2}return c},ED.LasikFlap.prototype.draw=function(a){var b=this.drawing.context;ED.LasikFlap.superclass.draw.call(this,a);var c=320,d=Math.PI/6,e=-Math.PI/2-d,f=-Math.PI/2+d;if(b.beginPath(),b.arc(0,0,c,e,f,!0),b.closePath(),b.fillStyle="rgba(155,255,255,0)",b.lineWidth=2,b.strokeStyle="rgba(100,100,100,0.9)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){switch(b.beginPath(),b.arc(0,0,c/2,0,2*Math.PI,!0),this.gradeDLK){case"None":b.fillStyle="rgba(155,255,255,0)";break;case"Grade 1":b.fillStyle="rgba(155,255,255,0.4)";break;case"Grade 2":b.fillStyle="rgba(155,255,255,0.6)";break;case"Grade 3":b.fillStyle="rgba(155,255,255,0.8)"}b.fill()}var g=new ED.Point(0,0);return g.setWithPolars(c,d),this.handleArray[2].location=this.transform.transformPoint(g),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.LasikFlap.prototype.description=function(){var a="";if(this.drawing.eye==ED.eye.Right)var b=!0;else var b=!1;var c=Math.cos(this.rotation),d=Math.sin(this.rotation),e=Math.abs(c),f=Math.abs(d),g="";return d>c&&f>e&&(g=b?"nasal":"temporal"),d>c&&fe&&(g=b?"temporal":"nasal"),d30&&(returnValue+="Lens subluxation: inferior"),"None"!=this.nuclearGrade&&(returnValue+=returnValue.length>0?", ":"",returnValue+=this.nuclearGrade+" nuclear cataract"),"None"!=this.corticalGrade&&(returnValue+=returnValue.length>0?", ":"",returnValue+=this.corticalGrade+" cortical cataract"),"None"!=this.posteriorSubcapsularGrade&&(returnValue+=returnValue.length>0?", ":"",returnValue+=this.posteriorSubcapsularGrade+" posterior subcapsular cataract"),this.coronary&&(returnValue+=returnValue.length>0?", ":"",returnValue+="Coronary cataract"),this.blueDot&&(returnValue+=returnValue.length>0?", ":"",returnValue+="Blue dot cataract"),this.anteriorPolar&&(returnValue+=returnValue.length>0?", ":"",returnValue+="Anterior polar cataract"),this.posteriorPolar&&(returnValue+=returnValue.length>0?", ":"",returnValue+="Posterior polar cataract"),this.phakodonesis&&(returnValue+=returnValue.length>0?", ":"",returnValue+="Phacodonesis"),returnValue},ED.Lens.prototype.snomedCodes=function(){return snomedCodes=new Array,"None"!=this.nuclearGrade&&snomedCodes.push([53889007,3]),"None"!=this.corticalGrade&&snomedCodes.push([193576003,3]),"None"!=this.posteriorSubcapsularGrade&&snomedCodes.push([315353005,3]),this.coronary&&snomedCodes.push([12195004,3]),this.anteriorPolar&&snomedCodes.push([253224008,3]),this.posteriorPolar&&snomedCodes.push([253225009,3]),this.phakodonesis&&snomedCodes.push([116669003,3]),snomedCodes},ED.LensCrossSection=function(a,b){this.className="LensCrossSection",this.nuclearGrade="None",this.corticalGrade="None",this.posteriorSubcapsularGrade="None",this.phakodonesis=!1,this.anteriorPolar=!1,this.posteriorPolar=!1,this.acd=3,this.savedParameterArray=["originX","originY","nuclearGrade","corticalGrade","posteriorSubcapsularGrade","phakodonesis","anteriorPolar","posteriorPolar","acd"],ED.Doodle.call(this,a,b),this.linkedDoodleParameters={Lens:{source:["originY","nuclearGrade","corticalGrade","posteriorSubcapsularGrade","phakodonesis","anteriorPolar","posteriorPolar"],store:[["originX","csOriginX"]]}}},ED.LensCrossSection.prototype=new ED.Doodle,ED.LensCrossSection.prototype.constructor=ED.LensCrossSection,ED.LensCrossSection.superclass=ED.Doodle.prototype,ED.LensCrossSection.prototype.setPropertyDefaults=function(){this.isUnique=!0,this.addAtBack=!0,this.parameterValidationArray.nuclearGrade={kind:"derived",type:"string",list:["None","Mild","Moderate","Brunescent"],animate:!1},this.parameterValidationArray.corticalGrade={kind:"derived",type:"string",list:["None","Mild","Moderate","White"],animate:!0},this.parameterValidationArray.posteriorSubcapsularGrade={kind:"derived",type:"string",list:["None","Small","Medium","Large"],animate:!1},this.parameterValidationArray.phakodonesis={kind:"other",type:"bool",display:!1},this.parameterValidationArray.anteriorPolar={kind:"derived",type:"bool",display:!1},this.parameterValidationArray.posteriorPolar={kind:"derived",type:"bool",display:!1},this.parameterValidationArray.acd={kind:"derived",type:"float",range:new ED.Range(0,5),precision:1,animate:!1},this.parameterValidationArray.originX.range.setMinAndMax(-150,200),this.parameterValidationArray.originY.range.setMinAndMax(-140,140)},ED.LensCrossSection.prototype.setParameterDefaults=function(){this.originX=44},ED.LensCrossSection.prototype.dependentParameterValues=function(a,b){var c=new Array;switch(a){case"originX":var d=this.drawing.lastDoodleOfClass("AntSegCrossSection");if(d){var e=d.parameterValidationArray.apexX.range.min,f=d.parameterValidationArray.apexX.range.max,g=32-72/220*(d.apexY+280)+this.originX-44;if(g20&&(h.x+=(g.x-20)/5);var j=new ED.Point(g.x+60*this.dir,1.45*g.y),k=new ED.Point(g.x-180*this.dir,1.16*g.y),l=this.squiggleArray[0].pointsArray[1],m=new ED.Point(c*this.dir,0+(l.y/5+19)),n=new ED.Point(-85*this.dir,1.3*l.y),o=new ED.Point(85*this.dir,1.35*l.y);if(b.beginPath(),b.moveTo(-510*this.dir,-510),b.lineTo(-510*this.dir,510),b.lineTo(510*this.dir,510),b.lineTo(510*this.dir,-510),b.lineTo(-510*this.dir,-510),b.moveTo(i.x,i.y),b.bezierCurveTo(n.x,n.y,o.x,o.y,m.x,m.y),b.bezierCurveTo(1.25*c*this.dir,.9*f,1.2*c*this.dir,f,h.x,h.y),b.bezierCurveTo(j.x,j.y,k.x,k.y,i.x,i.y),b.closePath(),b.lineWidth=5,b.fillStyle="white",b.strokeStyle="rgba(0,0,0,0)",b.shadowBlur=15,b.shadowColor="rgba(0,0,0,0.8)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){b.beginPath(),b.moveTo(-c*this.dir,0),b.bezierCurveTo(n.x,n.y,o.x,o.y,m.x,m.y),b.bezierCurveTo(1.25*c*this.dir,.9*f,1.2*c*this.dir,f,h.x,h.y),b.bezierCurveTo(j.x,j.y,k.x,k.y,i.x,i.y),b.moveTo(-c*this.dir,0),b.strokeStyle="black",b.stroke(),b.closePath(),b.beginPath(),b.moveTo(i.x,i.y),b.lineTo(i.x-.5*f*this.dir,i.y+.5*f-l.y/5-19),b.stroke(),b.closePath();var p=new ED.Point(g.x-170*this.dir,1.38*g.y),q=new ED.Point(g.x+70*this.dir,1.45*g.y);b.beginPath(),b.moveTo(-c*this.dir,0),b.bezierCurveTo(p.x,p.y,q.x,q.y,h.x,h.y),b.lineWidth=3,b.stroke(),b.closePath(),b.beginPath(),b.moveTo(-c*this.dir-.9*f*this.dir,.1*f),b.bezierCurveTo(1.3*-e*this.dir,1.2*-d,e*this.dir,1.2*-d,c*this.dir+f*this.dir,0),b.lineWidth=3,b.shadowBlur=7,b.shadowColor="black",b.stroke(),b.closePath()}return this.handleArray[0].location=this.transform.transformPoint(this.squiggleArray[0].pointsArray[0]),this.handleArray[1].location=this.transform.transformPoint(this.squiggleArray[0].pointsArray[1]),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.Lids.prototype.description=function(){var a=this.squiggleArray[0].pointsArray[0],b=this.squiggleArray[0].pointsArray[1],c="",d="";b.y>=-57&&b.y<-38?d="Mild ptosis":b.y>=-38&&b.y<-19?d="Moderate ptosis":b.y>=-19&&(d="Severe ptosis");var e="";return a.y>132&&a.x*this.dir>90?e="Medial ectropion":a.y>132&&a.x*this.dir<-90?e="Lateral ectropion":a.y>132&&(e="Ectropion"),d.length>0&&(c+=d),d.length>0&&e.length>0&&(c+=", "),e.length>0&&(c+=e),c},ED.LimbalRelaxingIncision=function(a,b){this.className="LimbalRelaxingIncision",this.savedParameterArray=["arc","rotation"],ED.Doodle.call(this,a,b)},ED.LimbalRelaxingIncision.prototype=new ED.Doodle,ED.LimbalRelaxingIncision.prototype.constructor=ED.LimbalRelaxingIncision,ED.LimbalRelaxingIncision.superclass=ED.Doodle.prototype,ED.LimbalRelaxingIncision.prototype.setHandles=function(){this.handleArray[3]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1))},ED.LimbalRelaxingIncision.prototype.setPropertyDefaults=function(){this.isScaleable=!1,this.isMoveable=!1,this.isRotatable=!0,this.isArcSymmetrical=!0,this.parameterValidationArray.arc.range.setMinAndMax(20*Math.PI/180,Math.PI/2)},ED.LimbalRelaxingIncision.prototype.setParameterDefaults=function(){this.arc=30*Math.PI/180;var a=this.drawing.lastDoodleOfClass(this.className);a?(this.rotation=a.rotation+Math.PI,this.arc=a.arc):this.drawing.eye==ED.eye.Right?this.rotation=-Math.PI/2:this.rotation=Math.PI/2},ED.LimbalRelaxingIncision.prototype.draw=function(a){var b=this.drawing.context;ED.LimbalRelaxingIncision.superclass.draw.call(this,a);var c=360,d=12,e=c+d,f=c-d;b.beginPath();var g=this.arc/2;b.arc(0,0,e,-Math.PI/2+g,-Math.PI/2-g,!0),b.arc(0,0,f,-Math.PI/2-g,-Math.PI/2+g,!1),b.closePath(),b.fillStyle="rgba(100,100,200,0.75)",b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.75)",this.drawBoundary(a);var h=new ED.Point(0,0);return h.setWithPolars(c,g),this.handleArray[3].location=this.transform.transformPoint(h),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.LimbalRelaxingIncision.prototype.description=function(){var a="Limbal relaxing incision "+(180*this.arc/Math.PI).toFixed(0)+" degrees at ";return a+=this.clockHour()+" o'clock"},ED.Macroaneurysm=function(a,b){this.className="Macroaneurysm",this.savedParameterArray=["originX","originY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.Macroaneurysm.prototype=new ED.Doodle,ED.Macroaneurysm.prototype.constructor=ED.Macroaneurysm,ED.Macroaneurysm.superclass=ED.Doodle.prototype,ED.Macroaneurysm.prototype.setParameterDefaults=function(){this.setOriginWithRotations(300,60,60)},ED.Macroaneurysm.prototype.draw=function(a){var b=this.drawing.context;ED.Macroaneurysm.superclass.draw.call(this,a);var c=50;return b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.lineWidth=1,b.strokeStyle="red",b.fillStyle="red",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&this.apexY>-70&&(b.beginPath(),b.arc(0,0,25,0,2*Math.PI,!0),b.fillStyle="rgba(197,186,80,1)",b.fill()),this.isClicked},ED.Macroaneurysm.prototype.description=function(){return"Macroaneurysm"},ED.Macroaneurysm.prototype.snomedCode=function(){return 247124009},ED.MaculaPostPole=function(a,b){this.className="MaculaPostPole",this.watzke="Not assessed",this.savedParameterArray=["watzke"],this.controlParameterArray={watzke:"Watzke Result"},ED.Doodle.call(this,a,b)},ED.MaculaPostPole.prototype=new ED.Doodle,ED.MaculaPostPole.prototype.constructor=ED.MaculaPostPole,ED.MaculaPostPole.superclass=ED.Doodle.prototype,ED.MaculaPostPole.prototype.setHandles=function(){},ED.MaculaPostPole.prototype.setPropertyDefaults=function(){this.isDeletable=!1,this.isScaleable=!1,this.isMoveable=!1,this.isRotatable=!1,this.isUnique=!0,this.willReport=!0,this.inFrontOfClassArray=["PostPole"],this.parameterValidationArray.watzke={kind:"derived",type:"string",list:["Not assessed","Normal","Abnormal"],animate:!0}},ED.MaculaPostPole.prototype.draw=function(a){var b=this.drawing.context;ED.MaculaPostPole.superclass.draw.call(this,a);this.drawing.eye==ED.eye.Right?300:-300;return b.beginPath(),b.lineWidth=4,b.strokeStyle="rgba(249,187,76,0)",b.fillStyle="rgba(249,187,76,0)",b.arc(0,0,20,0,2*Math.PI,!0),this.drawBoundary(a),this.isClicked},ED.MaculaPostPole.prototype.description=function(){var a="";return"Not assessed"!==this.watzke&&(a+="Watzke: "+this.watzke.toLowerCase()+" "),0===a.length&&1===this.drawing.doodleArray.length&&(a="No abnormality"),a},ED.MacularDystrophy=function(a,b){this.className="MacularDystrophy",this.savedParameterArray=["apexX","apexY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.MacularDystrophy.prototype=new ED.Doodle,ED.MacularDystrophy.prototype.constructor=ED.MacularDystrophy,ED.MacularDystrophy.superclass=ED.Doodle.prototype,ED.MacularDystrophy.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.MacularDystrophy.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isRotatable=!1,this.isUnique=!0,this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-100,100)},ED.MacularDystrophy.prototype.setParameterDefaults=function(){this.apexY=-100},ED.MacularDystrophy.prototype.draw=function(a){var b=this.drawing.context;ED.MacularDystrophy.superclass.draw.call(this,a);var c=150;b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.lineWidth=1,b.strokeStyle="rgba(255,0,0,0)",b.fillStyle="rgba(255,0,0,0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(this.apexY<-50?(b.beginPath(),b.moveTo(-200,0),b.bezierCurveTo(-200,-70,-100,-140,0,-140),b.bezierCurveTo(100,-140,200,-70,200,0),b.bezierCurveTo(200,70,100,140,0,140),b.bezierCurveTo(-100,140,-200,70,-200,0),b.fillStyle="rgba(223,80,20,1)",b.fill(),b.beginPath(),b.moveTo(-100,0),b.bezierCurveTo(-100,-35,-50,-70,0,-70),b.bezierCurveTo(50,-70,100,-35,100,0),b.bezierCurveTo(100,35,50,70,0,70),b.bezierCurveTo(-50,70,-100,35,-100,0),b.fillStyle="rgba(125,65,54,1)",b.fill()):this.apexY<0?(b.beginPath(),b.arc(0,0,100,0,2*Math.PI,!0),b.fillStyle="yellow",b.strokeStyle="brown",b.lineWidth=20,b.fill(),b.stroke()):(b.beginPath(),b.arc(0,0,120,0,2*Math.PI,!0),b.fillStyle="rgba(255, 120, 120, 0.5)",b.strokeStyle=b.fillStyle,b.lineWidth=1,b.fill()));var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.MacularDystrophy.prototype.groupDescription=function(){return this.apexY<-50?"Bull's eye maculopathy":this.apexY<0?"Vitelliform macular dystrophy":"Atrophic macular dystrophy"},ED.MacularDystrophy.prototype.snomedCode=function(){return 276436007},ED.MacularGrid=function(a,b){this.className="MacularGrid",this.savedParameterArray=["apexY","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.MacularGrid.prototype=new ED.Doodle,ED.MacularGrid.prototype.constructor=ED.MacularGrid,ED.MacularGrid.superclass=ED.Doodle.prototype,ED.MacularGrid.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.MacularGrid.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isRotatable=!1,this.isUnique=!0,this.addAtBack=!0,this.parameterValidationArray.scaleX.range.setMinAndMax(.5,1),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,1),this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-150,-50)},ED.MacularGrid.prototype.setParameterDefaults=function(){this.apexY=-100,this.scaleX=.7,this.scaleY=.7},ED.MacularGrid.prototype.draw=function(a){var b=this.drawing.context;ED.PRPPostPole.superclass.draw.call(this,a);var c=250,d=-this.apexY;if(b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.arc(0,0,d,2*Math.PI,0,!1),b.closePath(),b.lineWidth=4,b.fillStyle="rgba(0, 0, 0, 0)",b.strokeStyle="rgba(255, 255, 255, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var e=60;n=Math.floor(2*c/e);for(var f=-n/2*e,g=0;g=d*d&&k<=c*c&&this.drawLaserSpot(b,i,j)}}var l=new ED.Point(0,0);return l.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(l),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.MacularGrid.prototype.description=function(){return"Macular grid laser"},ED.MacularHole=function(a,b){this.className="MacularHole",this.savedParameterArray=["originX","scaleX","scaleY"],ED.Doodle.call(this,a,b)},ED.MacularHole.prototype=new ED.Doodle,ED.MacularHole.prototype.constructor=ED.MacularHole,ED.MacularHole.superclass=ED.Doodle.prototype,ED.MacularHole.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Scale,(!1))},ED.MacularHole.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isRotatable=!1,this.isUnique=!0,this.parameterValidationArray.scaleX.range.setMinAndMax(.5,1.5),this.parameterValidationArray.scaleY.range.setMinAndMax(.5,1.5)},ED.MacularHole.prototype.setParameterDefaults=function(){this.drawing.hasDoodleOfClass("Fundus")&&(this.originX=this.drawing.eye==ED.eye.Right?-100:100,this.scaleX=.5,this.scaleY=.5)},ED.MacularHole.prototype.draw=function(a){var b=this.drawing.context;ED.MacularHole.superclass.draw.call(this,a);var c=40;return b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.closePath(),b.lineWidth=0,b.fillStyle="yellow",b.strokeStyle="red",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(b.beginPath(),b.arc(0,0,2*c/3,0,2*Math.PI,!0),b.closePath(),b.fillStyle="red",b.fill()),point=new ED.Point(0,0),point.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(point),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.MacularHole.prototype.description=function(){return"Macular hole"},ED.MacularHole.prototype.snomedCode=function(){return 232006002},ED.MacularHole.prototype.diagnosticHierarchy=function(){return 2},ED.MacularThickening=function(a,b){this.className="MacularThickening",this.savedParameterArray=["originX","originY","apexX","apexY"],ED.Doodle.call(this,a,b),this.rotation=-Math.PI/4},ED.MacularThickening.prototype=new ED.Doodle,ED.MacularThickening.prototype.constructor=ED.MacularThickening,ED.MacularThickening.superclass=ED.Doodle.prototype,ED.MacularThickening.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.MacularThickening.prototype.setPropertyDefaults=function(){this.parameterValidationArray.apexX.range.setMinAndMax(100,400),this.parameterValidationArray.apexY.range.setMinAndMax(-0,0)},ED.MacularThickening.prototype.setParameterDefaults=function(){this.apexX=100,this.apexY=0,this.setOriginWithDisplacements(0,150)},ED.MacularThickening.prototype.draw=function(a){var b=this.drawing.context;ED.MacularThickening.superclass.draw.call(this,a);var c=Math.sqrt(this.apexX*this.apexX+this.apexY*this.apexY);if(b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.lineWidth=3,b.strokeStyle="rgba(255, 255, 255, 0)",b.fillStyle="rgba(255, 255, 255, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){b.beginPath();var d=30;b.moveTo(-c,0),b.lineTo(c,0);for(var e=-1;e<2;e+=2)for(var f=d;f1.1*c?e?b.endHour=this.squiggleArray[0].pointsArray[i].clockHour():(b={},b.startHour=this.squiggleArray[0].pointsArray[i].clockHour(),b.endHour=this.squiggleArray[0].pointsArray[i].clockHour(),e=!0):e&&(d.push(b),e=!1),h===this.numberOfHandles-1&&e&&(b.endHour=this.squiggleArray[0].pointsArray[i].clockHour(),d.push(b),e=!1)}if(d.length>0){var j=d.length>1;a=j?"Notches":"Notch";for(var k=0;k300?300:f,this.squiggleArray[0].pointsArray[c].setWithPolars(f,e)}},ED.OpticDisc.prototype.resetHandles=function(){for(var a=0;a1.5&&(a="Large "),a+="outer leaf break ",a+=this.clockHour()+" o'clock"},ED.PalpebralConjunctivitis=function(a,b){this.className="PalpebralConjunctivitis",this.type="Papillary",this.hyperaemia="+",this.savedParameterArray=["type","hyperaemia"],this.controlParameterArray={type:"Type",hyperaemia:"Hyperaemia"},ED.Doodle.call(this,a,b)},ED.PalpebralConjunctivitis.prototype=new ED.Doodle,ED.PalpebralConjunctivitis.prototype.constructor=ED.PalpebralConjunctivitis,ED.PalpebralConjunctivitis.superclass=ED.Doodle.prototype,ED.PalpebralConjunctivitis.prototype.setPropertyDefaults=function(){this.isUnique=!0,this.isMoveable=!1,this.isRotatable=!1,this.addAtBack=!0,this.parameterValidationArray.type={kind:"other",type:"string",list:["Papillary","Follicular"],animate:!1},this.parameterValidationArray.hyperaemia={kind:"other",type:"string",list:["+","++","+++"],animate:!1}},ED.PalpebralConjunctivitis.prototype.setParameterDefaults=function(){}, ED.PalpebralConjunctivitis.prototype.draw=function(a){var b=this.drawing.context;ED.PalpebralConjunctivitis.superclass.draw.call(this,a);var c=480,d=700,e=c-d,f=Math.asin(e/c),g=c*Math.cos(f);b.moveTo(-g,.5*e),b.arc(0,.5*-e,c,f,Math.PI-f,!0),b.lineTo(-g,.5*e),b.moveTo(-g,.5*-e),b.arc(0,.5*e,c,-f,Math.PI+f,!1),b.lineTo(-g,.5*-e),b.stroke(),b.lineWidth=4;var h=b.createPattern(this.drawing.imageArray.NewVesselPattern,"repeat");return b.fillStyle=h,b.strokeStyle="pink","+"==this.hyperaemia?b.filter="opacity(10%)":"++"==this.hyperaemia?b.filter="opacity(30%)":"+++"==this.hyperaemia&&(b.filter="opacity(50%)"),this.drawBoundary(a),b.filter="none",this.isClicked},ED.PalpebralConjunctivitis.prototype.description=function(){var a=this.type+" conjunctivitis";return a+=" with "+this.hyperaemia+" hyperaemia"},ED.Papilloedema=function(a,b){this.className="Papilloedema",ED.Doodle.call(this,a,b)},ED.Papilloedema.prototype=new ED.Doodle,ED.Papilloedema.prototype.constructor=ED.Papilloedema,ED.Papilloedema.superclass=ED.Doodle.prototype,ED.Papilloedema.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.isRotatable=!1,this.isUnique=!0,this.addAtBack=!0},ED.Papilloedema.prototype.draw=function(a){var b=this.drawing.context;ED.Papilloedema.superclass.draw.call(this,a);var c=450,d=300;b.beginPath(),b.arc(0,0,c,0,2*Math.PI,!0),b.arc(0,0,d,2*Math.PI,0,!1),b.closePath(),b.lineWidth=0,yellowColour="rgba(255, 255, 0, 0.75)";var e="rgba(240, 140, 40, 0.75)",f=b.createRadialGradient(0,0,c,0,0,d);return f.addColorStop(0,yellowColour),f.addColorStop(1,e),b.fillStyle=f,b.strokeStyle="rgba(0,0,0,0)",this.drawBoundary(a),this.isClicked},ED.Papilloedema.prototype.description=function(){return"Papilloedema"},ED.Patch=function(a,b){this.className="Patch",this.material="Sclera",this.savedParameterArray=["originX","originY","width","height","apexX","material"],this.controlParameterArray={material:"Material"},ED.Doodle.call(this,a,b)},ED.Patch.prototype=new ED.Doodle,ED.Patch.prototype.constructor=ED.Patch,ED.Patch.superclass=ED.Doodle.prototype,ED.Patch.prototype.setHandles=function(){this.handleArray[3]=new ED.Doodle.Handle(null,(!0),ED.Mode.Size,(!1))},ED.Patch.prototype.setPropertyDefaults=function(){this.isOrientated=!0,this.parameterValidationArray.material={kind:"other",type:"string",list:["Sclera","Tenons","Tutoplast","Cornea"],list:["Sclera","Tenons","Tutoplast","Cornea"],animate:!1}},ED.Patch.prototype.setParameterDefaults=function(){this.width=200,this.height=200,this.setParameterFromString("material","Sclera");var a=this.drawing.lastDoodleOfClass("Tube");if(a){var b=this.drawing.eye==ED.eye.Right;switch(a.platePosition){case"STQ":this.originX=b?-350:350,this.originY=-350,this.rotation=(b?7:1)*Math.PI/4;break;case"SNQ":this.originX=b?350:-350,this.originY=-350,this.rotation=(b?1:7)*Math.PI/4;break;case"INQ":this.originX=b?350:-350,this.originY=350,this.rotation=(b?3:5)*Math.PI/4;break;case"ITQ":this.originX=b?-350:350,this.originY=350,this.rotation=(b?5:3)*Math.PI/4}}var a=this.drawing.lastDoodleOfClass("TrabyFlap");a&&(this.originY=-360,this.width=488,this.height=228)},ED.Patch.prototype.draw=function(a){var b=this.drawing.context;switch(ED.Patch.superclass.draw.call(this,a),b.beginPath(),b.rect(-this.width/2,-this.height/2,this.width,this.height),b.closePath(),this.material){case"Sclera":b.fillStyle="rgba(200,200,50,0.5)";break;case"Cornea":b.fillStyle="rgba(180,180,180,0.5)";break;case"Tenons":b.fillStyle="rgba(200,200,200,0.5)";break;case"Tutoplast":b.fillStyle="rgba(230,230,230,0.5)"}if(b.strokeStyle="rgba(120,120,120,0.5)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){var c=this.width/2,d=this.height/2-10;this.drawSpot(b,-c,-d,5,"blue"),this.drawSpot(b,-c,d,5,"blue"),this.drawSpot(b,c,-d,5,"blue"),this.drawSpot(b,c,d,5,"blue")}return this.handleArray[3].location=this.transform.transformPoint(new ED.Point(this.width/2,-this.height/2)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.Patch.prototype.description=function(){return this.material+" patch"},ED.PCIOL=function(a,b){this.className="PCIOL",this.fixation="In-the-bag",this.fx=1,this.csOriginX=0,this.savedParameterArray=["fixation","fx","originX","originY","rotation","csOriginX"],this.controlParameterArray={fixation:"Fixation"},ED.Doodle.call(this,a,b),this.scaleX=.75,this.scaleY=.75},ED.PCIOL.prototype=new ED.Doodle,ED.PCIOL.prototype.constructor=ED.PCIOL,ED.PCIOL.superclass=ED.Doodle.prototype,ED.PCIOL.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Rotate,(!1))},ED.PCIOL.prototype.setPropertyDefaults=function(){this.addAtBack=!0,this.isScaleable=!1,this.isUnique=!0,this.parameterValidationArray.fixation={kind:"derived",type:"string",list:["In-the-bag","Ciliary sulcus","Partly in the bag"],animate:!0},this.parameterValidationArray.fx={kind:"other",type:"int",range:new ED.Range(1,8),animate:!1},this.parameterValidationArray.originX.range.setMinAndMax(-200,200),this.parameterValidationArray.originY.range.setMinAndMax(-200,200)},ED.PCIOL.prototype.dependentParameterValues=function(a,b){var c=new Array;switch(a){case"fx":1===b&&(c.fixation="In-the-bag"),2===b&&(c.fixation="Partly in the bag"),3===b&&(c.fixation="Ciliary sulcus");break;case"fixation":switch(b){case"In-the-bag":this.setParameterFromString("fx","1",!0);break;case"Partly in the bag":this.setParameterFromString("fx","2",!0);break;case"Ciliary sulcus":this.setParameterFromString("fx","3",!0)}}return c},ED.PCIOL.prototype.draw=function(a){var b=this.drawing.context;ED.PCIOL.superclass.draw.call(this,a),b.beginPath();var c=240;b.arc(0,0,c,0,2*Math.PI,!1),b.moveTo(150,-190),b.bezierCurveTo(160,-200,190,-350,160,-380),b.bezierCurveTo(90,-440,-150,-410,-220,-370),b.bezierCurveTo(-250,-350,-260,-400,-200,-430),b.bezierCurveTo(-110,-480,130,-470,200,-430),b.bezierCurveTo(270,-390,220,-140,220,-100),b.moveTo(-150,190),b.bezierCurveTo(-160,200,-190,350,-160,380),b.bezierCurveTo(-90,440,150,410,220,370),b.bezierCurveTo(250,350,260,400,200,430),b.bezierCurveTo(110,480,-130,470,-200,430),b.bezierCurveTo(-270,390,-220,140,-220,100),b.fillStyle="rgba(255,255,255,0.75)",b.lineWidth=4,b.strokeStyle="darkgray",this.drawBoundary(a);var d=new ED.Point(0,0);return d.setWithPolars(c,Math.PI/4),this.handleArray[2].location=this.transform.transformPoint(d),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.PCIOL.prototype.description=function(){var a="Posterior chamber IOL";a+=" ("+this.fixation+" fixation)";var b=40,c="";return this.originY<-b&&(c.length>0&&(c+=" and"),c+=" superiorly"),this.originY>b&&(c.length>0&&(c+=" and"),c+=" inferiorly"),this.originX<-b&&(c.length>0&&(c+=" and"),c+=this.drawing.eye==ED.eye.Right?" temporally":" nasally"),this.originX>b&&(c.length>0&&(c+=" and"),c+=this.drawing.eye==ED.eye.Right?" nasally":" temporally"),c.length>0&&(a+=" displaced"+c),a},ED.PCIOLCrossSection=function(a,b){this.className="PCIOLCrossSection",this.fixation="In-the-bag",this.fx=1,this.savedParameterArray=["fixation","fx","originX","originY"],this.controlParameterArray={fixation:"Fixation"},ED.Doodle.call(this,a,b),this.linkedDoodleParameters={PCIOL:{source:["fixation","fx","originY"],store:[["originX","csOriginX"]]}}},ED.PCIOLCrossSection.prototype=new ED.Doodle,ED.PCIOLCrossSection.prototype.constructor=ED.PCIOLCrossSection,ED.PCIOLCrossSection.superclass=ED.Doodle.prototype,ED.PCIOLCrossSection.prototype.setPropertyDefaults=function(){this.isUnique=!0,this.inFrontOfClassArray=["HypopyonCrossSection","HyphaemaCrossSection"],this.addAtBack=!0,this.parameterValidationArray.fixation={kind:"derived",type:"string",list:["In-the-bag","Ciliary sulcus","Partly in the bag"],animate:!0},this.parameterValidationArray.fx={kind:"other",type:"int",range:new ED.Range(1,3),animate:!1},this.parameterValidationArray.originX.range.setMinAndMax(-150,44),this.parameterValidationArray.originY.range.setMinAndMax(-140,140)},ED.PCIOLCrossSection.prototype.setParameterDefaults=function(){this.originX=44},ED.PCIOLCrossSection.prototype.dependentParameterValues=function(a,b){var c=new Array;switch(a){case"fx":1===b&&(c.fixation="In-the-bag"),2===b&&(c.fixation="Partly in the bag"),3===b&&(c.fixation="Ciliary sulcus");break;case"fixation":switch(b){case"In-the-bag":this.setParameterFromString("fx","1",!0);break;case"Partly in the bag":this.setParameterFromString("fx","2",!0);break;case"Ciliary sulcus":this.setParameterFromString("fx","3",!0)}break;case"originX":var d=this.drawing.lastDoodleOfClass("AntSegCrossSection");if(d){var e=d.parameterValidationArray.apexX.range.min,f=32-72/220*(d.apexY+280)+this.originX;if(fg&&(g=b,f=this.drawing.eye==ED.eye.Right?"temporally":"nasally"),c>g&&(g=c,f="superiorly"),d>g&&(g=d,f=this.drawing.eye==ED.eye.Right?"nasally":"temporally"),e>g&&(g=e,f="inferiorly"),g>this.radius){var h="Mild";g>350&&(h="Moderate"),g>400&&(h="Signficant"),a+=h,a+=" peri-papillary atrophy, maximum ",a+=f}return a},ED.PeripheralRetinectomy=function(a,b){this.className="PeripheralRetinectomy",this.extent="",this.savedParameterArray=["apexY","arc","rotation"],ED.Doodle.call(this,a,b)},ED.PeripheralRetinectomy.prototype=new ED.Doodle,ED.PeripheralRetinectomy.prototype.constructor=ED.PeripheralRetinectomy,ED.PeripheralRetinectomy.superclass=ED.Doodle.prototype,ED.PeripheralRetinectomy.prototype.setHandles=function(){this.handleArray[0]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1)),this.handleArray[3]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.PeripheralRetinectomy.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.parameterValidationArray.arc.range.setMinAndMax(Math.PI/4,2*Math.PI),this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-450,-350)},ED.PeripheralRetinectomy.prototype.setParameterDefaults=function(){this.arc=240*Math.PI/180,this.apexY=-380;var a=this.drawing.lastDoodleOfClass(this.className);a?this.rotation=a.rotation+Math.PI/4:this.rotation=Math.PI},ED.PeripheralRetinectomy.prototype.draw=function(a){var b=this.drawing.context;ED.PeripheralRetinectomy.superclass.draw.call(this,a);var c=476,d=-this.apexY,e=d+(c-d)/2,f=this.arc/2,g=-Math.PI/2+f,h=-Math.PI/2-f,i=e*Math.sin(f),j=-e*Math.cos(f),k=-e*Math.sin(f),l=j;if(b.beginPath(),b.arc(0,0,c,g,h,!0),b.arc(0,0,d,h,g,!1),b.lineWidth=4,b.fillStyle="rgba(255,255,0,0)",b.strokeStyle="rgba(255,0,255,0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw){if(b.beginPath(),this.arc<1.95*Math.PI){var m=f-Math.PI/24,n=f-2*Math.PI/24,o=new ED.Point(c*Math.sin(f),-c*Math.cos(f)),p=new ED.Point(e*Math.sin(f),-e*Math.cos(f)),q=new ED.Point(d*Math.sin(m),-d*Math.cos(m)),r=new ED.Point(d*Math.sin(n),-d*Math.cos(n));g=-Math.PI/2+n,h=-Math.PI/2-n;var s=(new ED.Point(-d*Math.sin(n),-d*Math.cos(n)),new ED.Point(-d*Math.sin(m),-d*Math.cos(m))),t=new ED.Point(-e*Math.sin(f),-e*Math.cos(f)),u=new ED.Point(-c*Math.sin(f),-c*Math.cos(f));b.moveTo(o.x,o.y),b.bezierCurveTo(p.x,p.y,q.x,q.y,r.x,r.y),b.arc(0,0,d,g,h,!0),b.bezierCurveTo(s.x,s.y,t.x,t.y,u.x,u.y);var v=10*Math.floor(18*this.arc/Math.PI);this.extent="Retinectomy of "+v+" degrees centred at "+this.clockHour()+" o'clock"}else b.arc(0,0,d,0,2*Math.PI,!0),this.extent="360 degree retinectomy";b.lineWidth=16,b.strokeStyle="red",b.stroke()}return this.handleArray[0].location=this.transform.transformPoint(new ED.Point(k,l)),this.handleArray[3].location=this.transform.transformPoint(new ED.Point(i,j)),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.PeripheralRetinectomy.prototype.description=function(){return this.extent},ED.PeripheralRRD=function(a,b){this.className="PeripheralRRD",this.savedParameterArray=["apexY","arc","rotation"],ED.Doodle.call(this,a,b)},ED.PeripheralRRD.prototype=new ED.Doodle,ED.PeripheralRRD.prototype.constructor=ED.PeripheralRRD,ED.PeripheralRRD.superclass=ED.Doodle.prototype,ED.PeripheralRRD.prototype.setHandles=function(){this.handleArray[0]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1)),this.handleArray[3]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.PeripheralRRD.prototype.setPropertyDefaults=function(){this.isMoveable=!1,this.parameterValidationArray.arc.range.setMinAndMax(Math.PI/4,2*Math.PI),this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-400,-300)},ED.PeripheralRRD.prototype.setParameterDefaults=function(){this.arc=112*Math.PI/180,this.apexY=-380;var a=this.drawing.lastDoodleOfClass(this.className);a?this.drawing.eye==ED.eye.Right:this.drawing.eye==ED.eye.Right?this.rotation=-.8*Math.PI:this.rotation=.8*Math.PI},ED.PeripheralRRD.prototype.draw=function(a){var b=this.drawing.context;ED.PeripheralRRD.superclass.draw.call(this,a);var c=476,d=-this.apexY,e=d+(c-d)/2,f=c-d,g=this.arc/2,h=-Math.PI/2+g,i=-Math.PI/2-g,j=e*Math.sin(g),k=-e*Math.cos(g),l=-e*Math.sin(g),m=k,n=new ED.Point(0,0);n.x=-c*Math.sin(g-f/c),n.y=-c*Math.cos(g-f/c);var o=new ED.Point(0,0);o.x=-c*Math.sin(-g+f/c),o.y=-c*Math.cos(-g+f/c),b.beginPath(),b.arc(0,0,c,h,i,!0);var p=i-Math.PI/2;return b.arc(n.x,n.y,f,p,p-Math.PI/2+f/c,!0),b.arc(0,0,d,n.direction()-Math.PI/2,o.direction()-Math.PI/2,!1),p=h+Math.PI/2,b.arc(o.x,o.y,f,p+Math.PI/2-f/c,p,!0),b.closePath(),b.lineWidth=4,b.fillStyle="rgba(0, 0, 255, 0.75)",b.strokeStyle="blue",this.drawBoundary(a),this.handleArray[0].location=this.transform.transformPoint(new ED.Point(l,m)),this.handleArray[3].location=this.transform.transformPoint(new ED.Point(j,k)),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.PeripheralRRD.prototype.snomedCode=function(){return 232008001},ED.PeripheralRRD.prototype.diagnosticHierarchy=function(){return 8},ED.PhakoIncision=function(a,b){this.className="PhakoIncision",this.defaultRadius=330,this.sutureSeparation=1.5,this.incisionSite="Corneal",this.incisionType="Pocket",this.incisionMeridian=0,this.savedParameterArray=["apexY","arc","rotation","radius"],ED.Doodle.call(this,a,b),this.apexYDelta=this.radius+this.apexY},ED.PhakoIncision.prototype=new ED.Doodle,ED.PhakoIncision.prototype.constructor=ED.PhakoIncision,ED.PhakoIncision.superclass=ED.Doodle.prototype,ED.PhakoIncision.prototype.setHandles=function(){this.handleArray[3]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1)),this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.PhakoIncision.prototype.setPropertyDefaults=function(){this.isScaleable=!1,this.isMoveable=!1,this.isRotatable=!0,this.isArcSymmetrical=!0,this.parameterValidationArray.radius.range.setMinAndMax(250,450),this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.incisionMeridian={kind:"derived",type:"mod",range:new ED.Range(0,360),clock:"bottom",animate:!0},this.parameterValidationArray.incisionLength={kind:"derived",type:"float",range:new ED.Range(1,9.9),precision:1,animate:!0},this.parameterValidationArray.incisionSite={kind:"derived",type:"string",list:["Corneal","Limbal","Scleral"],animate:!0},this.parameterValidationArray.incisionType={kind:"derived",type:"string",list:["Pocket","Section"],animate:!1}},ED.PhakoIncision.prototype.setParameterDefaults=function(){this.setParameterFromString("incisionSite","Corneal"),this.setParameterFromString("incisionLength","3.5"),this.setParameterFromString("incisionType","Pocket"),this.setRotationWithDisplacements(90,-90)},ED.PhakoIncision.prototype.dependentParameterValues=function(a,b){var c={};switch(a){case"rotation":var d=(180*(2*Math.PI-b+Math.PI/2)/Math.PI+360)%360;360==d&&(d=0),c.incisionMeridian=d;break;case"arc":c.incisionLength=b*(6*this.radius)/this.defaultRadius;break;case"radius":b>=428?c.incisionSite="Scleral":b>=344?c.incisionSite="Limbal":c.incisionSite="Corneal",c.arc=this.incisionLength*this.defaultRadius/(6*b),this.updateArcRange(),c.apexY=this.apexYDelta-b,this.parameterValidationArray.apexY.range.setMinAndMax(-b,-b+34);break;case"apexY":c.apexYDelta=this.radius+b,c.incisionType=this.radius+b>0?"Section":"Pocket";break;case"incisionMeridian":c.rotation=(90-b+360)%360*Math.PI/180;break;case"incisionLength":c.arc=b*this.defaultRadius/(6*this.radius),this.updateArcRange();break;case"incisionSite":switch(b){case"Scleral":c.radius=428;break;case"Limbal":c.radius=376;break;case"Corneal":c.radius=330}break;case"incisionType":switch(b){case"Pocket":c.apexYDelta=0,c.apexY=-this.radius;break;case"Section":c.apexYDelta=34,c.apexY=34-this.radius}}return c},ED.PhakoIncision.prototype.updateArcRange=function(){this.radius>0?(this.parameterValidationArray.arc.range.min=this.parameterValidationArray.incisionLength.range.min*this.defaultRadius/(6*this.radius),this.parameterValidationArray.arc.range.max=this.parameterValidationArray.incisionLength.range.max*this.defaultRadius/(6*this.radius)):ED.errorHandler("ED.PhakoIncision","updateArcRange","Attempt to calculate a range of arc using an illegal value of radius: "+this.radius)},ED.PhakoIncision.prototype.draw=function(a){var b=this.drawing.context;ED.PhakoIncision.superclass.draw.call(this,a);var c=this.radius,d=40,e=c+d,f=c-d;b.beginPath();var g=this.arc/2;if(b.arc(0,0,e,-Math.PI/2+g,-Math.PI/2-g,!0),b.arc(0,0,f,-Math.PI/2-g,-Math.PI/2+g,!1),b.closePath(),0==this.apexYDelta?(b.fillStyle="rgba(200,200,200,0.75)",b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.75)"):(b.fillStyle="rgba(200,200,200,0)",b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0)"),this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&0!=this.apexYDelta){b.beginPath(),b.arc(0,0,c,-Math.PI/2+g,-Math.PI/2-g,!0);var h=this.sutureSeparation*this.defaultRadius/(6*this.radius),i=new ED.Point(0,0),j=g-h/2;do i.setWithPolars(c-d,j),b.moveTo(i.x,i.y),i.setWithPolars(c+d,j),b.lineTo(i.x,i.y),j-=h;while(j>-g);b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.75)",b.stroke()}var k=new ED.Point(0,0);return k.setWithPolars(c,g),this.handleArray[3].location=this.transform.transformPoint(k),this.handleArray[4].location=this.transform.transformPoint(new ED.Point(this.apexX,this.apexY)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.PhakoIncision.prototype.description=function(){var a="";return a=this.radius>428?"Scleral ":this.radius>344?"Limbal ":"Corneal ",a+=this.incisionType?this.incisionType.toLowerCase()+" ":this.apexY+this.radius==0?"pocket ":"section ",a+="incision at ",a+=this.clockHour()+" o'clock"},ED.PI=function(a,b){this.className="PI",this.type="Surgical",this.patent=!0,this.savedParameterArray=["rotation","type","patent"],this.controlParameterArray={type:"Type",patent:"Patent"},ED.Doodle.call(this,a,b)},ED.PI.prototype=new ED.Doodle,ED.PI.prototype.constructor=ED.PI,ED.PI.superclass=ED.Doodle.prototype,ED.PI.prototype.setPropertyDefaults=function(){this.isScaleable=!1,this.isMoveable=!1,this.parameterValidationArray.type={kind:"derived",type:"string",list:["Surgical","Laser"],animate:!1},this.parameterValidationArray.patent={kind:"derived",type:"bool",display:!1}},ED.PI.prototype.setParameterDefaults=function(){this.setRotationWithDisplacements(30,-30)},ED.PI.prototype.draw=function(a){var b=this.drawing.context;ED.PI.superclass.draw.call(this,a);var c=360;switch(b.beginPath(),this.type){case"Surgical":var d=Math.PI/24;b.arc(0,0,c,-d-Math.PI/2,d-Math.PI/2,!1),b.lineTo(0,.8*-c),b.closePath();break;case"Laser":b.arc(0,.9*-c,36,0,2*Math.PI,!0)}return b.lineWidth=4,b.strokeStyle="rgba(120,120,120,0.75)",this.patent?b.fillStyle="rgba(255,255,255,1)":b.fillStyle="rgba(150,150,150,1)",this.drawBoundary(a),this.isClicked},ED.PI.prototype.description=function(){return"Peripheral iridectomy at "+this.clockHour()+" o'clock"},ED.Pingueculum=function(a,b){this.className="Pingueculum",this.savedParameterArray=["arc","rotation"],this.controlParameterArray={},ED.Doodle.call(this,a,b)},ED.Pingueculum.prototype=new ED.Doodle,ED.Pingueculum.prototype.constructor=ED.Pingueculum,ED.Pingueculum.superclass=ED.Doodle.prototype,ED.Pingueculum.prototype.setHandles=function(){this.handleArray[2]=new ED.Doodle.Handle(null,(!0),ED.Mode.Arc,(!1))},ED.Pingueculum.prototype.setPropertyDefaults=function(){this.isUnique=!1,this.isMoveable=!1,this.isRotatable=!1,this.parameterValidationArray.arc.range.setMinAndMax(.75*Math.PI,1.25*Math.PI)},ED.Pingueculum.prototype.setParameterDefaults=function(){this.arc=180*Math.PI/180,this.setRotationWithDisplacements(0,180),this.rotation>.5*Math.PI&&(this.rotation=Math.PI)},ED.Pingueculum.prototype.draw=function(a){var b=this.drawing.context;ED.Pingueculum.superclass.draw.call(this,a);var c=this.arc/2,d=460,e=d*Math.sin(c),f=-d*Math.cos(c),g=38;b.beginPath(),b.arc(e,f,2*g,0,2*Math.PI,!0),b.closePath(),b.lineWidth=4,b.fillStyle="rgba(255, 255, 255, 0)",b.strokeStyle="rgba(255, 255, 255, 0)",this.drawBoundary(a),this.drawFunctionMode==ED.drawFunctionMode.Draw&&(b.fillStyle="yellow",b.beginPath(),b.arc(e-g,f-.5*g,g,0,2*Math.PI,!1),b.fill(),b.beginPath(),b.arc(e-g,f+.5*g,g,0,2*Math.PI,!1),b.fill(),b.beginPath(),b.arc(e,f,g,0,2*Math.PI,!1),b.fill());var h=d*Math.sin(c),i=-d*Math.cos(c);-d*Math.sin(c);return this.handleArray[2].location=this.transform.transformPoint(new ED.Point(h,i)),this.isSelected&&!this.isForDrawing&&this.drawHandles(a),this.isClicked},ED.Pingueculum.prototype.description=function(){var a="Pinguecula";return a},ED.Pingueculum.prototype.snomedCode=function(){return 87614e3},ED.PosteriorCapsularOpacity=function(a,b){this.className="PosteriorCapsularOpacity",this.numberOfHandles=4,this.initialRadius=360,this.intensity="Mild",this.stromal=!1,this.epithelial=!1,this.endothelial=!1,this.savedParameterArray=["originX","originY","apexX","apexY","rotation","intensity","stromal","epithelial","endothelial"],this.controlParameterArray={intensity:"Intensity",epithelial:"Epithelial",stromal:"Stromal",endothelial:"Endothelial"},ED.Doodle.call(this,a,b)},ED.PosteriorCapsularOpacity.prototype=new ED.Doodle,ED.PosteriorCapsularOpacity.prototype.constructor=ED.PosteriorCapsularOpacity,ED.PosteriorCapsularOpacity.superclass=ED.Doodle.prototype,ED.PosteriorCapsularOpacity.prototype.setHandles=function(){this.handleArray[4]=new ED.Doodle.Handle(null,(!0),ED.Mode.Apex,(!1))},ED.PosteriorCapsularOpacity.prototype.setPropertyDefaults=function(){this.isRotatable=!1,this.parameterValidationArray.apexX.range.setMinAndMax(-0,0),this.parameterValidationArray.apexY.range.setMinAndMax(-380,-80),this.parameterValidationArray.intensity={kind:"derived",type:"string",list:["Mild","Moderate","Severe"],animate:!1},this.parameterValidationArray.stromal={kind:"derived",type:"bool",display:!0},this.parameterValidationArray.epithelial={kind:"derived",type:"bool",display:!0},this.parameterValidationArray.endothelial={kind:"derived",type:"bool",display:!0}},ED.PosteriorCapsularOpacity.prototype.setParameterDefaults=function(){this.apexY=-this.initialRadius,this.setParameterFromString("stromal","false"),this.setParameterFromString("epithelial","false"),this.setParameterFromString("endothelial","false"),this.rotation=Math.PI/4},ED.PosteriorCapsularOpacity.prototype.draw=function(a){var b=this.drawing.context;ED.PosteriorCapsularOpacity.superclass.draw.call(this,a),b.beginPath();var c=Math.sqrt(this.apexX*this.apexX+this.apexY*this.apexY);switch(b.arc(0,0,c,0,2*Math.PI,!0),b.lineWidth=4,this.intensity){ diff --git a/assets/js/dist/oe-eyedraw.js b/assets/js/dist/oe-eyedraw.js index 12b311d0..907c8075 100644 --- a/assets/js/dist/oe-eyedraw.js +++ b/assets/js/dist/oe-eyedraw.js @@ -1454,7 +1454,7 @@ ED.Views.SelectedDoodle = (function() { return SelectedDoodle; }()); -/*! Generated on 4/3/2019 */ +/*! Generated on 15/3/2019 */ ED.scriptTemplates = { "doodle-popup": "\n\n{{#doodle}}\n{{^doodle.isNode}}\n\t\n\t
\n\t\t{{^doodle.isLocked}}\n\t\t\t{{#desc}}\n\t\t\t\t
{{{desc}}}
\n\t\t\t{{/desc}}\n\t\t{{/doodle.isLocked}}\n\t
\n\t
\n\t
\n\t{{/doodle.isNode}}\n\t{{#doodle.isLocked}}\n\t\t
\n\t\t\tThis doodle is locked and cannot be edited.\n\t\t
\n\t{{/doodle.isLocked}}\n{{/doodle}}" }; diff --git a/assets/js/dist/oe-eyedraw.min.js b/assets/js/dist/oe-eyedraw.min.js index 30d63694..f5246ce3 100644 --- a/assets/js/dist/oe-eyedraw.min.js +++ b/assets/js/dist/oe-eyedraw.min.js @@ -1,2 +1,2 @@ -/*! eyedraw 04-03-2019 */ +/*! eyedraw 15-03-2019 */ var ED=ED||{};ED.init=function(){"use strict";return function(a,b){(b=$.isFunction(b)?b:$.noop)(new ED.Controller(a))}}();var ED=ED||{};ED.Checker=ED.Checker||function(){"use strict";function a(){$("canvas").each(function(){var a=$(this),c=this.id;(a.hasClass("ed-canvas-edit")||a.hasClass("ed-canvas-display"))&&b(c)})}function b(a){n.indexOf(a)===-1&&n.push(a)}function c(a){var b=n.indexOf(a);b>-1&&n.splice(b,1),b=o.indexOf(a),b>-1&&o.splice(b,1)}function d(){m.forEach(function(a){a()}),m=[]}function e(a){p[a.drawingName]=a,b(a.canvas.id),a.registerForNotifications({callback:function(){var b=a.canvas.id;o.indexOf(b)===-1&&o.push(b),f()&&d()}},"callback",["ready"])}function f(){return n.length===o.length}function g(a){f()?a():m.push(a)}function h(a){return p[a]}function i(a){return Object.keys(p).filter(function(b){return p[b].idSuffix===a}).map(function(a){return p[a]})[0]}function j(){p={},m=[],n=[]}function k(){return[n,o]}function l(){$(n).each(function(a,b){$("#"+b).length||c(b)})}var m=[],n=[],o=[],p={};return $(a),ED.getInstance=h,{register:e,onAllReady:g,isReady:f,getInstance:h,getInstanceByIdSuffix:i,reset:j,resync:l,inspect:k,storeCanvasId:b,registerForReady:g}}(),window.getOEEyeDrawChecker=function(){return ED.Checker};var ED=ED||{};ED.Controller=function(){"use strict";function a(a,b,c,d,e,f,g){this.properties=a,this.canvas=document.getElementById(a.canvasId),this.input=document.getElementById(a.inputId),this.container=$(this.canvas).closest(".ed-widget"),this.previousReport="",this.Checker=b||ED.Checker,this.drawing=c||this.createDrawing(),this.properties.isEditable&&(this.mainToolbar=d||this.createMainToolbar(),this.drawingToolbar=e||this.createDrawingToolbar(),this.doodlePopup=f||this.createDoodlePopup(),this.selectedDoodle=g||this.createSelectedDoodle(),this.bindEditEvents()),this.registerDrawing(),this.registerForNotifications(),this.initListeners(),this.drawing.init()}var b=ED.firstLetterToUpperCase;return a.prototype.createDrawing=function(){var a={drawingName:this.properties.drawingName,offsetX:this.properties.offsetX,offsetY:this.properties.offsetY,toImage:this.properties.toImage,graphicsPath:this.properties.graphicsPath,scale:this.properties.scale,toggleScale:this.properties.toggleScale},b=new ED.Drawing(this.canvas,this.properties.eye,this.properties.idSuffix,this.properties.isEditable,a);return b},a.prototype.createMainToolbar=function(){var a=this.container.find(".ed-main-toolbar");return a.length?new ED.Views.Toolbar.Main(this.drawing,a):null},a.prototype.createDrawingToolbar=function(){var a=this.container.find(".ed-drawing-toolbar");return a.length?new ED.Views.Toolbar.Drawing(this.drawing,a):null},a.prototype.createDoodlePopup=function(){var a=this.container.find(".ed-doodle-popup:first"),b=this.properties.showDoodlePopupForDoodles||[];return a.length?new ED.Views.DoodlePopup(this.drawing,a,b):null},a.prototype.createSelectedDoodle=function(){var a=this.container.find(".ed-selected-doodle");return a.length?new ED.Views.SelectedDoodle(this.drawing,a,this.doodlePopup):null},a.prototype.registerDrawing=function(){this.Checker.register(this.drawing)},a.prototype.registerForNotifications=function(){this.drawing.registerForNotifications(this,"notificationHandler",["ready","doodlesLoaded","parameterChanged"]),this.drawing.registerForNotifications(this,"saveDrawingToInputField",["doodleAdded","doodleDeleted","mouseup","drawingZoom","parameterChanged"])},a.prototype.bindEditEvents=function(){this.doodlePopup&&this.doodlePopup instanceof ED.Views.DoodlePopup&&(this.doodlePopup.on("show.before",function(){this.container.addClass("ed-state-doodle-popup-show")}.bind(this)),this.doodlePopup.on("hide.after",function(){this.container.removeClass("ed-state-doodle-popup-show")}.bind(this)))},a.prototype.initListeners=function(){this.properties.listenerArray instanceof Array&&this.properties.listenerArray.forEach(function(a){new a(this.drawing)}.bind(this))},a.prototype.notificationHandler=function(a){var c=a.eventName,d="on"+b(c);this[d]&&this[d](a)},a.prototype.hasInputFieldData=function(){return this.hasInputField()&&this.input.value.length>0},a.prototype.hasInputField=function(){return null!==this.input},a.prototype.saveDrawingToInputField=function(a){(a&&this.hasInputField()||this.hasInputFieldData())&&(this.input.value=this.drawing.save()),clearTimeout(this.saveTimer),this.saveTimer=setTimeout(function(){if(this.properties.autoReport){var a=document.getElementById(this.properties.autoReport);this.autoReport(a)}}.bind(this),200)},a.prototype.loadInputFieldData=function(){this.drawing.loadDoodles(this.properties.inputId)},a.prototype.addBindings=function(){ED.objectIsEmpty(this.properties.bindingArray)||this.drawing.addBindings(this.properties.bindingArray)},a.prototype.addDeletedValues=function(){ED.objectIsEmpty(this.properties.deleteValueArray)||this.drawing.addDeleteValues(this.properties.deleteValueArray)},a.prototype.deselectSyncedDoodles=function(){var a=this.properties.syncArray;for(var b in a)this.getEyeDrawInstance(b).deselectDoodles()},a.prototype.runOnReadyCommands=function(){var a=this.properties.onReadyCommandArray||[];this.runCommands(a),this.drawing.onReadyCommands.push(a)},a.prototype.runOnDoodlesLoadedCommands=function(){var a=this.properties.onDoodlesLoadedCommandArray||[];this.runCommands(a)},a.prototype.runCommands=function(a){for(var b=0;b'),b="None",c=null===this.drawing.selectedDoodle;a.append(this.createOption(b,c));var d=this.drawing.doodleArray.slice();d.reverse();var e=d.map(this.createDoodleOption.bind(this));a.append(e),this.select.html(a)},a.prototype.createOption=function(a,b){return $("