@brownnrl/geomlib 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/package.json +7 -5
package/dist/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var geomlib;(()=>{"use strict";var t={1454(t,e){function n(){var t=s(Math.random(),Math.random(),1);return"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")")}function r(t){var e=o(t);if(null==e)return t;var n=.7,r=Math.ceil(1/(1-n)),i=0===e.r?r:Math.min(Math.floor(e.r/n),255),s=0===e.g?r:Math.min(Math.floor(e.g/n),255),a=0===e.b?r:Math.min(Math.floor(e.b/n),255);return i<r&&(i=r),s<r&&(s=r),a<r&&(a=r),"rgb(".concat(i,",").concat(s,",").concat(a,")")}function i(t){var e=o(t);if(null==e)return t;var n=Math.floor(.7*e.r),r=Math.floor(.7*e.g),i=Math.floor(.7*e.b);return"rgb(".concat(n,",").concat(r,",").concat(i,")")}function o(t){if(null==t)return null;var n=t.match(/^rgb\((\d+),(\d+),(\d+)\)$/);if(n)return{r:parseInt(n[1]),g:parseInt(n[2]),b:parseInt(n[3])};if(t in e.colors)return o(e.colors[t]);var r=t.replace(/^#/,"");if(/^[0-9a-fA-F]{6}$/.test(r)){var i=parseInt(r,16);return{r:i>>16&255,g:i>>8&255,b:255&i}}var a=t.split(",");if(3===a.length){var l=parseInt(a[0])/360,u=parseInt(a[1])/100,c=parseInt(a[2])/100;if(!isNaN(l)&&!isNaN(u)&&!isNaN(c))return s(l,u,c)}return null}function s(t,e,n){var r,i,o,s=Math.floor(6*t),a=6*t-s,l=n*(1-e),u=n*(1-a*e),c=n*(1-(1-a)*e);switch(s%6){case 0:r=n,i=c,o=l;break;case 1:r=u,i=n,o=l;break;case 2:r=l,i=n,o=c;break;case 3:r=l,i=u,o=n;break;case 4:r=c,i=l,o=n;break;case 5:r=n,i=l,o=u}return{r:Math.round(255*r),g:Math.round(255*i),b:Math.round(255*o)}}Object.defineProperty(e,"__esModule",{value:!0}),e.anglePalette=e.colors=void 0,e.parseColor=function(t,o,a){if(0===t)return null;if(null==t)return o;var l=String(t);if("none"===l||"0"===l||""===l)return null;if("random"===l)return n();if("background"===l)return a;if("brighter"===l)return r(a);if("darker"===l)return i(a);if(l in e.colors)return e.colors[l];var u=l.replace(/^#/,"");if(/^[0-9a-fA-F]+$/.test(u)){var c=parseInt(u,16);if(!isNaN(c)){var h=c>>8&255,p=255&c;return"rgb(".concat(c>>16&255,",").concat(h,",").concat(p,")")}}var f=l.split(",");if(3===f.length){var d=parseInt(f[0])/360,y=parseInt(f[1])/100;if(p=parseInt(f[2])/100,!isNaN(d)&&!isNaN(y)&&!isNaN(p)){var _=s(d,y,p);return"rgb(".concat(_.r,",").concat(_.g,",").concat(_.b,")")}}return null},e.randomColor=n,e.brighter=r,e.darker=i,e.lighten=function(t){return r(t)},e.darken=function(t){return i(t)},e.colors={black:"rgb(0,0,0)",blue:"rgb(0,0,255)",cyan:"rgb(0,255,255)",darkGray:"rgb(64,64,64)",gray:"rgb(128,128,128)",green:"rgb(0,255,0)",lightGray:"rgb(192,192,192)",magenta:"rgb(255,0,255)",orange:"rgb(255,200,0)",pink:"rgb(255,175,175)",red:"rgb(255,0,0)",white:"rgb(255,255,255)",yellow:"rgb(255,255,0)"},e.anglePalette=[{edge:"rgb(59,110,165)",face:"rgba(59,110,165,0.30)"},{edge:"rgb(63,142,79)",face:"rgba(63,142,79,0.30)"},{edge:"rgb(122,79,163)",face:"rgba(122,79,163,0.30)"},{edge:"rgb(194,90,60)",face:"rgba(194,90,60,0.30)"},{edge:"rgb(46,139,139)",face:"rgba(46,139,139,0.30)"},{edge:"rgb(163,60,122)",face:"rgba(163,60,122,0.30)"}]},8041(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Slate=void 0;var r=n(8020),i=n(6055),o=n(6401),s=n(7658),a=n(6091),l=n(2145),u=n(7091),c=n(1313),h=n(6900),p=function(){function t(e){if(this._aliases=new Map,this._slides=[],this._resolveJustification=null,this._animationConfig={},this._animator=null,this._ephemerals=[],this._viewOffsetX=0,this._viewOffsetY=0,this._viewScale=1,this._logicalWidth=0,this._logicalHeight=0,this._lastHighlightedKey="\0",this._htmlCanvas=null,this.inTest=!1,this._itsNumSlate=-1,this._deferredDraggables=new Set,this._initiallyHidden=new Set,t.numSlate+=1,this._itsNumSlate=t.numSlate,this._elements=[],null==e)throw new TypeError("canvas cannot be null or undefined.");this._canvas=e;var n=new o.FixedPoint({x:0,y:0,z:0});n.name="screen_origin";var r=new o.FixedPoint({x:1,y:0,z:0});r.name="screen_x";var s=new o.FixedPoint({x:0,y:1,z:0});s.name="screen_y";var a=new i.PlaneElement({A:n,B:r,C:s});a.name="screen",a.nameColor=null,a.isScreen=!0,this._screen=a,this._pick=null;for(var l=0,u=[n,r,s,a];l<u.length;l++){var c=u[l];c.nameColor=null,c.vertexColor=null,c.vertexHighlightColor=null,c.faceColor=null,c.faceHighlightColor=null,this._elements.push(c)}var h=this,p=this._canvas;if(this._htmlCanvas=p,null!=this._htmlCanvas.addEventListener){this._htmlCanvas.style.touchAction="none";var f=null;this._htmlCanvas.addEventListener("pointerdown",(function(t){if(null===f){f=t.pointerId;try{h._htmlCanvas.setPointerCapture(t.pointerId)}catch(t){}var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseDown(n,r)}})),this._htmlCanvas.addEventListener("pointermove",(function(t){if(t.pointerId===f){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseDrag(n,r)}}));var d=function(t){if(t.pointerId===f){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseUp(n,r);try{h._htmlCanvas.releasePointerCapture(t.pointerId)}catch(t){}f=null}};this._htmlCanvas.addEventListener("pointerup",d),this._htmlCanvas.addEventListener("pointercancel",d),this._htmlCanvas.addEventListener("lostpointercapture",(function(t){t.pointerId===f&&(null!=h._pick&&(h._pick=null),f=null)}))}}return t.prototype._getCanvasPosition=function(t,e){var n=this._htmlCanvas.getBoundingClientRect(),r=this._viewScale||1;return[(t-n.left-this._viewOffsetX)/r,(e-n.top-this._viewOffsetY)/r]},t.prototype._onMouseDown=function(t,e){this._pick=null,this.movePick(t,e)},t.prototype._onMouseUp=function(t,e){null!=this._pick&&(this.movePick(t,e),this._pick=null)},t.prototype._onMouseDrag=function(t,e){null!=this._pick&&this.movePick(t,e)},Object.defineProperty(t.prototype,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bgcolor",{get:function(){return this._bgcolor},set:function(t){this._bgcolor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this._canvas},enumerable:!1,configurable:!0}),t.prototype.lookupElement=function(t){for(var e=0,n=this._elements;e<n.length;e++)if((s=n[e]).name==t)return s;var r=this._aliases.get(t);if(null!=r)for(var i=0,o=this._elements;i<o.length;i++){var s;if((s=o[i]).name==r)return s}return null},t.prototype.addAlias=function(t,e){this._aliases.set(t,e)},t.prototype.addAliases=function(t){for(var e in t)this._aliases.set(e,t[e])},Object.defineProperty(t.prototype,"deferredDraggables",{get:function(){return this._deferredDraggables},enumerable:!1,configurable:!0}),t.prototype.deferDraggables=function(t){for(var e=0,n=t||[];e<n.length;e++){var r=n[e];this._deferredDraggables.add(r)}},Object.defineProperty(t.prototype,"slides",{get:function(){return this._slides},set:function(t){this._slides=t||[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolveJustification",{get:function(){return this._resolveJustification},set:function(t){this._resolveJustification=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationConfig",{get:function(){return this._animationConfig},set:function(t){this._animationConfig=t||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animator",{get:function(){return this._animator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ephemerals",{get:function(){return this._ephemerals},enumerable:!1,configurable:!0}),t.prototype.addEphemeral=function(t){this._ephemerals.push(t)},t.prototype.addElement=function(t){-1===this._elements.indexOf(t)&&this._elements.push(t)},t.prototype.removeEphemeral=function(t){var e=this._ephemerals.indexOf(t);e>=0&&this._ephemerals.splice(e,1)},t.prototype.clearEphemerals=function(){this._ephemerals.length=0},Object.defineProperty(t.prototype,"viewOffsetX",{get:function(){return this._viewOffsetX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewOffsetY",{get:function(){return this._viewOffsetY},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewScale",{get:function(){return this._viewScale},enumerable:!1,configurable:!0}),t.prototype._dpr=function(){return"undefined"!=typeof window&&window.devicePixelRatio||1},Object.defineProperty(t.prototype,"logicalWidth",{get:function(){return this._logicalWidth||this._canvas.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logicalHeight",{get:function(){return this._logicalHeight||this._canvas.height},enumerable:!1,configurable:!0}),t.prototype.setLogicalSize=function(t,e){t>0&&(this._logicalWidth=t),e>0&&(this._logicalHeight=e)},Object.defineProperty(t.prototype,"displayWidth",{get:function(){var t=this._canvas;return"number"==typeof t.clientWidth&&t.clientWidth||this._canvas.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayHeight",{get:function(){var t=this._canvas;return"number"==typeof t.clientHeight&&t.clientHeight||this._canvas.height},enumerable:!1,configurable:!0}),t.prototype.recomputeFitScale=function(){var t=this.displayWidth/this.logicalWidth,e=this.displayHeight/this.logicalHeight;this._viewScale=Math.min(1,t,e)},t.prototype.setViewOffset=function(t,e){this._viewOffsetX=t,this._viewOffsetY=e},t.prototype.clearViewOffset=function(){this._viewOffsetX=0,this._viewOffsetY=0},t.prototype.visibleBounds=function(){return this._bounds(!0)},t.prototype.figureBounds=function(){return this._bounds(!1)},t.prototype._bounds=function(t){for(var e=1/0,n=-1/0,r=1/0,i=-1/0,o=function(t,o){t<e&&(e=t),t>n&&(n=t),o<r&&(r=o),o>i&&(i=o)},s=0,h=this._elements;s<h.length;s++){var p=h[s];if(null!=p.name&&!p.name.startsWith("screen")&&(!t||p.visible))if(p instanceof u.PolygonElement)for(var f=0,d=p.V;f<d.length;f++){var y=d[f];o(y.x,y.y)}else if(p instanceof c.CircleElement){var _=p.radius;o(p.Center.x-_,p.Center.y-_),o(p.Center.x+_,p.Center.y+_)}else p instanceof l.LineElement?(o(p.A.x,p.A.y),o(p.B.x,p.B.y)):p instanceof a.PointElement&&o(p.x,p.y)}return e===1/0?null:{minX:e,maxX:n,minY:r,maxY:i}},t.prototype.namesFor=function(t){var e=[t];return this._aliases.forEach((function(n,r){n===t&&r!==t&&e.push(r)})),e},t.prototype._ensureAnimator=function(){return null==this._animator&&(this._animator=new h.SlateAnimator(this)),this._animator},t.prototype.animateTo=function(t,e,n,r){return this._ensureAnimator().run(t,e,n,r)},t.prototype.setVisibleNames=function(t){for(var e=new Set(t),n=0,r=this._elements;n<r.length;n++){var i=r[n];null!=i.name&&(i.visible=e.has(i.name))}},Object.defineProperty(t.prototype,"initiallyHidden",{get:function(){return this._initiallyHidden},enumerable:!1,configurable:!0}),t.prototype.setInitiallyHidden=function(t){if(null!=t){this._initiallyHidden.add(t);var e=this.lookupElement(t);null!=e&&(e.visible=!1)}},t.prototype.clearVisibility=function(){for(var t=0,e=this._elements;t<e.length;t++){var n=e[t];n.visible=!(null!=n.name&&this._initiallyHidden.has(n.name))}},t.prototype.convertParams=function(t,e){void 0===e&&(e=!1);for(var n=[],r=[],i=[],o=0,s=t;o<s.length;o++){var u=s[o];switch(typeof u){case"string":var c=this.lookupElement(u);if(null==c)throw new TypeError("Element with name ".concat(u," not found."));c instanceof a.PointElement?n.push(c):c instanceof l.LineElement&&!e?(n.push(c.A),n.push(c.B)):r.push(c);break;case"number":i.push(u);break;default:throw new TypeError("Expecting only named elements (strings) or numbers.")}}return{P:n,E:r,N:i}},t.prototype.findConstruction=function(t,e){for(var n=0,r=s.constructions;n<r.length;n++){var i=r[n];if(i.validateSignature(t,e))return i}return null},t.prototype.createElement=function(t,e,n){var r=s.constructions.some((function(e){return e.constructionMethod===t&&e.keepsLineElements})),i=this.convertParams(e,r),o=this.findConstruction(t,i);if(null==o){var a=(0,s.getConstructionName)(t);throw null==n&&(n=""),new TypeError('Construction not found for "'.concat(n,'" ').concat(a," with params P=[").concat(i.P,"] E=[").concat(i.E,"] N=[").concat(i.N,"]"))}var l=o.construct(this._screen,i.P,i.E,i.N),u=l[0],c=l[1];-1!==this._elements.indexOf(c)&&(c.preexists=!0),null!=n&&(c.name=n);for(var h=0,p=u;h<p.length;h++){var f=p[h];-1==this._elements.indexOf(f)&&this._elements.push(f)}return-1==this._elements.indexOf(c)&&this._elements.push(c),c},t.prototype.reset=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].reset();this.update()},t.prototype.update=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].update();this.drawElements()},t.prototype.drawElements=function(){if(!this.inTest){var t=this._canvas.getContext("2d"),e=this._dpr(),n=this._viewScale,i=this._viewOffsetX,o=this._viewOffsetY;r.GeomElement.styleScale=n>0?1/n:1,t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this._canvas.width,this._canvas.height),t.fillStyle=this._bgcolor,t.fillRect(0,0,this._canvas.width,this._canvas.height),t.setTransform(e*n,0,0,e*n,e*i,e*o);for(var s=0,a=this._elements;s<a.length;s++)a[s].drawFace(this._canvas);for(var l=0,u=this._elements;l<u.length;l++)u[l].drawEdge(this._canvas);for(var c=0,h=this._elements;c<h.length;c++)h[c].drawVertex(this._canvas);for(var p=0,f=this._elements;p<f.length;p++)f[p].drawName(this._canvas);for(var d=0,y=this._ephemerals;d<y.length;d++)y[d].drawFace(this._canvas);for(var _=0,g=this._ephemerals;_<g.length;_++)g[_].drawEdge(this._canvas);for(var v=0,m=this._ephemerals;v<m.length;v++)m[v].drawVertex(this._canvas);for(var P=0,C=this._ephemerals;P<C.length;P++)C[P].drawName(this._canvas);t.setTransform(1,0,0,1,0,0),r.GeomElement.styleScale=1,this._dispatchHighlightChange()}},t.prototype._dispatchHighlightChange=function(){for(var t=this,e=[],n=0,r=this._elements;n<r.length;n++){var i=r[n];null==i.name||i.name.startsWith("screen")||(i.shouldHighlight||i.emphasized)&&e.push(i.name)}var o=e.sort().join("|");if(o!==this._lastHighlightedKey){this._lastHighlightedKey=o;var s=this._canvas;if(s&&"function"==typeof s.dispatchEvent&&"function"==typeof CustomEvent){var a=e.map((function(e){return{name:e,aliases:t.namesFor(e)}}));s.dispatchEvent(new CustomEvent("geomlib:highlight",{bubbles:!0,detail:{highlighted:a}}))}}},t.prototype.updateCoordinates=function(t){for(++t;t<this._elements.length;t++)this._elements[t].defined()||this._elements[t].reset(),this._elements[t].update();this.drawElements()},t.prototype.translateCoordinates=function(t,e){for(var n=0;n<this._elements.length;n++){var r=this._elements[n];r.preexists||r.translate(t,e)}this.update()},t.prototype.closestVisiblePoint=function(t,e,n){void 0===n&&(n=30);var r=function(t,e){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)},i=t.filter((function(t){return t instanceof a.PointElement})).map((function(t){return t})).filter((function(t){return null!=t.vertexColor})).sort((function(t,n){var i=r(t,e),o=r(n,e);return i<o?-1:o<i?1:0}));if(0==i.length)return null;var o=i[0];return Math.sqrt(r(o,e))>n?null:o},t.prototype._getPick=function(t,e){if(null!=this._pick)return this._pick;var n=new a.PointElement({x:t,y:e}),r=this.closestVisiblePoint(this._elements,n);return null!=r?(this._pick=r,this._pick):void 0},t.prototype.setPivot=function(t){var e=t.split(","),n=e[0].trim(),r=this.lookupElement(n);if(null!=r&&r instanceof a.PointElement){var o=r;if(e.length>1){var s=e[1].trim(),l=this.lookupElement(s);if(null==l||!(l instanceof i.PlaneElement))return;l.pivot=o}else o._AP=this._screen,this._screen.pivot=o}},t.prototype.movePick=function(t,e){if(null!=this._getPick(t,e)){var n=this._elements.indexOf(this._pick),r=this._viewScale||1,i=this._viewOffsetX,o=this._viewOffsetY,s=-i/r,a=(this.displayWidth-i)/r;t<s?t=s:t>a&&(t=a);var l=-o/r,u=(this.displayHeight-o)/r;if(e<l?e=l:e>u&&(e=u),!(Math.abs(t-this._pick.x)+Math.abs(e-this._pick.y)<1)){if(this._pick.draggable){if(!this._pick.drag(t,e))return;this.updateCoordinates(n)}else if(null!=this._pick.AP&&null!=this._pick.AP.pivot&&this._pick.AP.pivot!=this._pick)this.rotateCoordinates(t,e);else{var c=t-this._pick.x,h=e-this._pick.y;this.translateCoordinates(c,h)}this.drawElements()}}},t.prototype.rotateCoordinates=function(t,e){for(var n=this._pick,r=n.AP.pivot,i=a.PointElement.difference(n,r),o=t-r.x,s=e-r.y,l=n.AP.S,u=n.AP.T,c=a.PointElement.dot(i,l),h=a.PointElement.dot(i,u),p=l.x*u.y-l.y*u.x,f=(o*u.y-s*u.x)/p,d=(s*l.x-o*l.y)/p,y=(f*c+d*h)/(p=c*c+h*h),_=(d*c-f*h)/p,g=0,v=this._elements;g<v.length;g++){var m=v[g];m.preexists||m.rotate(r,y,_)}this.update()},t.numSlate=0,t}();e.Slate=p},6900(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.SlateAnimator=void 0;var i=n(7233),o="function"==typeof requestAnimationFrame,s="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return Date.now()},a=function(){function t(t){this.groups=[],this.mode="cascade",this.resolveCurrent=null,this.cascadeIndex=0,this.rafId=null,this.lastFrameMs=0,this.fadingOut=!1,this.fadeStartMs=0,this.slate=t}return t.prototype.run=function(t,e,n,o){var a=this;this.groups.length>0&&this.cancel();for(var l=[],u=this.slate.animationConfig||{},c=null!=u.speedMultiplier?u.speedMultiplier:1,h=!0===u.reducedMotion||0===c,p=function(t){var e=f.slate.lookupElement(t.elem);if(null==e)return"continue";var n=(0,i.findAnimation)(t.name);if(null==n)return"continue";if(!(e instanceof n.elementType))return"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] animation '"+n.name+"' targets "+n.elementType.name+" but element '"+t.elem+"' is "+e.constructor.name+" — falling back to instant"),e.drawProgress=1,e.visible=!0,"continue";var o=(n.build(e,f.slate,t.args||{})||[]).map((function(e){return{step:r(r({},e),{durationMs:(i=e.durationMs,o=t.durationMs,s=u.durations&&u.durations[n.name],null!=o?o:null!=s?s:i)}),elapsedMs:0,started:!1,finalised:!1};var i,o,s}));l.push({target:e,steps:o,currentIndex:0})},f=this,d=0,y=n||[];d<y.length;d++)p(y[d]);for(var _=new Set(l.map((function(t){return t.target}))),g=0,v=this.slate.elements;g<v.length;g++){var m=v[g];if(null!=m.name){var P=t.has(m.name),C=e.has(m.name);_.has(m)?(m.shouldHighlight=C,m.drawProgress=0,m.visible=!1):(m.visible=P,m.shouldHighlight=C,m.drawProgress=1)}}if(h||0===l.length){for(var w=0,x=l;w<x.length;w++)for(var A=0,E=x[w].steps;A<E.length;A++){var b=E[A];b.step.setup&&!b.started&&b.step.setup(),b.step.finalise(),b.finalised=!0}return this.slate.drawElements(),Promise.resolve()}return this.groups=l,this.mode=o,this.cascadeIndex=0,this.lastFrameMs=s(),new Promise((function(t){a.resolveCurrent=t,a._kickoff(),a._scheduleFrame()}))},t.prototype._clearAnimatedEmphasis=function(){for(var t=0,e=this.groups;t<e.length;t++)e[t].target.emphasized=!1},t.prototype.cancel=function(){if(0!==this.groups.length){for(var t=0,e=this.groups;t<e.length;t++)for(var n=e[t],r=0;r<n.steps.length;r++){var i=n.steps[r];i.finalised||(i.step.setup&&!i.started&&(i.step.setup(),i.started=!0),i.step.finalise(),i.finalised=!0)}this._clearAnimatedEmphasis(),this.slate.clearEphemerals(),this.slate.drawElements(),this.groups=[],this.fadingOut=!1,null!=this.rafId&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this.rafId),this.rafId=null,this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null)}},t.prototype._kickoff=function(){if("cascade"===this.mode)this._startGroupIndex(0);else for(var t=0,e=this.groups;t<e.length;t++){var n=e[t];this._startStep(n,0)}},t.prototype._startGroupIndex=function(t){t>=this.groups.length||this._startStep(this.groups[t],0)},t.prototype._startStep=function(t,e){if(!(e>=t.steps.length)){var n=t.steps[e];n.started||(0===e&&(t.target.visible=!0,t.target.emphasized=!0),n.step.setup&&n.step.setup(),n.started=!0,t.currentIndex=e)}},t.prototype._scheduleFrame=function(){var t=this;if(o)this.rafId=requestAnimationFrame((function(e){return t._frame(e)}));else{var e=s()+16;this.rafId=setTimeout((function(){return t._frame(e)}),16)}},t.prototype._frame=function(t){if(0!==this.groups.length){var e=this.slate.animationConfig||{},n=null!=e.speedMultiplier?e.speedMultiplier:1,r=e.cascadeGapMs||0,i=t-this.lastFrameMs;i<0&&(i=0),i>100&&(i=100);var o=i*n;if(this.lastFrameMs=t,"cascade"===this.mode?this._tickCascade(o,t,r):this._tickParallel(o,t),this.slate.drawElements(),this._allFinalised()){this.fadingOut||(this.fadingOut=!0,this.fadeStartMs=t);for(var s=t-this.fadeStartMs,a=s>=250?1:s/250,l=1-a,u=0,c=this.groups;u<c.length;u++)c[u].target.emphasisAmount=l;return this.slate.drawElements(),a>=1?(this._clearAnimatedEmphasis(),this.groups=[],this.fadingOut=!1,this.rafId=null,void(this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null))):void this._scheduleFrame()}this._scheduleFrame()}},t.prototype._tickCascade=function(t,e,n){for(;this.cascadeIndex<this.groups.length;){var r=this.groups[this.cascadeIndex],i=r.steps[r.currentIndex];if(i){if(!i.finalised)return void this._tickStep(r.target,i,t,e);if(null==r.finishedAtMs&&(r.finishedAtMs=e),e-r.finishedAtMs<n)return;r.currentIndex+1<r.steps.length?this._startStep(r,r.currentIndex+1):(this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0))}else this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0)}},t.prototype._tickParallel=function(t,e){for(var n=0,r=this.groups;n<r.length;n++){var i=r[n],o=i.steps[i.currentIndex];o&&(o.finalised?i.currentIndex+1<i.steps.length&&this._startStep(i,i.currentIndex+1):this._tickStep(i.target,o,t,e))}},t.prototype._tickStep=function(t,e,n,r){e.started||(e.step.setup&&e.step.setup(),e.started=!0),e.elapsedMs+=n;var i=e.step.durationMs,o=i>0?e.elapsedMs/i:1;o>1&&(o=1),o<0&&(o=0),e.step.tick(o,n,e.elapsedMs),o>=1&&(e.step.finalise(),e.finalised=!0)},t.prototype._allFinalised=function(){for(var t=0,e=this.groups;t<e.length;t++)for(var n=0,r=e[t].steps;n<r.length;n++)if(!r[n].finalised)return!1;return!0},t}();e.SlateAnimator=a},3267(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.trackWindowResize=u,e.createControls=function(t,e,n){e.parentElement&&new c(t,e,n).init()};var r=n(7680);function i(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches}var o=i()?18:20,s=(i(),4),a=i()?7:8,l="geomlib-controls-style";function u(t,e){var n=function(){return e()};return t.addEventListener("resize",n),function(){return t.removeEventListener("resize",n)}}var c=function(){function t(t,e,n){this._maximized=!1,this._savedStyles=null,this._stopTrackingResize=null,this._presenting=!1,this._presentationIndex=0,this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null,this._presentationOnKey=null,this._stickyRefSpan=null,this._stickyRefElem=null,this._slate=t,this._canvas=e,this._config=n}return t.prototype.init=function(){var t=this;this._wrapper=this.createWrapper(),this.createButtons(),this.addKeyboardShortcuts(),this._stopTrackingResize=u(window,(function(){return t.resizeAndRedraw()}))},t.prototype.createWrapper=function(){var t=this;!function(){if("undefined"!=typeof document&&!document.getElementById(l)){var t=document.createElement("style");t.id=l,t.textContent=".geomlib-wrapper>button{opacity:0;transition:opacity .15s ease-in-out}.geomlib-wrapper:hover>button,.geomlib-wrapper:focus-within>button{opacity:1}",(document.head||document.documentElement).appendChild(t)}}();var e=document.createElement("div");return e.className="geomlib-wrapper",e.style.position="relative",e.style.display="inline-block",this._canvas.parentElement.insertBefore(e,this._canvas),e.appendChild(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.style.outline="none",this._canvas.addEventListener("focus",(function(){t._canvas.style.outline="2px solid rgba(66,133,244,0.5)"})),this._canvas.addEventListener("blur",(function(){t._canvas.style.outline="none"})),e},t.prototype.createButtons=function(){var t=this,e=[{draw:p,action:function(){return t.onReset()},title:"Reset (r)"},{draw:f,action:function(){return t.onMaximize()},title:"Maximize (m)"}];this._slate.slides.length>0&&e.push({draw:d,action:function(){return t.onPresent()},title:"Present (p)"});for(var n=function(n){var i=document.createElement("button");i.style.position="absolute",i.style.top=a+"px",i.style.right=a+n*(o+s)+"px",i.style.width=o+"px",i.style.height=o+"px",i.style.padding="0",i.style.border="none",i.style.cursor="pointer",i.style.background="rgba(0,0,0,0.12)",i.style.borderRadius="3px",i.title=e[n].title,i.addEventListener("mouseenter",(function(){i.style.background="rgba(0,0,0,0.3)"})),i.addEventListener("mouseleave",(function(){i.style.background="rgba(0,0,0,0.12)"}));var l=document.createElement("canvas");l.width=o,l.height=o,l.style.display="block";var u=l.getContext("2d");e[n].draw(u,o),i.appendChild(l),i.addEventListener("click",(function(r){r.stopPropagation(),e[n].action(),t._canvas.focus()})),1===n&&(r._maxBtn=i,r._maxIconCanvas=l),r._wrapper.appendChild(i)},r=this,i=0;i<e.length;i++)n(i)},t.prototype.addKeyboardShortcuts=function(){var t=this;this._canvas.addEventListener("keydown",(function(e){switch(e.key){case"r":case"R":case" ":e.preventDefault(),t.onReset();break;case"m":case"M":e.preventDefault(),t.onMaximize();break;case"p":case"P":t._slate.slides.length>0&&(e.preventDefault(),t.onPresent())}}))},t.prototype.onReset=function(){this._slate.reset()},t.prototype.onMaximize=function(){this._maximized?this.minimize():this.maximize()},t.prototype.maximize=function(){this._savedStyles={wrapperPosition:this._wrapper.style.position,wrapperTop:this._wrapper.style.top,wrapperLeft:this._wrapper.style.left,wrapperWidth:this._wrapper.style.width,wrapperHeight:this._wrapper.style.height,wrapperZIndex:this._wrapper.style.zIndex,wrapperBackground:this._wrapper.style.background,canvasStyleWidth:this._canvas.style.width,canvasStyleHeight:this._canvas.style.height,canvasAttrWidth:this._canvas.width,canvasAttrHeight:this._canvas.height},this._wrapper.style.position="fixed",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.style.width="100vw",this._wrapper.style.height="100vh",this._wrapper.style.zIndex="9999",this._wrapper.style.background="white",this._canvas.style.width="100%",this._canvas.style.height="100%",this._maximized=!0,this.resizeAndRedraw(),this.updateMaximizeIcon()},t.prototype.minimize=function(){this._savedStyles&&(this._wrapper.style.position=this._savedStyles.wrapperPosition,this._wrapper.style.top=this._savedStyles.wrapperTop,this._wrapper.style.left=this._savedStyles.wrapperLeft,this._wrapper.style.width=this._savedStyles.wrapperWidth,this._wrapper.style.height=this._savedStyles.wrapperHeight,this._wrapper.style.zIndex=this._savedStyles.wrapperZIndex,this._wrapper.style.background=this._savedStyles.wrapperBackground,this._canvas.style.width=this._savedStyles.canvasStyleWidth,this._canvas.style.height=this._savedStyles.canvasStyleHeight,this._canvas.width=this._savedStyles.canvasAttrWidth,this._canvas.height=this._savedStyles.canvasAttrHeight,this._maximized=!1,this.resizeAndRedraw(),this._savedStyles=null,this.updateMaximizeIcon(),this._slate.reset())},t.prototype.resizeAndRedraw=function(){var t="undefined"!=typeof window&&window.devicePixelRatio||1,e=Math.round(this._canvas.clientWidth*t),n=Math.round(this._canvas.clientHeight*t);this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n),this._slate.recomputeFitScale(),this._applyCentring(),this._slate.update()},t.prototype._applyCentring=function(){if(this._maximized){var t=this._slate.figureBounds();if(null!=t){var e=(t.minX+t.maxX)/2,n=(t.minY+t.maxY)/2,r=this._slate.viewScale;this._slate.setViewOffset(this._slate.displayWidth/2-r*e,this._slate.displayHeight/2-r*n)}else this._slate.clearViewOffset()}else this._slate.clearViewOffset()},t.prototype.updateMaximizeIcon=function(){var t=this._maxIconCanvas,e=this._maxBtn;if(t){var n=t.getContext("2d");n.clearRect(0,0,o,o),this._maximized?(function(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var r=4+n,i=4,o=4+.55*n,s=4+.45*n;t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.stroke(),t.beginPath(),t.moveTo(o,s),t.lineTo(o+5,s),t.lineTo(o,s-5),t.closePath(),t.fill(),r=4,i=4+n,o=4+.45*n,s=4+.55*n,t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.stroke(),t.beginPath(),t.moveTo(o,s),t.lineTo(o-5,s),t.lineTo(o,s+5),t.closePath(),t.fill()}(n,o),e.title="Minimize (m)"):(f(n,o),e.title="Maximize (m)")}},t.prototype.onPresent=function(){this._presenting||0!==this._slate.slides.length&&(this._maximized||this.maximize(),this._applyCentring(),this.buildPresentationOverlay(),this.bindPresentationKeys(),this._presenting=!0,this.showSlide(0))},t.prototype.exitPresent=function(){if(this._presenting){this.unbindPresentationKeys(),this.clearStickyRef(),this.removePresentationOverlay(),null!=this._slate.animator&&this._slate.animator.cancel(),this._slate.clearEphemerals(),this._slate.clearVisibility();for(var t=0,e=this._slate.elements;t<e.length;t++){var n=e[t];n.shouldHighlight=!1,n.emphasized=!1}this._presenting=!1,this._slate.update()}},t.prototype.buildPresentationOverlay=function(){var t=this,e=document.createElement("div");e.className="geomlib-presentation-overlay",e.style.position="fixed",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.margin="0 auto",e.style.maxWidth="100vw",e.style.background="#ffffff",e.style.color="#222",e.style.borderTop="1px solid rgba(0,0,0,0.18)",e.style.boxShadow="0 -6px 18px rgba(0,0,0,0.18)",e.style.padding="12px 16px calc(12px + env(safe-area-inset-bottom, 0px))",e.style.zIndex="2147483647",e.style.fontFamily="Georgia, 'Times New Roman', serif",e.style.touchAction="manipulation",e.style.boxSizing="border-box",e.style.textAlign="center";var n=document.createElement("div");n.className="geomlib-presentation-caption",n.style.fontSize="1.1rem",n.style.lineHeight="1.45",n.style.textAlign="center",n.style.marginBottom="6px",e.appendChild(n);var r=document.createElement("div");r.className="geomlib-presentation-justs",r.style.fontSize="0.85rem",r.style.textAlign="center",r.style.opacity="0.85",r.style.minHeight="1em",r.style.marginBottom="10px",e.appendChild(r);var i=document.createElement("div");i.className="geomlib-presentation-nav",i.style.display="flex",i.style.gap="10px",i.style.alignItems="center",i.style.justifyContent="center";var o=h("‹ Prev"),s=document.createElement("span");s.className="geomlib-presentation-counter",s.style.minWidth="56px",s.style.textAlign="center",s.style.opacity="0.7",s.style.fontSize="0.9rem";var a=h("Next ›"),l=h("✕ Exit");l.style.marginLeft="16px",o.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex-1)})),a.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex+1)})),l.addEventListener("click",(function(e){e.stopPropagation(),t.exitPresent()})),i.appendChild(o),i.appendChild(s),i.appendChild(a),i.appendChild(l),e.appendChild(i),document.documentElement.appendChild(e),this._presentationOverlay=e,this._presentationCaption=n,this._presentationJusts=r,this._presentationCounter=s},t.prototype.removePresentationOverlay=function(){this._presentationOverlay&&this._presentationOverlay.parentNode&&this._presentationOverlay.parentNode.removeChild(this._presentationOverlay),this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null},t.prototype.bindPresentationKeys=function(){var t=this,e=function(e){if(t._presenting)switch(e.key){case"ArrowLeft":e.preventDefault(),t.showSlide(t._presentationIndex-1);break;case"ArrowRight":case" ":e.preventDefault(),t.showSlide(t._presentationIndex+1);break;case"Escape":e.preventDefault(),t.exitPresent()}};this._presentationOnKey=e,document.addEventListener("keydown",e)},t.prototype.unbindPresentationKeys=function(){this._presentationOnKey&&(document.removeEventListener("keydown",this._presentationOnKey),this._presentationOnKey=null)},t.prototype.showSlide=function(t){var e=this._slate.slides;if(0!==e.length){var n=Math.max(0,Math.min(e.length-1,t));this._presentationIndex=n;var i=(0,r.computeSlideState)(this._slate,e,n);this.clearStickyRef(),this._slate.clearEphemerals();for(var o=e[n],s=o.transition,a=s&&s.animations,l=s&&"parallel"===s.mode?"parallel":"cascade",u=0,c=this._slate.elements;u<c.length;u++)(f=c[u]).emphasized=!1;if(a&&a.length>0)this._slate.animateTo(i.visible,i.highlighted,a,l);else{for(var h=0,p=this._slate.elements;h<p.length;h++){var f;null!=(f=p[h]).name&&(f.visible=i.visible.has(f.name),f.shouldHighlight=i.highlighted.has(f.name),f.drawProgress=1)}this._slate.update()}if(this._presentationCaption&&this.renderCaptionText(this._presentationCaption,o.text||""),this._presentationCounter&&(this._presentationCounter.textContent=n+1+" / "+e.length),this._presentationJusts){this._presentationJusts.innerHTML="";var d=this._slate.resolveJustification;if(o.justifications)for(var y=0;y<o.justifications.length;y++){if(y>0){var _=document.createElement("span");_.textContent=" · ",_.style.opacity="0.5",this._presentationJusts.appendChild(_)}var g=o.justifications[y].ref,v=d?d(g):null;if(v){var m=document.createElement("a");m.href=v,m.textContent=g,m.target="_blank",m.rel="noopener",m.style.color="#0066cc",this._presentationJusts.appendChild(m)}else{var P=document.createElement("span");P.textContent=g,this._presentationJusts.appendChild(P)}}}}},t.prototype.renderCaptionText=function(t,e){t.innerHTML="";for(var n,r=/\{([A-Za-z][A-Za-z0-9'\-]*)(?:\|([A-Za-z][A-Za-z0-9'\-]*))?\}/g,i=0;null!==(n=r.exec(e));){n.index>i&&t.appendChild(document.createTextNode(e.slice(i,n.index)));var o=n[1],s=null!=n[2]?n[2]:n[1],a=this._slate.lookupElement(s);a?t.appendChild(this.buildCaptionRef(o,a)):t.appendChild(document.createTextNode(o)),i=n.index+n[0].length}i<e.length&&t.appendChild(document.createTextNode(e.slice(i)))},t.prototype.buildCaptionRef=function(t,e){var n=this,r=document.createElement("span");return r.className="geomlib-presentation-ref",r.textContent=t,r.style.fontWeight="700",r.style.fontStyle="italic",r.style.cursor="pointer",r.style.borderBottom="1px dotted currentColor",r.addEventListener("mouseenter",(function(){null==n._stickyRefSpan&&(e.emphasized=!0,n._slate.update())})),r.addEventListener("mouseleave",(function(){null==n._stickyRefSpan&&(e.emphasized=!1,n._slate.update())})),r.addEventListener("pointerdown",(function(t){t.preventDefault(),t.stopPropagation();var i=n._stickyRefSpan===r;n.clearStickyRef(),i||n.setStickyRef(r,e),n._slate.update()})),r},t.prototype.clearStickyRef=function(){null!=this._stickyRefSpan&&(this._stickyRefSpan.classList.remove("active"),this._stickyRefSpan.style.color=""),null!=this._stickyRefElem&&(this._stickyRefElem.emphasized=!1),this._stickyRefSpan=null,this._stickyRefElem=null},t.prototype.setStickyRef=function(t,e){t.classList.add("active"),t.style.color="#b08800",e.emphasized=!0,this._stickyRefSpan=t,this._stickyRefElem=e},t}();function h(t){var e=document.createElement("button");return e.textContent=t,e.style.background="rgba(0,0,0,0.08)",e.style.color="#222",e.style.border="1px solid rgba(0,0,0,0.15)",e.style.borderRadius="4px",e.style.padding="10px 16px",e.style.minHeight="44px",e.style.cursor="pointer",e.style.fontFamily="inherit",e.style.fontSize="1rem",e.style.touchAction="manipulation",e.addEventListener("mouseenter",(function(){e.style.background="rgba(0,0,0,0.16)"})),e.addEventListener("mouseleave",(function(){e.style.background="rgba(0,0,0,0.08)"})),e}function p(t,e){var n=e/2,r=e/2,i=.32*e;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5,t.beginPath(),t.arc(n,r,i,.5*-Math.PI,.75*Math.PI),t.stroke();var o=.75*Math.PI,s=n+i*Math.cos(o),a=r+i*Math.sin(o),l=o+.3*Math.PI,u=o+.9*Math.PI;t.beginPath(),t.moveTo(s,a),t.lineTo(s+4*Math.cos(l),a+4*Math.sin(l)),t.lineTo(s+4*Math.cos(u),a+4*Math.sin(u)),t.closePath(),t.fill()}function f(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var r=4+.55*n,i=4+.45*n,o=4+n,s=4;t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.stroke(),t.beginPath(),t.moveTo(o,s),t.lineTo(o-5,s),t.lineTo(o,s+5),t.closePath(),t.fill(),r=4+.45*n,i=4+.55*n,o=4,s=4+n,t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.stroke(),t.beginPath(),t.moveTo(o,s),t.lineTo(o+5,s),t.lineTo(o,s-5),t.closePath(),t.fill()}function d(t,e){var n=.28*e,r=n-1,i=e-n+2,o=n,s=e-n;t.fillStyle="rgba(0,0,0,0.7)",t.beginPath(),t.moveTo(r,o),t.lineTo(r,s),t.lineTo(i,e/2),t.closePath(),t.fill()}},7233(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InstantAnimation=e.Animation=e.A=e.AllAnimations=void 0,e.registerAnimation=p,e.findAnimation=function(t){var e;if(null==(e="string"==typeof t?c.get(t):u.get(t))){var n=String(t);return h.has(n)||(h.add(n),"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] unknown animation '"+n+"' — falling back to instant")),null}return null!=e?e:null};var o,s=n(8020);!function(t){t[t.INSTANT=0]="INSTANT",t[t.POINT_APPEAR=1]="POINT_APPEAR",t[t.POINT_INTERSECT=2]="POINT_INTERSECT",t[t.POINT_SLIDE=3]="POINT_SLIDE",t[t.LINE_STRAIGHT_EDGE_CONNECT=4]="LINE_STRAIGHT_EDGE_CONNECT",t[t.LINE_STRAIGHT_EDGE_EXTEND=5]="LINE_STRAIGHT_EDGE_EXTEND",t[t.LINE_COMPASS_TRANSFER=6]="LINE_COMPASS_TRANSFER",t[t.CIRCLE_COMPASS=7]="CIRCLE_COMPASS",t[t.CIRCLE_COMPASS_EXPLICIT=8]="CIRCLE_COMPASS_EXPLICIT",t[t.CIRCLE_COMPASS_TRANSFER=9]="CIRCLE_COMPASS_TRANSFER",t[t.POLYGON_OUTLINE=10]="POLYGON_OUTLINE",t[t.POLYGON_OUTLINE_AND_FILL=11]="POLYGON_OUTLINE_AND_FILL",t[t.POLYGON_SUPERPOSE=12]="POLYGON_SUPERPOSE",t[t.POLYGON_EQUILATERAL_BUILD=13]="POLYGON_EQUILATERAL_BUILD",t[t.SECTOR_SWEEP=14]="SECTOR_SWEEP",t[t.GROUP_CLONE_ASIDE=15]="GROUP_CLONE_ASIDE"}(o||(e.AllAnimations=o={})),e.A={Point:{appear:o.POINT_APPEAR,intersect:o.POINT_INTERSECT,slide:o.POINT_SLIDE},Line:{straightEdgeConnect:o.LINE_STRAIGHT_EDGE_CONNECT,straightEdgeExtend:o.LINE_STRAIGHT_EDGE_EXTEND,compassTransfer:o.LINE_COMPASS_TRANSFER},Circle:{compass:o.CIRCLE_COMPASS,compassExplicit:o.CIRCLE_COMPASS_EXPLICIT,compassTransfer:o.CIRCLE_COMPASS_TRANSFER},Polygon:{outline:o.POLYGON_OUTLINE,outlineAndFill:o.POLYGON_OUTLINE_AND_FILL,superpose:o.POLYGON_SUPERPOSE,equilateralBuild:o.POLYGON_EQUILATERAL_BUILD},Sector:{sweep:o.SECTOR_SWEEP},Group:{cloneAside:o.GROUP_CLONE_ASIDE},instant:o.INSTANT};var a=function(){};e.Animation=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.INSTANT,e.name="instant",e.elementType=s.GeomElement,e}return i(e,t),e.prototype.build=function(t,e,n){return[{durationMs:0,tick:function(){},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(a);e.InstantAnimation=l;var u=new Map,c=new Map,h=new Set;function p(t){u.set(t.animationMethod,t),c.set(t.name,t)}p(new l)},7658(t,e,n){var r,i,o,s,a,l,u,c,h,p=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.constructions=e.Construction=e.E=e.PolyhedraConstructions=e.SphereConstructions=e.PlaneConstructions=e.SectorConstructions=e.PolygonConstructions=e.CircleConstructions=e.LineConstructions=e.PointConstructions=e.ConstructionTypes=void 0,e.getConstructionName=function(t){return t<100?"Point."+i[t]:100<t&&t<200?"Line."+o[t]:300<t&&t<400?"Polygon."+a[t]:400<t&&t<500?"Sector."+l[t]:500<t&&t<600?"Plane."+u[t]:600<t&&t<700?"Sphere."+c[t]:700<t&&t<800?"Polyhedra."+h[t]:"<Not Valid Construction>"},function(t){t[t.Integer=0]="Integer",t[t.PointElement=1]="PointElement",t[t.CircleElement=2]="CircleElement",t[t.PlaneElement=3]="PlaneElement",t[t.SphereElement=4]="SphereElement",t[t.PolygonElement=5]="PolygonElement",t[t.PolyhedronElement=6]="PolyhedronElement"}(r||(e.ConstructionTypes=r={})),function(t){t[t.free=1]="free",t[t.midpoint=2]="midpoint",t[t.intersection=3]="intersection",t[t.first=4]="first",t[t.last=5]="last",t[t.center=6]="center",t[t.lineSlider=7]="lineSlider",t[t.circleSlider=8]="circleSlider",t[t.circumcenter=9]="circumcenter",t[t.vertex=10]="vertex",t[t.foot=11]="foot",t[t.cutoff=12]="cutoff",t[t.extend=13]="extend",t[t.parallelogram=14]="parallelogram",t[t.similar=15]="similar",t[t.perpendicular=16]="perpendicular",t[t.proportion=17]="proportion",t[t.invert=18]="invert",t[t.meanProportional=19]="meanProportional",t[t.planeSlider=20]="planeSlider",t[t.sphereSlider=21]="sphereSlider",t[t.angleBisector=22]="angleBisector",t[t.angleDivider=23]="angleDivider",t[t.fixed=24]="fixed",t[t.lineSegmentSlider=25]="lineSegmentSlider",t[t.harmonic=26]="harmonic"}(i||(e.PointConstructions=i={})),function(t){t[t.connect=101]="connect",t[t.angleBisector=102]="angleBisector",t[t.angleDivider=103]="angleDivider",t[t.foot=104]="foot",t[t.chord=105]="chord",t[t.bichord=106]="bichord",t[t.perpendicular=107]="perpendicular",t[t.cutoff=108]="cutoff",t[t.extend=109]="extend",t[t.parallel=110]="parallel",t[t.similar=111]="similar",t[t.proportion=112]="proportion",t[t.meanProportional=113]="meanProportional",t[t.path=114]="path"}(o||(e.LineConstructions=o={})),function(t){t[t.radius=201]="radius",t[t.circumcircle=202]="circumcircle",t[t.invert=203]="invert",t[t.intersection=204]="intersection"}(s||(e.CircleConstructions=s={})),function(t){t[t.square=301]="square",t[t.triangle=302]="triangle",t[t.quadrilateral=303]="quadrilateral",t[t.pentagon=304]="pentagon",t[t.hexagon=305]="hexagon",t[t.equilateralTriangle=306]="equilateralTriangle",t[t.parallelogram=307]="parallelogram",t[t.regularPolygon=308]="regularPolygon",t[t.starPolygon=309]="starPolygon",t[t.similar=310]="similar",t[t.application=311]="application",t[t.octagon=312]="octagon",t[t.face=313]="face",t[t.curvedTriangle=314]="curvedTriangle"}(a||(e.PolygonConstructions=a={})),function(t){t[t.sector=401]="sector",t[t.arc=402]="arc",t[t.angleMarker=403]="angleMarker",t[t.angleMarkerReflex=404]="angleMarkerReflex"}(l||(e.SectorConstructions=l={})),function(t){t[t.threePoints=501]="threePoints",t[t.perpendicular=502]="perpendicular",t[t.parallel=503]="parallel",t[t.ambient=504]="ambient"}(u||(e.PlaneConstructions=u={})),function(t){t[t.radius=601]="radius"}(c||(e.SphereConstructions=c={})),function(t){t[t.tetrahedron=701]="tetrahedron",t[t.parallelepiped=702]="parallelepiped",t[t.prism=703]="prism",t[t.pyramid=704]="pyramid"}(h||(e.PolyhedraConstructions=h={})),e.E={Point:i,Line:o,Circle:s,Polygon:a,Sector:l,Plane:u,Sphere:c,Polyhedra:h};var f=function(){function t(){this.keepsLineElements=!1}return t.prototype.validateSignature=function(t,e){if(t!=this.constructionMethod)return!1;var n=this.signature;if(n.points!==e.P.length)return!1;if(n.elements!==e.E.length)return!1;if(n.integers!==e.N.length)return!1;if(n.elementTypes)for(var r=0;r<n.elementTypes.length;r++)if(!(e.E[r]instanceof n.elementTypes[r]))return!1;return!0},t}();e.Construction=f;var d=n(4461),y=n(7339),_=n(9275),g=n(4133),v=n(5755),m=n(5193),P=n(8649),C=n(1099);e.constructions=p(p(p(p(p(p(p(p([],d.pointConstructions,!0),y.lineConstructions,!0),_.circleConstructions,!0),v.sectorConstructions,!0),g.polygonConstructions,!0),m.planeConstructions,!0),P.sphereConstructions,!0),C.polyhedronConstructions,!0)},8020(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeomElement=e.Align=void 0,function(t){t[t.CENTRAL=0]="CENTRAL",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(n||(e.Align=n={}));var r=function(){function t(){this.preexists=!1,this._nameColor=null,this._vertexColor=null,this._edgeColor=null,this._faceColor=null,this._nameHighlightColor="#FFD700",this._vertexHighlightColor="#FFD700",this._edgeHighlightColor="#FFD700",this._faceHighlightColor="#FFD700",this._shouldHighlight=!1,this._visible=!0,this._emphasisAmount=0,this._drawProgress=1,this._pixelTolerance=50}return t.setFont=function(e,n){t._fontName=e,t._fontSize=n},t.fontString=function(){return"italic ".concat(t._fontSize*t.styleScale,"px ").concat(t._fontName)},t.prototype._getTextMetrics=function(t,e){var n=t.measureText(e);return[n.width,null!=n.actualBoundingBoxAscent?n.actualBoundingBoxAscent+n.actualBoundingBoxDescent:16]},t.prototype.drawString=function(e,r,i,o){var s=i.getContext("2d");if(null!=this._nameColor){s.font=t.fontString(),s.fillStyle=this._nameColor;var a=this._getTextMetrics(s,this._name),l=a[0],u=a[1];switch(o||this._align){case n.LEFT:return e=e-l-6,r=r+u/2-4,void s.fillText(this._name,e,r);case n.RIGHT:return e+=2,r+=u/2-4,void s.fillText(this._name,e,r);case n.ABOVE:return e-=l/2,r+=-u/2+4,void s.fillText(this._name,e,r);case n.BELOW:return e-=l/2,r+=u/2+6,void s.fillText(this._name,e,r)}var c=i.width,h=i.height,p=(e-c/2)*h,f=(r-h/2)*c;f>p?f>=-p?(e-=l/2,r+=u/2+6,s.fillText(this._name,e,r)):(e=e-l-6,r+=u/2-4,s.fillText(this._name,e,r)):f>=-p?(e+=2,r+=u/2-4,s.fillText(this._name,e,r)):(e-=l/2,r+=-u/2+4,s.fillText(this._name,e,r))}},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.update()},t.prototype.defined=function(){return!1},t.prototype.drag=function(t,e){return!1},Object.defineProperty(t.prototype,"nameColor",{get:function(){return this._nameColor},set:function(t){this._nameColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeColor",{get:function(){return this._edgeColor},set:function(t){this._edgeColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceColor",{get:function(){return this._faceColor},set:function(t){this._faceColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameHighlightColor",{get:function(){return this._nameHighlightColor},set:function(t){this._nameHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexHighlightColor",{get:function(){return this._vertexHighlightColor},set:function(t){this._vertexHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeHighlightColor",{get:function(){return this._edgeHighlightColor},set:function(t){this._edgeHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceHighlightColor",{get:function(){return this._faceHighlightColor},set:function(t){this._faceHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"draggable",{get:function(){return this._draggable},set:function(t){this._draggable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimension",{get:function(){return this._dimension},set:function(t){this._dimension=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldHighlight",{get:function(){return this._shouldHighlight},set:function(t){this._shouldHighlight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasized",{get:function(){return this._emphasisAmount>0},set:function(t){this._emphasisAmount=t?1:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasisAmount",{get:function(){return this._emphasisAmount},set:function(t){this._emphasisAmount=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawProgress",{get:function(){return this._drawProgress},set:function(t){this._drawProgress=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexColor",{get:function(){return this._vertexColor},set:function(t){this._vertexColor=t},enumerable:!1,configurable:!0}),t._fontSize=18,t._fontName="Times New Roman",t.styleScale=1,t}();e.GeomElement=r},9222(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleCompassTransferAnimation=e.CircleCompassAnimation=void 0;var o=n(7233),s=n(1313),a=n(6091),l=n(2145),u=n(7091),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.CIRCLE_COMPASS,e.name="Circle.compass",e.elementType=s.CircleElement,e.defaultRate=.003,e.defaultDurationMs=600,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=n&&"number"==typeof n.startAngle?n.startAngle:Math.atan2(r.B.y-r.Center.y,r.B.x-r.Center.x),o=2*Math.PI/this.defaultRate,s=function(){r.faceAlpha=1,r.drawProgress=1,r.drawStartAngle=0,r.visible=!0},a={durationMs:o,setup:function(){r.drawStartAngle=i,r.faceAlpha=0,r.drawProgress=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};return null==r.faceColor?(a.finalise=s,[a]):[a,{durationMs:Math.min(o/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:s}]},e}(o.Animation);e.CircleCompassAnimation=c,(0,o.registerAnimation)(new c);var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.CIRCLE_COMPASS_TRANSFER,e.name="Circle.compassTransfer",e.elementType=s.CircleElement,e.defaultRate=.0055,e.defaultDurationMs=600,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=r.Center,o=r.A,c=r.B;if(null==o||null==c||o===i||c===i||o.distance(c)<1e-6)return"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] Circle.compassTransfer: needs a radius defined by two points distinct from the centre (circle;radius;centre,p1,p2) — skipping"),[{durationMs:0,tick:function(){},finalise:function(){r.faceAlpha=1,r.drawProgress=1,r.visible=!0}}];var h=i.AP||r.AP,p=o.distance(c),f=i.distance(o)<=i.distance(c)?o:c,d=f===o?c:o,y=!n||1!==n.side&&-1!==n.side?1:n.side,_=function(t,e,n){var r=(t.x+e.x)/2,i=(t.y+e.y)/2,o=e.x-t.x,s=e.y-t.y,a=Math.hypot(o,s)||1,l=a*Math.sqrt(3)/2;return{x:r+n*l*(-s/a),y:i+n*l*(o/a)}}(i,f,y),g=new a.PointElement;g.x=_.x,g.y=_.y,g.AP=h;var v=Math.hypot(f.x-_.x,f.y-_.y)||1,m=(f.x-_.x)/v,P=(f.y-_.y)/v,C=new a.PointElement;C.x=f.x+p*m,C.y=f.y+p*P,C.AP=h;var w=Math.hypot(i.x-_.x,i.y-_.y)||1,x=(i.x-_.x)/w,A=(i.y-_.y)/w,E=new a.PointElement;E.x=_.x+(v+p)*x,E.y=_.y+(v+p)*A,E.AP=h;var b=new l.LineElement({A:i,B:f}),S=new u.PolygonElement;S.V=[i,f,g];for(var O=new l.LineElement({A:f,B:C}),M=new l.LineElement({A:i,B:E}),T=new s.CircleElement({C:f,B:d,AP:h}),j=new s.CircleElement({C:g,B:C,AP:h}),L=new s.CircleElement({C:i,B:f,AP:h}),B=new s.CircleElement({C:f,B:i,AP:h}),z=[b,S,O,M],I=[L,B,T,j],k=0,N=z.concat(I);k<N.length;k++){var R=N[k];R.edgeColor=null,R.faceColor=null,R.nameColor=null,R.vertexColor=null,R.emphasized=!0}var V=n&&Array.isArray(n.keepCircles)?n.keepCircles:null;V&&I.forEach((function(t,e){V[e]&&(t.name=String(V[e]))}));var D=function(t){return null!=V&&null!=t.name},H=2*Math.PI/this.defaultRate,F=function(t,e){return Math.max(120,t.distance(e)/.3)},G=function(t,e){return{durationMs:e,setup:function(){t.drawProgress=0},tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1}}},U=function(t){return{durationMs:H,setup:function(){t.drawStartAngle=Math.atan2(t.B.y-t.Center.y,t.B.x-t.Center.x),t.drawProgress=0},tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1}}},W=G(b,F(i,f));W.setup=function(){r.drawProgress=0,r.faceAlpha=0;for(var t=0,n=z;t<n.length;t++){var i=n[t];e.addEphemeral(i),i.drawProgress=0}for(var o=0,s=I;o<s.length;o++){var a=s[o];a.drawProgress=0,D(a)?(e.addElement(a),e.setInitiallyHidden(a.name),a.visible=!0):e.addEphemeral(a)}b.drawProgress=0};var Y=[W,U(L),U(B),{durationMs:F(i,f)+F(f,g),setup:function(){S.drawProgress=0},tick:function(t){S.drawProgress=t},finalise:function(){S.drawProgress=1}},G(O,F(f,C)),G(M,F(i,E)),U(T),U(j)],X={durationMs:H,setup:function(){r.drawStartAngle=Math.atan2(r.B.y-i.y,r.B.x-i.x),r.drawProgress=0,r.faceAlpha=0,r.visible=!0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1,r.faceAlpha=1,r.visible=!0,function(){for(var t=0,n=z;t<n.length;t++){var r=n[t];e.removeEphemeral(r)}for(var i=0,o=I;i<o.length;i++){var s=o[i];D(s)||e.removeEphemeral(s)}}()}};return Y.push(X),Y},e}(o.Animation);e.CircleCompassTransferAnimation=h,(0,o.registerAnimation)(new h)},9275(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.circleConstructions=e.SphereIntersectionConstruction=e.InvertCircleConstruction=e.CircleRadius3PointConstruction=e.CircleRadiusCenterConstruction=void 0;var o=n(7658),s=n(1313),a=n(4021),l=n(8157),u=n(6055),c=n(2295),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new s.CircleElement({C:e[0],B:e[1],AP:i});return[[o],o]},e}(o.Construction);e.CircleRadiusCenterConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new s.CircleElement({C:e[0],A:e[1],B:e[2],AP:i});return[[o],o]},e}(o.Construction);e.CircleRadius3PointConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.invert,e.signature={points:0,elements:2,integers:0,elementTypes:[s.CircleElement,s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.InvertCircleElement(n[0],n[1]);return[[i],i]},e}(o.Construction);e.InvertCircleConstruction=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.intersection,e.signature={points:0,elements:2,integers:0,elementTypes:[c.SphereElement,c.SphereElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new l.SphereIntersectionElement(n[0],n[1]);return[[i],i]},e}(o.Construction);e.SphereIntersectionConstruction=d,e.circleConstructions=[new p,new h,new f,new d]},1313(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n._drawStartAngle=0,n._faceAlpha=1,n.dimension=2,null==e||(n.Center=e.C,n.A=null!=e.A?e.A:n.Center,n.B=e.B,n.AP=e.AP),n}return i(e,t),Object.defineProperty(e.prototype,"drawStartAngle",{get:function(){return this._drawStartAngle},set:function(t){this._drawStartAngle=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.A.distance(this.B)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius2",{get:function(){return this.A.distance2(this.B)},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!0},e.prototype._drawCircleArc=function(t,e,n){t.beginPath();var r=this.radius2,i=Math.sqrt(r),o=this.AP.S.z*this.AP.S.z+this.AP.T.z*this.AP.T.z;if(Math.abs(o)<.01)t.ellipse(this.Center.x,this.Center.y,i,i,0,e,n);else{var s=i/Math.sqrt(o),a=s*this.AP.T.z,l=-s*this.AP.S.z,u=a*this.AP.S.x+l*this.AP.T.x,c=a*this.AP.S.y+l*this.AP.T.y,h=o<1?Math.sqrt(1-o):0,p=-h*c,f=h*u,d=Math.sqrt(u*u+c*c),y=Math.sqrt(p*p+f*f);if(y<.5)return t.moveTo(this.Center.x-u,this.Center.y-c),void t.lineTo(this.Center.x+u,this.Center.y+c);var _=Math.atan2(c,u);t.ellipse(this.Center.x,this.Center.y,d,y,_,e,n)}},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale;var i=this.drawStartAngle,s=i+2*Math.PI*this.drawProgress;this._drawCircleArc(n,i,s),n.stroke()}}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=this.faceAlpha;if(!(e<=0)){var n=t.getContext("2d");n.fillStyle=this.faceColor,this._drawCircleArc(n,0,2*Math.PI),e<1?(n.save(),n.globalAlpha=e,n.fill(),n.restore()):n.fill()}}},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name){var e=t.getContext("2d");e.strokeStyle=this.nameColor,e.font=o.GeomElement.fontString();var n=this._getTextMetrics(e,this.name),r=n[0],i=n[1];e.fillText(this._name,this.Center.x-r/2,this.Center.y-i/2)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(o.GeomElement);e.CircleElement=s},2218(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircumcircleElement=void 0;var o=n(6091),s=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.dimension=2,s.B=e,s.C=n,s.D=r,s.AP=i,s.Center=new o.PointElement({AP:i}),s.A=s.Center,s}return i(e,t),e.prototype.update=function(){this.Center.toCircumcenter(this.B,this.C,this.D)},e.prototype.translate=function(t,e){this.Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n)},e}(n(1313).CircleElement);e.CircumcircleElement=s},4021(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertCircleElement=void 0;var o=n(1313),s=n(6091),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._C=e,r._D=n,r.AP=e.AP,r.Center=new s.PointElement({AP:r.AP}),r.A=r.Center,r.B=new s.PointElement({AP:r.AP}),r}return i(e,t),e.prototype.update=function(){var t=this._C.Center.distance2(this._D.Center),e=this._C.radius2,n=this._D.radius2/(t-e);this.Center.to(this._C.Center).minus(this._D.Center).times(n).plus(this._D.Center),n=1+Math.sqrt(e/t),this.B.to(this.Center).minus(this._D.Center).times(n).plus(this._D.Center)},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n)},e}(o.CircleElement);e.InvertCircleElement=a},8157(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereIntersectionElement=void 0;var o=n(1313),s=n(6091),a=n(103),l=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._S=e,r._T=n,r.Center=r.A=new s.PointElement,r.B=new s.PointElement,r.AP=new a.PerpendicularPlane({A:r.Center,E:n.Center}),r.Center._AP=r.AP,r}return i(e,t),e.prototype.update=function(){var t=this._T.Center.distance2(this._S.Center),e=this._T.radius2(),n=.5+(e-this._S.radius2())/(2*t);this.Center.to(this._S.Center).minus(this._T.Center).times(n).plus(this._T.Center);var r=Math.sqrt(e-this.Center.distance2(this._T.Center));this.B.to(this.Center),this.B.z+=r,this.AP.update()},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e),this.AP.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n),this.AP.rotate(t,e,n)},e}(o.CircleElement);e.SphereIntersectionElement=l},4580(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.GroupCloneAsideAnimation=void 0;var o=n(7233),s=n(8020),a=n(6091),l=n(2145),u=n(7091),c=n(4610);function h(t){var e=function(t){var e=new a.PointElement;return e.x=t.x,e.y=t.y,e.z=t.z,e};if(t instanceof u.PolygonElement){for(var n=new u.PolygonElement,r=[],i=0,o=t.V;i<o.length;i++){var s=e(o[i]);n.V.push(s),r.push({pt:s,bx:s.x,by:s.y})}return n.edgeColor=t.edgeColor,n.faceColor=t.faceColor,n.faceAlpha=t.faceAlpha,n.nameColor=t.nameColor,n.vertexColor=t.vertexColor,{ghost:n,pts:r}}if(t instanceof l.LineElement){var c=e(t.A),h=e(t.B);return(n=new l.LineElement({A:c,B:h})).edgeColor=t.edgeColor,n.nameColor=t.nameColor,{ghost:n,pts:[{pt:c,bx:c.x,by:c.y},{pt:h,bx:h.x,by:h.y}]}}return t instanceof a.PointElement?((s=e(t)).vertexColor=t.vertexColor,s.nameColor=t.nameColor,null!=t.name&&(s.name=t.name),{ghost:s,pts:[{pt:s,bx:s.x,by:s.y}]}):null}var p=!1;function f(t){for(var e=[],n=[],r=0,i=t;r<i.length;r++){var o=i[r],s=h(o);if(null!=s){e.push(s.ghost);for(var a=0,l=s.pts;a<l.length;a++){var u=l[a];n.push(u)}}else!p&&"undefined"!=typeof console&&console.warn&&(console.warn("[geomlib] Group.cloneAside: skipping unsupported element type ("+o.name+")"),p=!0)}return{ghosts:e,pts:n}}function d(t,e){if(!e||null==e.elem||"number"!=typeof e.to)return null;var n=t.lookupElement(String(e.elem));if(!(n instanceof c.LineSlider))return null;var r=n.x,i=n.y,o=n.z,s=n._A,a=n._B;return n.x=s.x+(a.x-s.x)*e.to,n.y=s.y+(a.y-s.y)*e.to,n.z=s.z+(a.z-s.z)*e.to,t.update(),function(){n.x=r,n.y=i,n.z=o,t.update()}}function y(t){for(var e=1/0,n=-1/0,r=1/0,i=-1/0,o=0,s=t;o<s.length;o++){var a=s[o];a.bx<e&&(e=a.bx),a.bx>n&&(n=a.bx),a.by<r&&(r=a.by),a.by>i&&(i=a.by)}return{minX:e,maxX:n,minY:r,maxY:i}}function _(t,e){return Math.abs(t)>=Math.abs(e)?t<0?"left":"right":e<0?"top":"bottom"}var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.GROUP_CLONE_ASIDE,e.name="Group.cloneAside",e.elementType=s.GeomElement,e}return i(e,t),e.prototype.build=function(t,e,n){var r=n&&n.include,i=n&&!0===n.autoPlace,o=function(t,e){var n=[];if(Array.isArray(e))for(var r=0,i=e;r<i.length;r++){var o=i[r];null!=(l=t.lookupElement(String(o)))&&n.push(l)}else for(var s=0,a=t.elements;s<a.length;s++){var l;null!=(l=a[s]).name&&l.visible&&!l.name.startsWith("screen")&&n.push(l)}return n}(e,r);return i?[this._autoPlaceStep(t,e,n,o)]:[this._legacyStep(t,e,n,o)]},e.prototype._autoPlaceStep=function(t,e,n,r){var i=n&&"number"==typeof n.dx?n.dx:0,o=n&&"number"==typeof n.dy?n.dy:0,s=Array.isArray(n&&n.variants)&&n.variants.length>0?n.variants:[{vary:n&&n.vary,prefer:_(i,o)}],a=0,l=0,u=0,c=0,h=!1,p=[],g=function(t){if(h){var n,r=(n=Math.min(1,t/.4),1-Math.pow(1-n,3)),i=Math.max(0,Math.min(1,(t-.4)/.6));e.setViewOffset(u+(a-u)*r,c+(l-c)*r);for(var o=0,s=p;o<s.length;o++)for(var f=s[o],d=0,y=f.pts;d<y.length;d++){var _=y[d];_.pt.x=_.bx+f.edx*i,_.pt.y=_.by+f.edy*i}}};return{durationMs:900,setup:function(){t.drawProgress=1,t.visible=!0;var n=e.displayWidth,i=e.displayHeight;if(n&&i){for(var o=[],_=0,g=s;_<g.length;_++){var v=g[_],m=d(e,v&&v.vary),P=f(r);m&&m(),0!==P.pts.length&&o.push({ghosts:P.ghosts,pts:P.pts,bbox:y(P.pts),prefer:v&&v.prefer})}if(0!==o.length){u=e.viewOffsetX,c=e.viewOffsetY;var C=e.figureBounds();if(null!=C){var w=C.maxX-C.minX,x=C.maxY-C.minY,A=(C.minX+C.maxX)/2,E=(C.minY+C.maxY)/2;a=n/2-A,l=i/2-E;for(var b=function(t,e){var r=e.maxX-e.minX,o=e.maxY-e.minY,s=(e.minX+e.maxX)/2,u=(e.minY+e.maxY)/2;if("left"===t||"right"===t){if(o>i-16)return null;var c="left"===t?n/2-w/2-16:n/2+w/2+16,h="left"===t?8:n-8;return Math.abs(h-c)<r?null:[(c+h)/2-a-s,E-u]}if(r>n-16)return null;var p="top"===t?i/2-x/2-16:i/2+x/2+16,f="top"===t?8:i-8;return Math.abs(f-p)<o?null:[A-s,(p+f)/2-l-u]},S=["left","right","top","bottom"],O=new Set,M=[],T=function(t){for(var e=o[t],n=e.prefer||S[t%S.length],r=null,i=0,s=[n].concat(S.filter((function(t){return t!==n})));i<s.length;i++){var a=s[i];if(!O.has(a)&&null!=(r=b(a,e.bbox))){O.add(a);break}}if(null==r)return{value:void 0};M.push({pts:e.pts,edx:r[0],edy:r[1]})},j=0;j<o.length;j++){var L=T(j);if("object"==typeof L)return L.value}for(var B=0,z=o;B<z.length;B++)for(var I=0,k=z[B].ghosts;I<k.length;I++){var N=k[I];e.addEphemeral(N)}p=M,h=!0}}}},tick:function(t){g(t)},finalise:function(){g(1)}}},e.prototype._legacyStep=function(t,e,n,r){var i=n&&"number"==typeof n.dx?n.dx:0,o=n&&"number"==typeof n.dy?n.dy:0,s=n&&n.vary,a=Math.max(200,Math.hypot(i,o)/.4),l=[],u=i,c=o,h=!1,p=function(t){for(var e=0,n=l;e<n.length;e++){var r=n[e];r.pt.x=r.bx+u*t,r.pt.y=r.by+c*t}};return{durationMs:a,setup:function(){t.drawProgress=1,t.visible=!0;var n=d(e,s),a=f(r);n&&n();var p=a.ghosts,_=a.pts;if(0!==p.length){var g=y(_),v=g.maxX-g.minX,m=g.maxY-g.minY,P=e.displayWidth,C=e.displayHeight;if(!(P&&P<520)&&(u=i,c=o,P&&C&&(g.minX+u<6&&(u=6-g.minX),g.maxX+u>P-6&&(u=P-6-g.maxX),g.minY+c<6&&(c=6-g.minY),g.maxY+c>C-6&&(c=C-6-g.maxY)),Math.abs(u)>=v+8||Math.abs(c)>=m+8||0===v&&0===m)){for(var w=0,x=p;w<x.length;w++){var A=x[w];e.addEphemeral(A)}l=_,h=!0}}},tick:function(t){h&&p(t)},finalise:function(){h&&p(1)}}},e}(o.Animation);e.GroupCloneAsideAnimation=g,(0,o.registerAnimation)(new g)},5002(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Bichord=void 0;var o=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new s.PointElement,n._B=new s.PointElement,n.C=e.C,n.D=e.D,n._A._AP=n.C.AP,n._B._AP=n.C.AP),n}return i(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){var t=this.C.radius,e=this.D.radius,n=this.C.Center.distance(this.D.Center);if(n>t+e){var r=NaN;return this.A.x=r,this.A.y=r,this.A.z=r,this.B.x=r,this.B.y=r,void(this.B.z=r)}var i=(n*n+t*t-e*e)/(2*n*t),o=Math.sqrt(1-i*i);this.A.to(this.D.Center).toCircle(this.C),this.B.to(this.A),this.A.rotate(this.C.Center,i,o,this.C.AP),this.B.rotate(this.C.Center,i,-o,this.C.AP)},e}(o.LineElement);e.Bichord=a},1549(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Chord=void 0;var o=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n.C=e.C,n.D=e.D,n.E=e.E,n._A=new s.PointElement({AP:n.C.AP}),n._B=new s.PointElement({AP:n.C.AP})),n}return i(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){this._B.to(this.C.Center).toLine(this.D,this.E,!1);var t=this.C.Center.distance2(this._B),e=this.C.radius2;if(t>e){var n=NaN;return this._A.x=n,this._A.y=n,this._A.z=n,this._B.x=n,this._B.y=n,void(this._B.z=n)}var r=Math.sqrt(e-t),i=r/this.D.distance(this._B);i<1e10?this._A.to(this.D).minus(this._B).times(i).plus(this._B):(i=r/this.E.distance(this._B),this._A.to(this.E).minus(this._B).times(i).plus(this._B)),this._B.times(2).minus(this._A)},e}(o.LineElement);e.Chord=a},1910(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineStraightEdgeExtendAnimation=e.LineStraightEdgeConnectAnimation=void 0;var o=n(7233),s=n(2145);function a(t,e){var n=t.B.x-t.A.x,r=t.B.y-t.A.y,i=Math.sqrt(n*n+r*r);return{durationMs:Math.max(120,i/e),tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}}var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.LINE_STRAIGHT_EDGE_CONNECT,e.name="Line.straightEdgeConnect",e.elementType=s.LineElement,e.defaultRate=.25,e}return i(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(o.Animation);e.LineStraightEdgeConnectAnimation=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.LINE_STRAIGHT_EDGE_EXTEND,e.name="Line.straightEdgeExtend",e.elementType=s.LineElement,e.defaultRate=.25,e}return i(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(o.Animation);e.LineStraightEdgeExtendAnimation=u,(0,o.registerAnimation)(new l),(0,o.registerAnimation)(new u)},7339(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.lineConstructions=e.PolylineConstruction=e.MeanProportionalLineConstruction=e.ProportionLineConstruction=e.SimilarLineConstruction=e.LineParallelConstruction=e.LineExtendConstruction=e.LineCutoffConstruction=e.LinePerpendicular5Construction=e.LinePerpendicular4Construction=e.LinePerpendicular3Construction=e.LinePerpendicular2Construction=e.LinePerpendicular1Construction=e.BichordConstruction=e.ChordConstruction=e.PlaneFootLineConstruction=e.LineFootConstruction=e.AngleDividerLineConstruction=e.AngleBisectorLineConstruction=e.LineConnectConstruction=void 0;var o=n(7658),s=n(4461),a=n(1313),l=n(6055),u=n(2090),c=n(6921),h=n(3703),p=n(2145),f=n(3103),d=n(5002),y=n(1549),_=n(5014),g=n(9535),v=n(9237),m=n(3219),P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.connect,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new p.LineElement({A:e[0],B:e[1]});return[[i],i]},e}(o.Construction);e.LineConnectConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new v.AngleDividerElement(e[0],e[1],e[2],i,2),s=new p.LineElement({A:e[1],B:o});return[[o,s],s]},e}(o.Construction);e.AngleBisectorLineConstruction=C;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new v.AngleDividerElement(e[0],e[1],e[2],i,r[0]),s=new p.LineElement({A:e[1],B:o});return[[o,s],s]},e}(o.Construction);e.AngleDividerLineConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new c.Foot(e[0],e[1],e[2]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.LineFootConstruction=x;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new h.PlaneFootElement(e[0],n[0]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.PlaneFootLineConstruction=A;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.chord,e.signature={points:2,elements:1,integers:0,elementTypes:[a.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new y.Chord({D:e[0],E:e[1],C:n[0]});return[[i],i]},e}(o.Construction);e.ChordConstruction=E;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.bichord,e.signature={points:0,elements:2,integers:0,elementTypes:[a.CircleElement,a.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new d.Bichord({C:n[0],D:n[1]});return[[i],i]},e}(o.Construction);function S(t){return[t[0],t[0][0]]}e.BichordConstruction=b;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular1Construction);e.LinePerpendicular1Construction=O;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular2Construction);e.LinePerpendicular2Construction=M;var T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular3Construction);e.LinePerpendicular3Construction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular4Construction);e.LinePerpendicular4Construction=j;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular5Construction);e.LinePerpendicular5Construction=L;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.cutoff,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.Layoff(e[0],e[0],e[1],e[2],e[3]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.LineCutoffConstruction=B;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.extend,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.Layoff(e[1],e[0],e[1],e[2],e[3]),o=new p.LineElement({A:e[1],B:i});return[[i,o],o]},e}(o.Construction);e.LineExtendConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.parallel,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.Layoff(e[0],e[1],e[2],e[1],e[2]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.LineParallelConstruction=I;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=n.length>1?n[1]:t,s=new _.SimilarElement(e[0],e[1],i,e[2],e[3],e[4],o),a=new p.LineElement({A:e[0],B:s});return[[s,a],a]},e}(o.Construction);e.SimilarLineConstruction=k;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new g.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),o=new p.LineElement({A:e[6],B:i});return[[i,o],o]},e}(o.Construction);e.ProportionLineConstruction=N;var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new m.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]),o=new p.LineElement({A:e[4],B:i});return[[i,o],o]},e}(o.Construction);e.MeanProportionalLineConstruction=R;var V=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.path,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&0===e.E.length&&0===e.N.length&&e.P.length>=2},e.prototype.construct=function(t,e,n,r){var i=new f.PolylineElement(e.slice());return[[i],i]},e}(o.Construction);e.PolylineConstruction=V,e.lineConstructions=[new V,new P,new z,new O,new M,new T,new j,new L,new b,new E,new I,new B,new A,new x,new k,new N,new C,new w,new R]},2145(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,n._A=e&&e.A||null,n._B=e&&e.B||null,n}return i(e,t),Object.defineProperty(e.prototype,"A",{get:function(){return this._A},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return this._B},enumerable:!1,configurable:!0}),e.prototype.drawEdge=function(t,e){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e)){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale;var i=this.drawProgress,s=this._A.x+(this._B.x-this._A.x)*i,a=this._A.y+(this._B.y-this._A.y)*i;n.beginPath(),n.moveTo(this._A.x,this._A.y),n.lineTo(s,a),n.stroke()}},e.prototype.drawFace=function(t){},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&null!=this._A&&this._A.defined()&&null!=this._B&&this._B.defined()){var e=Math.round((this._A.x+this._B.x)/2),n=Math.round((this._A.y+this._B.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(o.GeomElement);e.LineElement=s},6279(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Perpendicular=void 0;var o=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._P=e.P,n._A=new o.PointElement({AP:e.P}),n._B=new o.PointElement({AP:e.P}),n._C=e.C,n._D=e.D,n._E=e.E,n._F=e.F),n}return i(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.to(this._D).minus(this._A);var t=o.PointElement.dot(this.B,this._P.S),e=o.PointElement.dot(this.B,this._P.T),n=Math.sqrt(this._E.distance2(this._F)/(t*t+e*e));t=-t/n,e/=n,this._B.x=e*this._P.S.x+t*this._P.T.x+this._A.x,this._B.y=e*this._P.S.y+t*this._P.T.y+this._A.y,this._B.z=e*this._P.S.z+t*this._P.T.z+this._A.z},e}(n(2145).LineElement);e.Perpendicular=s},3375(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlanePerpendicularLine=void 0;var o=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new o.PointElement({AP:e.P}),n._B=new o.PointElement,n._C=e.C,n._D=e.D,n._E=e.E,n._P=e.P),n}return i(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.toCross(this._P.S,this._P.T),this._B.times(this._D.distance(this._E)).plus(this._A)},e}(n(2145).LineElement);e.PlanePerpendicularLine=s},3103(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolylineElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,n.V=null==e?[]:e,n}return i(e,t),e.prototype.defined=function(){if(this.V.length<2)return!1;for(var t=0,e=this.V;t<e.length;t++)if(!e[t].defined())return!1;return!0},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(!(null==e||this.V.length<2)){var n=t.getContext("2d");n.beginPath(),n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale;var i=this.V.length-1,s=this.drawProgress*i,a=Math.floor(s),l=s-a;n.moveTo(this.V[0].x,this.V[0].y);for(var u=0;u<a;u++){var c=this.V[u+1];n.lineTo(c.x,c.y),n.stroke()}if(l>0&&a<i){var h=this.V[a];c=this.V[a+1],n.lineTo(h.x+(c.x-h.x)*l,h.y+(c.y-h.y)*l),n.stroke()}}}},e.prototype.drawFace=function(t){},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined())for(var e=0,n=this.V;e<n.length;e++)n[e].drawVertex(t,this.vertexColor)},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,i=this.V;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}var s=this.V.length,a=t.getContext("2d"),l=this._getTextMetrics(a,this._name),u=l[0],c=l[1];a.beginPath(),a.fillStyle=this.nameColor,a.fillText(this._name,e/s-u/2,n/s+c/4)}},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(o.GeomElement);e.PolylineElement=s},9362(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ParallelPlane=void 0;var o=n(6055),s=n(6091),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._P=e,r.A=n,r.B=new s.PointElement,r.C=new s.PointElement,r.S=e.S,r.T=e.T,r.U=e.U,r}return i(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(t,e,n){this.B.rotate(t,e,n),this.C.rotate(t,e,n)},e.prototype.update=function(){this.B.to(this._P.B).minus(this._P.A).plus(this.A),this.C.to(this._P.C).minus(this._P.A).plus(this.A)},e}(o.PlaneElement);e.ParallelPlane=a},103(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PerpendicularPlane=void 0;var o=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.A=e.A,n.E=e.E,n.B=new o.PointElement({AP:n}),n.C=new o.PointElement({AP:n}),n.S=new o.PointElement,n.T=new o.PointElement,n}return i(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(e,n,r){this.B.rotate(e,n,r),this.C.rotate(e,n,r),t.prototype.update.call(this)},e.prototype.update=function(){this.U=o.PointElement.difference(this.E,this.A);var t=this.U.length();this.U.times(1/t);var e=Math.sqrt(this.U.x*this.U.x+this.U.y*this.U.y);e>=1e-6?(this.S.x=-this.U.y/e,this.S.y=this.U.x/e,this.T.toCross(this.U,this.S)):(this.S.x=1,this.S.y=0,this.S.z=0,this.T.x=0,this.T.y=1,this.T.z=0),this.B.to(this.S).times(t).plus(this.A),this.C.to(this.T).times(t).plus(this.A)},e}(n(6055).PlaneElement);e.PerpendicularPlane=s},5193(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.planeConstructions=e.AmbientPlaneCircleConstruction=e.AmbientPlanePointConstruction=e.PlaneParallelConstruction=e.PerpendicularPlaneConstruction=e.Plane3PointsConstruction=void 0;var o=n(7658),s=n(1313),a=n(6055),l=n(103),u=n(9362),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.threePoints,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.PlaneElement({A:e[0],B:e[1],C:e[2]});return[[i],i]},e}(o.Construction);e.Plane3PointsConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.perpendicular,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new l.PerpendicularPlane({A:e[0],E:e[1]});return[[i],i]},e}(o.Construction);e.PerpendicularPlaneConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.parallel,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.ParallelPlane(n[0],e[0]);return[[i],i]},e}(o.Construction);e.PlaneParallelConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.ambient,e.signature={points:1,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[e[0]._AP],e[0]._AP]},e}(o.Construction);e.AmbientPlanePointConstruction=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.ambient,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=n[0];return[[i.AP],i.AP]},e}(o.Construction);e.AmbientPlaneCircleConstruction=d,e.planeConstructions=[new c,new h,new p,new f,new d]},6055(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneElement=void 0;var o=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n.isScreen=!1,null!=e&&(n.A=e.A,n.B=e.B,n.C=e.C,n.S=new s.PointElement,n.T=new s.PointElement,n.U=new s.PointElement),n}return i(e,t),e.prototype.defined=function(){return null!=this.A&&null!=this.B&&null!=this.C},e.prototype.drawEdge=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,r),e.lineTo(this.C.x,this.C.y),e.closePath(),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,r),e.lineTo(this.C.x,this.C.y),e.closePath(),e.fill(),e.restore()}},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){var e=Math.round((this.B.x+this.C.x)/2),n=Math.round((this.B.y+this.C.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined()){var e=t.getContext("2d"),n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.fillStyle=this.vertexColor,e.arc(n,r,2,0,2*Math.PI,!1),e.fill()}},e.prototype.rotate=function(t,e,n){this.update()},e.prototype.translate=function(t,e){},e.prototype.update=function(){!this.isScreen||0==this.A.z&&0==this.B.z&&0==this.C.z||(this.isScreen=!1),this.S.to(this.B).minus(this.A),this.T.to(this.C).minus(this.A),this.S.times(1/this.S.length());var t=s.PointElement.dot(this.T,this.S);this.T.x-=t*this.S.x,this.T.y-=t*this.S.y,this.T.z-=t*this.S.z,this.T.times(1/this.T.length()),this.U.toCross(this.S,this.T)},e}(o.GeomElement);e.PlaneElement=a},9237(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AngleDividerElement=void 0;var o=function(t){function e(e,n,r,i,o){var s=t.call(this)||this;return s.dimension=0,s._A=n,s._B=e,s._C=r,s._AP=i,s._n=o,s}return i(e,t),e.prototype.update=function(){var t=this._A.angle(this._B,this._C,this._AP)/this._n,e=Math.cos(t),n=Math.sin(t);this._AP.isScreen?(this._x=this._A.x+e*(this._B.x-this._A.x)-n*(this._B.y-this._A.y),this._y=this._A.y+n*(this._B.x-this._A.x)+e*(this._B.y-this._A.y),this._z=0):this.to(this._B).rotate(this._A,e,n,this._AP),this.toIntersection(this,this._A,this._B,this._C,this._AP)},e}(n(6091).PointElement);e.AngleDividerElement=o},788(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleSlider=void 0;var o=n(6091),s=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s._newP=new o.PointElement,s.dimension=0,s.draggable=!0,s._C=e,s._x=n,s._initx=n,s._y=r,s._inity=r,s._z=i,s._initz=i,s}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toCircle(this._C)},e.prototype.update=function(){this.toCircle(this._C)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._C.AP),this._newP.defined()||this._newP.to(this).toPlane(this._C.AP),this._newP.toSphere(this._C.Center,this._C.radius),!((this._newP.x-this.x)*(this._newP.x-this.x)+(this._newP.y-this.y)*(this._newP.y-this.y)<.5||(this.to(this._newP),0))},e}(o.PointElement);e.CircleSlider=s},6401(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FixedPoint=void 0;var o=function(t){function e(e){var n=t.call(this,e)||this;return n._initx=n._x,n._inity=n._y,n._initz=n._z,n}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz},e}(n(6091).PointElement);e.FixedPoint=o},6921(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Foot=void 0;var o=function(t){function e(e,n,r){var i=t.call(this)||this;return i.dimension=0,i._A=e,i._B=n,i._C=r,i._B.AP==i._C.AP&&(i._AP=i._B.AP),i}return i(e,t),e.prototype.update=function(){this.to(this._A).toLine(this._B,this._C,!1)},e}(n(6091).PointElement);e.Foot=o},7876(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.HarmonicElement=void 0;var o=n(6091),s=function(t){function e(e,n,r){var i=t.call(this)||this;return i.dimension=0,i._B=e,i._C=n,i._D=r,i._E=new o.PointElement,i._F=new o.PointElement,i._M=new o.PointElement,i}return i(e,t),e.prototype.update=function(){if(0===this._B.z&&0===this._C.z&&0===this._D.z){var t=this._B.x-this._C.x,e=this._B.y-this._C.y,n=this._B.x-this._D.x,r=this._B.y-this._D.y,i=this._C.x*n-this._C.y*r,s=this._C.x*r+this._C.y*n,a=this._D.x*t-this._D.y*e,l=this._D.x*e+this._D.y*t,u=(n+t)*(n+t)+(r+e)*(r+e),c=(i+a)*(n+t)+(s+l)*(r+e),h=-(i+a)*(r+e)+(s+l)*(n+t);this._x=c/u,this._y=h/u}else{this._M.to(this._C).plus(this._D).times(.5),this._F.to(this._C).minus(this._M),this._E.to(this._B).minus(this._M);var p=1/this._E.length2(),f=this._F.length2();this.to(this._F).times(2*o.PointElement.dot(this._E,this._F)).minus(this._E.times(f)).times(p).plus(this._M)}},e}(o.PointElement);e.HarmonicElement=s},7832(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Intersection=void 0;var o=function(t){function e(e,n,r,i,o){var s=t.call(this,{AP:o})||this;return s.dimension=0,s.A=e,s.B=n,s.C=r,s.D=i,s}return i(e,t),e.prototype.update=function(){this.toIntersection(this.A,this.B,this.C,this.D,this.AP)},e}(n(6091).PointElement);e.Intersection=o},6015(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertPointElement=void 0;var o=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._C=n,r._AP=n.AP,r}return i(e,t),e.prototype.update=function(){this.toInvertPoint(this._A,this._C)},e}(n(6091).PointElement);e.InvertPointElement=o},2090(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Layoff=void 0;var o=function(t){function e(e,n,r,i,o){var s=t.call(this)||this;return s.dimension=0,s._A=e,s._C=n,s._D=r,s._E=i,s._F=o,e.AP==n.AP&&e.AP==r.AP&&(s._AP=e.AP),s}return i(e,t),e.prototype.update=function(){var t=this._E.distance(this._F)/this._C.distance(this._D);this.to(this._D).minus(this._C),this.times(t).plus(this._A)},e}(n(6091).PointElement);e.Layoff=o},4610(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineSlider=void 0;var o=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.dimension=0,a.draggable=!0,a._A=e,a._B=n,a._x=r,a._initx=r,a._y=i,a._inity=i,a._z=o,a._initz=o,a._segment=s,a._A.AP==a._B.AP&&(a._AP=a._A.AP),a}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toLine(this._A,this._B,this._segment)},e.prototype.update=function(){this.toLine(this._A,this._B,this._segment)},e.prototype.drag=function(t,e){t-=this._A.x,e-=this._A.y;var n=this._B.x-this._A.x,r=this._B.y-this._A.y,i=(t*n+e*r)/(n*n+r*r);return this._segment&&(i<0?i=0:i>1&&(i=1)),t=this._A.x+n*i,e=this._A.y+r*i,!((t-this._x)*(t-this._x)+(t-this._y)*(t-this._y)<.5||(this._x=t,this._y=e,this._z=this._A.z+(this._B.z-this._A.z)*i,0))},e}(n(6091).PointElement);e.LineSlider=o},3219(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MeanProportionalElement=void 0;var o=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.dimension=0,a._S0=e,a._S1=n,a._T0=r,a._T1=i,a._U0=o,a._U1=s,o._AP===s._AP&&(a._AP=o._AP),a}return i(e,t),e.prototype.update=function(){var t=Math.sqrt(this._S0.distance2(this._S1)*this._T0.distance2(this._T1));t=Math.sqrt(t/this._U0.distance2(this._U1)),this.to(this._U1).minus(this._U0),this.times(t).plus(this._U0)},e}(n(6091).PointElement);e.MeanProportionalElement=o},489(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Midpoint=void 0;var o=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._B=n,r._A.AP==r._B.AP&&(r._AP=r._A.AP),r}return i(e,t),e.prototype.update=function(){this._x=(this._A.x+this._B.x)/2,this._y=(this._A.y+this._B.y)/2,this._z=(this._A.z+this._B.z)/2},e}(n(6091).PointElement);e.Midpoint=o},3703(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneFootElement=void 0;var o=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._AP=n,r}return i(e,t),e.prototype.update=function(){this.to(this._A).toPlane(this._AP)},e}(n(6091).PointElement);e.PlaneFootElement=o},2930(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneIntersection=void 0;var o=function(t){function e(e,n,r){var i=t.call(this)||this;return i.dimension=0,i._A=n,i._B=r,i._AP=e,i}return i(e,t),e.prototype.update=function(){this.toIntersectionPL(this._AP,this._A,this._B)},e}(n(6091).PointElement);e.PlaneIntersection=o},4994(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneSlider=void 0;var o=n(6091),s=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s._newP=new o.PointElement,s.dimension=0,s.draggable=!0,s._AP=e,s._x=s._initx=n,s._y=s._inity=r,s._z=s._initz=i,s}return i(e,t),e.prototype.update=function(){this.toPlane(this._AP)},e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toPlane(this._AP)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._AP),this._newP.defined()?this.to(this._newP):this.toPlane(this._AP),!0},e}(o.PointElement);e.PlaneSlider=s},2872(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointSlideAnimation=e.PointAppearAnimation=void 0;var o=n(7233),s=n(6091),a=n(4610),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POINT_APPEAR,e.name="Point.appear",e.elementType=s.PointElement,e.defaultDurationMs=350,e}return i(e,t),e.prototype.build=function(t,e,n){return[{durationMs:this.defaultDurationMs,tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(o.Animation);e.PointAppearAnimation=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POINT_SLIDE,e.name="Point.slide",e.elementType=a.LineSlider,e.defaultDurationMs=650,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=n&&"number"==typeof n.to?n.to:1,o=0,s=0,a=0,l=0,u=0,c=0,h=function(t){r.x=o+(l-o)*t,r.y=s+(u-s)*t,r.z=a+(c-a)*t,e.update()};return[{durationMs:this.defaultDurationMs,setup:function(){r.drawProgress=1,r.visible=!0,o=r.x,s=r.y,a=r.z;var t=r._A,e=r._B;l=t.x+(e.x-t.x)*i,u=t.y+(e.y-t.y)*i,c=t.z+(e.z-t.z)*i},tick:function(t){h(t)},finalise:function(){h(1),r.drawProgress=1,r.visible=!0}}]},e}(o.Animation);e.PointSlideAnimation=u,(0,o.registerAnimation)(new l),(0,o.registerAnimation)(new u)},4461(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.pointConstructions=e.VertexConstruction=e.HarmonicPointConstruction=e.LineSliderSegmentConstruction=e.FixedPointConstruction=e.AngleDividerPointConstruction=e.AngleBisectorPointConstruction=e.SphereSliderConstruction=e.PlaneSliderConstruction=e.MeanProportionalPointConstruction=e.InvertPointConstruction=e.ProportionPointConstruction=e.PointPerpendicular5Construction=e.PointPerpendicular4Construction=e.PointPerpendicular3Construction=e.PointPerpendicular2Construction=e.PointPerpendicular1Construction=e.PointPerpendicularConstruction=e.SimilarPointConstruction=e.ParallelogramConstruction=e.ExtendConstruction=e.CutoffConstruction=e.LayoffConstruction=e.PlaneFootPointConstruction=e.FootPointConstruction=e.CircumcenterConstruction=e.CircumcircleConstruction=e.CircleSliderConstruction=e.LineSliderConstruction=e.SphereCenterConstruction=e.CircleCenterConstruction=e.LastPointConstruction=e.FirstPointConstruction=e.PlaneIntersectionConstruction=e.IntersectionConstruction=e.MidPointConstruction=e.FreePointConstruction=void 0;var o=n(7658),s=n(1313),a=n(2218),l=n(6055),u=n(6401),c=n(4994),h=n(489),p=n(7832),f=n(2930),d=n(4610),y=n(2090),_=n(6921),g=n(3703),v=n(788),m=n(5014),P=n(9535),C=n(9237),w=n(3219),x=n(7876),A=n(6015),E=n(5089),b=n(6279),S=n(3375),O=n(2295),M=n(7091),T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.free,e.signature={points:0,elements:0,integers:2},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new c.PlaneSlider(t,r[0],r[1],0);return[[i],i]},e}(o.Construction);e.FreePointConstruction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.midpoint,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new h.Midpoint(e[0],e[1]);return[[i],i]},e}(o.Construction);e.MidPointConstruction=j;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.intersection,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&4===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new p.Intersection(e[0],e[1],e[2],e[3],i);return[[o],o]},e}(o.Construction);e.IntersectionConstruction=L;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.intersection,e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new f.PlaneIntersection(n[0],e[0],e[1]);return[[i],i]},e}(o.Construction);e.PlaneIntersectionConstruction=B;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.first,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],e[0]]},e}(o.Construction);e.FirstPointConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.last,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],e[1]]},e}(o.Construction);e.LastPointConstruction=I;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],n[0].Center]},e}(o.Construction);e.CircleCenterConstruction=k;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[O.SphereElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],n[0].Center]},e}(o.Construction);e.SphereCenterConstruction=N;var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.lineSlider,e.signature={points:2,elements:0,integers:2},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length)},e.prototype.construct=function(t,e,n,r){var i=this.createSlider(e[0],e[1],r[0],r[1],r.length>2?r[2]:0);return[[i],i]},e.prototype.createSlider=function(t,e,n,r,i){return new d.LineSlider(t,e,n,r,i,!1)},e}(o.Construction);e.LineSliderConstruction=R;var V=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.circleSlider,e.signature={points:0,elements:1,integers:2,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&0===e.P.length&&1===e.E.length&&(2===e.N.length||3===e.N.length)&&e.E[0]instanceof s.CircleElement},e.prototype.construct=function(t,e,n,r){var i=new v.CircleSlider(n[0],r[0],r[1],r.length>2?r[2]:0);return[[i],i]},e}(o.Construction);e.CircleSliderConstruction=V;var D=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.circumcircle,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new a.CircumcircleElement(e[0],e[1],e[2],i);return[[o],o]},e}(o.Construction);e.CircumcircleConstruction=D;var H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.circumcenter,e}return i(e,t),e.prototype.construct=function(e,n,r,i){var o=t.prototype.construct.call(this,e,n,r,i),s=o[1];return o[0].push(s.Center),[o[0],s.Center]},e}(D);e.CircumcenterConstruction=H;var F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new _.Foot(e[0],e[1],e[2]);return[[i],i]},e}(o.Construction);e.FootPointConstruction=F;var G=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new g.PlaneFootElement(e[0],n[0]);return[[i],i]},e}(o.Construction);e.PlaneFootPointConstruction=G;var U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=this._createLayoff(e);return[[i],i]},e}(o.Construction);e.LayoffConstruction=U;var W=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.cutoff,e}return i(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[0],t[0],t[1],t[2],t[3])},e}(U);e.CutoffConstruction=W;var Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.extend,e}return i(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[1],t[0],t[1],t[2],t[3])},e}(U);e.ExtendConstruction=Y;var X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new y.Layoff(e[0],e[1],e[2],e[1],e[2]);return[[i],i]},e}(o.Construction);e.ParallelogramConstruction=X;var q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=n.length>1?n[1]:t,s=new m.SimilarElement(e[0],e[1],i,e[2],e[3],e[4],o);return[[s],s]},e}(o.Construction);e.SimilarPointConstruction=q;var K=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.perpendicular,e}return i(e,t),e}(o.Construction);e.PointPerpendicularConstruction=K;var J=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new b.Perpendicular({C:e[0],D:e[1],P:t,E:e[0],F:e[1]});return[[i],i.B]},e}(K);e.PointPerpendicular1Construction=J;var Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new b.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[0],F:e[1]});return[[i],i.B]},e}(K);e.PointPerpendicular2Construction=Q;var Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new b.Perpendicular({C:e[0],D:e[1],P:t,E:e[2],F:e[3]});return[[i],i.B]},e}(K);e.PointPerpendicular3Construction=Z;var $=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new b.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[2],F:e[3]});return[[i],i.B]},e}(K);e.PointPerpendicular4Construction=$;var tt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:3,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new S.PlanePerpendicularLine({C:e[0],P:n[0],D:e[1],E:e[2]});return[[i],i.B]},e}(K);e.PointPerpendicular5Construction=tt;var et=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new P.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]);return[[i],i]},e}(o.Construction);e.ProportionPointConstruction=et;var nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.invert,e.signature={points:1,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new A.InvertPointElement(e[0],n[0]);return[[i],i]},e}(o.Construction);e.InvertPointConstruction=nt;var rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new w.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]);return[[i],i]},e}(o.Construction);e.MeanProportionalPointConstruction=rt;var it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.planeSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new c.PlaneSlider(n[0],r[0],r[1],r[2]);return[[i],i]},e}(o.Construction);e.PlaneSliderConstruction=it;var ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.sphereSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[O.SphereElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new E.SphereSliderElement(n[0],r[0],r[1],r[2]);return[[i],i]},e}(o.Construction);e.SphereSliderConstruction=ot;var st=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new C.AngleDividerElement(e[0],e[1],e[2],i,2);return[[o],o]},e}(o.Construction);e.AngleBisectorPointConstruction=st;var at=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new C.AngleDividerElement(e[0],e[1],e[2],i,r[0]);return[[o],o]},e}(o.Construction);e.AngleDividerPointConstruction=at;var lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.fixed,e.signature={points:0,elements:0,integers:2},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&0===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length)},e.prototype.construct=function(t,e,n,r){var i=new u.FixedPoint({x:r[0],y:r[1],z:r.length>2?r[2]:0});return[[i],i]},e}(o.Construction);e.FixedPointConstruction=lt;var ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.lineSegmentSlider,e}return i(e,t),e.prototype.createSlider=function(t,e,n,r,i){return new d.LineSlider(t,e,n,r,i,!0)},e}(R);e.LineSliderSegmentConstruction=ut;var ct=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.harmonic,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new x.HarmonicElement(e[0],e[1],e[2]);return[[i],i]},e}(o.Construction);e.HarmonicPointConstruction=ct;var ht=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.vertex,e.signature={points:0,elements:1,integers:1,elementTypes:[M.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=n[0].V[r[0]-1];return[[i],i]},e}(o.Construction);e.VertexConstruction=ht,e.pointConstructions=[new T,new lt,new z,new I,new k,new H,new j,new L,new F,new G,new Y,new W,new X,new q,new et,new st,new at,new rt,new it,new ot,new ct,new nt,new B,new N,new D,new R,new ut,new V,new J,new Q,new Z,new $,new tt,new ht]},6091(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=0,n._x=e&&e.x||0,n._y=e&&e.y||0,n._z=e&&e.z||0,n._AP=e&&e.AP||null,n}return i(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AP",{get:function(){return this._AP},set:function(t){this._AP=t},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!isNaN(this._x)&&!isNaN(this._y)&&!isNaN(this._z)&&null!=this._x&&null!=this._y&&null!=this._z},e.prototype.to=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this},e.prototype.plus=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this},e.prototype.minus=function(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this},e.prototype.times=function(t){return this._x*=t,this._y*=t,this._z*=t,this},e.difference=function(t,n){return new e({x:t.x-n.x,y:t.y-n.y,z:t.z-n.z,AP:null})},e.product=function(t,n){return new e({x:t*n.x,y:t*n.y,z:t*n.z,AP:null})},e.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},e.prototype.length2=function(){return this._x*this._x+this._y*this._y+this._z*this._z},e.prototype.length=function(){return Math.sqrt(this.length2())},e.prototype.distance2=function(t){return(this._x-t.x)*(this._x-t.x)+(this._y-t.y)*(this._y-t.y)+(this._z-t.z)*(this._z-t.z)},e.prototype.distance=function(t){return Math.sqrt(this.distance2(t))},e.prototype.toCross=function(t,e){return this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this},e.cross=function(t,n){return new e({x:t.y*n.z-t.z*n.y,y:t.z*n.x-t.x*n.z,z:t.x*n.y-t.y*n.x,AP:null})},e.triple=function(t,e,n){return t.x*(e.y*n.z-e.z*n.y)+e.x*(n.y*t.z-n.z*t.y)+n.x*(t.y*e.z-t.z*e.y)},e.prototype.toLine=function(t,n,r){var i=e.difference(n,t);this.minus(t);var o=e.dot(i,this)/i.length2();return r&&(o<0?o=0:o>1&&(o=1)),i.times(o),this.to(i).plus(t)},e.prototype.toPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=e.dot(this,t.S),r=e.dot(this,t.T);this.to(t.S).times(n).plus(e.product(r,t.T)).plus(t.A)}return this},e.prototype.uptoPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=t.S.x*t.T.y-t.S.y*t.T.x,r=(this.x*t.T.y-this.y*t.T.x)/n,i=(this.y*t.S.x-this.x*t.S.y)/n;this.to(t.S).times(r).plus(e.product(i,t.T)).plus(t.A)}return this},e.prototype.toCircumcenter=function(t,n,r){if(0==t.z&&0==n.z&&0==r.z){var i=((t.x-n.x)*(t.x+n.x)+(t.y-n.y)*(t.y+n.y))/2,o=((n.x-r.x)*(n.x+r.x)+(n.y-r.y)*(n.y+r.y))/2,s=(t.x-n.x)*(n.y-r.y)-(n.x-r.x)*(t.y-n.y);this._x=(i*(n.y-r.y)-o*(t.y-n.y))/s,this._y=(o*(t.x-n.x)-i*(n.x-r.x))/s,this._z=0}else{var a=e.difference(n,t),l=e.difference(r,t),u=e.dot(a,l),c=a.length2(),h=l.length2(),p=h*(c-u)/(s=2*(c*h-u*u)),f=c*(h-u)/s;this.to(t).plus(a.times(p)).plus(l.times(f))}return this},e.prototype.toCircle=function(t){if(t.AP.isScreen){var e=t.radius/this.distance(t.Center);this._x=t.Center.x+e*(this._x-t.Center.x),this._y=t.Center.y+e*(this._y-t.Center.y),this._z=0}else this.toPlane(t.AP),this.toSphere(t.Center,t.radius);return this},e.prototype.toSphere=function(t,e){var n=e/this.distance(t);return this._x=t.x+n*(this._x-t.x),this._y=t.y+n*(this._y-t.y),this._z=t.z+n*(this._z-t.z),this},e.area=function(t,n,r){var i=e.difference(n,t),o=e.difference(r,t);return this.cross(i,o).length()/2},e.prototype.angle=function(t,e,n){var r=t.x-this._x,i=e.x-this._x,o=t.y-this._y,s=e.y-this._y;if(n.isScreen)return Math.atan2(r*s-o*i,r*i+o*s);var a=t.z-this._z,l=e.z-this._z,u=r*n.S.x+o*n.S.y+a*n.S.z,c=r*n.T.x+o*n.T.y+a*n.T.z,h=i*n.S.x+s*n.S.y+l*n.S.z,p=i*n.T.x+s*n.T.y+l*n.T.z;return Math.atan2(u*p-c*h,u*h+c*p)},e.prototype.toIntersection=function(t,n,r,i,o){if(o.isScreen){var s=t.x*n.y-t.y*n.x,a=r.x*i.y-r.y*i.x,l=(n.y-t.y)*(r.x-i.x)-(t.x-n.x)*(i.y-r.y);this._x=(s*(r.x-i.x)-a*(t.x-n.x))/l,this._y=(a*(n.y-t.y)-s*(i.y-r.y))/l}else{var u=e.difference(t,o.A),c=e.difference(n,o.A),h=e.difference(r,o.A),p=e.difference(i,o.A),f=e.dot(u,o.S),d=e.dot(u,o.T),y=e.dot(c,o.S),_=e.dot(c,o.T),g=e.dot(h,o.S),v=e.dot(h,o.T),m=e.dot(p,o.S),P=e.dot(p,o.T),C=((s=f*_-d*y)*(g-m)-(a=g*P-v*m)*(f-y))/(l=(_-d)*(g-m)-(f-y)*(P-v)),w=(a*(_-d)-s*(P-v))/l;this.to(o.S).times(C).plus(e.product(w,o.T)).plus(o.A)}return this},e.prototype.toIntersectionPL=function(t,n,r){this.to(r).minus(n);var i=e.difference(n,t.A),o=-e.triple(t.S,t.T,i)/e.triple(t.S,t.T,this);return this.times(o).plus(n)},e.prototype.toInvertPoint=function(t,e){var n=e.radius2/t.distance2(e.Center);return this.to(t).minus(e.Center).times(n).plus(e.Center)},e.prototype.toSimilar=function(t,n,r,i,o,s,a){var l=i.angle(o,s,a),u=Math.cos(l),c=Math.sin(l),h=i.distance(s)/i.distance(o);if(r.isScreen)this._x=n.x,this._y=n.y,this.rotate(t,u,c,r),this._x=t.x+h*(this._x-t.x),this._y=t.y+h*(this._y-t.y),this._z=0;else{var p=e.difference(n,t),f=e.dot(p,r.S),d=e.dot(p,r.T),y=h*(u*f-c*d),_=h*(c*f+u*d);this._x=y*r.S.x+_*r.T.x+t.x,this._y=y*r.S.y+_*r.T.y+t.y,this._z=y*r.S.z+_*r.T.z+t.z}return this},e.prototype.rotate=function(t,n,r,i){if(null==i&&(i=t._AP),this!=t)if(i.isScreen){var o=this.x-t.x,s=this.y-t.y;this._x=t.x+n*o-r*s,this._y=t.y+r*o+n*s}else{this.minus(t);var a=i.S,l=i.T,u=i.U,c=e.dot(this,a),h=e.dot(this,l),p=e.dot(this,u),f=n*c-r*h,d=r*c+n*h;this._x=t.x+f*a.x+d*l.x+p*u.x,this._y=t.y+f*a.y+d*l.y+p*u.y,this._z=t.z+f*a.z+d*l.z+p*u.z}},e.prototype.drawName=function(t){this.visible&&(this.drawProgress<1||null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this.x),Math.round(this.y),t))},e.prototype.drawVertex=function(t,e){if(this.visible){var n=t.getContext("2d");if(null==e&&(e=this.emphasized||this.shouldHighlight?this.vertexHighlightColor:this.vertexColor),null!=e){var r=this.shouldHighlight?4:2,i=r+this.emphasisAmount*(6-r);(i*=this.drawProgress*o.GeomElement.styleScale)<.5||(n.beginPath(),n.fillStyle=e,n.arc(this._x,this._y,i,0,2*Math.PI,!1),n.fill())}}},e.prototype.translate=function(t,e){this._x+=t,this._y+=e},e.prototype.update=function(){},e.prototype.drawEdge=function(t){},e.prototype.drawFace=function(t){},e}(o.GeomElement);e.PointElement=s},9535(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ProportionElement=void 0;var o=function(t){function e(e,n,r,i,o,s,a,l){var u=t.call(this)||this;return u.dimension=0,u._S0=e,u._S1=n,u._T0=r,u._T1=i,u._U0=o,u._U1=s,u._V0=a,u._V1=l,a._AP===l._AP&&(u._AP=a._AP),u}return i(e,t),e.prototype.update=function(){var t=this._T0.distance2(this._T1)*this._U0.distance2(this._U1)/(this._S0.distance2(this._S1)*this._V0.distance2(this._V1));t=Math.sqrt(t),this.to(this._V1).minus(this._V0),this.times(t).plus(this._V0)},e}(n(6091).PointElement);e.ProportionElement=o},5014(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimilarElement=void 0;var o=function(t){function e(e,n,r,i,o,s,a){var l=t.call(this)||this;return l.dimension=0,l._parentA=e,l._parentB=n,l._AP=r,l._D=i,l._E=o,l._F=s,l._Q=a,l}return i(e,t),e.prototype.update=function(){this.toSimilar(this._parentA,this._parentB,this._AP,this._D,this._E,this._F,this._Q)},e}(n(6091).PointElement);e.SimilarElement=o},5089(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereSliderElement=void 0;var o=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.dimension=0,o.draggable=!0,o._S=e,o._x=o._initx=n,o._y=o._inity=r,o._z=o._initz=i,o}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toSphere(this._S.Center,this._S.radius())},e.prototype.update=function(){this.toSphere(this._S.Center,this._S.radius())},e.prototype.drag=function(t,e){var n=(this._S.Center.x-t)*(this._S.Center.x-t)+(this._S.Center.y-e)*(this._S.Center.y-e),r=this._S.radius2();if(n<=r)this._x=t,this._y=e,this._z>this._S.Center.z?this._z=this._S.Center.z+Math.sqrt(r-n):this._z=this._S.Center.z-Math.sqrt(r-n);else{t-=this._S.Center.x,e-=this._S.Center.y;var i=Math.sqrt((t*t+e*e)/r);if(t=t/i+this._S.Center.x,e=e/i+this._S.Center.y,(t-this._x)*(t-this._x)+(e-this._y)*(e-this._y)<.5)return!1;this._x=t,this._y=e,this._z=this._S.Center.z}return!0},e}(n(6091).PointElement);e.SphereSliderElement=o},2563(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationElement=void 0;var o=n(7091),s=n(6091),a=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.dimension=2,o._P=e,o._C=i,o.V=new Array(4),o.V[0]=n,o.V[1]=r,o.V[2]=new s.PointElement,o.V[3]=new s.PointElement,n._AP===r._AP&&n._AP===i._AP&&(o.V[2]._AP=n._AP,o.V[3]._AP=n._AP),o}return i(e,t),e.prototype.translate=function(t,e){this.V[2].translate(t,e),this.V[3].translate(t,e)},e.prototype.rotate=function(t,e,n){this.V[2].rotate(t,e,n),this.V[3].rotate(t,e,n)},e.prototype.update=function(){var t=this._P.area()/(2*s.PointElement.area(this.V[0],this.V[1],this._C));t=Math.abs(t),this.V[3].x=this.V[0].x+t*(this._C.x-this.V[0].x),this.V[3].y=this.V[0].y+t*(this._C.y-this.V[0].y),this.V[3].z=this.V[0].z+t*(this._C.z-this.V[0].z),this.V[2].x=this.V[1].x+this.V[3].x-this.V[0].x,this.V[2].y=this.V[1].y+this.V[3].y-this.V[0].y,this.V[2].z=this.V[1].z+this.V[3].z-this.V[0].z},e}(o.PolygonElement);e.ApplicationElement=a},4458(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CurvedTriangleElement=void 0;var o=n(8020),s=n(1313),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=1,r._vertices=e,r._sides=n,r}return i(e,t),e.prototype.update=function(){},e._onCircle=function(t,e){var n=e.radius;return Math.abs(t.distance(e.Center)-n)<=Math.max(.5,.001*n)},e._onLine=function(t,e){var n=e.A.x,r=e.A.y,i=e.B.x-n,o=e.B.y-r,s=Math.hypot(i,o);return 0!==s&&Math.abs((t.x-n)*o-(t.y-r)*i)/s<=Math.max(.5,.001*s)},e.prototype.defined=function(){var t=this._vertices.length;if(t<3||this._sides.length!==t)return!1;for(var n=0,r=this._vertices;n<r.length;n++)if(!r[n].defined())return!1;for(var i=0;i<t;i++){var o=this._vertices[i],a=this._vertices[(i+1)%t],l=this._sides[i];if(l instanceof s.CircleElement){if(!l.defined())return!1;if(!e._onCircle(o,l)||!e._onCircle(a,l))return!1}else{var u=l;if(null==u.A||null==u.B||!u.A.defined()||!u.B.defined())return!1;if(!e._onLine(o,u)||!e._onLine(a,u))return!1}}return!0},e._delta=function(t,e){for(var n=e-t;n>Math.PI;)n-=2*Math.PI;for(;n<=-Math.PI;)n+=2*Math.PI;return n},e.prototype._traceBoundary=function(t){var n=this._vertices.length,r=this._vertices[0];t.moveTo(r.x,r.y);for(var i=0;i<n;i++){var o=this._vertices[i],a=this._vertices[(i+1)%n],l=this._sides[i];if(l instanceof s.CircleElement){var u=l.Center.x,c=l.Center.y,h=l.radius,p=Math.atan2(o.y-c,o.x-u),f=Math.atan2(a.y-c,a.x-u),d=e._delta(p,f);t.arc(u,c,h,p,p+d,d<0)}else t.lineTo(a.x,a.y)}t.closePath()},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.beginPath(),this._traceBoundary(e),e.fillStyle=this.faceColor,e.fill()}},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale,n.beginPath(),this._traceBoundary(n),n.stroke()}}},e.prototype.drawVertex=function(t){},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&this.defined()){for(var e=0,n=0,r=0,i=this._vertices;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}this.drawString(e/this._vertices.length,n/this._vertices.length,t)}},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n){},e}(o.GeomElement);e.CurvedTriangleElement=a},3712(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonEquilateralBuildAnimation=e.PolygonSuperposeAnimation=e.PolygonOutlineAndFillAnimation=e.PolygonOutlineAnimation=void 0;var o=n(7233),s=n(7091),a=n(6091),l=n(1313),u=.25;function c(t){var e=t.V.length;if(e<2)return 0;for(var n=0,r=e>2?e:e-1,i=0;i<r;i++){var o=t.V[i],s=t.V[(i+1)%e],a=s.x-o.x,l=s.y-o.y;n+=Math.sqrt(a*a+l*l)}return n}var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_OUTLINE,e.name="Polygon.outline",e.elementType=s.PolygonElement,e.defaultRate=u,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t;return[{durationMs:Math.max(180,c(r)/this.defaultRate),tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1,r.visible=!0}}]},e}(o.Animation);e.PolygonOutlineAnimation=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_OUTLINE_AND_FILL,e.name="Polygon.outlineAndFill",e.elementType=s.PolygonElement,e.defaultRate=u,e.defaultDurationMs=500,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=Math.max(180,c(r)/this.defaultRate),o=function(){r.faceAlpha=1,r.drawProgress=1,r.visible=!0},s={durationMs:i,setup:function(){r.drawProgress=0,r.faceAlpha=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};return null==r.faceColor?(s.finalise=o,[s]):[s,{durationMs:Math.min(i/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:o}]},e}(o.Animation);e.PolygonOutlineAndFillAnimation=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_SUPERPOSE,e.name="Polygon.superpose",e.elementType=s.PolygonElement,e}return i(e,t),e.prototype.build=function(t,e,n){var r=this,i=t,o=n&&n.onto,l=null!=o?e.lookupElement(String(o)):null;if(!(l instanceof s.PolygonElement)||l.V.length!==i.V.length)return"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] Polygon.superpose: args.onto ('"+o+"') is not a polygon with "+i.V.length+" vertices — skipping"),[{durationMs:0,tick:function(){},finalise:function(){i.drawProgress=1,i.visible=!0}}];var u=i.V.length,c=[],h=0,p=0,f=0,d=[],y=new s.PolygonElement;y.edgeColor="#FFD700",y.faceColor=null,y.nameColor=null,y.vertexColor=null;var _=function(t){for(var e=0;e<u;e++)d[e].x=t[e].x,d[e].y=t[e].y},g=function(t){return c.map((function(e){return{x:e.x+h*t,y:e.y+p*t}}))},v=function(t){var e=l.V[0].x,n=l.V[0].y,r=Math.cos(f*t),i=Math.sin(f*t);return g(1).map((function(t){return{x:e+(t.x-e)*r-(t.y-n)*i,y:n+(t.x-e)*i+(t.y-n)*r}}))},m=Math.hypot(l.V[0].x-i.V[0].x,l.V[0].y-i.V[0].y),P=Math.max(250,m/.25),C=Math.abs(this._sideAngleDelta(i,l)),w=Math.max(250,C/.003);return[{durationMs:P,setup:function(){i.drawProgress=1,i.visible=!0,c=i.V.map((function(t){return{x:t.x,y:t.y}})),h=l.V[0].x-c[0].x,p=l.V[0].y-c[0].y,f=r._sideAngleDelta(i,l);for(var t=0;t<u;t++){var n=new a.PointElement;n.x=c[t].x,n.y=c[t].y,d.push(n),y.V.push(n)}e.addEphemeral(y)},tick:function(t){_(g(t))},finalise:function(){_(g(1))}},{durationMs:w,tick:function(t){_(v(t))},finalise:function(){_(v(1))}},{durationMs:800,tick:function(){},finalise:function(){}},{durationMs:w,tick:function(t){_(v(1-t))},finalise:function(){_(g(1))}},{durationMs:P,tick:function(t){_(g(1-t))},finalise:function(){e.removeEphemeral(y),i.drawProgress=1,i.visible=!0}}]},e.prototype._sideAngleDelta=function(t,e){for(var n=Math.atan2(t.V[1].y-t.V[0].y,t.V[1].x-t.V[0].x),r=Math.atan2(e.V[1].y-e.V[0].y,e.V[1].x-e.V[0].x)-n;r>Math.PI;)r-=2*Math.PI;for(;r<-Math.PI;)r+=2*Math.PI;return r},e}(o.Animation);e.PolygonSuperposeAnimation=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_EQUILATERAL_BUILD,e.name="Polygon.equilateralBuild",e.elementType=s.PolygonElement,e.defaultRate=.0045,e.defaultDurationMs=500,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t;if(r.V.length<2)return[{durationMs:0,tick:function(){},finalise:function(){r.drawProgress=1,r.faceAlpha=1,r.visible=!0}}];for(var i=r.V[0],o=r.V[1],s=i.AP,a=2*Math.PI/this.defaultRate,h=new l.CircleElement({C:i,B:o,AP:s}),p=new l.CircleElement({C:o,B:i,AP:s}),f=0,d=[h,p];f<d.length;f++){var y=d[f];y.edgeColor=null,y.faceColor=null,y.nameColor=null,y.vertexColor=null,y.emphasized=!0}var _=function(t){return{durationMs:a,setup:function(){t.drawStartAngle=function(t){return Math.atan2(t.B.y-t.Center.y,t.B.x-t.Center.x)}(t),t.drawProgress=0},tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1}}},g=Math.max(180,c(r)/u),v=function(){r.drawProgress=1,r.faceAlpha=1,r.visible=!0,e.removeEphemeral(h),e.removeEphemeral(p)},m=_(h),P=m.setup;m.setup=function(){r.drawProgress=0,r.faceAlpha=0,e.addEphemeral(h),e.addEphemeral(p),h.drawProgress=0,p.drawProgress=0,P&&P()};var C={durationMs:g,setup:function(){r.drawProgress=0,r.faceAlpha=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};if(null==r.faceColor)return C.finalise=v,[m,_(p),C];var w=Math.min(g/2,this.defaultDurationMs);return[m,_(p),C,{durationMs:w,tick:function(t){r.faceAlpha=t},finalise:v}]},e}(o.Animation);e.PolygonEquilateralBuildAnimation=d,(0,o.registerAnimation)(new h),(0,o.registerAnimation)(new p),(0,o.registerAnimation)(new f),(0,o.registerAnimation)(new d)},4133(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polygonConstructions=e.CurvedTriangleConstruction=e.FacePolygonConstruction=e.OctagonPolygonConstruction=e.ApplicationPolygonConstruction=e.SimilarPolygonConstruction=e.StarPolygonConstruction=e.RegularPolygonConstruction=e.ParallelogramPolygonConstruction=e.EquilateralTriangleConstruction=e.HexagonPolygonConstruction=e.PentagonPolygonConstruction=e.QuadrilateralPolygonConstruction=e.TrianglePolygonConstruction=e.SquarePolygonConstruction=e.PolyConstruction=void 0;var o=n(7658),s=n(6055),a=n(2090),l=n(5014),u=n(7091),c=n(4458),h=n(1313),p=n(2145),f=n(1943),d=n(2563),y=n(3857),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.PolygonElement(e);return[[i],i]},e}(o.Construction);e.PolyConstruction=_;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.square,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new f.RegularPolygonElement(e[0],e[1],i,4);return[[o],o]},e}(o.Construction);e.SquarePolygonConstruction=g;var v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.triangle,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e}(_);e.TrianglePolygonConstruction=v;var m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.quadrilateral,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e}(_);e.QuadrilateralPolygonConstruction=m;var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.pentagon,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e}(_);e.PentagonPolygonConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.hexagon,e.signature={points:6,elements:0,integers:0},e}return i(e,t),e}(_);e.HexagonPolygonConstruction=C;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.equilateralTriangle,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new f.RegularPolygonElement(e[0],e[1],i,3);return[[o],o]},e}(o.Construction);e.EquilateralTriangleConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.Layoff(e[0],e[1],e[2],e[1],e[2]),o=new u.PolygonElement([e[0],e[1],e[2],i]);return[[i,o],o]},e}(o.Construction);e.ParallelogramPolygonConstruction=x;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.regularPolygon,e.signature={points:2,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new f.RegularPolygonElement(e[0],e[1],i,r[0]);return[[o],o]},e}(o.Construction);e.RegularPolygonConstruction=A;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.starPolygon,e.signature={points:2,elements:0,integers:2},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new f.RegularPolygonElement(e[0],e[1],t,r[0],r[1]);return[[i],i]},e}(o.Construction);e.StarPolygonConstruction=E;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=n.length>1?n[1]:t,s=new l.SimilarElement(e[0],e[1],i,e[2],e[3],e[4],o),a=new u.PolygonElement([e[0],e[1],s]);return[[s,a],a]},e}(o.Construction);e.SimilarPolygonConstruction=b;var S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.application,e.signature={points:3,elements:1,integers:0,elementTypes:[u.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new d.ApplicationElement(n[0],e[0],e[1],e[2]);return[[i],i]},e}(o.Construction);e.ApplicationPolygonConstruction=S;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.octagon,e.signature={points:8,elements:0,integers:0},e}return i(e,t),e}(_);e.OctagonPolygonConstruction=O;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.face,e.signature={points:0,elements:1,integers:1,elementTypes:[y.PolyhedronElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=n[0].P[r[0]-1];return[[i],i]},e}(o.Construction);function T(t){return t instanceof h.CircleElement||t instanceof p.LineElement}e.FacePolygonConstruction=M;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.curvedTriangle,e.signature={points:3,elements:3,integers:0},e.keepsLineElements=!0,e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&3===e.E.length&&e.E.every(T)},e.prototype.construct=function(t,e,n,r){var i=new c.CurvedTriangleElement(e.slice(),n.slice());return[[i],i]},e}(o.Construction);e.CurvedTriangleConstruction=j,e.polygonConstructions=[new j,new v,new E,new A,new g,new w,new x,new m,new O,new P,new C,new b,new S,new M]},7091(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonElement=void 0;var o=n(6091),s=n(8020),a=function(t){function e(e){var n=t.call(this)||this;return n._faceAlpha=1,n.dimension=2,null==e?(n.V=[],n):(n.V=e,n)}return i(e,t),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),e.prototype.area=function(){for(var t=0,e=0;e<this.V.length-2;++e)t+=o.PointElement.area(this.V[0],this.V[e+1],this.V[e+2]);return t},e.prototype.drawEdge=function(t,e){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e&&!(this.V.length<=1))){var n=t.getContext("2d");n.beginPath(),n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*s.GeomElement.styleScale;var i=this.V.length,o=i>2?i:i-1,a=this.drawProgress*o,l=Math.floor(a),u=a-l;n.moveTo(this.V[0].x,this.V[0].y);for(var c=0;c<l;c++){var h=this.V[(c+1)%i];n.lineTo(h.x,h.y),n.stroke()}if(u>0&&l<o){var p=this.V[l],f=(h=this.V[(l+1)%i],p.x+(h.x-p.x)*u),d=p.y+(h.y-p.y)*u;n.lineTo(f,d),n.stroke()}}},e.prototype.defined=function(){if(0==this.V.length)return!1;for(var t=0,e=this.V;t<e.length;t++)if(!e[t].defined())return!1;return!0},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()&&this.V.length>2){var e=t.getContext("2d");e.beginPath(),e.fillStyle=this.faceColor;var n=this.V[0],r=this.V.slice(1);e.moveTo(n.x,n.y);for(var i=0,o=r;i<o.length;i++){var s=o[i];e.lineTo(s.x,s.y)}e.closePath();var a=this.faceAlpha;if(a<1){if(a<=0)return;e.save(),e.globalAlpha=a,e.fill(),e.restore()}else e.fill()}},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,i=this.V;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}var s=this.V.length;e/=s,n/=s;var a=t.getContext("2d"),l=this._getTextMetrics(a,this._name),u=l[0],c=l[1];a.beginPath(),a.fillStyle=this.nameColor,a.fillText(this._name,e-u/2,n+c/4)}},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined())for(var e=0,n=this.V;e<n.length;e++)n[e].drawVertex(t,this.vertexColor)},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(s.GeomElement);e.PolygonElement=a},1943(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RegularPolygonElement=void 0;var o=n(7091),s=n(6091),a=function(t){function e(e,n,r,i,o){void 0===o&&(o=1);var a=t.call(this)||this;a._P=r;var l=Math.PI*o*(i-2)/i;a._cos=Math.cos(l),a._sin=Math.sin(l),a.V=new Array(i),a.V[0]=e,a.V[1]=n;for(var u=2;u<i;u++)a.V[u]=new s.PointElement({AP:r});return a}return i(e,t),e.prototype.update=function(){for(var t=2;t<this.V.length;t++)this.V[t].to(this.V[t-2]),this.V[t].rotate(this.V[t-1],this._cos,this._sin,this._P)},e.prototype.translate=function(t,e){for(var n=2;n<this.V.length;n++)this.V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var r=2;r<this.V.length;r++)this.V[r].rotate(t,e,n,this._P)},e}(o.PolygonElement);e.RegularPolygonElement=a},1099(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polyhedronConstructions=e.PyramidConstruction=e.PrismConstruction=e.ParallelepipedConstruction=e.TetrahedronConstruction=void 0;var o=n(7658),s=n(2090),a=n(7091),l=n(2383),u=n(444),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.tetrahedron,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.PolygonElement([e[0],e[1],e[2]]),o=new l.PyramidElement(i,e[3]);return[[i,o],o]},e}(o.Construction);e.TetrahedronConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.parallelepiped,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new s.Layoff(e[1],e[0],e[2],e[0],e[2]),o=new a.PolygonElement([e[1],e[0],e[2],i]),l=new u.PrismElement(o,e[0],e[3]);return[[i,o,l],l]},e}(o.Construction);e.ParallelepipedConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.prism,e.signature={points:2,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.PrismElement(n[0],e[0],e[1]);return[[i],i]},e}(o.Construction);e.PrismConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.pyramid,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new l.PyramidElement(n[0],e[0]);return[[i],i]},e}(o.Construction);e.PyramidConstruction=f,e.polyhedronConstructions=[new c,new h,new p,new f]},3857(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolyhedronElement=void 0;var o=function(t){function e(){var e=t.call(this)||this;return e.dimension=2,e.P=[],e}return i(e,t),e.prototype.defined=function(){for(var t=0;t<this.P.length;++t)if(!this.P[t].defined())return!1;return!0},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,i=0;i<this.P.length;++i)for(var o=0;o<this.P[i].V.length;++o)e+=this.P[i].V[o].x,n+=this.P[i].V[o].y,++r;e/=r,n/=r,this.drawString(Math.round(e),Math.round(n),t)}},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined())for(var e=0;e<this.P.length;++e)for(var n=0;n<this.P[e].V.length;++n)this.P[e].V[n].drawVertex(t,this.vertexColor)},e.prototype.drawEdge=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.strokeStyle=this.edgeColor;for(var n=0;n<this.P.length;++n)for(var r=0;r<this.P[n].V.length;++r){var i=this.P[n].V[r],o=this.P[n].V[(r+1)%this.P[n].V.length];e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(o.x,o.y),e.stroke()}}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined())for(var e=0;e<this.P.length;++e){var n=this.P[e].faceColor;this.P[e].faceColor=this.faceColor,this.P[e].drawFace(t),this.P[e].faceColor=n}},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n){},e}(n(8020).GeomElement);e.PolyhedronElement=o},444(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PrismElement=void 0;var o=n(3857),s=n(7091),a=n(6091),l=function(t){function e(e,n,r){var i=t.call(this)||this;i.dimension=2,i._C=n,i._D=r;var o=e.V.length,l=2+o;i.P=new Array(l),i.P[0]=e;for(var u=new Array(o),c=0;c<o;++c)u[c]=new a.PointElement,u[c].to(e.V[c]).plus(r).minus(n);i.P[1]=new s.PolygonElement(u);for(var h=2;h<l;++h)i.P[h]=new s.PolygonElement([e.V[h-2],e.V[(h-1)%o],i.P[1].V[(h-1)%o],i.P[1].V[h-2]]);return i}return i(e,t),e.prototype.translate=function(t,e){for(var n=0;n<this.P[1].V.length;++n)this.P[1].V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var r=0;r<this.P[1].V.length;++r)this.P[1].V[r].rotate(t,e,n)},e.prototype.update=function(){for(var t=0;t<this.P[1].V.length;++t)this.P[1].V[t].to(this.P[0].V[t]).plus(this._D).minus(this._C)},e}(o.PolyhedronElement);e.PrismElement=l},2383(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PyramidElement=void 0;var o=n(3857),s=n(7091),a=function(t){function e(e,n){var r=t.call(this)||this;r.dimension=2;var i=1+e.V.length;r.P=new Array(i),r.P[0]=e;for(var o=1;o<i;++o)r.P[o]=new s.PolygonElement([n,e.V[o-1],e.V[o%e.V.length]]);return r}return i(e,t),e}(o.PolyhedronElement);e.PyramidElement=a},320(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AngleMarkerElement=e.ANGLE_MARKER_RING_STEP=e.ANGLE_MARKER_MAX_ARM_FRACTION=e.DEFAULT_ANGLE_MARKER_RADIUS_PX=void 0;var o=n(1025),s=n(6091);e.DEFAULT_ANGLE_MARKER_RADIUS_PX=22,e.ANGLE_MARKER_MAX_ARM_FRACTION=.45,e.ANGLE_MARKER_RING_STEP=9;var a=function(t){function n(e,n,r,i,o,a){var l=t.call(this)||this;return l.ringIndex=0,l.reflex=!1,l.dimension=2,l._Center=e,l._arm1=n,l._arm2=r,l._P=i,l._radiusOverride=null!=o?o:null,l.reflex=!0===a,l._A=new s.PointElement,l._B=new s.PointElement,l}return i(n,t),Object.defineProperty(n.prototype,"vertex",{get:function(){return this._Center},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRadiusOverride",{get:function(){return null!=this._radiusOverride},enumerable:!1,configurable:!0}),n.prototype.spanRadians=function(){return Math.abs(this._Center.angle(this._arm1,this._arm2,this._P))},n.prototype._arcAngle=function(){var t=this._Center.angle(this._A,this._B,this._P);return this.reflex?2*Math.PI-Math.abs(t):t},n.prototype._anticlockwise=function(){return!this.reflex},n.prototype._flashFace=function(){return!0},n.prototype.radius=function(){var t=this._Center.distance(this._arm1),n=this._Center.distance(this._arm2),r=Math.min(t,n),i=null!=this._radiusOverride?this._radiusOverride:e.DEFAULT_ANGLE_MARKER_RADIUS_PX;return Math.min(i,r*e.ANGLE_MARKER_MAX_ARM_FRACTION)+this.ringIndex*e.ANGLE_MARKER_RING_STEP},n.prototype._place=function(t,e,n){var r=e.x-this._Center.x,i=e.y-this._Center.y,o=e.z-this._Center.z,s=Math.sqrt(r*r+i*i+o*o);if(0===s)return t.x=this._Center.x,t.y=this._Center.y,void(t.z=this._Center.z);t.x=this._Center.x+r/s*n,t.y=this._Center.y+i/s*n,t.z=this._Center.z+o/s*n},n.prototype.update=function(){var t=this.radius();this._place(this._A,this._arm1,t),this._place(this._B,this._arm2,t),this._Center.angle(this._A,this._B,this._P)>0&&(this._place(this._A,this._arm2,t),this._place(this._B,this._arm1,t))},n}(o.SectorElement);e.AngleMarkerElement=a},5483(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ArcElement=void 0;var o=n(1025),s=n(6091),a=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.dimension=2,o._Center=new s.PointElement,o._A=e,o._M=n,o._B=r,o._P=i,o}return i(e,t),e.prototype.update=function(){this._P.update(),this._Center.toCircumcenter(this._A,this._M,this._B)},e.prototype.translate=function(t,e){this._Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this._Center.rotate(t,e,n)},e}(o.SectorElement);e.ArcElement=a},3702(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SectorSweepAnimation=void 0;var o=n(7233),s=n(1025),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.SECTOR_SWEEP,e.name="Sector.sweep",e.elementType=s.SectorElement,e.defaultRate=.003,e.defaultDurationMs=500,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=r.arcSpan(),o=Math.max(250,i/this.defaultRate),s=function(){r.faceAlpha=1,r.drawProgress=1,r.visible=!0},a={durationMs:o,setup:function(){r.faceAlpha=0,r.drawProgress=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};return null==r.faceColor?(a.finalise=s,[a]):[a,{durationMs:Math.min(o/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:s}]},e}(o.Animation);e.SectorSweepAnimation=a,(0,o.registerAnimation)(new a)},5755(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sectorConstructions=e.AngleMarkerReflexRadiusConstruction=e.AngleMarkerReflexConstruction=e.AngleMarkerRadiusConstruction=e.AngleMarkerConstruction=e.ArcConstruction=e.SectorConstruction=void 0;var o=n(7658),s=n(6055),a=n(1025),l=n(5483),u=n(320),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.sector,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new a.SectorElement({O:e[0],A:e[1],B:e[2],P:i});return[[o],o]},e}(o.Construction);e.SectorConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.arc,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new l.ArcElement(e[0],e[1],e[2],i);return[[o],o]},e}(o.Construction);e.ArcConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarker,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&0===e.E.length},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t);return[[i],i]},e}(o.Construction);e.AngleMarkerConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarker,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&0===e.E.length},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t,r[0]);return[[i],i]},e}(o.Construction);e.AngleMarkerRadiusConstruction=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarkerReflex,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&0===e.E.length},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t,void 0,!0);return[[i],i]},e}(o.Construction);e.AngleMarkerReflexConstruction=d;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarkerReflex,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&0===e.E.length},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t,r[0],!0);return[[i],i]},e}(o.Construction);e.AngleMarkerReflexRadiusConstruction=y,e.sectorConstructions=[new c,new h,new p,new f,new d,new y]},1025(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SectorElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n._angle=null,n._faceAlpha=1,n.dimension=2,null!=e&&(n._Center=e.O,n._A=e.A,n._B=e.B,n._P=e.P),n}return i(e,t),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),e.prototype.radius=function(){return this._Center.distance(this._A)},e.prototype.defined=function(){return this._A.defined()&&this._B.defined()&&this._Center.defined()},e.prototype._updateThroughPoint=function(){0!=this.radius()&&(this._angle=Math.atan2(this._B.y-this._A.y,this._B.x-this._A.x)-Math.atan2(this._Center.y-this._A.y,this._Center.x-this._A.x),this._Center.x,Math.cos(this._angle/2),this._Center.y,Math.sin(this._angle/2))},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale,n.beginPath();var i=this.radius(),s=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),a=s+this._arcAngle()*this.drawProgress;n.arc(this._Center.x,this._Center.y,i,s,a,this._anticlockwise()),n.stroke()}}},e.prototype._arcAngle=function(){return this._Center.angle(this._A,this._B,this._P)},e.prototype._anticlockwise=function(){return!0},e.prototype.arcSpan=function(){return Math.abs(this._arcAngle())},e.prototype._traceWedge=function(t,e){var n=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),r=this._arcAngle(),i=n+r;t.beginPath(),t.arc(this._Center.x,this._Center.y,e,n,i,this._anticlockwise()),t.moveTo(this._Center.x,this._Center.y),r<=180?(t.lineTo(this._A.x,this._A.y),t.lineTo(this._B.x,this._B.y)):(t.lineTo(this._B.x,this._B.y),t.lineTo(this._A.x,this._A.y)),t.lineTo(this._Center.x,this._Center.y)},e.prototype._flashFace=function(){return!1},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=this.faceAlpha;if(!(e<=0)){var n=t.getContext("2d"),r=this.radius();n.fillStyle=this.faceColor,this._traceWedge(n,r),e<1?(n.save(),n.globalAlpha=e,n.fill(),n.restore()):n.fill(),this._flashFace()&&this.emphasisAmount>0&&(n.save(),n.fillStyle=this.faceHighlightColor,n.globalAlpha=.55*this.emphasisAmount,this._traceWedge(n,r),n.fill(),n.restore())}}},e.prototype.drawName=function(t){},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){this._updateThroughPoint()},e}(o.GeomElement);e.SectorElement=s},8649(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sphereConstructions=e.SphereRadius3PointConstruction=e.SphereRadiusConstruction=void 0;var o=n(7658),s=n(2295),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SphereConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new s.SphereElement({Center:e[0],B:e[1]});return[[i],i]},e}(o.Construction);e.SphereRadiusConstruction=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SphereConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new s.SphereElement({Center:e[0],A:e[1],B:e[2]});return[[i],i]},e}(o.Construction);e.SphereRadius3PointConstruction=l,e.sphereConstructions=[new l,new a]},2295(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereElement=void 0;var o=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n._Center=e&&e.Center||new s.PointElement,n._A=e&&e.A||n._Center,n._B=e&&e.B||new s.PointElement,n}return i(e,t),Object.defineProperty(e.prototype,"Center",{get:function(){return this._Center},enumerable:!1,configurable:!0}),e.prototype.drawName=function(t){!this.visible&&!this.shouldHighlight&&this.emphasisAmount<=0||null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this._Center.x),Math.round(this._Center.y),t,o.Align.CENTRAL)},e.prototype.defined=function(){return!0},e.prototype.drawEdge=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.fill(),e.restore()}},e.prototype.radius=function(){return this._A.distance(this._B)},e.prototype.radius2=function(){return this._A.distance2(this._B)},e.prototype.drawVertex=function(){},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n,r){},e}(o.GeomElement);e.SphereElement=a},8156(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.slates=e.BUILD_MARKER=e.A=e.AllAnimations=e.E=e.Align=void 0,e.highlightByName=function(t,n,r){void 0===n&&(n=!0);for(var i=r&&r.canvasids,o=0,s=0,a=e.slates;s<a.length;s++){var l=a[s];if(null!=i){var u=l.canvas&&l.canvas.id;if(-1===i.indexOf(u))continue}var c=l.lookupElement(t);null!=c&&(c.emphasized=n,l.update(),o++)}return o},e.parseParam=f,e.revealNoscriptFallback=d,e.init=function(t){var n=null!=t.canvasid?t.canvasid:"canvasid",i=document.getElementById(n);try{!function(t,n){var i=null!=t.align?t.align:r.Align.CENTRAL,o=function(t,e){var n=e,r=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*px\s*$/.exec("string"==typeof t?t:"");return e?parseFloat(e[1]):0},i=n.style||{},o=function(t){return"function"==typeof n.getAttribute&&parseInt(n.getAttribute(t)||"0",10)||0};return[t.width||r(i.width)||o("width")||n.clientWidth||e.width,t.height||r(i.height)||o("height")||n.clientHeight||e.height]}(t,n),p=o[0],d=o[1];!function(t){var e="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.round(t.clientWidth*e),r=Math.round(t.clientHeight*e);t.width==n&&t.height==r||(t.width=n,t.height=r)}(n);var y=new a.Slate(n);y.setLogicalSize(p,d),y.recomputeFitScale(),e.slates.push(y);var _=null!=t.font?t.font:"Times New Roman",g=null!=t.fontsize?t.fontsize:18;r.GeomElement.setFont(_,g),y.bgcolor=(0,c.parseColor)(t.background,"#ffffff","#ffffff");for(var v=0,m=0,P=t.elements;m<P.length;m++){var C=P[m],w="string"==typeof C?f(C):C,x=y.createElement(w.construction,w.params,w.name);if(x.align=i,x instanceof u.AngleMarkerElement){var A=c.anglePalette[v%c.anglePalette.length];v++,x.nameColor=(0,c.parseColor)(w.nameColor,null,y.bgcolor),x.vertexColor=(0,c.parseColor)(w.vertexColor,null,y.bgcolor),x.edgeColor=(0,c.parseColor)(w.edgeColor,A.edge,y.bgcolor),null!=w.faceColor?x.faceColor=(0,c.parseColor)(w.faceColor,A.edge,y.bgcolor):x.faceColor=A.face}else{var E=x instanceof s.PointElement?"black":null;x.nameColor=(0,c.parseColor)(w.nameColor,E,y.bgcolor);var b=x.draggable?x instanceof l.PlaneSlider?"red":"orange":"black";x.vertexColor=(0,c.parseColor)(w.vertexColor,b,y.bgcolor),x.edgeColor=(0,c.parseColor)(w.edgeColor,"black",y.bgcolor);var S=(0,c.lighten)(y.bgcolor),O=2==x.dimension?S:null;x.faceColor=(0,c.parseColor)(w.faceColor,O,y.bgcolor)}}if(null!=t.aliases&&y.addAliases(t.aliases),null!=t.deferDraggables&&y.deferDraggables(t.deferDraggables),!t.showAngles)for(var M=0,T=y.elements;M<T.length;M++)(N=T[M])instanceof u.AngleMarkerElement&&null!=N.name&&y.setInitiallyHidden(N.name);if(null!=t.initiallyHidden)for(var j=0,L=t.initiallyHidden;j<L.length;j++){var B=L[j];y.setInitiallyHidden(B)}for(var z=new Map,I=0,k=y.elements;I<k.length;I++){var N;if((N=k[I])instanceof u.AngleMarkerElement){var R=z.get(N.vertex);null==R&&(R=[],z.set(N.vertex,R)),R.push(N)}}z.forEach((function(t){if(!(t.length<=1)){t.sort((function(t,e){return t.spanRadians()-e.spanRadians()}));var e=0;t.forEach((function(t,n){if(c.anglePalette.some((function(e){return e.face===t.faceColor}))){var r=c.anglePalette[n%c.anglePalette.length];t.edgeColor=r.edge,t.faceColor=r.face}t.hasRadiusOverride||(t.ringIndex=e,e++)}))}})),null!=t.slides&&t.slides.length>0&&(y.slides=t.slides),null!=t.resolveJustification&&(y.resolveJustification=t.resolveJustification),null!=t.animationConfig&&(y.animationConfig=t.animationConfig),null!=t.pivot&&y.setPivot(t.pivot),y.update(),y.updateCoordinates(0),n&&n.parentElement&&(0,h.createControls)(y,n,t)}(t,i)}catch(t){throw console.error("[geomlib] init failed:",t),d(i),t}};var r=n(8020);Object.defineProperty(e,"Align",{enumerable:!0,get:function(){return r.Align}});var i=n(7658);Object.defineProperty(e,"E",{enumerable:!0,get:function(){return i.E}});var o=n(7233);Object.defineProperty(e,"AllAnimations",{enumerable:!0,get:function(){return o.AllAnimations}}),Object.defineProperty(e,"A",{enumerable:!0,get:function(){return o.A}}),n(2872),n(1910),n(9222),n(3712),n(3702),n(4580);var s=n(6091),a=n(8041),l=n(4994),u=n(320),c=n(1454),h=n(3267);e.BUILD_MARKER="pointer-events-refactor-v1 (Slate.ts #55)",e.slates=[];var p={point:"Point",line:"Line",circle:"Circle",polygon:"Polygon",sector:"Sector",plane:"Plane",sphere:"Sphere",polyhedron:"Polyhedra"};function f(t){var e=t.split(";");if(e.length<4)throw new Error("parseParam: expected at least 4 semicolon-separated fields, got ".concat(e.length,': "').concat(t,'"'));var n=e[0],r=e[1],o=e[2],s=e[3],a=p[r];if(null==a)throw new Error('parseParam: unknown element type "'.concat(r,'" in "').concat(t,'"'));var l=i.E[a]["3points"===o?"threePoints":o];if(null==l)throw new Error('parseParam: unknown construction "'.concat(r,";").concat(o,'" in "').concat(t,'"'));var u={name:n,construction:l,params:s.split(",").map((function(t){var e=Number(t);return""===t||isNaN(e)?t:e}))};return e.length>4&&void 0!==e[4]&&(u.nameColor=e[4]),e.length>5&&void 0!==e[5]&&(u.vertexColor=e[5]),e.length>6&&void 0!==e[6]&&(u.edgeColor=e[6]),e.length>7&&void 0!==e[7]&&(u.faceColor=e[7]),u}function d(t){var e;if(t)try{for(var n=t.nextElementSibling,r=0;n&&r++<5&&"NOSCRIPT"!==n.tagName;)n=n.nextElementSibling;if(!n||"NOSCRIPT"!==n.tagName)return;var i=n.innerHTML;if(!i)return;var o=document.createElement("div");o.innerHTML=i,null===(e=n.parentNode)||void 0===e||e.insertBefore(o,n),t.style.display="none"}catch(t){}}},7680(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.computeSlideState=function(t,e,n){for(var r=[],i=n;i>=0;i--)if(null!=e[i].visible){r=e[i].visible;break}for(var o=new Set(r),s=e[n],a=new Set(s.highlighted||[]),l=0,u=t.elements;l<u.length;l++){var c=u[l];c.draggable&&null!=c.name&&!t.deferredDraggables.has(c.name)&&o.add(c.name)}return a.forEach((function(t){return o.add(t)})),{visible:o,highlighted:a}}}},e={},n=function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}(8156);geomlib=n})();
|
|
1
|
+
var geomlib;(()=>{"use strict";var t={1454(t,e){function n(){var t=s(Math.random(),Math.random(),1);return"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")")}function r(t){var e=o(t);if(null==e)return t;var n=.7,r=Math.ceil(1/(1-n)),i=0===e.r?r:Math.min(Math.floor(e.r/n),255),s=0===e.g?r:Math.min(Math.floor(e.g/n),255),a=0===e.b?r:Math.min(Math.floor(e.b/n),255);return i<r&&(i=r),s<r&&(s=r),a<r&&(a=r),"rgb(".concat(i,",").concat(s,",").concat(a,")")}function i(t){var e=o(t);if(null==e)return t;var n=Math.floor(.7*e.r),r=Math.floor(.7*e.g),i=Math.floor(.7*e.b);return"rgb(".concat(n,",").concat(r,",").concat(i,")")}function o(t){if(null==t)return null;var n=t.match(/^rgb\((\d+),(\d+),(\d+)\)$/);if(n)return{r:parseInt(n[1]),g:parseInt(n[2]),b:parseInt(n[3])};if(t in e.colors)return o(e.colors[t]);var r=t.replace(/^#/,"");if(/^[0-9a-fA-F]{6}$/.test(r)){var i=parseInt(r,16);return{r:i>>16&255,g:i>>8&255,b:255&i}}var a=t.split(",");if(3===a.length){var l=parseInt(a[0])/360,u=parseInt(a[1])/100,c=parseInt(a[2])/100;if(!isNaN(l)&&!isNaN(u)&&!isNaN(c))return s(l,u,c)}return null}function s(t,e,n){var r,i,o,s=Math.floor(6*t),a=6*t-s,l=n*(1-e),u=n*(1-a*e),c=n*(1-(1-a)*e);switch(s%6){case 0:r=n,i=c,o=l;break;case 1:r=u,i=n,o=l;break;case 2:r=l,i=n,o=c;break;case 3:r=l,i=u,o=n;break;case 4:r=c,i=l,o=n;break;case 5:r=n,i=l,o=u}return{r:Math.round(255*r),g:Math.round(255*i),b:Math.round(255*o)}}Object.defineProperty(e,"__esModule",{value:!0}),e.anglePalette=e.cssColors=e.colors=void 0,e.parseColor=function(t,o,a){if(0===t)return null;if(null==t)return o;var l=String(t);if("none"===l||"0"===l||""===l)return null;if("random"===l)return n();if("background"===l)return a;if("brighter"===l)return r(a);if("darker"===l)return i(a);if(l in e.colors)return e.colors[l];var u=l.toLowerCase();if(u in e.cssColors)return e.cssColors[u];var c=l.replace(/^#/,"");if(/^[0-9a-fA-F]+$/.test(c)){var h=parseInt(c,16);if(!isNaN(h)){var p=h>>8&255,f=255&h;return"rgb(".concat(h>>16&255,",").concat(p,",").concat(f,")")}}var d=l.split(",");if(3===d.length){var y=parseInt(d[0])/360,_=parseInt(d[1])/100;f=parseInt(d[2])/100;if(!isNaN(y)&&!isNaN(_)&&!isNaN(f)){var g=s(y,_,f);return"rgb(".concat(g.r,",").concat(g.g,",").concat(g.b,")")}}return null},e.randomColor=n,e.brighter=r,e.darker=i,e.lighten=function(t){return r(t)},e.darken=function(t){return i(t)},e.colors={black:"rgb(0,0,0)",blue:"rgb(0,0,255)",cyan:"rgb(0,255,255)",darkGray:"rgb(64,64,64)",gray:"rgb(128,128,128)",green:"rgb(0,255,0)",lightGray:"rgb(192,192,192)",magenta:"rgb(255,0,255)",orange:"rgb(255,200,0)",pink:"rgb(255,175,175)",red:"rgb(255,0,0)",white:"rgb(255,255,255)",yellow:"rgb(255,255,0)"},e.cssColors={aliceblue:"rgb(240,248,255)",antiquewhite:"rgb(250,235,215)",aqua:"rgb(0,255,255)",aquamarine:"rgb(127,255,212)",azure:"rgb(240,255,255)",beige:"rgb(245,245,220)",bisque:"rgb(255,228,196)",black:"rgb(0,0,0)",blanchedalmond:"rgb(255,235,205)",blue:"rgb(0,0,255)",blueviolet:"rgb(138,43,226)",brown:"rgb(165,42,42)",burlywood:"rgb(222,184,135)",cadetblue:"rgb(95,158,160)",chartreuse:"rgb(127,255,0)",chocolate:"rgb(210,105,30)",coral:"rgb(255,127,80)",cornflowerblue:"rgb(100,149,237)",cornsilk:"rgb(255,248,220)",crimson:"rgb(220,20,60)",cyan:"rgb(0,255,255)",darkblue:"rgb(0,0,139)",darkcyan:"rgb(0,139,139)",darkgoldenrod:"rgb(184,134,11)",darkgray:"rgb(64,64,64)",darkgrey:"rgb(64,64,64)",darkgreen:"rgb(0,100,0)",darkkhaki:"rgb(189,183,107)",darkmagenta:"rgb(139,0,139)",darkolivegreen:"rgb(85,107,47)",darkorange:"rgb(255,140,0)",darkorchid:"rgb(153,50,204)",darkred:"rgb(139,0,0)",darksalmon:"rgb(233,150,122)",darkseagreen:"rgb(143,188,143)",darkslateblue:"rgb(72,61,139)",darkslategray:"rgb(47,79,79)",darkslategrey:"rgb(47,79,79)",darkturquoise:"rgb(0,206,209)",darkviolet:"rgb(148,0,211)",deeppink:"rgb(255,20,147)",deepskyblue:"rgb(0,191,255)",dimgray:"rgb(105,105,105)",dimgrey:"rgb(105,105,105)",dodgerblue:"rgb(30,144,255)",firebrick:"rgb(178,34,34)",floralwhite:"rgb(255,250,240)",forestgreen:"rgb(34,139,34)",fuchsia:"rgb(255,0,255)",gainsboro:"rgb(220,220,220)",ghostwhite:"rgb(248,248,255)",gold:"rgb(255,215,0)",goldenrod:"rgb(218,165,32)",gray:"rgb(128,128,128)",grey:"rgb(128,128,128)",green:"rgb(0,255,0)",greenyellow:"rgb(173,255,47)",honeydew:"rgb(240,255,240)",hotpink:"rgb(255,105,180)",indianred:"rgb(205,92,92)",indigo:"rgb(75,0,130)",ivory:"rgb(255,255,240)",khaki:"rgb(240,230,140)",lavender:"rgb(230,230,250)",lavenderblush:"rgb(255,240,245)",lawngreen:"rgb(124,252,0)",lemonchiffon:"rgb(255,250,205)",lightblue:"rgb(173,216,230)",lightcoral:"rgb(240,128,128)",lightcyan:"rgb(224,255,255)",lightgoldenrodyellow:"rgb(250,250,210)",lightgray:"rgb(192,192,192)",lightgrey:"rgb(192,192,192)",lightgreen:"rgb(144,238,144)",lightpink:"rgb(255,182,193)",lightsalmon:"rgb(255,160,122)",lightseagreen:"rgb(32,178,170)",lightskyblue:"rgb(135,206,250)",lightslategray:"rgb(119,136,153)",lightslategrey:"rgb(119,136,153)",lightsteelblue:"rgb(176,196,222)",lightyellow:"rgb(255,255,224)",lime:"rgb(0,255,0)",limegreen:"rgb(50,205,50)",linen:"rgb(250,240,230)",magenta:"rgb(255,0,255)",maroon:"rgb(128,0,0)",mediumaquamarine:"rgb(102,205,170)",mediumblue:"rgb(0,0,205)",mediumorchid:"rgb(186,85,211)",mediumpurple:"rgb(147,112,219)",mediumseagreen:"rgb(60,179,113)",mediumslateblue:"rgb(123,104,238)",mediumspringgreen:"rgb(0,250,154)",mediumturquoise:"rgb(72,209,204)",mediumvioletred:"rgb(199,21,133)",midnightblue:"rgb(25,25,112)",mintcream:"rgb(245,255,250)",mistyrose:"rgb(255,228,225)",moccasin:"rgb(255,228,181)",navajowhite:"rgb(255,222,173)",navy:"rgb(0,0,128)",oldlace:"rgb(253,245,230)",olive:"rgb(128,128,0)",olivedrab:"rgb(107,142,35)",orange:"rgb(255,200,0)",orangered:"rgb(255,69,0)",orchid:"rgb(218,112,214)",palegoldenrod:"rgb(238,232,170)",palegreen:"rgb(152,251,152)",paleturquoise:"rgb(175,238,238)",palevioletred:"rgb(219,112,147)",papayawhip:"rgb(255,239,213)",peachpuff:"rgb(255,218,185)",peru:"rgb(205,133,63)",pink:"rgb(255,175,175)",plum:"rgb(221,160,221)",powderblue:"rgb(176,224,230)",purple:"rgb(128,0,128)",rebeccapurple:"rgb(102,51,153)",red:"rgb(255,0,0)",rosybrown:"rgb(188,143,143)",royalblue:"rgb(65,105,225)",saddlebrown:"rgb(139,69,19)",salmon:"rgb(250,128,114)",sandybrown:"rgb(244,164,96)",seagreen:"rgb(46,139,87)",seashell:"rgb(255,245,238)",sienna:"rgb(160,82,45)",silver:"rgb(192,192,192)",skyblue:"rgb(135,206,235)",slateblue:"rgb(106,90,205)",slategray:"rgb(112,128,144)",slategrey:"rgb(112,128,144)",snow:"rgb(255,250,250)",springgreen:"rgb(0,255,127)",steelblue:"rgb(70,130,180)",tan:"rgb(210,180,140)",teal:"rgb(0,128,128)",thistle:"rgb(216,191,216)",tomato:"rgb(255,99,71)",turquoise:"rgb(64,224,208)",violet:"rgb(238,130,238)",wheat:"rgb(245,222,179)",white:"rgb(255,255,255)",whitesmoke:"rgb(245,245,245)",yellow:"rgb(255,255,0)",yellowgreen:"rgb(154,205,50)"},e.anglePalette=[{edge:"rgb(59,110,165)",face:"rgba(59,110,165,0.30)"},{edge:"rgb(63,142,79)",face:"rgba(63,142,79,0.30)"},{edge:"rgb(122,79,163)",face:"rgba(122,79,163,0.30)"},{edge:"rgb(194,90,60)",face:"rgba(194,90,60,0.30)"},{edge:"rgb(46,139,139)",face:"rgba(46,139,139,0.30)"},{edge:"rgb(163,60,122)",face:"rgba(163,60,122,0.30)"}]},9196(t,e){function n(t){var e=null!=t.severity?t.severity:"warning",n=null!=t.key?t.key:t.message;return e+"|"+t.code+"|"+n}function r(t,n){return null==t?n:null==n||e.SEVERITY_RANK[t]>=e.SEVERITY_RANK[n]?t:n}Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticLog=e.SEVERITY_RANK=void 0,e.dedupeKeyOf=n,e.worstSeverity=r,e.diagnosticEventDetail=function(t,e){return{diagnostic:e,severity:t.severity,count:t.count}},e.SEVERITY_RANK={warning:1,error:2};var i=function(){function t(){this._entries=[],this._byKey={},this._worst=null}return t.prototype.report=function(t,e){var i=n(t),o=this._byKey[i];if(null!=o)return o.count++,null;var s={severity:null!=t.severity?t.severity:"warning",code:t.code,message:t.message,at:e,count:1};return null!=t.detail&&(s.detail=t.detail),this._byKey[i]=s,this._entries.push(s),this._worst=r(this._worst,s.severity),s},Object.defineProperty(t.prototype,"entries",{get:function(){return this._entries.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"severity",{get:function(){return this._worst},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this._entries.length},enumerable:!1,configurable:!0}),t.prototype.clear=function(){this._entries=[],this._byKey={},this._worst=null},t}();e.DiagnosticLog=i},8041(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Slate=void 0,e.isPromoted=f,e.promotedDrawOrder=d;var r=n(8020),i=n(6055),o=n(6401),s=n(7658),a=n(6091),l=n(2145),u=n(7091),c=n(1313),h=n(6900),p=n(9196);function f(t){return t.shouldHighlight||t.emphasized||t.drawProgress<1}function d(t){for(var e=null,n=0,r=t;n<r.length;n++){f(a=r[n])&&(null==e&&(e=[]),e.push(a))}if(null==e)return t;for(var i=[],o=0,s=t;o<s.length;o++){var a;f(a=s[o])||i.push(a)}return i.concat(e)}var y=function(){function t(e){if(this._aliases=new Map,this._highlightOnTop=!0,this._slides=[],this._resolveJustification=null,this._animationConfig={},this._animator=null,this._ephemerals=[],this._centringBounds=null,this._viewOffsetX=0,this._viewOffsetY=0,this._viewScale=1,this._logicalWidth=0,this._logicalHeight=0,this._lastHighlightedKey="\0",this._diagnostics=new p.DiagnosticLog,this._diagnosticListeners=[],this._htmlCanvas=null,this.inTest=!1,this._itsNumSlate=-1,this._deferredDraggables=new Set,this._initiallyHidden=new Set,t.numSlate+=1,this._itsNumSlate=t.numSlate,this._elements=[],null==e)throw new TypeError("canvas cannot be null or undefined.");this._canvas=e;var n=new o.FixedPoint({x:0,y:0,z:0});n.name="screen_origin";var r=new o.FixedPoint({x:1,y:0,z:0});r.name="screen_x";var s=new o.FixedPoint({x:0,y:1,z:0});s.name="screen_y";var a=new i.PlaneElement({A:n,B:r,C:s});a.name="screen",a.nameColor=null,a.isScreen=!0,this._screen=a,this._pick=null;for(var l=0,u=[n,r,s,a];l<u.length;l++){var c=u[l];c.nameColor=null,c.vertexColor=null,c.vertexHighlightColor=null,c.faceColor=null,c.faceHighlightColor=null,this._elements.push(c)}var h=this,f=this._canvas;if(this._htmlCanvas=f,null!=this._htmlCanvas.addEventListener){this._htmlCanvas.style.touchAction="none";var d=null;this._htmlCanvas.addEventListener("pointerdown",(function(t){if(null===d){d=t.pointerId;try{h._htmlCanvas.setPointerCapture(t.pointerId)}catch(t){}var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseDown(n,r)}})),this._htmlCanvas.addEventListener("pointermove",(function(t){if(t.pointerId===d){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseDrag(n,r)}}));var y=function(t){if(t.pointerId===d){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseUp(n,r);try{h._htmlCanvas.releasePointerCapture(t.pointerId)}catch(t){}d=null}};this._htmlCanvas.addEventListener("pointerup",y),this._htmlCanvas.addEventListener("pointercancel",y),this._htmlCanvas.addEventListener("lostpointercapture",(function(t){t.pointerId===d&&(null!=h._pick&&(h._pick=null),d=null)}))}}return t.prototype._getCanvasPosition=function(t,e){var n=this._htmlCanvas.getBoundingClientRect(),r=this._viewScale||1;return[(t-n.left-this._viewOffsetX)/r,(e-n.top-this._viewOffsetY)/r]},t.prototype._onMouseDown=function(t,e){this._pick=null,this.movePick(t,e)},t.prototype._onMouseUp=function(t,e){null!=this._pick&&(this.movePick(t,e),this._pick=null)},t.prototype._onMouseDrag=function(t,e){null!=this._pick&&this.movePick(t,e)},Object.defineProperty(t.prototype,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightOnTop",{get:function(){return this._highlightOnTop},set:function(t){this._highlightOnTop=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bgcolor",{get:function(){return this._bgcolor},set:function(t){this._bgcolor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this._canvas},enumerable:!1,configurable:!0}),t.prototype.lookupElement=function(t){for(var e=0,n=this._elements;e<n.length;e++){if((s=n[e]).name==t)return s}var r=this._aliases.get(t);if(null!=r)for(var i=0,o=this._elements;i<o.length;i++){var s;if((s=o[i]).name==r)return s}return null},t.prototype.addAlias=function(t,e){this._aliases.set(t,e)},t.prototype.addAliases=function(t){for(var e in t)this._aliases.set(e,t[e])},Object.defineProperty(t.prototype,"deferredDraggables",{get:function(){return this._deferredDraggables},enumerable:!1,configurable:!0}),t.prototype.deferDraggables=function(t){for(var e=0,n=t||[];e<n.length;e++){var r=n[e];this._deferredDraggables.add(r)}},Object.defineProperty(t.prototype,"slides",{get:function(){return this._slides},set:function(t){this._slides=t||[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolveJustification",{get:function(){return this._resolveJustification},set:function(t){this._resolveJustification=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationConfig",{get:function(){return this._animationConfig},set:function(t){this._animationConfig=t||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animator",{get:function(){return this._animator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ephemerals",{get:function(){return this._ephemerals},enumerable:!1,configurable:!0}),t.prototype.addEphemeral=function(t){this._ephemerals.push(t)},t.prototype.addElement=function(t){-1===this._elements.indexOf(t)&&this._elements.push(t)},t.prototype.removeEphemeral=function(t){var e=this._ephemerals.indexOf(t);e>=0&&this._ephemerals.splice(e,1)},t.prototype.clearEphemerals=function(){this._ephemerals.length=0},Object.defineProperty(t.prototype,"viewOffsetX",{get:function(){return this._viewOffsetX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewOffsetY",{get:function(){return this._viewOffsetY},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewScale",{get:function(){return this._viewScale},enumerable:!1,configurable:!0}),t.prototype._dpr=function(){return"undefined"!=typeof window&&window.devicePixelRatio||1},Object.defineProperty(t.prototype,"logicalWidth",{get:function(){return this._logicalWidth||this._canvas.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logicalHeight",{get:function(){return this._logicalHeight||this._canvas.height},enumerable:!1,configurable:!0}),t.prototype.setLogicalSize=function(t,e){t>0&&(this._logicalWidth=t),e>0&&(this._logicalHeight=e)},Object.defineProperty(t.prototype,"displayWidth",{get:function(){var t=this._canvas;return"number"==typeof t.clientWidth&&t.clientWidth||this._canvas.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayHeight",{get:function(){var t=this._canvas;return"number"==typeof t.clientHeight&&t.clientHeight||this._canvas.height},enumerable:!1,configurable:!0}),t.prototype.recomputeFitScale=function(){var t=this.displayWidth/this.logicalWidth,e=this.displayHeight/this.logicalHeight;this._viewScale=Math.min(1,t,e)},t.prototype.setViewOffset=function(t,e){this._viewOffsetX=t,this._viewOffsetY=e},t.prototype.clearViewOffset=function(){this._viewOffsetX=0,this._viewOffsetY=0},t.prototype.visibleBounds=function(){return this._bounds(!0)},t.prototype.figureBounds=function(){return this._bounds(!1)},t.prototype._paintsInk=function(t){return!!t.visible&&(null!=t.nameColor||(t instanceof a.PointElement?null!=t.vertexColor:null!=t.edgeColor||null!=t.faceColor))},t.prototype.captureCentringBounds=function(){var t=this,e=this._bounds(!1,(function(e){return t._paintsInk(e)}));return this._centringBounds=null!=e?e:this._bounds(!1),this._centringBounds},Object.defineProperty(t.prototype,"centringBounds",{get:function(){return this._centringBounds},enumerable:!1,configurable:!0}),t.prototype.clearCentringBounds=function(){this._centringBounds=null},t.prototype._bounds=function(t,e){for(var n=1/0,r=-1/0,i=1/0,o=-1/0,s=function(t,e){t<n&&(n=t),t>r&&(r=t),e<i&&(i=e),e>o&&(o=e)},h=0,p=this._elements;h<p.length;h++){var f=p[h];if(null!=f.name&&!f.name.startsWith("screen")&&((!t||f.visible)&&(null==e||e(f))))if(f instanceof u.PolygonElement)for(var d=0,y=f.V;d<y.length;d++){var _=y[d];s(_.x,_.y)}else if(f instanceof c.CircleElement){var g=f.radius;s(f.Center.x-g,f.Center.y-g),s(f.Center.x+g,f.Center.y+g)}else f instanceof l.LineElement?(s(f.A.x,f.A.y),s(f.B.x,f.B.y)):f instanceof a.PointElement&&s(f.x,f.y)}return n===1/0?null:{minX:n,maxX:r,minY:i,maxY:o}},t.prototype.namesFor=function(t){var e=[t];return this._aliases.forEach((function(n,r){n===t&&r!==t&&e.push(r)})),e},t.prototype._ensureAnimator=function(){return null==this._animator&&(this._animator=new h.SlateAnimator(this)),this._animator},t.prototype.animateTo=function(t,e,n,r){return this._ensureAnimator().run(t,e,n,r)},t.prototype.setVisibleNames=function(t){for(var e=new Set(t),n=0,r=this._elements;n<r.length;n++){var i=r[n];null!=i.name&&(i.visible=e.has(i.name))}},Object.defineProperty(t.prototype,"initiallyHidden",{get:function(){return this._initiallyHidden},enumerable:!1,configurable:!0}),t.prototype.setInitiallyHidden=function(t){if(null!=t){this._initiallyHidden.add(t);var e=this.lookupElement(t);null!=e&&(e.visible=!1)}},t.prototype.clearVisibility=function(){for(var t=0,e=this._elements;t<e.length;t++){var n=e[t];n.visible=!(null!=n.name&&this._initiallyHidden.has(n.name))}},t.prototype.convertParams=function(t,e){void 0===e&&(e=!1);for(var n=[],r=[],i=[],o=0,s=t;o<s.length;o++){var u=s[o];switch(typeof u){case"string":var c=this.lookupElement(u);if(null==c)throw new TypeError("Element with name ".concat(u," not found."));c instanceof a.PointElement?n.push(c):c instanceof l.LineElement&&!e?(n.push(c.A),n.push(c.B)):r.push(c);break;case"number":i.push(u);break;default:throw new TypeError("Expecting only named elements (strings) or numbers.")}}return{P:n,E:r,N:i}},t.prototype.findConstruction=function(t,e){for(var n=0,r=s.constructions;n<r.length;n++){var i=r[n];if(i.validateSignature(t,e))return i}return null},t.prototype.createElement=function(t,e,n){var r=s.constructions.some((function(e){return e.constructionMethod===t&&e.keepsLineElements})),i=this.convertParams(e,r),o=this.findConstruction(t,i);if(null==o){var a=(0,s.getConstructionName)(t);throw null==n&&(n=""),new TypeError('Construction not found for "'.concat(n,'" ').concat(a," with params P=[").concat(i.P,"] E=[").concat(i.E,"] N=[").concat(i.N,"]"))}var l=o.construct(this._screen,i.P,i.E,i.N),u=l[0],c=l[1];-1!==this._elements.indexOf(c)&&(c.preexists=!0),null!=n&&(c.name=n);for(var h=0,p=u;h<p.length;h++){var f=p[h];-1==this._elements.indexOf(f)&&this._elements.push(f)}return-1==this._elements.indexOf(c)&&this._elements.push(c),c},t.prototype.reset=function(){for(var t=0,e=this._elements;t<e.length;t++){e[t].reset()}this.update()},t.prototype.update=function(){for(var t=0,e=this._elements;t<e.length;t++){e[t].update()}this.drawElements()},t.prototype.drawElements=function(){if(!this.inTest){var t=this._canvas.getContext("2d"),e=this._dpr(),n=this._viewScale,i=this._viewOffsetX,o=this._viewOffsetY;r.GeomElement.styleScale=n>0?1/n:1,t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this._canvas.width,this._canvas.height),t.fillStyle=this._bgcolor,t.fillRect(0,0,this._canvas.width,this._canvas.height),t.setTransform(e*n,0,0,e*n,e*i,e*o);for(var s=this._highlightOnTop?d(this._elements):this._elements,a=0,l=s;a<l.length;a++){l[a].drawFace(this._canvas)}for(var u=0,c=s;u<c.length;u++){c[u].drawEdge(this._canvas)}for(var h=0,p=s;h<p.length;h++){p[h].drawVertex(this._canvas)}for(var f=0,y=s;f<y.length;f++){y[f].drawName(this._canvas)}for(var _=0,g=this._ephemerals;_<g.length;_++){g[_].drawFace(this._canvas)}for(var v=0,m=this._ephemerals;v<m.length;v++){m[v].drawEdge(this._canvas)}for(var P=0,C=this._ephemerals;P<C.length;P++){C[P].drawVertex(this._canvas)}for(var b=0,w=this._ephemerals;b<w.length;b++){w[b].drawName(this._canvas)}t.setTransform(1,0,0,1,0,0),r.GeomElement.styleScale=1,this._dispatchHighlightChange()}},t.prototype._dispatchHighlightChange=function(){for(var t=this,e=[],n=0,r=this._elements;n<r.length;n++){var i=r[n];null==i.name||i.name.startsWith("screen")||(i.shouldHighlight||i.emphasized)&&e.push(i.name)}var o=e.sort().join("|");if(o!==this._lastHighlightedKey){this._lastHighlightedKey=o;var s=this._canvas;if(s&&"function"==typeof s.dispatchEvent&&"function"==typeof CustomEvent){var a=e.map((function(e){return{name:e,aliases:t.namesFor(e)}}));s.dispatchEvent(new CustomEvent("geomlib:highlight",{bubbles:!0,detail:{highlighted:a}}))}}},t.prototype.reportDiagnostic=function(t){var e=this._diagnostics.report(t,Date.now());if(null!=e){if("undefined"!=typeof console){var n="error"===e.severity?console.error:console.warn;n&&n("[geomlib] "+e.message)}this._dispatchDiagnostic(e),this._notifyDiagnosticListeners()}},Object.defineProperty(t.prototype,"diagnostics",{get:function(){return this._diagnostics.entries},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"diagnosticSeverity",{get:function(){return this._diagnostics.severity},enumerable:!1,configurable:!0}),t.prototype.clearDiagnostics=function(){this._diagnostics.clear(),this._dispatchDiagnostic(null),this._notifyDiagnosticListeners()},t.prototype.onDiagnosticsChanged=function(t){var e=this;return this._diagnosticListeners.push(t),function(){var n=e._diagnosticListeners.indexOf(t);n>=0&&e._diagnosticListeners.splice(n,1)}},t.prototype._notifyDiagnosticListeners=function(){for(var t=0,e=this._diagnosticListeners.slice();t<e.length;t++){var n=e[t];try{n(this)}catch(t){}}},t.prototype._dispatchDiagnostic=function(t){var e=this._canvas;e&&"function"==typeof e.dispatchEvent&&"function"==typeof CustomEvent&&e.dispatchEvent(new CustomEvent("geomlib:diagnostic",{bubbles:!0,detail:(0,p.diagnosticEventDetail)(this._diagnostics,t)}))},t.prototype.updateCoordinates=function(t){for(++t;t<this._elements.length;t++)this._elements[t].defined()||this._elements[t].reset(),this._elements[t].update();this.drawElements()},t.prototype.translateCoordinates=function(t,e){for(var n=0;n<this._elements.length;n++){var r=this._elements[n];r.preexists||r.translate(t,e)}this.update()},t.prototype.closestVisiblePoint=function(t,e,n){void 0===n&&(n=30);var r=function(t,e){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)},i=t.filter((function(t){return t instanceof a.PointElement})).map((function(t){return t})).filter((function(t){return null!=t.vertexColor})).sort((function(t,n){var i=r(t,e),o=r(n,e);return i<o?-1:o<i?1:0}));if(0==i.length)return null;var o=i[0];return Math.sqrt(r(o,e))>n?null:o},t.prototype._getPick=function(t,e){if(null!=this._pick)return this._pick;var n=new a.PointElement({x:t,y:e}),r=this.closestVisiblePoint(this._elements,n);return null!=r?(this._pick=r,this._pick):void 0},t.prototype.setPivot=function(t){var e=t.split(","),n=e[0].trim(),r=this.lookupElement(n);if(null!=r&&r instanceof a.PointElement){var o=r;if(e.length>1){var s=e[1].trim(),l=this.lookupElement(s);if(null==l||!(l instanceof i.PlaneElement))return;l.pivot=o}else o._AP=this._screen,this._screen.pivot=o}},t.prototype.movePick=function(t,e){if(null!=this._getPick(t,e)){var n=this._elements.indexOf(this._pick),r=this._viewScale||1,i=this._viewOffsetX,o=this._viewOffsetY,s=-i/r,a=(this.displayWidth-i)/r;t<s?t=s:t>a&&(t=a);var l=-o/r,u=(this.displayHeight-o)/r;if(e<l?e=l:e>u&&(e=u),!(Math.abs(t-this._pick.x)+Math.abs(e-this._pick.y)<1)){if(this._pick.draggable){if(!this._pick.drag(t,e))return;this.updateCoordinates(n)}else if(null!=this._pick.AP&&null!=this._pick.AP.pivot&&this._pick.AP.pivot!=this._pick)this.rotateCoordinates(t,e);else{var c=t-this._pick.x,h=e-this._pick.y;this.translateCoordinates(c,h)}this.drawElements()}}},t.prototype.rotateCoordinates=function(t,e){for(var n=this._pick,r=n.AP.pivot,i=a.PointElement.difference(n,r),o=t-r.x,s=e-r.y,l=n.AP.S,u=n.AP.T,c=a.PointElement.dot(i,l),h=a.PointElement.dot(i,u),p=l.x*u.y-l.y*u.x,f=(o*u.y-s*u.x)/p,d=(s*l.x-o*l.y)/p,y=(f*c+d*h)/(p=c*c+h*h),_=(d*c-f*h)/p,g=0,v=this._elements;g<v.length;g++){var m=v[g];m.preexists||m.rotate(r,y,_)}this.update()},t.numSlate=0,t}();e.Slate=y},6900(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.SlateAnimator=void 0;var i=n(7233),o="function"==typeof requestAnimationFrame,s="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return Date.now()},a=function(){function t(t){this.groups=[],this.mode="cascade",this.resolveCurrent=null,this.cascadeIndex=0,this.rafId=null,this.lastFrameMs=0,this.fadingOut=!1,this.fadeStartMs=0,this.slate=t}return t.prototype.run=function(t,e,n,o){var a=this;this.groups.length>0&&this.cancel();for(var u=[],c=this.slate.animationConfig||{},h=null!=c.speedMultiplier?c.speedMultiplier:1,p=!0===c.reducedMotion||0===h,f=function(t){var e=d.slate.lookupElement(t.elem);if(null==e)return d.slate.reportDiagnostic({code:"unknown-element",key:String(t.elem),message:"animation targets '"+t.elem+"', but no element or alias resolves to it \u2014 the step is skipped. Check for a typo, or for a target left behind by a figure change.",detail:{elem:t.elem}}),"continue";var n=(0,i.findAnimation)(t.name);if(null==n)return d.slate.reportDiagnostic({code:"unknown-animation",key:String(t.name),message:"unknown animation '"+String(t.name)+"' \u2014 falling back to instant",detail:{name:String(t.name),elem:t.elem}}),"continue";if(!(e instanceof n.elementType))return d.slate.reportDiagnostic({code:"animation-type-mismatch",key:String(n.name)+"|"+String(t.elem),message:"animation '"+n.name+"' targets "+n.elementType.name+" but element '"+t.elem+"' is "+e.constructor.name+" \u2014 falling back to instant",detail:{animation:String(n.name),elem:t.elem}}),e.drawProgress=1,e.visible=!0,"continue";var o=(n.build(e,d.slate,t.args||{})||[]).map((function(e){return{step:r(r({},e),{durationMs:l(e.durationMs,t.durationMs,c.durations&&c.durations[n.name])}),elapsedMs:0,started:!1,finalised:!1}}));u.push({target:e,steps:o,currentIndex:0})},d=this,y=0,_=n||[];y<_.length;y++){f(_[y])}for(var g=new Set(u.map((function(t){return t.target}))),v=0,m=this.slate.elements;v<m.length;v++){var P=m[v];if(null!=P.name){var C=t.has(P.name),b=e.has(P.name);g.has(P)?(P.shouldHighlight=b,P.drawProgress=0,P.visible=!1):(P.visible=C,P.shouldHighlight=b,P.drawProgress=1)}}if(p||0===u.length){for(var w=0,x=u;w<x.length;w++)for(var E=0,A=x[w].steps;E<A.length;E++){var S=A[E];S.step.setup&&!S.started&&S.step.setup(),S.step.finalise(),S.finalised=!0}return this.slate.drawElements(),Promise.resolve()}return this.groups=u,this.mode=o,this.cascadeIndex=0,this.lastFrameMs=s(),new Promise((function(t){a.resolveCurrent=t,a._kickoff(),a._scheduleFrame()}))},t.prototype._clearAnimatedEmphasis=function(){for(var t=0,e=this.groups;t<e.length;t++){e[t].target.emphasized=!1}},t.prototype.cancel=function(){if(0!==this.groups.length){for(var t=0,e=this.groups;t<e.length;t++)for(var n=e[t],r=0;r<n.steps.length;r++){var i=n.steps[r];i.finalised||(i.step.setup&&!i.started&&(i.step.setup(),i.started=!0),i.step.finalise(),i.finalised=!0)}this._clearAnimatedEmphasis(),this.slate.clearEphemerals(),this.slate.drawElements(),this.groups=[],this.fadingOut=!1,null!=this.rafId&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this.rafId),this.rafId=null,this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null)}},t.prototype._kickoff=function(){if("cascade"===this.mode)this._startGroupIndex(0);else for(var t=0,e=this.groups;t<e.length;t++){var n=e[t];this._startStep(n,0)}},t.prototype._startGroupIndex=function(t){t>=this.groups.length||this._startStep(this.groups[t],0)},t.prototype._startStep=function(t,e){if(!(e>=t.steps.length)){var n=t.steps[e];n.started||(0===e&&(t.target.visible=!0,t.target.emphasized=!0),n.step.setup&&n.step.setup(),n.started=!0,t.currentIndex=e)}},t.prototype._scheduleFrame=function(){var t=this;if(o)this.rafId=requestAnimationFrame((function(e){return t._frame(e)}));else{var e=s()+16;this.rafId=setTimeout((function(){return t._frame(e)}),16)}},t.prototype._frame=function(t){if(0!==this.groups.length){var e=this.slate.animationConfig||{},n=null!=e.speedMultiplier?e.speedMultiplier:1,r=e.cascadeGapMs||0,i=t-this.lastFrameMs;i<0&&(i=0),i>100&&(i=100);var o=i*n;if(this.lastFrameMs=t,"cascade"===this.mode?this._tickCascade(o,t,r):this._tickParallel(o,t),this.slate.drawElements(),this._allFinalised()){this.fadingOut||(this.fadingOut=!0,this.fadeStartMs=t);for(var s=t-this.fadeStartMs,a=s>=250?1:s/250,l=1-a,u=0,c=this.groups;u<c.length;u++){c[u].target.emphasisAmount=l}return this.slate.drawElements(),a>=1?(this._clearAnimatedEmphasis(),this.groups=[],this.fadingOut=!1,this.rafId=null,void(this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null))):void this._scheduleFrame()}this._scheduleFrame()}},t.prototype._tickCascade=function(t,e,n){for(;this.cascadeIndex<this.groups.length;){var r=this.groups[this.cascadeIndex],i=r.steps[r.currentIndex];if(i){if(!i.finalised)return void this._tickStep(r.target,i,t,e);if(null==r.finishedAtMs&&(r.finishedAtMs=e),e-r.finishedAtMs<n)return;r.currentIndex+1<r.steps.length?this._startStep(r,r.currentIndex+1):(this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0))}else this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0)}},t.prototype._tickParallel=function(t,e){for(var n=0,r=this.groups;n<r.length;n++){var i=r[n],o=i.steps[i.currentIndex];o&&(o.finalised?i.currentIndex+1<i.steps.length&&this._startStep(i,i.currentIndex+1):this._tickStep(i.target,o,t,e))}},t.prototype._tickStep=function(t,e,n,r){e.started||(e.step.setup&&e.step.setup(),e.started=!0),e.elapsedMs+=n;var i=e.step.durationMs,o=i>0?e.elapsedMs/i:1;o>1&&(o=1),o<0&&(o=0),e.step.tick(o,n,e.elapsedMs),o>=1&&(e.step.finalise(),e.finalised=!0)},t.prototype._allFinalised=function(){for(var t=0,e=this.groups;t<e.length;t++)for(var n=0,r=e[t].steps;n<r.length;n++){if(!r[n].finalised)return!1}return!0},t}();function l(t,e,n){return null!=e?e:null!=n?n:t}e.SlateAnimator=a},3267(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.BADGE_TOOLTIP=void 0,e.trackWindowResize=u,e.escapeAction=c,e.parseCaptionTokens=f,e.justsUseStackedLayout=d,e.createControls=function(t,e,n){if(!e.parentElement)return;new y(t,e,n).init()},e.createDiagnosticBadge=m,e.paintDiagnosticBadge=P,e.drawWarningIcon=C,e.drawErrorIcon=b;var r=n(7680);function i(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches}var o=i()?18:20,s=(i(),4),a=i()?7:8,l="geomlib-controls-style";function u(t,e){var n=function(){return e()};return t.addEventListener("resize",n),function(){return t.removeEventListener("resize",n)}}function c(t){return t.presenting?"exitPresent":t.maximized?"minimize":"none"}var h="[A-Za-z][A-Za-z0-9'\\-]*",p=new RegExp("\\{([^{}|]+)\\|("+h+")\\}|\\{("+h+")\\}","g");function f(t){for(var e,n=[],r=new RegExp(p.source,"g"),i=0;null!==(e=r.exec(t));){e.index>i&&n.push({kind:"text",text:t.slice(i,e.index)});var o=null!=e[2],s=o?e[1]:e[3],a=o?e[2]:e[3];n.push({kind:"ref",display:s,target:a}),i=e.index+e[0].length}return i<t.length&&n.push({kind:"text",text:t.slice(i)}),n}function d(t){return null!=t&&t.some((function(t){return null!=t.claim&&""!==t.claim}))}var y=function(){function t(t,e,n){this._maximized=!1,this._savedStyles=null,this._stopTrackingResize=null,this._badge=null,this._badgeSeverity=null,this._stopDiagnostics=null,this._maximizedOnKey=null,this._presenting=!1,this._presentationIndex=0,this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null,this._presentationOnKey=null,this._stickyRefSpan=null,this._stickyRefElem=null,this._slate=t,this._canvas=e,this._config=n}return t.prototype.init=function(){var t=this;this._wrapper=this.createWrapper(),this.createButtons(),this.addKeyboardShortcuts(),this._stopTrackingResize=u(window,(function(){return t.resizeAndRedraw()})),this._stopDiagnostics=this._slate.onDiagnosticsChanged((function(){return t.updateBadge()})),this.updateBadge()},t.prototype.updateBadge=function(){var t=this._slate.diagnosticSeverity;return null==t?(this._badge&&(this._badge.style.display="none"),void(this._badgeSeverity=null)):this._badge?(this._badge.style.display="",void(t!==this._badgeSeverity&&(P(this._badge,t),this._badgeSeverity=t))):(this._badge=m(t),this._badge.style.position="absolute",this._badge.style.top=a+"px",this._badge.style.left=a+"px",this._badge.style.zIndex="1",this._wrapper.appendChild(this._badge),void(this._badgeSeverity=t))},t.prototype.createWrapper=function(){var t=this;!function(){if("undefined"!=typeof document&&!document.getElementById(l)){var t=document.createElement("style");t.id=l,t.textContent=".geomlib-wrapper>button{opacity:0;transition:opacity .15s ease-in-out}.geomlib-wrapper:hover>button,.geomlib-wrapper:focus-within>button{opacity:1}",(document.head||document.documentElement).appendChild(t)}}();var e=document.createElement("div");return e.className="geomlib-wrapper",e.style.position="relative",e.style.display="inline-block",this._canvas.parentElement.insertBefore(e,this._canvas),e.appendChild(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.style.outline="none",this._canvas.addEventListener("focus",(function(){t._canvas.style.outline="2px solid rgba(66,133,244,0.5)"})),this._canvas.addEventListener("blur",(function(){t._canvas.style.outline="none"})),e},t.prototype.createButtons=function(){var t=this,e=[{draw:g,action:function(){return t.onReset()},title:"Reset (r)"},{draw:v,action:function(){return t.onMaximize()},title:"Maximize (m)"}];this._slate.slides.length>0&&e.push({draw:w,action:function(){return t.onPresent()},title:"Present (p)"});for(var n=function(n){var i=document.createElement("button");i.style.position="absolute",i.style.top=a+"px",i.style.right=a+n*(o+s)+"px",i.style.width=o+"px",i.style.height=o+"px",i.style.padding="0",i.style.border="none",i.style.cursor="pointer",i.style.background="rgba(0,0,0,0.12)",i.style.borderRadius="3px",i.title=e[n].title,i.addEventListener("mouseenter",(function(){i.style.background="rgba(0,0,0,0.3)"})),i.addEventListener("mouseleave",(function(){i.style.background="rgba(0,0,0,0.12)"}));var l=document.createElement("canvas");l.width=o,l.height=o,l.style.display="block";var u=l.getContext("2d");e[n].draw(u,o),i.appendChild(l),i.addEventListener("click",(function(r){r.stopPropagation(),e[n].action(),t._canvas.focus()})),1===n&&(r._maxBtn=i,r._maxIconCanvas=l),r._wrapper.appendChild(i)},r=this,i=0;i<e.length;i++)n(i)},t.prototype.addKeyboardShortcuts=function(){var t=this;this._canvas.addEventListener("keydown",(function(e){switch(e.key){case"r":case"R":case" ":e.preventDefault(),t.onReset();break;case"m":case"M":e.preventDefault(),t.onMaximize();break;case"p":case"P":t._slate.slides.length>0&&(e.preventDefault(),t.onPresent())}}))},t.prototype.onReset=function(){this._slate.reset(),this._slate.clearDiagnostics()},t.prototype.onMaximize=function(){this._maximized?this.minimize():this.maximize()},t.prototype.maximize=function(){this._savedStyles={wrapperPosition:this._wrapper.style.position,wrapperTop:this._wrapper.style.top,wrapperLeft:this._wrapper.style.left,wrapperWidth:this._wrapper.style.width,wrapperHeight:this._wrapper.style.height,wrapperZIndex:this._wrapper.style.zIndex,wrapperBackground:this._wrapper.style.background,canvasStyleWidth:this._canvas.style.width,canvasStyleHeight:this._canvas.style.height,canvasAttrWidth:this._canvas.width,canvasAttrHeight:this._canvas.height},this._wrapper.style.position="fixed",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.style.width="100vw",this._wrapper.style.height="100vh",this._wrapper.style.zIndex="9999",this._wrapper.style.background="white",this._canvas.style.width="100%",this._canvas.style.height="100%",this._maximized=!0,this.resizeAndRedraw(),this.updateMaximizeIcon(),this.bindMaximizedKeys()},t.prototype.bindMaximizedKeys=function(){var t=this;if(!this._maximizedOnKey){var e=function(e){if("Escape"===e.key)switch(c({presenting:t._presenting,maximized:t._maximized})){case"exitPresent":e.preventDefault(),t.exitPresent();break;case"minimize":e.preventDefault(),t.minimize()}};this._maximizedOnKey=e,document.addEventListener("keydown",e)}},t.prototype.unbindMaximizedKeys=function(){this._maximizedOnKey&&(document.removeEventListener("keydown",this._maximizedOnKey),this._maximizedOnKey=null)},t.prototype.minimize=function(){this._savedStyles&&(this._wrapper.style.position=this._savedStyles.wrapperPosition,this._wrapper.style.top=this._savedStyles.wrapperTop,this._wrapper.style.left=this._savedStyles.wrapperLeft,this._wrapper.style.width=this._savedStyles.wrapperWidth,this._wrapper.style.height=this._savedStyles.wrapperHeight,this._wrapper.style.zIndex=this._savedStyles.wrapperZIndex,this._wrapper.style.background=this._savedStyles.wrapperBackground,this._canvas.style.width=this._savedStyles.canvasStyleWidth,this._canvas.style.height=this._savedStyles.canvasStyleHeight,this._canvas.width=this._savedStyles.canvasAttrWidth,this._canvas.height=this._savedStyles.canvasAttrHeight,this._maximized=!1,this.unbindMaximizedKeys(),this.resizeAndRedraw(),this._savedStyles=null,this.updateMaximizeIcon(),this._slate.reset())},t.prototype.resizeAndRedraw=function(){var t="undefined"!=typeof window&&window.devicePixelRatio||1,e=Math.round(this._canvas.clientWidth*t),n=Math.round(this._canvas.clientHeight*t);this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n),this._slate.recomputeFitScale(),this._applyCentring(),this._slate.update()},t.prototype._applyCentring=function(){if(!this._maximized)return this._slate.clearViewOffset(),void this._slate.clearCentringBounds();var t=null!=this._slate.centringBounds?this._slate.centringBounds:this._slate.captureCentringBounds();if(null!=t){var e=(t.minX+t.maxX)/2,n=(t.minY+t.maxY)/2,r=this._slate.viewScale;this._slate.setViewOffset(this._slate.displayWidth/2-r*e,this._slate.displayHeight/2-r*n)}else this._slate.clearViewOffset()},t.prototype.updateMaximizeIcon=function(){var t=this._maxIconCanvas,e=this._maxBtn;if(t){var n=t.getContext("2d");n.clearRect(0,0,o,o),this._maximized?(!function(t,e){var n=4,r=e-2*n;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var i=n+r,o=n,s=n+.55*r,a=n+.45*r;t.beginPath(),t.moveTo(i,o),t.lineTo(s,a),t.stroke(),t.beginPath(),t.moveTo(s,a),t.lineTo(s+5,a),t.lineTo(s,a-5),t.closePath(),t.fill(),i=n,o=n+r,s=n+.45*r,a=n+.55*r,t.beginPath(),t.moveTo(i,o),t.lineTo(s,a),t.stroke(),t.beginPath(),t.moveTo(s,a),t.lineTo(s-5,a),t.lineTo(s,a+5),t.closePath(),t.fill()}(n,o),e.title="Minimize (m)"):(v(n,o),e.title="Maximize (m)")}},t.prototype.onPresent=function(){this._presenting||0!==this._slate.slides.length&&(this._maximized||this.maximize(),this._slate.clearCentringBounds(),this._applyCentring(),this.buildPresentationOverlay(),this.bindPresentationKeys(),this._presenting=!0,this.showSlide(0))},t.prototype.exitPresent=function(){if(this._presenting){this.unbindPresentationKeys(),this.clearStickyRef(),this.removePresentationOverlay(),null!=this._slate.animator&&this._slate.animator.cancel(),this._slate.clearEphemerals(),this._slate.clearVisibility();for(var t=0,e=this._slate.elements;t<e.length;t++){var n=e[t];n.shouldHighlight=!1,n.emphasized=!1}this._presenting=!1,this._slate.update()}},t.prototype.buildPresentationOverlay=function(){var t=this,e=document.createElement("div");e.className="geomlib-presentation-overlay",e.style.position="fixed",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.margin="0 auto",e.style.maxWidth="100vw",e.style.background="#ffffff",e.style.color="#222",e.style.borderTop="1px solid rgba(0,0,0,0.18)",e.style.boxShadow="0 -6px 18px rgba(0,0,0,0.18)",e.style.padding="12px 16px calc(12px + env(safe-area-inset-bottom, 0px))",e.style.zIndex="2147483647",e.style.fontFamily="Georgia, 'Times New Roman', serif",e.style.touchAction="manipulation",e.style.boxSizing="border-box",e.style.textAlign="center";var n=document.createElement("div");n.className="geomlib-presentation-caption",n.style.fontSize="1.1rem",n.style.lineHeight="1.45",n.style.textAlign="center",n.style.marginBottom="6px",e.appendChild(n);var r=document.createElement("div");r.className="geomlib-presentation-justs",r.style.fontSize="0.85rem",r.style.textAlign="center",r.style.opacity="0.85",r.style.minHeight="1em",r.style.marginBottom="10px",e.appendChild(r);var i=document.createElement("div");i.className="geomlib-presentation-nav",i.style.display="flex",i.style.gap="10px",i.style.alignItems="center",i.style.justifyContent="center";var o=_("\u2039 Prev"),s=document.createElement("span");s.className="geomlib-presentation-counter",s.style.minWidth="56px",s.style.textAlign="center",s.style.opacity="0.7",s.style.fontSize="0.9rem";var a=_("Next \u203a"),l=_("\u2715 Exit");l.style.marginLeft="16px",o.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex-1)})),a.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex+1)})),l.addEventListener("click",(function(e){e.stopPropagation(),t.exitPresent()})),i.appendChild(o),i.appendChild(s),i.appendChild(a),i.appendChild(l),e.appendChild(i),document.documentElement.appendChild(e),this._presentationOverlay=e,this._presentationCaption=n,this._presentationJusts=r,this._presentationCounter=s},t.prototype.removePresentationOverlay=function(){this._presentationOverlay&&this._presentationOverlay.parentNode&&this._presentationOverlay.parentNode.removeChild(this._presentationOverlay),this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null},t.prototype.bindPresentationKeys=function(){var t=this,e=function(e){if(t._presenting)switch(e.key){case"ArrowLeft":e.preventDefault(),t.showSlide(t._presentationIndex-1);break;case"ArrowRight":case" ":e.preventDefault(),t.showSlide(t._presentationIndex+1)}};this._presentationOnKey=e,document.addEventListener("keydown",e)},t.prototype.unbindPresentationKeys=function(){this._presentationOnKey&&(document.removeEventListener("keydown",this._presentationOnKey),this._presentationOnKey=null)},t.prototype.showSlide=function(t){var e=this._slate.slides;if(0!==e.length){var n=Math.max(0,Math.min(e.length-1,t));this._presentationIndex=n;var i=(0,r.computeSlideState)(this._slate,e,n);this.clearStickyRef(),this._slate.clearEphemerals();for(var o=e[n],s=o.transition,a=s&&s.animations,l=s&&"parallel"===s.mode?"parallel":"cascade",u=0,c=this._slate.elements;u<c.length;u++){(f=c[u]).emphasized=!1}if(a&&a.length>0)this._slate.animateTo(i.visible,i.highlighted,a,l);else{for(var h=0,p=this._slate.elements;h<p.length;h++){var f;null!=(f=p[h]).name&&(f.visible=i.visible.has(f.name),f.shouldHighlight=i.highlighted.has(f.name),f.drawProgress=1)}this._slate.update()}if(this._presentationCaption&&this.renderCaptionText(this._presentationCaption,o.text||""),this._presentationCounter&&(this._presentationCounter.textContent=n+1+" / "+e.length),this._presentationJusts){this._presentationJusts.innerHTML="";var y=this._slate.resolveJustification,_=o.justifications;if(_)for(var g=d(_),v=0;v<_.length;v++){var m=g?document.createElement("div"):this._presentationJusts;if(!g&&v>0){var P=document.createElement("span");P.textContent=" \xb7 ",P.style.opacity="0.5",m.appendChild(P)}var C=_[v].claim;if(null!=C&&""!==C){var b=document.createElement("span");b.textContent=C,m.appendChild(b);var w=document.createElement("span");w.textContent=" \u2014 ",w.style.opacity="0.5",m.appendChild(w)}var x=_[v].ref,E=y?y(x):null;if(E){var A=document.createElement("a");A.href=E,A.textContent=x,A.target="_blank",A.rel="noopener",A.style.color="#0066cc",m.appendChild(A)}else{var S=document.createElement("span");S.textContent=x,m.appendChild(S)}g&&this._presentationJusts.appendChild(m)}}}},t.prototype.renderCaptionText=function(t,e){t.innerHTML="";for(var n=0,r=f(e);n<r.length;n++){var i=r[n];if("text"!==i.kind){var o=this._slate.lookupElement(i.target);o?t.appendChild(this.buildCaptionRef(i.display,o)):t.appendChild(document.createTextNode(i.display))}else t.appendChild(document.createTextNode(i.text))}},t.prototype.buildCaptionRef=function(t,e){var n=this,r=document.createElement("span");return r.className="geomlib-presentation-ref",r.textContent=t,r.style.fontWeight="700",r.style.fontStyle="italic",r.style.cursor="pointer",r.style.borderBottom="1px dotted currentColor",r.addEventListener("mouseenter",(function(){null==n._stickyRefSpan&&(e.emphasized=!0,n._slate.update())})),r.addEventListener("mouseleave",(function(){null==n._stickyRefSpan&&(e.emphasized=!1,n._slate.update())})),r.addEventListener("pointerdown",(function(t){t.preventDefault(),t.stopPropagation();var i=n._stickyRefSpan===r;n.clearStickyRef(),i||n.setStickyRef(r,e),n._slate.update()})),r},t.prototype.clearStickyRef=function(){null!=this._stickyRefSpan&&(this._stickyRefSpan.classList.remove("active"),this._stickyRefSpan.style.color=""),null!=this._stickyRefElem&&(this._stickyRefElem.emphasized=!1),this._stickyRefSpan=null,this._stickyRefElem=null},t.prototype.setStickyRef=function(t,e){t.classList.add("active"),t.style.color="#b08800",e.emphasized=!0,this._stickyRefSpan=t,this._stickyRefElem=e},t}();function _(t){var e=document.createElement("button");return e.textContent=t,e.style.background="rgba(0,0,0,0.08)",e.style.color="#222",e.style.border="1px solid rgba(0,0,0,0.15)",e.style.borderRadius="4px",e.style.padding="10px 16px",e.style.minHeight="44px",e.style.cursor="pointer",e.style.fontFamily="inherit",e.style.fontSize="1rem",e.style.touchAction="manipulation",e.addEventListener("mouseenter",(function(){e.style.background="rgba(0,0,0,0.16)"})),e.addEventListener("mouseleave",(function(){e.style.background="rgba(0,0,0,0.08)"})),e}function g(t,e){var n=e/2,r=e/2,i=.32*e;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5,t.beginPath(),t.arc(n,r,i,.5*-Math.PI,.75*Math.PI),t.stroke();var o=.75*Math.PI,s=n+i*Math.cos(o),a=r+i*Math.sin(o),l=o+.3*Math.PI,u=o+.9*Math.PI;t.beginPath(),t.moveTo(s,a),t.lineTo(s+4*Math.cos(l),a+4*Math.sin(l)),t.lineTo(s+4*Math.cos(u),a+4*Math.sin(u)),t.closePath(),t.fill()}function v(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var r=4+.55*n,i=4+.45*n,o=4+n,s=4;t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.stroke(),t.beginPath(),t.moveTo(o,s),t.lineTo(o-5,s),t.lineTo(o,s+5),t.closePath(),t.fill(),r=4+.45*n,i=4+.55*n,o=4,s=4+n,t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.stroke(),t.beginPath(),t.moveTo(o,s),t.lineTo(o+5,s),t.lineTo(o,s-5),t.closePath(),t.fill()}function m(t,n){var r=null!=n?n:o,i=document.createElement("div");return i.className="geomlib-badge",i.setAttribute("role","img"),i.title=e.BADGE_TOOLTIP,i.setAttribute("aria-label",e.BADGE_TOOLTIP),i.style.width=r+"px",i.style.height=r+"px",i.style.lineHeight="0",i.style.cursor="default",P(i,t,r),i}function P(t,e,n){var r=null!=n?n:o,i=t.firstChild;i&&"CANVAS"===i.tagName||(t.innerHTML="",i=document.createElement("canvas"),t.appendChild(i)),i.width=r,i.height=r;var s=i.getContext("2d");s&&(s.clearRect(0,0,r,r),"error"===e?b(s,r):C(s,r))}function C(t,e){var n=.06*e,r=n,i=e-n,o=n,s=e-1.2*n;t.fillStyle="#e6a700",t.beginPath(),t.moveTo(e/2,o),t.lineTo(i,s),t.lineTo(r,s),t.closePath(),t.fill();var a=Math.max(1.5,.11*e);t.fillStyle="#ffffff",t.fillRect(e/2-a/2,.34*e,a,.3*e),t.fillRect(e/2-a/2,.71*e,a,a)}function b(t,e){var n=e/2,r=e/2,i=.47*e;t.fillStyle="#d13438",t.beginPath();for(var o=0;o<8;o++){var s=Math.PI/8+o*Math.PI/4,a=n+i*Math.cos(s),l=r+i*Math.sin(s);0===o?t.moveTo(a,l):t.lineTo(a,l)}t.closePath(),t.fill();var u=.34*e;t.strokeStyle="#ffffff",t.lineWidth=Math.max(1.5,.11*e),t.lineCap="round",t.beginPath(),t.moveTo(u,u),t.lineTo(e-u,e-u),t.moveTo(e-u,u),t.lineTo(u,e-u),t.stroke()}function w(t,e){var n=.28*e,r=n-1,i=e-n+2,o=n,s=e-n;t.fillStyle="rgba(0,0,0,0.7)",t.beginPath(),t.moveTo(r,o),t.lineTo(r,s),t.lineTo(i,e/2),t.closePath(),t.fill()}e.BADGE_TOOLTIP="geomlib generated warnings - check console"},7233(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InstantAnimation=e.Animation=e.A=e.AllAnimations=void 0,e.registerAnimation=h,e.findAnimation=function(t){var e;e="string"==typeof t?c.get(t):u.get(t);return null!=e?e:null};var o,s=n(8020);!function(t){t[t.INSTANT=0]="INSTANT",t[t.POINT_APPEAR=1]="POINT_APPEAR",t[t.POINT_INTERSECT=2]="POINT_INTERSECT",t[t.POINT_SLIDE=3]="POINT_SLIDE",t[t.LINE_STRAIGHT_EDGE_CONNECT=4]="LINE_STRAIGHT_EDGE_CONNECT",t[t.LINE_STRAIGHT_EDGE_EXTEND=5]="LINE_STRAIGHT_EDGE_EXTEND",t[t.LINE_COMPASS_TRANSFER=6]="LINE_COMPASS_TRANSFER",t[t.CIRCLE_COMPASS=7]="CIRCLE_COMPASS",t[t.CIRCLE_COMPASS_EXPLICIT=8]="CIRCLE_COMPASS_EXPLICIT",t[t.CIRCLE_COMPASS_TRANSFER=9]="CIRCLE_COMPASS_TRANSFER",t[t.POLYGON_OUTLINE=10]="POLYGON_OUTLINE",t[t.POLYGON_OUTLINE_AND_FILL=11]="POLYGON_OUTLINE_AND_FILL",t[t.POLYGON_SUPERPOSE=12]="POLYGON_SUPERPOSE",t[t.POLYGON_EQUILATERAL_BUILD=13]="POLYGON_EQUILATERAL_BUILD",t[t.SECTOR_SWEEP=14]="SECTOR_SWEEP",t[t.GROUP_CLONE_ASIDE=15]="GROUP_CLONE_ASIDE"}(o||(e.AllAnimations=o={})),e.A={Point:{appear:o.POINT_APPEAR,intersect:o.POINT_INTERSECT,slide:o.POINT_SLIDE},Line:{straightEdgeConnect:o.LINE_STRAIGHT_EDGE_CONNECT,straightEdgeExtend:o.LINE_STRAIGHT_EDGE_EXTEND,compassTransfer:o.LINE_COMPASS_TRANSFER},Circle:{compass:o.CIRCLE_COMPASS,compassExplicit:o.CIRCLE_COMPASS_EXPLICIT,compassTransfer:o.CIRCLE_COMPASS_TRANSFER},Polygon:{outline:o.POLYGON_OUTLINE,outlineAndFill:o.POLYGON_OUTLINE_AND_FILL,superpose:o.POLYGON_SUPERPOSE,equilateralBuild:o.POLYGON_EQUILATERAL_BUILD},Sector:{sweep:o.SECTOR_SWEEP},Group:{cloneAside:o.GROUP_CLONE_ASIDE},instant:o.INSTANT};var a=function(){};e.Animation=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.INSTANT,e.name="instant",e.elementType=s.GeomElement,e}return i(e,t),e.prototype.build=function(t,e,n){return[{durationMs:0,tick:function(){},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(a);e.InstantAnimation=l;var u=new Map,c=new Map;function h(t){u.set(t.animationMethod,t),c.set(t.name,t)}h(new l)},7658(t,e,n){var r,i,o,s,a,l,u,c,h,p=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.constructions=e.Construction=e.E=e.PolyhedraConstructions=e.SphereConstructions=e.PlaneConstructions=e.SectorConstructions=e.PolygonConstructions=e.CircleConstructions=e.LineConstructions=e.PointConstructions=e.ConstructionTypes=void 0,e.getConstructionName=function(t){if(t<100)return"Point."+i[t];if(100<t&&t<200)return"Line."+o[t];if(300<t&&t<400)return"Polygon."+a[t];if(400<t&&t<500)return"Sector."+l[t];if(500<t&&t<600)return"Plane."+u[t];if(600<t&&t<700)return"Sphere."+c[t];if(700<t&&t<800)return"Polyhedra."+h[t];return"<Not Valid Construction>"},function(t){t[t.Integer=0]="Integer",t[t.PointElement=1]="PointElement",t[t.CircleElement=2]="CircleElement",t[t.PlaneElement=3]="PlaneElement",t[t.SphereElement=4]="SphereElement",t[t.PolygonElement=5]="PolygonElement",t[t.PolyhedronElement=6]="PolyhedronElement"}(r||(e.ConstructionTypes=r={})),function(t){t[t.free=1]="free",t[t.midpoint=2]="midpoint",t[t.intersection=3]="intersection",t[t.first=4]="first",t[t.last=5]="last",t[t.center=6]="center",t[t.lineSlider=7]="lineSlider",t[t.circleSlider=8]="circleSlider",t[t.circumcenter=9]="circumcenter",t[t.vertex=10]="vertex",t[t.foot=11]="foot",t[t.cutoff=12]="cutoff",t[t.extend=13]="extend",t[t.parallelogram=14]="parallelogram",t[t.similar=15]="similar",t[t.perpendicular=16]="perpendicular",t[t.proportion=17]="proportion",t[t.invert=18]="invert",t[t.meanProportional=19]="meanProportional",t[t.planeSlider=20]="planeSlider",t[t.sphereSlider=21]="sphereSlider",t[t.angleBisector=22]="angleBisector",t[t.angleDivider=23]="angleDivider",t[t.fixed=24]="fixed",t[t.lineSegmentSlider=25]="lineSegmentSlider",t[t.harmonic=26]="harmonic"}(i||(e.PointConstructions=i={})),function(t){t[t.connect=101]="connect",t[t.angleBisector=102]="angleBisector",t[t.angleDivider=103]="angleDivider",t[t.foot=104]="foot",t[t.chord=105]="chord",t[t.bichord=106]="bichord",t[t.perpendicular=107]="perpendicular",t[t.cutoff=108]="cutoff",t[t.extend=109]="extend",t[t.parallel=110]="parallel",t[t.similar=111]="similar",t[t.proportion=112]="proportion",t[t.meanProportional=113]="meanProportional",t[t.path=114]="path"}(o||(e.LineConstructions=o={})),function(t){t[t.radius=201]="radius",t[t.circumcircle=202]="circumcircle",t[t.invert=203]="invert",t[t.intersection=204]="intersection"}(s||(e.CircleConstructions=s={})),function(t){t[t.square=301]="square",t[t.triangle=302]="triangle",t[t.quadrilateral=303]="quadrilateral",t[t.pentagon=304]="pentagon",t[t.hexagon=305]="hexagon",t[t.equilateralTriangle=306]="equilateralTriangle",t[t.parallelogram=307]="parallelogram",t[t.regularPolygon=308]="regularPolygon",t[t.starPolygon=309]="starPolygon",t[t.similar=310]="similar",t[t.application=311]="application",t[t.octagon=312]="octagon",t[t.face=313]="face",t[t.curvedTriangle=314]="curvedTriangle"}(a||(e.PolygonConstructions=a={})),function(t){t[t.sector=401]="sector",t[t.arc=402]="arc",t[t.angleMarker=403]="angleMarker",t[t.angleMarkerReflex=404]="angleMarkerReflex"}(l||(e.SectorConstructions=l={})),function(t){t[t.threePoints=501]="threePoints",t[t.perpendicular=502]="perpendicular",t[t.parallel=503]="parallel",t[t.ambient=504]="ambient"}(u||(e.PlaneConstructions=u={})),function(t){t[t.radius=601]="radius"}(c||(e.SphereConstructions=c={})),function(t){t[t.tetrahedron=701]="tetrahedron",t[t.parallelepiped=702]="parallelepiped",t[t.prism=703]="prism",t[t.pyramid=704]="pyramid"}(h||(e.PolyhedraConstructions=h={})),e.E={Point:i,Line:o,Circle:s,Polygon:a,Sector:l,Plane:u,Sphere:c,Polyhedra:h};var f=function(){function t(){this.keepsLineElements=!1}return t.prototype.validateSignature=function(t,e){if(t!=this.constructionMethod)return!1;var n=this.signature;if(n.points!==e.P.length)return!1;if(n.elements!==e.E.length)return!1;if(n.integers!==e.N.length)return!1;if(n.elementTypes)for(var r=0;r<n.elementTypes.length;r++)if(!(e.E[r]instanceof n.elementTypes[r]))return!1;return!0},t}();e.Construction=f;var d=n(4461),y=n(7339),_=n(9275),g=n(4133),v=n(5755),m=n(5193),P=n(8649),C=n(1099);e.constructions=p(p(p(p(p(p(p(p([],d.pointConstructions,!0),y.lineConstructions,!0),_.circleConstructions,!0),v.sectorConstructions,!0),g.polygonConstructions,!0),m.planeConstructions,!0),P.sphereConstructions,!0),C.polyhedronConstructions,!0)},8020(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeomElement=e.Align=void 0,function(t){t[t.CENTRAL=0]="CENTRAL",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(n||(e.Align=n={}));var r=function(){function t(){this.preexists=!1,this._nameColor=null,this._vertexColor=null,this._edgeColor=null,this._faceColor=null,this._nameHighlightColor="#FFD700",this._vertexHighlightColor="#FFD700",this._edgeHighlightColor="#FFD700",this._faceHighlightColor="#FFD700",this._shouldHighlight=!1,this._visible=!0,this._emphasisAmount=0,this._drawProgress=1,this._pixelTolerance=50}return t.setFont=function(e,n){t._fontName=e,t._fontSize=n},t.fontString=function(){return"italic ".concat(t._fontSize*t.styleScale,"px ").concat(t._fontName)},t.prototype._getTextMetrics=function(t,e){var n=t.measureText(e);return[n.width,null!=n.actualBoundingBoxAscent?n.actualBoundingBoxAscent+n.actualBoundingBoxDescent:16]},t.prototype.drawString=function(e,r,i,o){var s=i.getContext("2d");if(null!=this._nameColor){s.font=t.fontString(),s.fillStyle=this._nameColor;var a=this._getTextMetrics(s,this._name),l=a[0],u=a[1];switch(o||this._align){case n.LEFT:return e=e-l-6,r=r+u/2-4,void s.fillText(this._name,e,r);case n.RIGHT:return e+=2,r+=u/2-4,void s.fillText(this._name,e,r);case n.ABOVE:return e-=l/2,r+=-u/2+4,void s.fillText(this._name,e,r);case n.BELOW:return e-=l/2,r+=u/2+6,void s.fillText(this._name,e,r)}var c=i.width,h=i.height,p=(e-c/2)*h,f=(r-h/2)*c;f>p?f>=-p?(e-=l/2,r+=u/2+6,s.fillText(this._name,e,r)):(e=e-l-6,r+=u/2-4,s.fillText(this._name,e,r)):f>=-p?(e+=2,r+=u/2-4,s.fillText(this._name,e,r)):(e-=l/2,r+=-u/2+4,s.fillText(this._name,e,r))}},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.update()},t.prototype.defined=function(){return!1},t.prototype.drag=function(t,e){return!1},Object.defineProperty(t.prototype,"nameColor",{get:function(){return this._nameColor},set:function(t){this._nameColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeColor",{get:function(){return this._edgeColor},set:function(t){this._edgeColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceColor",{get:function(){return this._faceColor},set:function(t){this._faceColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameHighlightColor",{get:function(){return this._nameHighlightColor},set:function(t){this._nameHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexHighlightColor",{get:function(){return this._vertexHighlightColor},set:function(t){this._vertexHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeHighlightColor",{get:function(){return this._edgeHighlightColor},set:function(t){this._edgeHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceHighlightColor",{get:function(){return this._faceHighlightColor},set:function(t){this._faceHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"draggable",{get:function(){return this._draggable},set:function(t){this._draggable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimension",{get:function(){return this._dimension},set:function(t){this._dimension=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldHighlight",{get:function(){return this._shouldHighlight},set:function(t){this._shouldHighlight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasized",{get:function(){return this._emphasisAmount>0},set:function(t){this._emphasisAmount=t?1:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasisAmount",{get:function(){return this._emphasisAmount},set:function(t){this._emphasisAmount=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawProgress",{get:function(){return this._drawProgress},set:function(t){this._drawProgress=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexColor",{get:function(){return this._vertexColor},set:function(t){this._vertexColor=t},enumerable:!1,configurable:!0}),t._fontSize=18,t._fontName="Times New Roman",t.styleScale=1,t}();e.GeomElement=r},9222(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleCompassTransferAnimation=e.CircleCompassAnimation=void 0;var o=n(7233),s=n(1313),a=n(6091),l=n(2145),u=n(7091),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.CIRCLE_COMPASS,e.name="Circle.compass",e.elementType=s.CircleElement,e.defaultRate=.003,e.defaultDurationMs=600,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=n&&"number"==typeof n.startAngle?n.startAngle:Math.atan2(r.B.y-r.Center.y,r.B.x-r.Center.x),o=2*Math.PI/this.defaultRate,s=function(){r.faceAlpha=1,r.drawProgress=1,r.drawStartAngle=0,r.visible=!0},a={durationMs:o,setup:function(){r.drawStartAngle=i,r.faceAlpha=0,r.drawProgress=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};return null==r.faceColor?(a.finalise=s,[a]):[a,{durationMs:Math.min(o/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:s}]},e}(o.Animation);e.CircleCompassAnimation=c,(0,o.registerAnimation)(new c);var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.CIRCLE_COMPASS_TRANSFER,e.name="Circle.compassTransfer",e.elementType=s.CircleElement,e.defaultRate=.0055,e.defaultDurationMs=600,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=r.Center,o=r.A,c=r.B;if(null==o||null==c||o===i||c===i||o.distance(c)<1e-6)return e.reportDiagnostic({code:"bad-animation-args",key:"Circle.compassTransfer|"+String(r.name),message:"Circle.compassTransfer: needs a radius defined by two points distinct from the centre (circle;radius;centre,p1,p2) \u2014 skipping",detail:{animation:"Circle.compassTransfer",elem:String(r.name)}}),[{durationMs:0,tick:function(){},finalise:function(){r.faceAlpha=1,r.drawProgress=1,r.visible=!0}}];var h=i.AP||r.AP,p=o.distance(c),f=i.distance(o)<=i.distance(c)?o:c,d=f===o?c:o,y=!n||1!==n.side&&-1!==n.side?1:n.side,_=function(t,e,n){var r=(t.x+e.x)/2,i=(t.y+e.y)/2,o=e.x-t.x,s=e.y-t.y,a=Math.hypot(o,s)||1,l=a*Math.sqrt(3)/2;return{x:r+n*l*(-s/a),y:i+n*l*(o/a)}}(i,f,y),g=new a.PointElement;g.x=_.x,g.y=_.y,g.AP=h;var v=Math.hypot(f.x-_.x,f.y-_.y)||1,m=(f.x-_.x)/v,P=(f.y-_.y)/v,C=new a.PointElement;C.x=f.x+p*m,C.y=f.y+p*P,C.AP=h;var b=Math.hypot(i.x-_.x,i.y-_.y)||1,w=(i.x-_.x)/b,x=(i.y-_.y)/b,E=new a.PointElement;E.x=_.x+(v+p)*w,E.y=_.y+(v+p)*x,E.AP=h;var A=new l.LineElement({A:i,B:f}),S=new u.PolygonElement;S.V=[i,f,g];for(var O=new l.LineElement({A:f,B:C}),M=new l.LineElement({A:i,B:E}),T=new s.CircleElement({C:f,B:d,AP:h}),j=new s.CircleElement({C:g,B:C,AP:h}),k=new s.CircleElement({C:i,B:f,AP:h}),L=new s.CircleElement({C:f,B:i,AP:h}),B=[A,S,O,M],z=[k,L,T,j],I=0,N=B.concat(z);I<N.length;I++){var R=N[I];R.edgeColor=null,R.faceColor=null,R.nameColor=null,R.vertexColor=null,R.emphasized=!0}var D=n&&Array.isArray(n.keepCircles)?n.keepCircles:null;D&&z.forEach((function(t,e){D[e]&&(t.name=String(D[e]))}));var V=function(t){return null!=D&&null!=t.name},H=2*Math.PI/this.defaultRate,F=function(t,e){return Math.max(120,t.distance(e)/.3)},G=function(t,e){return{durationMs:e,setup:function(){t.drawProgress=0},tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1}}},U=function(t){return{durationMs:H,setup:function(){t.drawStartAngle=Math.atan2(t.B.y-t.Center.y,t.B.x-t.Center.x),t.drawProgress=0},tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1}}},q=G(A,F(i,f));q.setup=function(){r.drawProgress=0,r.faceAlpha=0;for(var t=0,n=B;t<n.length;t++){var i=n[t];e.addEphemeral(i),i.drawProgress=0}for(var o=0,s=z;o<s.length;o++){var a=s[o];a.drawProgress=0,V(a)?(e.addElement(a),e.setInitiallyHidden(a.name),a.visible=!0):e.addEphemeral(a)}A.drawProgress=0};var W=[q,U(k),U(L),{durationMs:F(i,f)+F(f,g),setup:function(){S.drawProgress=0},tick:function(t){S.drawProgress=t},finalise:function(){S.drawProgress=1}},G(O,F(f,C)),G(M,F(i,E)),U(T),U(j)],Y={durationMs:H,setup:function(){r.drawStartAngle=Math.atan2(r.B.y-i.y,r.B.x-i.x),r.drawProgress=0,r.faceAlpha=0,r.visible=!0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1,r.faceAlpha=1,r.visible=!0,function(){for(var t=0,n=B;t<n.length;t++){var r=n[t];e.removeEphemeral(r)}for(var i=0,o=z;i<o.length;i++){var s=o[i];V(s)||e.removeEphemeral(s)}}()}};return W.push(Y),W},e}(o.Animation);e.CircleCompassTransferAnimation=h,(0,o.registerAnimation)(new h)},9275(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.circleConstructions=e.SphereIntersectionConstruction=e.InvertCircleConstruction=e.CircleRadius3PointConstruction=e.CircleRadiusCenterConstruction=void 0;var o=n(7658),s=n(1313),a=n(4021),l=n(8157),u=n(6055),c=n(2295),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new s.CircleElement({C:e[0],B:e[1],AP:i});return[[o],o]},e}(o.Construction);e.CircleRadiusCenterConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new s.CircleElement({C:e[0],A:e[1],B:e[2],AP:i});return[[o],o]},e}(o.Construction);e.CircleRadius3PointConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.invert,e.signature={points:0,elements:2,integers:0,elementTypes:[s.CircleElement,s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.InvertCircleElement(n[0],n[1]);return[[i],i]},e}(o.Construction);e.InvertCircleConstruction=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.intersection,e.signature={points:0,elements:2,integers:0,elementTypes:[c.SphereElement,c.SphereElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new l.SphereIntersectionElement(n[0],n[1]);return[[i],i]},e}(o.Construction);e.SphereIntersectionConstruction=d,e.circleConstructions=[new p,new h,new f,new d]},1313(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n._drawStartAngle=0,n._faceAlpha=1,n.dimension=2,null==e||(n.Center=e.C,n.A=null!=e.A?e.A:n.Center,n.B=e.B,n.AP=e.AP),n}return i(e,t),Object.defineProperty(e.prototype,"drawStartAngle",{get:function(){return this._drawStartAngle},set:function(t){this._drawStartAngle=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.A.distance(this.B)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius2",{get:function(){return this.A.distance2(this.B)},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!0},e.prototype._drawCircleArc=function(t,e,n){t.beginPath();var r=this.radius2,i=Math.sqrt(r),o=this.AP.S.z*this.AP.S.z+this.AP.T.z*this.AP.T.z;if(Math.abs(o)<.01)t.ellipse(this.Center.x,this.Center.y,i,i,0,e,n);else{var s=i/Math.sqrt(o),a=s*this.AP.T.z,l=-s*this.AP.S.z,u=a*this.AP.S.x+l*this.AP.T.x,c=a*this.AP.S.y+l*this.AP.T.y,h=o<1?Math.sqrt(1-o):0,p=-h*c,f=h*u,d=Math.sqrt(u*u+c*c),y=Math.sqrt(p*p+f*f);if(y<.5)return t.moveTo(this.Center.x-u,this.Center.y-c),void t.lineTo(this.Center.x+u,this.Center.y+c);var _=Math.atan2(c,u);t.ellipse(this.Center.x,this.Center.y,d,y,_,e,n)}},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale;var i=this.drawStartAngle,s=i+2*Math.PI*this.drawProgress;this._drawCircleArc(n,i,s),n.stroke()}}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=this.faceAlpha;if(!(e<=0)){var n=t.getContext("2d");n.fillStyle=this.faceColor,this._drawCircleArc(n,0,2*Math.PI),e<1?(n.save(),n.globalAlpha=e,n.fill(),n.restore()):n.fill()}}},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name){var e=t.getContext("2d");e.strokeStyle=this.nameColor,e.font=o.GeomElement.fontString();var n=this._getTextMetrics(e,this.name),r=n[0],i=n[1];e.fillText(this._name,this.Center.x-r/2,this.Center.y-i/2)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(o.GeomElement);e.CircleElement=s},2218(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircumcircleElement=void 0;var o=n(6091),s=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s.dimension=2,s.B=e,s.C=n,s.D=r,s.AP=i,s.Center=new o.PointElement({AP:i}),s.A=s.Center,s}return i(e,t),e.prototype.update=function(){this.Center.toCircumcenter(this.B,this.C,this.D)},e.prototype.translate=function(t,e){this.Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n)},e}(n(1313).CircleElement);e.CircumcircleElement=s},4021(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertCircleElement=void 0;var o=n(1313),s=n(6091),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._C=e,r._D=n,r.AP=e.AP,r.Center=new s.PointElement({AP:r.AP}),r.A=r.Center,r.B=new s.PointElement({AP:r.AP}),r}return i(e,t),e.prototype.update=function(){var t=this._C.Center.distance2(this._D.Center),e=this._C.radius2,n=this._D.radius2/(t-e);this.Center.to(this._C.Center).minus(this._D.Center).times(n).plus(this._D.Center),n=1+Math.sqrt(e/t),this.B.to(this.Center).minus(this._D.Center).times(n).plus(this._D.Center)},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n)},e}(o.CircleElement);e.InvertCircleElement=a},8157(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereIntersectionElement=void 0;var o=n(1313),s=n(6091),a=n(103),l=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._S=e,r._T=n,r.Center=r.A=new s.PointElement,r.B=new s.PointElement,r.AP=new a.PerpendicularPlane({A:r.Center,E:n.Center}),r.Center._AP=r.AP,r}return i(e,t),e.prototype.update=function(){var t=this._T.Center.distance2(this._S.Center),e=this._T.radius2(),n=.5+(e-this._S.radius2())/(2*t);this.Center.to(this._S.Center).minus(this._T.Center).times(n).plus(this._T.Center);var r=Math.sqrt(e-this.Center.distance2(this._T.Center));this.B.to(this.Center),this.B.z+=r,this.AP.update()},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e),this.AP.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n),this.AP.rotate(t,e,n)},e}(o.CircleElement);e.SphereIntersectionElement=l},4580(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.GroupCloneAsideAnimation=void 0;var o=n(7233),s=n(8020),a=n(6091),l=n(2145),u=n(7091),c=n(4610);function h(t){var e=function(t){var e=new a.PointElement;return e.x=t.x,e.y=t.y,e.z=t.z,e};if(t instanceof u.PolygonElement){for(var n=new u.PolygonElement,r=[],i=0,o=t.V;i<o.length;i++){var s=e(o[i]);n.V.push(s),r.push({pt:s,bx:s.x,by:s.y})}return n.edgeColor=t.edgeColor,n.faceColor=t.faceColor,n.faceAlpha=t.faceAlpha,n.nameColor=t.nameColor,n.vertexColor=t.vertexColor,{ghost:n,pts:r}}if(t instanceof l.LineElement){var c=e(t.A),h=e(t.B);return(n=new l.LineElement({A:c,B:h})).edgeColor=t.edgeColor,n.nameColor=t.nameColor,{ghost:n,pts:[{pt:c,bx:c.x,by:c.y},{pt:h,bx:h.x,by:h.y}]}}return t instanceof a.PointElement?((s=e(t)).vertexColor=t.vertexColor,s.nameColor=t.nameColor,null!=t.name&&(s.name=t.name),{ghost:s,pts:[{pt:s,bx:s.x,by:s.y}]}):null}function p(t,e){for(var n=[],r=[],i=0,o=t;i<o.length;i++){var s=o[i],a=h(s);if(null!=a){n.push(a.ghost);for(var l=0,u=a.pts;l<u.length;l++){var c=u[l];r.push(c)}}else e.reportDiagnostic({code:"unsupported-element",key:String(s.name),message:"Group.cloneAside: skipping unsupported element type ("+s.name+")",detail:{animation:"Group.cloneAside",elem:String(s.name)}})}return{ghosts:n,pts:r}}function f(t,e){if(!e||null==e.elem||"number"!=typeof e.to)return null;var n=t.lookupElement(String(e.elem));if(!(n instanceof c.LineSlider))return null;var r=n.x,i=n.y,o=n.z,s=n._A,a=n._B;return n.x=s.x+(a.x-s.x)*e.to,n.y=s.y+(a.y-s.y)*e.to,n.z=s.z+(a.z-s.z)*e.to,t.update(),function(){n.x=r,n.y=i,n.z=o,t.update()}}function d(t){for(var e=1/0,n=-1/0,r=1/0,i=-1/0,o=0,s=t;o<s.length;o++){var a=s[o];a.bx<e&&(e=a.bx),a.bx>n&&(n=a.bx),a.by<r&&(r=a.by),a.by>i&&(i=a.by)}return{minX:e,maxX:n,minY:r,maxY:i}}function y(t,e){return Math.abs(t)>=Math.abs(e)?t<0?"left":"right":e<0?"top":"bottom"}var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.GROUP_CLONE_ASIDE,e.name="Group.cloneAside",e.elementType=s.GeomElement,e}return i(e,t),e.prototype.build=function(t,e,n){var r=n&&n.include,i=n&&!0===n.autoPlace,o=function(t,e){var n=[];if(Array.isArray(e))for(var r=0,i=e;r<i.length;r++){var o=i[r];null!=(l=t.lookupElement(String(o)))&&n.push(l)}else for(var s=0,a=t.elements;s<a.length;s++){var l;null!=(l=a[s]).name&&l.visible&&!l.name.startsWith("screen")&&n.push(l)}return n}(e,r);return i?[this._autoPlaceStep(t,e,n,o)]:[this._legacyStep(t,e,n,o)]},e.prototype._autoPlaceStep=function(t,e,n,r){var i=n&&"number"==typeof n.dx?n.dx:0,o=n&&"number"==typeof n.dy?n.dy:0,s=Array.isArray(n&&n.variants)&&n.variants.length>0?n.variants:[{vary:n&&n.vary,prefer:y(i,o)}],a=0,l=0,u=0,c=0,h=!1,_=[],g=function(t){if(h){var n,r=(n=Math.min(1,t/.4),1-Math.pow(1-n,3)),i=Math.max(0,Math.min(1,(t-.4)/.6));e.setViewOffset(u+(a-u)*r,c+(l-c)*r);for(var o=0,s=_;o<s.length;o++)for(var p=s[o],f=0,d=p.pts;f<d.length;f++){var y=d[f];y.pt.x=y.bx+p.edx*i,y.pt.y=y.by+p.edy*i}}};return{durationMs:900,setup:function(){t.drawProgress=1,t.visible=!0;var n=e.displayWidth,i=e.displayHeight;if(n&&i){for(var o=[],y=0,g=s;y<g.length;y++){var v=g[y],m=f(e,v&&v.vary),P=p(r,e);m&&m(),0!==P.pts.length&&o.push({ghosts:P.ghosts,pts:P.pts,bbox:d(P.pts),prefer:v&&v.prefer})}if(0!==o.length){u=e.viewOffsetX,c=e.viewOffsetY;var C=null!=e.centringBounds?e.centringBounds:e.figureBounds();if(null!=C){var b=C.maxX-C.minX,w=C.maxY-C.minY,x=(C.minX+C.maxX)/2,E=(C.minY+C.maxY)/2;a=n/2-x,l=i/2-E;for(var A=function(t,e){var r=e.maxX-e.minX,o=e.maxY-e.minY,s=(e.minX+e.maxX)/2,u=(e.minY+e.maxY)/2;if("left"===t||"right"===t){if(o>i-16)return null;var c="left"===t?n/2-b/2-16:n/2+b/2+16,h="left"===t?8:n-8;return Math.abs(h-c)<r?null:[(c+h)/2-a-s,E-u]}if(r>n-16)return null;var p="top"===t?i/2-w/2-16:i/2+w/2+16,f="top"===t?8:i-8;return Math.abs(f-p)<o?null:[x-s,(p+f)/2-l-u]},S=["left","right","top","bottom"],O=new Set,M=[],T=function(t){for(var e=o[t],n=e.prefer||S[t%S.length],r=null,i=0,s=[n].concat(S.filter((function(t){return t!==n})));i<s.length;i++){var a=s[i];if(!O.has(a)&&null!=(r=A(a,e.bbox))){O.add(a);break}}if(null==r)return{value:void 0};M.push({pts:e.pts,edx:r[0],edy:r[1]})},j=0;j<o.length;j++){var k=T(j);if("object"==typeof k)return k.value}for(var L=0,B=o;L<B.length;L++)for(var z=0,I=B[L].ghosts;z<I.length;z++){var N=I[z];e.addEphemeral(N)}_=M,h=!0}}}},tick:function(t){g(t)},finalise:function(){g(1)}}},e.prototype._legacyStep=function(t,e,n,r){var i=n&&"number"==typeof n.dx?n.dx:0,o=n&&"number"==typeof n.dy?n.dy:0,s=n&&n.vary,a=Math.max(200,Math.hypot(i,o)/.4),l=[],u=i,c=o,h=!1,y=function(t){for(var e=0,n=l;e<n.length;e++){var r=n[e];r.pt.x=r.bx+u*t,r.pt.y=r.by+c*t}};return{durationMs:a,setup:function(){t.drawProgress=1,t.visible=!0;var n=f(e,s),a=p(r,e);n&&n();var y=a.ghosts,_=a.pts;if(0!==y.length){var g=d(_),v=g.maxX-g.minX,m=g.maxY-g.minY,P=e.displayWidth,C=e.displayHeight;if(!(P&&P<520)){u=i,c=o,P&&C&&(g.minX+u<6&&(u=6-g.minX),g.maxX+u>P-6&&(u=P-6-g.maxX),g.minY+c<6&&(c=6-g.minY),g.maxY+c>C-6&&(c=C-6-g.maxY));if(Math.abs(u)>=v+8||Math.abs(c)>=m+8||0===v&&0===m){for(var b=0,w=y;b<w.length;b++){var x=w[b];e.addEphemeral(x)}l=_,h=!0}}}},tick:function(t){h&&y(t)},finalise:function(){h&&y(1)}}},e}(o.Animation);e.GroupCloneAsideAnimation=_,(0,o.registerAnimation)(new _)},5002(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Bichord=void 0;var o=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new s.PointElement,n._B=new s.PointElement,n.C=e.C,n.D=e.D,n._A._AP=n.C.AP,n._B._AP=n.C.AP),n}return i(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){var t=this.C.radius,e=this.D.radius,n=this.C.Center.distance(this.D.Center);if(n>t+e){var r=NaN;return this.A.x=r,this.A.y=r,this.A.z=r,this.B.x=r,this.B.y=r,void(this.B.z=r)}var i=(n*n+t*t-e*e)/(2*n*t),o=Math.sqrt(1-i*i);this.A.to(this.D.Center).toCircle(this.C),this.B.to(this.A),this.A.rotate(this.C.Center,i,o,this.C.AP),this.B.rotate(this.C.Center,i,-o,this.C.AP)},e}(o.LineElement);e.Bichord=a},1549(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Chord=void 0;var o=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n.C=e.C,n.D=e.D,n.E=e.E,n._A=new s.PointElement({AP:n.C.AP}),n._B=new s.PointElement({AP:n.C.AP})),n}return i(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){this._B.to(this.C.Center).toLine(this.D,this.E,!1);var t=this.C.Center.distance2(this._B),e=this.C.radius2;if(t>e){var n=NaN;return this._A.x=n,this._A.y=n,this._A.z=n,this._B.x=n,this._B.y=n,void(this._B.z=n)}var r=Math.sqrt(e-t),i=r/this.D.distance(this._B);i<1e10?this._A.to(this.D).minus(this._B).times(i).plus(this._B):(i=r/this.E.distance(this._B),this._A.to(this.E).minus(this._B).times(i).plus(this._B)),this._B.times(2).minus(this._A)},e}(o.LineElement);e.Chord=a},1910(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineStraightEdgeExtendAnimation=e.LineStraightEdgeConnectAnimation=void 0;var o=n(7233),s=n(2145);function a(t,e){var n=t.B.x-t.A.x,r=t.B.y-t.A.y,i=Math.sqrt(n*n+r*r);return{durationMs:Math.max(120,i/e),tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}}var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.LINE_STRAIGHT_EDGE_CONNECT,e.name="Line.straightEdgeConnect",e.elementType=s.LineElement,e.defaultRate=.25,e}return i(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(o.Animation);e.LineStraightEdgeConnectAnimation=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.LINE_STRAIGHT_EDGE_EXTEND,e.name="Line.straightEdgeExtend",e.elementType=s.LineElement,e.defaultRate=.25,e}return i(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(o.Animation);e.LineStraightEdgeExtendAnimation=u,(0,o.registerAnimation)(new l),(0,o.registerAnimation)(new u)},7339(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.lineConstructions=e.PolylineConstruction=e.MeanProportionalLineConstruction=e.ProportionLineConstruction=e.SimilarLineConstruction=e.LineParallelConstruction=e.LineExtendConstruction=e.LineCutoffConstruction=e.LinePerpendicular5Construction=e.LinePerpendicular4Construction=e.LinePerpendicular3Construction=e.LinePerpendicular2Construction=e.LinePerpendicular1Construction=e.BichordConstruction=e.ChordConstruction=e.PlaneFootLineConstruction=e.LineFootConstruction=e.AngleDividerLineConstruction=e.AngleBisectorLineConstruction=e.LineConnectConstruction=void 0;var o=n(7658),s=n(4461),a=n(1313),l=n(6055),u=n(2090),c=n(6921),h=n(3703),p=n(2145),f=n(3103),d=n(5002),y=n(1549),_=n(5014),g=n(9535),v=n(9237),m=n(3219),P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.connect,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new p.LineElement({A:e[0],B:e[1]});return[[i],i]},e}(o.Construction);e.LineConnectConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new v.AngleDividerElement(e[0],e[1],e[2],i,2),s=new p.LineElement({A:e[1],B:o});return[[o,s],s]},e}(o.Construction);e.AngleBisectorLineConstruction=C;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new v.AngleDividerElement(e[0],e[1],e[2],i,r[0]),s=new p.LineElement({A:e[1],B:o});return[[o,s],s]},e}(o.Construction);e.AngleDividerLineConstruction=b;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new c.Foot(e[0],e[1],e[2]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.LineFootConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new h.PlaneFootElement(e[0],n[0]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.PlaneFootLineConstruction=x;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.chord,e.signature={points:2,elements:1,integers:0,elementTypes:[a.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new y.Chord({D:e[0],E:e[1],C:n[0]});return[[i],i]},e}(o.Construction);e.ChordConstruction=E;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.bichord,e.signature={points:0,elements:2,integers:0,elementTypes:[a.CircleElement,a.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new d.Bichord({C:n[0],D:n[1]});return[[i],i]},e}(o.Construction);function S(t){return[t[0],t[0][0]]}e.BichordConstruction=A;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular1Construction);e.LinePerpendicular1Construction=O;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular2Construction);e.LinePerpendicular2Construction=M;var T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular3Construction);e.LinePerpendicular3Construction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular4Construction);e.LinePerpendicular4Construction=j;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.perpendicular,e}return i(e,t),e.prototype.construct=function(e,n,r,i){return S(t.prototype.construct.call(this,e,n,r,i))},e}(s.PointPerpendicular5Construction);e.LinePerpendicular5Construction=k;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.cutoff,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.Layoff(e[0],e[0],e[1],e[2],e[3]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.LineCutoffConstruction=L;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.extend,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.Layoff(e[1],e[0],e[1],e[2],e[3]),o=new p.LineElement({A:e[1],B:i});return[[i,o],o]},e}(o.Construction);e.LineExtendConstruction=B;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.parallel,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.Layoff(e[0],e[1],e[2],e[1],e[2]),o=new p.LineElement({A:e[0],B:i});return[[i,o],o]},e}(o.Construction);e.LineParallelConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=n.length>1?n[1]:t,s=new _.SimilarElement(e[0],e[1],i,e[2],e[3],e[4],o),a=new p.LineElement({A:e[0],B:s});return[[s,a],a]},e}(o.Construction);e.SimilarLineConstruction=I;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new g.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),o=new p.LineElement({A:e[6],B:i});return[[i,o],o]},e}(o.Construction);e.ProportionLineConstruction=N;var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new m.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]),o=new p.LineElement({A:e[4],B:i});return[[i,o],o]},e}(o.Construction);e.MeanProportionalLineConstruction=R;var D=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.LineConstructions.path,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(0===e.E.length&&0===e.N.length&&e.P.length>=2)},e.prototype.construct=function(t,e,n,r){var i=new f.PolylineElement(e.slice());return[[i],i]},e}(o.Construction);e.PolylineConstruction=D,e.lineConstructions=[new D,new P,new B,new O,new M,new T,new j,new k,new A,new E,new z,new L,new x,new w,new I,new N,new C,new b,new R]},2145(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,n._A=e&&e.A||null,n._B=e&&e.B||null,n}return i(e,t),Object.defineProperty(e.prototype,"A",{get:function(){return this._A},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return this._B},enumerable:!1,configurable:!0}),e.prototype.drawEdge=function(t,e){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e)){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale;var i=this.drawProgress,s=this._A.x+(this._B.x-this._A.x)*i,a=this._A.y+(this._B.y-this._A.y)*i;n.beginPath(),n.moveTo(this._A.x,this._A.y),n.lineTo(s,a),n.stroke()}},e.prototype.drawFace=function(t){},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&null!=this._A&&this._A.defined()&&null!=this._B&&this._B.defined()){var e=Math.round((this._A.x+this._B.x)/2),n=Math.round((this._A.y+this._B.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(o.GeomElement);e.LineElement=s},6279(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Perpendicular=void 0;var o=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._P=e.P,n._A=new o.PointElement({AP:e.P}),n._B=new o.PointElement({AP:e.P}),n._C=e.C,n._D=e.D,n._E=e.E,n._F=e.F),n}return i(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.to(this._D).minus(this._A);var t=o.PointElement.dot(this.B,this._P.S),e=o.PointElement.dot(this.B,this._P.T),n=Math.sqrt(this._E.distance2(this._F)/(t*t+e*e));t=-t/n,e/=n,this._B.x=e*this._P.S.x+t*this._P.T.x+this._A.x,this._B.y=e*this._P.S.y+t*this._P.T.y+this._A.y,this._B.z=e*this._P.S.z+t*this._P.T.z+this._A.z},e}(n(2145).LineElement);e.Perpendicular=s},3375(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlanePerpendicularLine=void 0;var o=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new o.PointElement({AP:e.P}),n._B=new o.PointElement,n._C=e.C,n._D=e.D,n._E=e.E,n._P=e.P),n}return i(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.toCross(this._P.S,this._P.T),this._B.times(this._D.distance(this._E)).plus(this._A)},e}(n(2145).LineElement);e.PlanePerpendicularLine=s},3103(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolylineElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,n.V=null==e?[]:e,n}return i(e,t),e.prototype.defined=function(){if(this.V.length<2)return!1;for(var t=0,e=this.V;t<e.length;t++){if(!e[t].defined())return!1}return!0},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(!(null==e||this.V.length<2)){var n=t.getContext("2d");n.beginPath(),n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale;var i=this.V.length-1,s=this.drawProgress*i,a=Math.floor(s),l=s-a;n.moveTo(this.V[0].x,this.V[0].y);for(var u=0;u<a;u++){var c=this.V[u+1];n.lineTo(c.x,c.y),n.stroke()}if(l>0&&a<i){var h=this.V[a];c=this.V[a+1];n.lineTo(h.x+(c.x-h.x)*l,h.y+(c.y-h.y)*l),n.stroke()}}}},e.prototype.drawFace=function(t){},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined())for(var e=0,n=this.V;e<n.length;e++){n[e].drawVertex(t,this.vertexColor)}},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,i=this.V;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}var s=this.V.length,a=t.getContext("2d"),l=this._getTextMetrics(a,this._name),u=l[0],c=l[1];a.beginPath(),a.fillStyle=this.nameColor,a.fillText(this._name,e/s-u/2,n/s+c/4)}},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(o.GeomElement);e.PolylineElement=s},9362(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ParallelPlane=void 0;var o=n(6055),s=n(6091),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._P=e,r.A=n,r.B=new s.PointElement,r.C=new s.PointElement,r.S=e.S,r.T=e.T,r.U=e.U,r}return i(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(t,e,n){this.B.rotate(t,e,n),this.C.rotate(t,e,n)},e.prototype.update=function(){this.B.to(this._P.B).minus(this._P.A).plus(this.A),this.C.to(this._P.C).minus(this._P.A).plus(this.A)},e}(o.PlaneElement);e.ParallelPlane=a},103(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PerpendicularPlane=void 0;var o=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.A=e.A,n.E=e.E,n.B=new o.PointElement({AP:n}),n.C=new o.PointElement({AP:n}),n.S=new o.PointElement,n.T=new o.PointElement,n}return i(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(e,n,r){this.B.rotate(e,n,r),this.C.rotate(e,n,r),t.prototype.update.call(this)},e.prototype.update=function(){this.U=o.PointElement.difference(this.E,this.A);var t=this.U.length();this.U.times(1/t);var e=Math.sqrt(this.U.x*this.U.x+this.U.y*this.U.y);e>=1e-6?(this.S.x=-this.U.y/e,this.S.y=this.U.x/e,this.T.toCross(this.U,this.S)):(this.S.x=1,this.S.y=0,this.S.z=0,this.T.x=0,this.T.y=1,this.T.z=0),this.B.to(this.S).times(t).plus(this.A),this.C.to(this.T).times(t).plus(this.A)},e}(n(6055).PlaneElement);e.PerpendicularPlane=s},5193(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.planeConstructions=e.AmbientPlaneCircleConstruction=e.AmbientPlanePointConstruction=e.PlaneParallelConstruction=e.PerpendicularPlaneConstruction=e.Plane3PointsConstruction=void 0;var o=n(7658),s=n(1313),a=n(6055),l=n(103),u=n(9362),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.threePoints,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.PlaneElement({A:e[0],B:e[1],C:e[2]});return[[i],i]},e}(o.Construction);e.Plane3PointsConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.perpendicular,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new l.PerpendicularPlane({A:e[0],E:e[1]});return[[i],i]},e}(o.Construction);e.PerpendicularPlaneConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.parallel,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.ParallelPlane(n[0],e[0]);return[[i],i]},e}(o.Construction);e.PlaneParallelConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.ambient,e.signature={points:1,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[e[0]._AP],e[0]._AP]},e}(o.Construction);e.AmbientPlanePointConstruction=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PlaneConstructions.ambient,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=n[0];return[[i.AP],i.AP]},e}(o.Construction);e.AmbientPlaneCircleConstruction=d,e.planeConstructions=[new c,new h,new p,new f,new d]},6055(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneElement=void 0;var o=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n.isScreen=!1,null!=e&&(n.A=e.A,n.B=e.B,n.C=e.C,n.S=new s.PointElement,n.T=new s.PointElement,n.U=new s.PointElement),n}return i(e,t),e.prototype.defined=function(){return null!=this.A&&null!=this.B&&null!=this.C},e.prototype.drawEdge=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,r),e.lineTo(this.C.x,this.C.y),e.closePath(),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,r),e.lineTo(this.C.x,this.C.y),e.closePath(),e.fill(),e.restore()}},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){var e=Math.round((this.B.x+this.C.x)/2),n=Math.round((this.B.y+this.C.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined()){var e=t.getContext("2d"),n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.fillStyle=this.vertexColor,e.arc(n,r,2,0,2*Math.PI,!1),e.fill()}},e.prototype.rotate=function(t,e,n){this.update()},e.prototype.translate=function(t,e){},e.prototype.update=function(){!this.isScreen||0==this.A.z&&0==this.B.z&&0==this.C.z||(this.isScreen=!1),this.S.to(this.B).minus(this.A),this.T.to(this.C).minus(this.A),this.S.times(1/this.S.length());var t=s.PointElement.dot(this.T,this.S);this.T.x-=t*this.S.x,this.T.y-=t*this.S.y,this.T.z-=t*this.S.z,this.T.times(1/this.T.length()),this.U.toCross(this.S,this.T)},e}(o.GeomElement);e.PlaneElement=a},9237(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AngleDividerElement=void 0;var o=function(t){function e(e,n,r,i,o){var s=t.call(this)||this;return s.dimension=0,s._A=n,s._B=e,s._C=r,s._AP=i,s._n=o,s}return i(e,t),e.prototype.update=function(){var t=this._A.angle(this._B,this._C,this._AP)/this._n,e=Math.cos(t),n=Math.sin(t);this._AP.isScreen?(this._x=this._A.x+e*(this._B.x-this._A.x)-n*(this._B.y-this._A.y),this._y=this._A.y+n*(this._B.x-this._A.x)+e*(this._B.y-this._A.y),this._z=0):this.to(this._B).rotate(this._A,e,n,this._AP),this.toIntersection(this,this._A,this._B,this._C,this._AP)},e}(n(6091).PointElement);e.AngleDividerElement=o},788(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleSlider=void 0;var o=n(6091),s=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s._newP=new o.PointElement,s.dimension=0,s.draggable=!0,s._C=e,s._x=n,s._initx=n,s._y=r,s._inity=r,s._z=i,s._initz=i,s}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toCircle(this._C)},e.prototype.update=function(){this.toCircle(this._C)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._C.AP),this._newP.defined()||this._newP.to(this).toPlane(this._C.AP),this._newP.toSphere(this._C.Center,this._C.radius),!((this._newP.x-this.x)*(this._newP.x-this.x)+(this._newP.y-this.y)*(this._newP.y-this.y)<.5)&&(this.to(this._newP),!0)},e}(o.PointElement);e.CircleSlider=s},6401(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FixedPoint=void 0;var o=function(t){function e(e){var n=t.call(this,e)||this;return n._initx=n._x,n._inity=n._y,n._initz=n._z,n}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz},e}(n(6091).PointElement);e.FixedPoint=o},6921(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Foot=void 0;var o=function(t){function e(e,n,r){var i=t.call(this)||this;return i.dimension=0,i._A=e,i._B=n,i._C=r,i._B.AP==i._C.AP&&(i._AP=i._B.AP),i}return i(e,t),e.prototype.update=function(){this.to(this._A).toLine(this._B,this._C,!1)},e}(n(6091).PointElement);e.Foot=o},7876(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.HarmonicElement=void 0;var o=n(6091),s=function(t){function e(e,n,r){var i=t.call(this)||this;return i.dimension=0,i._B=e,i._C=n,i._D=r,i._E=new o.PointElement,i._F=new o.PointElement,i._M=new o.PointElement,i}return i(e,t),e.prototype.update=function(){if(0===this._B.z&&0===this._C.z&&0===this._D.z){var t=this._B.x-this._C.x,e=this._B.y-this._C.y,n=this._B.x-this._D.x,r=this._B.y-this._D.y,i=this._C.x*n-this._C.y*r,s=this._C.x*r+this._C.y*n,a=this._D.x*t-this._D.y*e,l=this._D.x*e+this._D.y*t,u=(n+t)*(n+t)+(r+e)*(r+e),c=(i+a)*(n+t)+(s+l)*(r+e),h=-(i+a)*(r+e)+(s+l)*(n+t);this._x=c/u,this._y=h/u}else{this._M.to(this._C).plus(this._D).times(.5),this._F.to(this._C).minus(this._M),this._E.to(this._B).minus(this._M);var p=1/this._E.length2(),f=this._F.length2();this.to(this._F).times(2*o.PointElement.dot(this._E,this._F)).minus(this._E.times(f)).times(p).plus(this._M)}},e}(o.PointElement);e.HarmonicElement=s},7832(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Intersection=void 0;var o=function(t){function e(e,n,r,i,o){var s=t.call(this,{AP:o})||this;return s.dimension=0,s.A=e,s.B=n,s.C=r,s.D=i,s}return i(e,t),e.prototype.update=function(){this.toIntersection(this.A,this.B,this.C,this.D,this.AP)},e}(n(6091).PointElement);e.Intersection=o},6015(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertPointElement=void 0;var o=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._C=n,r._AP=n.AP,r}return i(e,t),e.prototype.update=function(){this.toInvertPoint(this._A,this._C)},e}(n(6091).PointElement);e.InvertPointElement=o},2090(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Layoff=void 0;var o=function(t){function e(e,n,r,i,o){var s=t.call(this)||this;return s.dimension=0,s._A=e,s._C=n,s._D=r,s._E=i,s._F=o,e.AP==n.AP&&e.AP==r.AP&&(s._AP=e.AP),s}return i(e,t),e.prototype.update=function(){var t=this._E.distance(this._F)/this._C.distance(this._D);this.to(this._D).minus(this._C),this.times(t).plus(this._A)},e}(n(6091).PointElement);e.Layoff=o},4610(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineSlider=void 0;var o=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.dimension=0,a.draggable=!0,a._A=e,a._B=n,a._x=r,a._initx=r,a._y=i,a._inity=i,a._z=o,a._initz=o,a._segment=s,a._A.AP==a._B.AP&&(a._AP=a._A.AP),a}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toLine(this._A,this._B,this._segment)},e.prototype.update=function(){this.toLine(this._A,this._B,this._segment)},e.prototype.drag=function(t,e){t-=this._A.x,e-=this._A.y;var n=this._B.x-this._A.x,r=this._B.y-this._A.y,i=(t*n+e*r)/(n*n+r*r);return this._segment&&(i<0?i=0:i>1&&(i=1)),t=this._A.x+n*i,e=this._A.y+r*i,!((t-this._x)*(t-this._x)+(t-this._y)*(t-this._y)<.5)&&(this._x=t,this._y=e,this._z=this._A.z+(this._B.z-this._A.z)*i,!0)},e}(n(6091).PointElement);e.LineSlider=o},3219(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MeanProportionalElement=void 0;var o=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.dimension=0,a._S0=e,a._S1=n,a._T0=r,a._T1=i,a._U0=o,a._U1=s,o._AP===s._AP&&(a._AP=o._AP),a}return i(e,t),e.prototype.update=function(){var t=Math.sqrt(this._S0.distance2(this._S1)*this._T0.distance2(this._T1));t=Math.sqrt(t/this._U0.distance2(this._U1)),this.to(this._U1).minus(this._U0),this.times(t).plus(this._U0)},e}(n(6091).PointElement);e.MeanProportionalElement=o},489(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Midpoint=void 0;var o=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._B=n,r._A.AP==r._B.AP&&(r._AP=r._A.AP),r}return i(e,t),e.prototype.update=function(){this._x=(this._A.x+this._B.x)/2,this._y=(this._A.y+this._B.y)/2,this._z=(this._A.z+this._B.z)/2},e}(n(6091).PointElement);e.Midpoint=o},3703(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneFootElement=void 0;var o=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._AP=n,r}return i(e,t),e.prototype.update=function(){this.to(this._A).toPlane(this._AP)},e}(n(6091).PointElement);e.PlaneFootElement=o},2930(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneIntersection=void 0;var o=function(t){function e(e,n,r){var i=t.call(this)||this;return i.dimension=0,i._A=n,i._B=r,i._AP=e,i}return i(e,t),e.prototype.update=function(){this.toIntersectionPL(this._AP,this._A,this._B)},e}(n(6091).PointElement);e.PlaneIntersection=o},4994(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneSlider=void 0;var o=n(6091),s=function(t){function e(e,n,r,i){var s=t.call(this)||this;return s._newP=new o.PointElement,s.dimension=0,s.draggable=!0,s._AP=e,s._x=s._initx=n,s._y=s._inity=r,s._z=s._initz=i,s}return i(e,t),e.prototype.update=function(){this.toPlane(this._AP)},e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toPlane(this._AP)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._AP),this._newP.defined()?this.to(this._newP):this.toPlane(this._AP),!0},e}(o.PointElement);e.PlaneSlider=s},2872(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointSlideAnimation=e.PointAppearAnimation=void 0;var o=n(7233),s=n(6091),a=n(4610),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POINT_APPEAR,e.name="Point.appear",e.elementType=s.PointElement,e.defaultDurationMs=350,e}return i(e,t),e.prototype.build=function(t,e,n){return[{durationMs:this.defaultDurationMs,tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(o.Animation);e.PointAppearAnimation=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POINT_SLIDE,e.name="Point.slide",e.elementType=a.LineSlider,e.defaultDurationMs=650,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=n&&"number"==typeof n.to?n.to:null,o=n?"string"==typeof n.to?n.to:"string"==typeof n.toElement?n.toElement:null:null,a=0,l=0,u=0,c=0,h=0,p=0,f=function(t){r.x=a+(c-a)*t,r.y=l+(h-l)*t,r.z=u+(p-u)*t,e.update()};return[{durationMs:this.defaultDurationMs,setup:function(){r.drawProgress=1,r.visible=!0,a=r.x,l=r.y,u=r.z;var t,n=r._A,f=r._B,d=!!r._segment,y=f.x-n.x,_=f.y-n.y,g=f.z-n.z;if(null!=o){var v=e.lookupElement(o);if(null==v||!(v instanceof s.PointElement))return e.reportDiagnostic({code:"unresolvable-target",key:"Point.slide|"+String(o),message:'Point.slide: target "'.concat(o,'" is not a resolvable point \u2014 staying put'),detail:{animation:"Point.slide",to:String(o)}}),c=a,h=l,void(p=u);var m=y*y+_*_+g*g;t=m>1e-9?((v.x-n.x)*y+(v.y-n.y)*_+(v.z-n.z)*g)/m:0,d&&(t=Math.max(0,Math.min(1,t)))}else t=null!=i?i:1;c=n.x+y*t,h=n.y+_*t,p=n.z+g*t},tick:function(t){f(t)},finalise:function(){f(1),r.drawProgress=1,r.visible=!0}}]},e}(o.Animation);e.PointSlideAnimation=u,(0,o.registerAnimation)(new l),(0,o.registerAnimation)(new u)},4461(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.pointConstructions=e.VertexConstruction=e.HarmonicPointConstruction=e.LineSliderSegmentConstruction=e.FixedPointConstruction=e.AngleDividerPointConstruction=e.AngleBisectorPointConstruction=e.SphereSliderConstruction=e.PlaneSliderConstruction=e.MeanProportionalPointConstruction=e.InvertPointConstruction=e.ProportionPointConstruction=e.PointPerpendicular5Construction=e.PointPerpendicular4Construction=e.PointPerpendicular3Construction=e.PointPerpendicular2Construction=e.PointPerpendicular1Construction=e.PointPerpendicularConstruction=e.SimilarPointConstruction=e.ParallelogramConstruction=e.ExtendConstruction=e.CutoffConstruction=e.LayoffConstruction=e.PlaneFootPointConstruction=e.FootPointConstruction=e.CircumcenterConstruction=e.CircumcircleConstruction=e.CircleSliderConstruction=e.LineSliderConstruction=e.SphereCenterConstruction=e.CircleCenterConstruction=e.LastPointConstruction=e.FirstPointConstruction=e.PlaneIntersectionConstruction=e.IntersectionConstruction=e.MidPointConstruction=e.FreePointConstruction=void 0;var o=n(7658),s=n(1313),a=n(2218),l=n(6055),u=n(6401),c=n(4994),h=n(489),p=n(7832),f=n(2930),d=n(4610),y=n(2090),_=n(6921),g=n(3703),v=n(788),m=n(5014),P=n(9535),C=n(9237),b=n(3219),w=n(7876),x=n(6015),E=n(5089),A=n(6279),S=n(3375),O=n(2295),M=n(7091),T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.free,e.signature={points:0,elements:0,integers:2},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new c.PlaneSlider(t,r[0],r[1],0);return[[i],i]},e}(o.Construction);e.FreePointConstruction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.midpoint,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new h.Midpoint(e[0],e[1]);return[[i],i]},e}(o.Construction);e.MidPointConstruction=j;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.intersection,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(4===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new p.Intersection(e[0],e[1],e[2],e[3],i);return[[o],o]},e}(o.Construction);e.IntersectionConstruction=k;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.intersection,e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new f.PlaneIntersection(n[0],e[0],e[1]);return[[i],i]},e}(o.Construction);e.PlaneIntersectionConstruction=L;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.first,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],e[0]]},e}(o.Construction);e.FirstPointConstruction=B;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.last,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],e[1]]},e}(o.Construction);e.LastPointConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],n[0].Center]},e}(o.Construction);e.CircleCenterConstruction=I;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[O.SphereElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){return[[],n[0].Center]},e}(o.Construction);e.SphereCenterConstruction=N;var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.lineSlider,e.signature={points:2,elements:0,integers:2},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(2===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length))},e.prototype.construct=function(t,e,n,r){var i=this.createSlider(e[0],e[1],r[0],r[1],r.length>2?r[2]:0);return[[i],i]},e.prototype.createSlider=function(t,e,n,r,i){return new d.LineSlider(t,e,n,r,i,!1)},e}(o.Construction);e.LineSliderConstruction=R;var D=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.circleSlider,e.signature={points:0,elements:1,integers:2,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(0===e.P.length&&1===e.E.length&&(2===e.N.length||3===e.N.length)&&e.E[0]instanceof s.CircleElement)},e.prototype.construct=function(t,e,n,r){var i=new v.CircleSlider(n[0],r[0],r[1],r.length>2?r[2]:0);return[[i],i]},e}(o.Construction);e.CircleSliderConstruction=D;var V=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.CircleConstructions.circumcircle,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new a.CircumcircleElement(e[0],e[1],e[2],i);return[[o],o]},e}(o.Construction);e.CircumcircleConstruction=V;var H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.circumcenter,e}return i(e,t),e.prototype.construct=function(e,n,r,i){var o=t.prototype.construct.call(this,e,n,r,i),s=o[1];return o[0].push(s.Center),[o[0],s.Center]},e}(V);e.CircumcenterConstruction=H;var F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new _.Foot(e[0],e[1],e[2]);return[[i],i]},e}(o.Construction);e.FootPointConstruction=F;var G=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new g.PlaneFootElement(e[0],n[0]);return[[i],i]},e}(o.Construction);e.PlaneFootPointConstruction=G;var U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=this._createLayoff(e);return[[i],i]},e}(o.Construction);e.LayoffConstruction=U;var q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.cutoff,e}return i(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[0],t[0],t[1],t[2],t[3])},e}(U);e.CutoffConstruction=q;var W=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.extend,e}return i(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[1],t[0],t[1],t[2],t[3])},e}(U);e.ExtendConstruction=W;var Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new y.Layoff(e[0],e[1],e[2],e[1],e[2]);return[[i],i]},e}(o.Construction);e.ParallelogramConstruction=Y;var X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=n.length>1?n[1]:t,s=new m.SimilarElement(e[0],e[1],i,e[2],e[3],e[4],o);return[[s],s]},e}(o.Construction);e.SimilarPointConstruction=X;var K=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.perpendicular,e}return i(e,t),e}(o.Construction);e.PointPerpendicularConstruction=K;var J=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new A.Perpendicular({C:e[0],D:e[1],P:t,E:e[0],F:e[1]});return[[i],i.B]},e}(K);e.PointPerpendicular1Construction=J;var Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new A.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[0],F:e[1]});return[[i],i.B]},e}(K);e.PointPerpendicular2Construction=Q;var Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new A.Perpendicular({C:e[0],D:e[1],P:t,E:e[2],F:e[3]});return[[i],i.B]},e}(K);e.PointPerpendicular3Construction=Z;var $=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new A.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[2],F:e[3]});return[[i],i.B]},e}(K);e.PointPerpendicular4Construction=$;var tt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:3,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new S.PlanePerpendicularLine({C:e[0],P:n[0],D:e[1],E:e[2]});return[[i],i.B]},e}(K);e.PointPerpendicular5Construction=tt;var et=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new P.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]);return[[i],i]},e}(o.Construction);e.ProportionPointConstruction=et;var nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.invert,e.signature={points:1,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new x.InvertPointElement(e[0],n[0]);return[[i],i]},e}(o.Construction);e.InvertPointConstruction=nt;var rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new b.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]);return[[i],i]},e}(o.Construction);e.MeanProportionalPointConstruction=rt;var it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.planeSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[l.PlaneElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new c.PlaneSlider(n[0],r[0],r[1],r[2]);return[[i],i]},e}(o.Construction);e.PlaneSliderConstruction=it;var ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.sphereSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[O.SphereElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new E.SphereSliderElement(n[0],r[0],r[1],r[2]);return[[i],i]},e}(o.Construction);e.SphereSliderConstruction=ot;var st=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new C.AngleDividerElement(e[0],e[1],e[2],i,2);return[[o],o]},e}(o.Construction);e.AngleBisectorPointConstruction=st;var at=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new C.AngleDividerElement(e[0],e[1],e[2],i,r[0]);return[[o],o]},e}(o.Construction);e.AngleDividerPointConstruction=at;var lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.fixed,e.signature={points:0,elements:0,integers:2},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(0===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length))},e.prototype.construct=function(t,e,n,r){var i=new u.FixedPoint({x:r[0],y:r[1],z:r.length>2?r[2]:0});return[[i],i]},e}(o.Construction);e.FixedPointConstruction=lt;var ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.lineSegmentSlider,e}return i(e,t),e.prototype.createSlider=function(t,e,n,r,i){return new d.LineSlider(t,e,n,r,i,!0)},e}(R);e.LineSliderSegmentConstruction=ut;var ct=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.harmonic,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new w.HarmonicElement(e[0],e[1],e[2]);return[[i],i]},e}(o.Construction);e.HarmonicPointConstruction=ct;var ht=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PointConstructions.vertex,e.signature={points:0,elements:1,integers:1,elementTypes:[M.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=n[0].V[r[0]-1];return[[i],i]},e}(o.Construction);e.VertexConstruction=ht,e.pointConstructions=[new T,new lt,new B,new z,new I,new H,new j,new k,new F,new G,new W,new q,new Y,new X,new et,new st,new at,new rt,new it,new ot,new ct,new nt,new L,new N,new V,new R,new ut,new D,new J,new Q,new Z,new $,new tt,new ht]},6091(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=0,n._x=e&&e.x||0,n._y=e&&e.y||0,n._z=e&&e.z||0,n._AP=e&&e.AP||null,n}return i(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AP",{get:function(){return this._AP},set:function(t){this._AP=t},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!isNaN(this._x)&&!isNaN(this._y)&&!isNaN(this._z)&&null!=this._x&&null!=this._y&&null!=this._z},e.prototype.to=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this},e.prototype.plus=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this},e.prototype.minus=function(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this},e.prototype.times=function(t){return this._x*=t,this._y*=t,this._z*=t,this},e.difference=function(t,n){return new e({x:t.x-n.x,y:t.y-n.y,z:t.z-n.z,AP:null})},e.product=function(t,n){return new e({x:t*n.x,y:t*n.y,z:t*n.z,AP:null})},e.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},e.prototype.length2=function(){return this._x*this._x+this._y*this._y+this._z*this._z},e.prototype.length=function(){return Math.sqrt(this.length2())},e.prototype.distance2=function(t){return(this._x-t.x)*(this._x-t.x)+(this._y-t.y)*(this._y-t.y)+(this._z-t.z)*(this._z-t.z)},e.prototype.distance=function(t){return Math.sqrt(this.distance2(t))},e.prototype.toCross=function(t,e){return this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this},e.cross=function(t,n){return new e({x:t.y*n.z-t.z*n.y,y:t.z*n.x-t.x*n.z,z:t.x*n.y-t.y*n.x,AP:null})},e.triple=function(t,e,n){return t.x*(e.y*n.z-e.z*n.y)+e.x*(n.y*t.z-n.z*t.y)+n.x*(t.y*e.z-t.z*e.y)},e.prototype.toLine=function(t,n,r){var i=e.difference(n,t);this.minus(t);var o=e.dot(i,this)/i.length2();return r&&(o<0?o=0:o>1&&(o=1)),i.times(o),this.to(i).plus(t)},e.prototype.toPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=e.dot(this,t.S),r=e.dot(this,t.T);this.to(t.S).times(n).plus(e.product(r,t.T)).plus(t.A)}return this},e.prototype.uptoPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=t.S.x*t.T.y-t.S.y*t.T.x,r=(this.x*t.T.y-this.y*t.T.x)/n,i=(this.y*t.S.x-this.x*t.S.y)/n;this.to(t.S).times(r).plus(e.product(i,t.T)).plus(t.A)}return this},e.prototype.toCircumcenter=function(t,n,r){if(0==t.z&&0==n.z&&0==r.z){var i=((t.x-n.x)*(t.x+n.x)+(t.y-n.y)*(t.y+n.y))/2,o=((n.x-r.x)*(n.x+r.x)+(n.y-r.y)*(n.y+r.y))/2,s=(t.x-n.x)*(n.y-r.y)-(n.x-r.x)*(t.y-n.y);this._x=(i*(n.y-r.y)-o*(t.y-n.y))/s,this._y=(o*(t.x-n.x)-i*(n.x-r.x))/s,this._z=0}else{var a=e.difference(n,t),l=e.difference(r,t),u=e.dot(a,l),c=a.length2(),h=l.length2(),p=h*(c-u)/(s=2*(c*h-u*u)),f=c*(h-u)/s;this.to(t).plus(a.times(p)).plus(l.times(f))}return this},e.prototype.toCircle=function(t){if(t.AP.isScreen){var e=t.radius/this.distance(t.Center);this._x=t.Center.x+e*(this._x-t.Center.x),this._y=t.Center.y+e*(this._y-t.Center.y),this._z=0}else this.toPlane(t.AP),this.toSphere(t.Center,t.radius);return this},e.prototype.toSphere=function(t,e){var n=e/this.distance(t);return this._x=t.x+n*(this._x-t.x),this._y=t.y+n*(this._y-t.y),this._z=t.z+n*(this._z-t.z),this},e.area=function(t,n,r){var i=e.difference(n,t),o=e.difference(r,t);return this.cross(i,o).length()/2},e.prototype.angle=function(t,e,n){var r=t.x-this._x,i=e.x-this._x,o=t.y-this._y,s=e.y-this._y;if(n.isScreen)return Math.atan2(r*s-o*i,r*i+o*s);var a=t.z-this._z,l=e.z-this._z,u=r*n.S.x+o*n.S.y+a*n.S.z,c=r*n.T.x+o*n.T.y+a*n.T.z,h=i*n.S.x+s*n.S.y+l*n.S.z,p=i*n.T.x+s*n.T.y+l*n.T.z;return Math.atan2(u*p-c*h,u*h+c*p)},e.prototype.toIntersection=function(t,n,r,i,o){if(o.isScreen){var s=t.x*n.y-t.y*n.x,a=r.x*i.y-r.y*i.x,l=(n.y-t.y)*(r.x-i.x)-(t.x-n.x)*(i.y-r.y);this._x=(s*(r.x-i.x)-a*(t.x-n.x))/l,this._y=(a*(n.y-t.y)-s*(i.y-r.y))/l}else{var u=e.difference(t,o.A),c=e.difference(n,o.A),h=e.difference(r,o.A),p=e.difference(i,o.A),f=e.dot(u,o.S),d=e.dot(u,o.T),y=e.dot(c,o.S),_=e.dot(c,o.T),g=e.dot(h,o.S),v=e.dot(h,o.T),m=e.dot(p,o.S),P=e.dot(p,o.T),C=((s=f*_-d*y)*(g-m)-(a=g*P-v*m)*(f-y))/(l=(_-d)*(g-m)-(f-y)*(P-v)),b=(a*(_-d)-s*(P-v))/l;this.to(o.S).times(C).plus(e.product(b,o.T)).plus(o.A)}return this},e.prototype.toIntersectionPL=function(t,n,r){this.to(r).minus(n);var i=e.difference(n,t.A),o=-e.triple(t.S,t.T,i)/e.triple(t.S,t.T,this);return this.times(o).plus(n)},e.prototype.toInvertPoint=function(t,e){var n=e.radius2/t.distance2(e.Center);return this.to(t).minus(e.Center).times(n).plus(e.Center)},e.prototype.toSimilar=function(t,n,r,i,o,s,a){var l=i.angle(o,s,a),u=Math.cos(l),c=Math.sin(l),h=i.distance(s)/i.distance(o);if(r.isScreen)this._x=n.x,this._y=n.y,this.rotate(t,u,c,r),this._x=t.x+h*(this._x-t.x),this._y=t.y+h*(this._y-t.y),this._z=0;else{var p=e.difference(n,t),f=e.dot(p,r.S),d=e.dot(p,r.T),y=h*(u*f-c*d),_=h*(c*f+u*d);this._x=y*r.S.x+_*r.T.x+t.x,this._y=y*r.S.y+_*r.T.y+t.y,this._z=y*r.S.z+_*r.T.z+t.z}return this},e.prototype.rotate=function(t,n,r,i){if(null==i&&(i=t._AP),this!=t)if(i.isScreen){var o=this.x-t.x,s=this.y-t.y;this._x=t.x+n*o-r*s,this._y=t.y+r*o+n*s}else{this.minus(t);var a=i.S,l=i.T,u=i.U,c=e.dot(this,a),h=e.dot(this,l),p=e.dot(this,u),f=n*c-r*h,d=r*c+n*h;this._x=t.x+f*a.x+d*l.x+p*u.x,this._y=t.y+f*a.y+d*l.y+p*u.y,this._z=t.z+f*a.z+d*l.z+p*u.z}},e.prototype.drawName=function(t){this.visible&&(this.drawProgress<1||null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this.x),Math.round(this.y),t))},e.prototype.drawVertex=function(t,e){if(this.visible){var n=t.getContext("2d");if(null==e&&(e=this.emphasized||this.shouldHighlight?this.vertexHighlightColor:this.vertexColor),null!=e){var r=this.shouldHighlight?4:2,i=r+this.emphasisAmount*(6-r);(i*=this.drawProgress*o.GeomElement.styleScale)<.5||(n.beginPath(),n.fillStyle=e,n.arc(this._x,this._y,i,0,2*Math.PI,!1),n.fill())}}},e.prototype.translate=function(t,e){this._x+=t,this._y+=e},e.prototype.update=function(){},e.prototype.drawEdge=function(t){},e.prototype.drawFace=function(t){},e}(o.GeomElement);e.PointElement=s},9535(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ProportionElement=void 0;var o=function(t){function e(e,n,r,i,o,s,a,l){var u=t.call(this)||this;return u.dimension=0,u._S0=e,u._S1=n,u._T0=r,u._T1=i,u._U0=o,u._U1=s,u._V0=a,u._V1=l,a._AP===l._AP&&(u._AP=a._AP),u}return i(e,t),e.prototype.update=function(){var t=this._T0.distance2(this._T1)*this._U0.distance2(this._U1)/(this._S0.distance2(this._S1)*this._V0.distance2(this._V1));t=Math.sqrt(t),this.to(this._V1).minus(this._V0),this.times(t).plus(this._V0)},e}(n(6091).PointElement);e.ProportionElement=o},5014(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimilarElement=void 0;var o=function(t){function e(e,n,r,i,o,s,a){var l=t.call(this)||this;return l.dimension=0,l._parentA=e,l._parentB=n,l._AP=r,l._D=i,l._E=o,l._F=s,l._Q=a,l}return i(e,t),e.prototype.update=function(){this.toSimilar(this._parentA,this._parentB,this._AP,this._D,this._E,this._F,this._Q)},e}(n(6091).PointElement);e.SimilarElement=o},5089(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereSliderElement=void 0;var o=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.dimension=0,o.draggable=!0,o._S=e,o._x=o._initx=n,o._y=o._inity=r,o._z=o._initz=i,o}return i(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toSphere(this._S.Center,this._S.radius())},e.prototype.update=function(){this.toSphere(this._S.Center,this._S.radius())},e.prototype.drag=function(t,e){var n=(this._S.Center.x-t)*(this._S.Center.x-t)+(this._S.Center.y-e)*(this._S.Center.y-e),r=this._S.radius2();if(n<=r)this._x=t,this._y=e,this._z>this._S.Center.z?this._z=this._S.Center.z+Math.sqrt(r-n):this._z=this._S.Center.z-Math.sqrt(r-n);else{t-=this._S.Center.x,e-=this._S.Center.y;var i=Math.sqrt((t*t+e*e)/r);if(t=t/i+this._S.Center.x,e=e/i+this._S.Center.y,(t-this._x)*(t-this._x)+(e-this._y)*(e-this._y)<.5)return!1;this._x=t,this._y=e,this._z=this._S.Center.z}return!0},e}(n(6091).PointElement);e.SphereSliderElement=o},2563(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationElement=void 0;var o=n(7091),s=n(6091),a=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.dimension=2,o._P=e,o._C=i,o.V=new Array(4),o.V[0]=n,o.V[1]=r,o.V[2]=new s.PointElement,o.V[3]=new s.PointElement,n._AP===r._AP&&n._AP===i._AP&&(o.V[2]._AP=n._AP,o.V[3]._AP=n._AP),o}return i(e,t),e.prototype.translate=function(t,e){this.V[2].translate(t,e),this.V[3].translate(t,e)},e.prototype.rotate=function(t,e,n){this.V[2].rotate(t,e,n),this.V[3].rotate(t,e,n)},e.prototype.update=function(){var t=this._P.area()/(2*s.PointElement.area(this.V[0],this.V[1],this._C));t=Math.abs(t),this.V[3].x=this.V[0].x+t*(this._C.x-this.V[0].x),this.V[3].y=this.V[0].y+t*(this._C.y-this.V[0].y),this.V[3].z=this.V[0].z+t*(this._C.z-this.V[0].z),this.V[2].x=this.V[1].x+this.V[3].x-this.V[0].x,this.V[2].y=this.V[1].y+this.V[3].y-this.V[0].y,this.V[2].z=this.V[1].z+this.V[3].z-this.V[0].z},e}(o.PolygonElement);e.ApplicationElement=a},4458(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CurvedTriangleElement=void 0;var o=n(8020),s=n(1313),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=1,r._vertices=e,r._sides=n,r}return i(e,t),e.prototype.update=function(){},e._onCircle=function(t,e){var n=e.radius;return Math.abs(t.distance(e.Center)-n)<=Math.max(.5,.001*n)},e._onLine=function(t,e){var n=e.A.x,r=e.A.y,i=e.B.x-n,o=e.B.y-r,s=Math.hypot(i,o);return 0!==s&&Math.abs((t.x-n)*o-(t.y-r)*i)/s<=Math.max(.5,.001*s)},e.prototype.defined=function(){var t=this._vertices.length;if(t<3||this._sides.length!==t)return!1;for(var n=0,r=this._vertices;n<r.length;n++){if(!r[n].defined())return!1}for(var i=0;i<t;i++){var o=this._vertices[i],a=this._vertices[(i+1)%t],l=this._sides[i];if(l instanceof s.CircleElement){if(!l.defined())return!1;if(!e._onCircle(o,l)||!e._onCircle(a,l))return!1}else{var u=l;if(null==u.A||null==u.B||!u.A.defined()||!u.B.defined())return!1;if(!e._onLine(o,u)||!e._onLine(a,u))return!1}}return!0},e._delta=function(t,e){for(var n=e-t;n>Math.PI;)n-=2*Math.PI;for(;n<=-Math.PI;)n+=2*Math.PI;return n},e.prototype._traceBoundary=function(t){var n=this._vertices.length,r=this._vertices[0];t.moveTo(r.x,r.y);for(var i=0;i<n;i++){var o=this._vertices[i],a=this._vertices[(i+1)%n],l=this._sides[i];if(l instanceof s.CircleElement){var u=l.Center.x,c=l.Center.y,h=l.radius,p=Math.atan2(o.y-c,o.x-u),f=Math.atan2(a.y-c,a.x-u),d=e._delta(p,f);t.arc(u,c,h,p,p+d,d<0)}else t.lineTo(a.x,a.y)}t.closePath()},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.beginPath(),this._traceBoundary(e),e.fillStyle=this.faceColor,e.fill()}},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale,n.beginPath(),this._traceBoundary(n),n.stroke()}}},e.prototype.drawVertex=function(t){},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&this.defined()){for(var e=0,n=0,r=0,i=this._vertices;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}this.drawString(e/this._vertices.length,n/this._vertices.length,t)}},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n){},e}(o.GeomElement);e.CurvedTriangleElement=a},3712(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonEquilateralBuildAnimation=e.PolygonSuperposeAnimation=e.PolygonOutlineAndFillAnimation=e.PolygonOutlineAnimation=void 0;var o=n(7233),s=n(7091),a=n(6091),l=n(1313),u=.25;function c(t){var e=t.V.length;if(e<2)return 0;for(var n=0,r=e>2?e:e-1,i=0;i<r;i++){var o=t.V[i],s=t.V[(i+1)%e],a=s.x-o.x,l=s.y-o.y;n+=Math.sqrt(a*a+l*l)}return n}var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_OUTLINE,e.name="Polygon.outline",e.elementType=s.PolygonElement,e.defaultRate=u,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t;return[{durationMs:Math.max(180,c(r)/this.defaultRate),tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1,r.visible=!0}}]},e}(o.Animation);e.PolygonOutlineAnimation=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_OUTLINE_AND_FILL,e.name="Polygon.outlineAndFill",e.elementType=s.PolygonElement,e.defaultRate=u,e.defaultDurationMs=500,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=Math.max(180,c(r)/this.defaultRate),o=function(){r.faceAlpha=1,r.drawProgress=1,r.visible=!0},s={durationMs:i,setup:function(){r.drawProgress=0,r.faceAlpha=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};return null==r.faceColor?(s.finalise=o,[s]):[s,{durationMs:Math.min(i/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:o}]},e}(o.Animation);e.PolygonOutlineAndFillAnimation=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_SUPERPOSE,e.name="Polygon.superpose",e.elementType=s.PolygonElement,e}return i(e,t),e.prototype.build=function(t,e,n){var r=this,i=t,o=n&&n.onto,l=null!=o?e.lookupElement(String(o)):null;if(!(l instanceof s.PolygonElement)||l.V.length!==i.V.length)return e.reportDiagnostic({code:"bad-animation-args",key:"Polygon.superpose|"+String(i.name)+"|"+String(o),message:"Polygon.superpose: args.onto ('"+o+"') is not a polygon with "+i.V.length+" vertices \u2014 skipping",detail:{animation:"Polygon.superpose",elem:String(i.name),onto:String(o)}}),[{durationMs:0,tick:function(){},finalise:function(){i.drawProgress=1,i.visible=!0}}];var u=i.V.length,c=[],h=0,p=0,f=0,d=[],y=new s.PolygonElement;y.edgeColor="#FFD700",y.faceColor=null,y.nameColor=null,y.vertexColor=null;var _=function(t){for(var e=0;e<u;e++)d[e].x=t[e].x,d[e].y=t[e].y},g=function(t){return c.map((function(e){return{x:e.x+h*t,y:e.y+p*t}}))},v=function(t){var e=l.V[0].x,n=l.V[0].y,r=Math.cos(f*t),i=Math.sin(f*t);return g(1).map((function(t){return{x:e+(t.x-e)*r-(t.y-n)*i,y:n+(t.x-e)*i+(t.y-n)*r}}))},m=Math.hypot(l.V[0].x-i.V[0].x,l.V[0].y-i.V[0].y),P=Math.max(250,m/.25),C=Math.abs(this._sideAngleDelta(i,l)),b=Math.max(250,C/.003);return[{durationMs:P,setup:function(){i.drawProgress=1,i.visible=!0,c=i.V.map((function(t){return{x:t.x,y:t.y}})),h=l.V[0].x-c[0].x,p=l.V[0].y-c[0].y,f=r._sideAngleDelta(i,l);for(var t=0;t<u;t++){var n=new a.PointElement;n.x=c[t].x,n.y=c[t].y,d.push(n),y.V.push(n)}e.addEphemeral(y)},tick:function(t){_(g(t))},finalise:function(){_(g(1))}},{durationMs:b,tick:function(t){_(v(t))},finalise:function(){_(v(1))}},{durationMs:800,tick:function(){},finalise:function(){}},{durationMs:b,tick:function(t){_(v(1-t))},finalise:function(){_(g(1))}},{durationMs:P,tick:function(t){_(g(1-t))},finalise:function(){e.removeEphemeral(y),i.drawProgress=1,i.visible=!0}}]},e.prototype._sideAngleDelta=function(t,e){for(var n=Math.atan2(t.V[1].y-t.V[0].y,t.V[1].x-t.V[0].x),r=Math.atan2(e.V[1].y-e.V[0].y,e.V[1].x-e.V[0].x)-n;r>Math.PI;)r-=2*Math.PI;for(;r<-Math.PI;)r+=2*Math.PI;return r},e}(o.Animation);e.PolygonSuperposeAnimation=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.POLYGON_EQUILATERAL_BUILD,e.name="Polygon.equilateralBuild",e.elementType=s.PolygonElement,e.defaultRate=.0045,e.defaultDurationMs=500,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t;if(r.V.length<2)return[{durationMs:0,tick:function(){},finalise:function(){r.drawProgress=1,r.faceAlpha=1,r.visible=!0}}];for(var i=r.V[0],o=r.V[1],s=i.AP,a=2*Math.PI/this.defaultRate,h=new l.CircleElement({C:i,B:o,AP:s}),p=new l.CircleElement({C:o,B:i,AP:s}),f=0,d=[h,p];f<d.length;f++){var y=d[f];y.edgeColor=null,y.faceColor=null,y.nameColor=null,y.vertexColor=null,y.emphasized=!0}var _=function(t){return{durationMs:a,setup:function(){t.drawStartAngle=function(t){return Math.atan2(t.B.y-t.Center.y,t.B.x-t.Center.x)}(t),t.drawProgress=0},tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1}}},g=Math.max(180,c(r)/u),v=function(){r.drawProgress=1,r.faceAlpha=1,r.visible=!0,e.removeEphemeral(h),e.removeEphemeral(p)},m=_(h),P=m.setup;m.setup=function(){r.drawProgress=0,r.faceAlpha=0,e.addEphemeral(h),e.addEphemeral(p),h.drawProgress=0,p.drawProgress=0,P&&P()};var C={durationMs:g,setup:function(){r.drawProgress=0,r.faceAlpha=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};if(null==r.faceColor)return C.finalise=v,[m,_(p),C];var b=Math.min(g/2,this.defaultDurationMs);return[m,_(p),C,{durationMs:b,tick:function(t){r.faceAlpha=t},finalise:v}]},e}(o.Animation);e.PolygonEquilateralBuildAnimation=d,(0,o.registerAnimation)(new h),(0,o.registerAnimation)(new p),(0,o.registerAnimation)(new f),(0,o.registerAnimation)(new d)},4133(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polygonConstructions=e.CurvedTriangleConstruction=e.FacePolygonConstruction=e.OctagonPolygonConstruction=e.ApplicationPolygonConstruction=e.SimilarPolygonConstruction=e.StarPolygonConstruction=e.RegularPolygonConstruction=e.ParallelogramPolygonConstruction=e.EquilateralTriangleConstruction=e.HexagonPolygonConstruction=e.PentagonPolygonConstruction=e.QuadrilateralPolygonConstruction=e.TrianglePolygonConstruction=e.SquarePolygonConstruction=e.PolyConstruction=void 0;var o=n(7658),s=n(6055),a=n(2090),l=n(5014),u=n(7091),c=n(4458),h=n(1313),p=n(2145),f=n(1943),d=n(2563),y=n(3857),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.PolygonElement(e);return[[i],i]},e}(o.Construction);e.PolyConstruction=_;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.square,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new f.RegularPolygonElement(e[0],e[1],i,4);return[[o],o]},e}(o.Construction);e.SquarePolygonConstruction=g;var v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.triangle,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e}(_);e.TrianglePolygonConstruction=v;var m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.quadrilateral,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e}(_);e.QuadrilateralPolygonConstruction=m;var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.pentagon,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e}(_);e.PentagonPolygonConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.hexagon,e.signature={points:6,elements:0,integers:0},e}return i(e,t),e}(_);e.HexagonPolygonConstruction=C;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.equilateralTriangle,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new f.RegularPolygonElement(e[0],e[1],i,3);return[[o],o]},e}(o.Construction);e.EquilateralTriangleConstruction=b;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.Layoff(e[0],e[1],e[2],e[1],e[2]),o=new u.PolygonElement([e[0],e[1],e[2],i]);return[[i,o],o]},e}(o.Construction);e.ParallelogramPolygonConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.regularPolygon,e.signature={points:2,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(2===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new f.RegularPolygonElement(e[0],e[1],i,r[0]);return[[o],o]},e}(o.Construction);e.RegularPolygonConstruction=x;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.starPolygon,e.signature={points:2,elements:0,integers:2},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new f.RegularPolygonElement(e[0],e[1],t,r[0],r[1]);return[[i],i]},e}(o.Construction);e.StarPolygonConstruction=E;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=n.length>1?n[1]:t,s=new l.SimilarElement(e[0],e[1],i,e[2],e[3],e[4],o),a=new u.PolygonElement([e[0],e[1],s]);return[[s,a],a]},e}(o.Construction);e.SimilarPolygonConstruction=A;var S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.application,e.signature={points:3,elements:1,integers:0,elementTypes:[u.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new d.ApplicationElement(n[0],e[0],e[1],e[2]);return[[i],i]},e}(o.Construction);e.ApplicationPolygonConstruction=S;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.octagon,e.signature={points:8,elements:0,integers:0},e}return i(e,t),e}(_);e.OctagonPolygonConstruction=O;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.face,e.signature={points:0,elements:1,integers:1,elementTypes:[y.PolyhedronElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=n[0].P[r[0]-1];return[[i],i]},e}(o.Construction);function T(t){return t instanceof h.CircleElement||t instanceof p.LineElement}e.FacePolygonConstruction=M;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolygonConstructions.curvedTriangle,e.signature={points:3,elements:3,integers:0},e.keepsLineElements=!0,e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&3===e.E.length&&e.E.every(T))},e.prototype.construct=function(t,e,n,r){var i=new c.CurvedTriangleElement(e.slice(),n.slice());return[[i],i]},e}(o.Construction);e.CurvedTriangleConstruction=j,e.polygonConstructions=[new j,new v,new E,new x,new g,new b,new w,new m,new O,new P,new C,new A,new S,new M]},7091(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonElement=void 0;var o=n(6091),s=n(8020),a=function(t){function e(e){var n=t.call(this)||this;return n._faceAlpha=1,n.dimension=2,null==e?(n.V=[],n):(n.V=e,n)}return i(e,t),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),e.prototype.area=function(){for(var t=0,e=0;e<this.V.length-2;++e)t+=o.PointElement.area(this.V[0],this.V[e+1],this.V[e+2]);return t},e.prototype.drawEdge=function(t,e){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e&&!(this.V.length<=1))){var n=t.getContext("2d");n.beginPath(),n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*s.GeomElement.styleScale;var i=this.V.length,o=i>2?i:i-1,a=this.drawProgress*o,l=Math.floor(a),u=a-l;n.moveTo(this.V[0].x,this.V[0].y);for(var c=0;c<l;c++){var h=this.V[(c+1)%i];n.lineTo(h.x,h.y),n.stroke()}if(u>0&&l<o){var p=this.V[l],f=(h=this.V[(l+1)%i],p.x+(h.x-p.x)*u),d=p.y+(h.y-p.y)*u;n.lineTo(f,d),n.stroke()}}},e.prototype.defined=function(){if(0==this.V.length)return!1;for(var t=0,e=this.V;t<e.length;t++){if(!e[t].defined())return!1}return!0},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()&&this.V.length>2){var e=t.getContext("2d");e.beginPath(),e.fillStyle=this.faceColor;var n=this.V[0],r=this.V.slice(1);e.moveTo(n.x,n.y);for(var i=0,o=r;i<o.length;i++){var s=o[i];e.lineTo(s.x,s.y)}e.closePath();var a=this.faceAlpha;if(a<1){if(a<=0)return;e.save(),e.globalAlpha=a,e.fill(),e.restore()}else e.fill()}},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,i=this.V;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}var s=this.V.length;e/=s,n/=s;var a=t.getContext("2d"),l=this._getTextMetrics(a,this._name),u=l[0],c=l[1];a.beginPath(),a.fillStyle=this.nameColor,a.fillText(this._name,e-u/2,n+c/4)}},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined())for(var e=0,n=this.V;e<n.length;e++){n[e].drawVertex(t,this.vertexColor)}},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(s.GeomElement);e.PolygonElement=a},1943(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RegularPolygonElement=void 0;var o=n(7091),s=n(6091),a=function(t){function e(e,n,r,i,o){void 0===o&&(o=1);var a=t.call(this)||this;a._P=r;var l=Math.PI*o*(i-2)/i;a._cos=Math.cos(l),a._sin=Math.sin(l),a.V=new Array(i),a.V[0]=e,a.V[1]=n;for(var u=2;u<i;u++)a.V[u]=new s.PointElement({AP:r});return a}return i(e,t),e.prototype.update=function(){for(var t=2;t<this.V.length;t++)this.V[t].to(this.V[t-2]),this.V[t].rotate(this.V[t-1],this._cos,this._sin,this._P)},e.prototype.translate=function(t,e){for(var n=2;n<this.V.length;n++)this.V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var r=2;r<this.V.length;r++)this.V[r].rotate(t,e,n,this._P)},e}(o.PolygonElement);e.RegularPolygonElement=a},1099(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polyhedronConstructions=e.PyramidConstruction=e.PrismConstruction=e.ParallelepipedConstruction=e.TetrahedronConstruction=void 0;var o=n(7658),s=n(2090),a=n(7091),l=n(2383),u=n(444),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.tetrahedron,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new a.PolygonElement([e[0],e[1],e[2]]),o=new l.PyramidElement(i,e[3]);return[[i,o],o]},e}(o.Construction);e.TetrahedronConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.parallelepiped,e.signature={points:4,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new s.Layoff(e[1],e[0],e[2],e[0],e[2]),o=new a.PolygonElement([e[1],e[0],e[2],i]),l=new u.PrismElement(o,e[0],e[3]);return[[i,o,l],l]},e}(o.Construction);e.ParallelepipedConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.prism,e.signature={points:2,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new u.PrismElement(n[0],e[0],e[1]);return[[i],i]},e}(o.Construction);e.PrismConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.PolyhedraConstructions.pyramid,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new l.PyramidElement(n[0],e[0]);return[[i],i]},e}(o.Construction);e.PyramidConstruction=f,e.polyhedronConstructions=[new c,new h,new p,new f]},3857(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolyhedronElement=void 0;var o=function(t){function e(){var e=t.call(this)||this;return e.dimension=2,e.P=[],e}return i(e,t),e.prototype.defined=function(){for(var t=0;t<this.P.length;++t)if(!this.P[t].defined())return!1;return!0},e.prototype.drawName=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,i=0;i<this.P.length;++i)for(var o=0;o<this.P[i].V.length;++o)e+=this.P[i].V[o].x,n+=this.P[i].V[o].y,++r;e/=r,n/=r,this.drawString(Math.round(e),Math.round(n),t)}},e.prototype.drawVertex=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.vertexColor&&this.defined())for(var e=0;e<this.P.length;++e)for(var n=0;n<this.P[e].V.length;++n)this.P[e].V[n].drawVertex(t,this.vertexColor)},e.prototype.drawEdge=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.strokeStyle=this.edgeColor;for(var n=0;n<this.P.length;++n)for(var r=0;r<this.P[n].V.length;++r){var i=this.P[n].V[r],o=this.P[n].V[(r+1)%this.P[n].V.length];e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(o.x,o.y),e.stroke()}}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined())for(var e=0;e<this.P.length;++e){var n=this.P[e].faceColor;this.P[e].faceColor=this.faceColor,this.P[e].drawFace(t),this.P[e].faceColor=n}},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n){},e}(n(8020).GeomElement);e.PolyhedronElement=o},444(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PrismElement=void 0;var o=n(3857),s=n(7091),a=n(6091),l=function(t){function e(e,n,r){var i=t.call(this)||this;i.dimension=2,i._C=n,i._D=r;var o=e.V.length,l=2+o;i.P=new Array(l),i.P[0]=e;for(var u=new Array(o),c=0;c<o;++c)u[c]=new a.PointElement,u[c].to(e.V[c]).plus(r).minus(n);i.P[1]=new s.PolygonElement(u);for(var h=2;h<l;++h)i.P[h]=new s.PolygonElement([e.V[h-2],e.V[(h-1)%o],i.P[1].V[(h-1)%o],i.P[1].V[h-2]]);return i}return i(e,t),e.prototype.translate=function(t,e){for(var n=0;n<this.P[1].V.length;++n)this.P[1].V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var r=0;r<this.P[1].V.length;++r)this.P[1].V[r].rotate(t,e,n)},e.prototype.update=function(){for(var t=0;t<this.P[1].V.length;++t)this.P[1].V[t].to(this.P[0].V[t]).plus(this._D).minus(this._C)},e}(o.PolyhedronElement);e.PrismElement=l},2383(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PyramidElement=void 0;var o=n(3857),s=n(7091),a=function(t){function e(e,n){var r=t.call(this)||this;r.dimension=2;var i=1+e.V.length;r.P=new Array(i),r.P[0]=e;for(var o=1;o<i;++o)r.P[o]=new s.PolygonElement([n,e.V[o-1],e.V[o%e.V.length]]);return r}return i(e,t),e}(o.PolyhedronElement);e.PyramidElement=a},320(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AngleMarkerElement=e.ANGLE_MARKER_RING_STEP=e.ANGLE_MARKER_MAX_ARM_FRACTION=e.DEFAULT_ANGLE_MARKER_RADIUS_PX=void 0;var o=n(1025),s=n(6091);e.DEFAULT_ANGLE_MARKER_RADIUS_PX=22,e.ANGLE_MARKER_MAX_ARM_FRACTION=.45,e.ANGLE_MARKER_RING_STEP=9;var a=function(t){function n(e,n,r,i,o,a){var l=t.call(this)||this;return l.ringIndex=0,l.reflex=!1,l.dimension=2,l._Center=e,l._arm1=n,l._arm2=r,l._P=i,l._radiusOverride=null!=o?o:null,l.reflex=!0===a,l._A=new s.PointElement,l._B=new s.PointElement,l}return i(n,t),Object.defineProperty(n.prototype,"vertex",{get:function(){return this._Center},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRadiusOverride",{get:function(){return null!=this._radiusOverride},enumerable:!1,configurable:!0}),n.prototype.spanRadians=function(){return Math.abs(this._Center.angle(this._arm1,this._arm2,this._P))},n.prototype._arcAngle=function(){var t=this._Center.angle(this._A,this._B,this._P);return this.reflex?2*Math.PI-Math.abs(t):t},n.prototype._anticlockwise=function(){return!this.reflex},n.prototype._flashFace=function(){return!0},n.prototype.radius=function(){var t=this._Center.distance(this._arm1),n=this._Center.distance(this._arm2),r=Math.min(t,n),i=null!=this._radiusOverride?this._radiusOverride:e.DEFAULT_ANGLE_MARKER_RADIUS_PX;return Math.min(i,r*e.ANGLE_MARKER_MAX_ARM_FRACTION)+this.ringIndex*e.ANGLE_MARKER_RING_STEP},n.prototype._place=function(t,e,n){var r=e.x-this._Center.x,i=e.y-this._Center.y,o=e.z-this._Center.z,s=Math.sqrt(r*r+i*i+o*o);if(0===s)return t.x=this._Center.x,t.y=this._Center.y,void(t.z=this._Center.z);t.x=this._Center.x+r/s*n,t.y=this._Center.y+i/s*n,t.z=this._Center.z+o/s*n},n.prototype.update=function(){var t=this.radius();this._place(this._A,this._arm1,t),this._place(this._B,this._arm2,t),this._Center.angle(this._A,this._B,this._P)>0&&(this._place(this._A,this._arm2,t),this._place(this._B,this._arm1,t))},n}(o.SectorElement);e.AngleMarkerElement=a},5483(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ArcElement=void 0;var o=n(1025),s=n(6091),a=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.dimension=2,o._Center=new s.PointElement,o._A=e,o._M=n,o._B=r,o._P=i,o}return i(e,t),e.prototype.update=function(){this._P.update(),this._Center.toCircumcenter(this._A,this._M,this._B)},e.prototype.translate=function(t,e){this._Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this._Center.rotate(t,e,n)},e}(o.SectorElement);e.ArcElement=a},3702(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SectorSweepAnimation=void 0;var o=n(7233),s=n(1025),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=o.AllAnimations.SECTOR_SWEEP,e.name="Sector.sweep",e.elementType=s.SectorElement,e.defaultRate=.003,e.defaultDurationMs=500,e}return i(e,t),e.prototype.build=function(t,e,n){var r=t,i=r.arcSpan(),o=Math.max(250,i/this.defaultRate),s=function(){r.faceAlpha=1,r.drawProgress=1,r.visible=!0},a={durationMs:o,setup:function(){r.faceAlpha=0,r.drawProgress=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}};return null==r.faceColor?(a.finalise=s,[a]):[a,{durationMs:Math.min(o/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:s}]},e}(o.Animation);e.SectorSweepAnimation=a,(0,o.registerAnimation)(new a)},5755(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sectorConstructions=e.AngleMarkerReflexRadiusConstruction=e.AngleMarkerReflexConstruction=e.AngleMarkerRadiusConstruction=e.AngleMarkerConstruction=e.ArcConstruction=e.SectorConstruction=void 0;var o=n(7658),s=n(6055),a=n(1025),l=n(5483),u=n(320),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.sector,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new a.SectorElement({O:e[0],A:e[1],B:e[2],P:i});return[[o],o]},e}(o.Construction);e.SectorConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.arc,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement))},e.prototype.construct=function(t,e,n,r){var i=n.length>0?n[0]:t,o=new l.ArcElement(e[0],e[1],e[2],i);return[[o],o]},e}(o.Construction);e.ArcConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarker,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&0===e.E.length)},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t);return[[i],i]},e}(o.Construction);e.AngleMarkerConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarker,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&1===e.N.length&&0===e.E.length)},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t,r[0]);return[[i],i]},e}(o.Construction);e.AngleMarkerRadiusConstruction=f;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarkerReflex,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&0===e.N.length&&0===e.E.length)},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t,void 0,!0);return[[i],i]},e}(o.Construction);e.AngleMarkerReflexConstruction=d;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SectorConstructions.angleMarkerReflex,e.signature={points:3,elements:0,integers:1},e}return i(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&(3===e.P.length&&1===e.N.length&&0===e.E.length)},e.prototype.construct=function(t,e,n,r){var i=new u.AngleMarkerElement(e[0],e[1],e[2],t,r[0],!0);return[[i],i]},e}(o.Construction);e.AngleMarkerReflexRadiusConstruction=y,e.sectorConstructions=[new c,new h,new p,new f,new d,new y]},1025(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SectorElement=void 0;var o=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n._angle=null,n._faceAlpha=1,n.dimension=2,null!=e&&(n._Center=e.O,n._A=e.A,n._B=e.B,n._P=e.P),n}return i(e,t),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),e.prototype.radius=function(){return this._Center.distance(this._A)},e.prototype.defined=function(){return this._A.defined()&&this._B.defined()&&this._Center.defined()},e.prototype._updateThroughPoint=function(){var t=this.radius();if(0!=t){this._angle=Math.atan2(this._B.y-this._A.y,this._B.x-this._A.x)-Math.atan2(this._Center.y-this._A.y,this._Center.x-this._A.x);this._Center.x,Math.cos(this._angle/2),this._Center.y,Math.sin(this._angle/2)}},e.prototype.drawEdge=function(t){if(this.visible||this.shouldHighlight||!(this.emphasisAmount<=0)){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=(r+this.emphasisAmount*(6-r))*o.GeomElement.styleScale,n.beginPath();var i=this.radius(),s=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),a=s+this._arcAngle()*this.drawProgress;n.arc(this._Center.x,this._Center.y,i,s,a,this._anticlockwise()),n.stroke()}}},e.prototype._arcAngle=function(){return this._Center.angle(this._A,this._B,this._P)},e.prototype._anticlockwise=function(){return!0},e.prototype.arcSpan=function(){return Math.abs(this._arcAngle())},e.prototype._traceWedge=function(t,e){var n=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),r=this._arcAngle(),i=n+r;t.beginPath(),t.arc(this._Center.x,this._Center.y,e,n,i,this._anticlockwise()),t.moveTo(this._Center.x,this._Center.y),r<=180?(t.lineTo(this._A.x,this._A.y),t.lineTo(this._B.x,this._B.y)):(t.lineTo(this._B.x,this._B.y),t.lineTo(this._A.x,this._A.y)),t.lineTo(this._Center.x,this._Center.y)},e.prototype._flashFace=function(){return!1},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=this.faceAlpha;if(!(e<=0)){var n=t.getContext("2d"),r=this.radius();n.fillStyle=this.faceColor,this._traceWedge(n,r),e<1?(n.save(),n.globalAlpha=e,n.fill(),n.restore()):n.fill(),this._flashFace()&&this.emphasisAmount>0&&(n.save(),n.fillStyle=this.faceHighlightColor,n.globalAlpha=.55*this.emphasisAmount,this._traceWedge(n,r),n.fill(),n.restore())}}},e.prototype.drawName=function(t){},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){this._updateThroughPoint()},e}(o.GeomElement);e.SectorElement=s},8649(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sphereConstructions=e.SphereRadius3PointConstruction=e.SphereRadiusConstruction=void 0;var o=n(7658),s=n(2295),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SphereConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new s.SphereElement({Center:e[0],B:e[1]});return[[i],i]},e}(o.Construction);e.SphereRadiusConstruction=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=o.SphereConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return i(e,t),e.prototype.construct=function(t,e,n,r){var i=new s.SphereElement({Center:e[0],A:e[1],B:e[2]});return[[i],i]},e}(o.Construction);e.SphereRadius3PointConstruction=l,e.sphereConstructions=[new l,new a]},2295(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereElement=void 0;var o=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n._Center=e&&e.Center||new s.PointElement,n._A=e&&e.A||n._Center,n._B=e&&e.B||new s.PointElement,n}return i(e,t),Object.defineProperty(e.prototype,"Center",{get:function(){return this._Center},enumerable:!1,configurable:!0}),e.prototype.drawName=function(t){!this.visible&&!this.shouldHighlight&&this.emphasisAmount<=0||null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this._Center.x),Math.round(this._Center.y),t,o.Align.CENTRAL)},e.prototype.defined=function(){return!0},e.prototype.drawEdge=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if((this.visible||this.shouldHighlight||!(this.emphasisAmount<=0))&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.fill(),e.restore()}},e.prototype.radius=function(){return this._A.distance(this._B)},e.prototype.radius2=function(){return this._A.distance2(this._B)},e.prototype.drawVertex=function(){},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n,r){},e}(o.GeomElement);e.SphereElement=a},8156(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.initDiagnostics=e.slates=e.BUILD_MARKER=e.A=e.AllAnimations=e.E=e.Align=void 0,e.highlightByName=function(t,n,r){void 0===n&&(n=!0);for(var i=r&&r.canvasids,o=0,s=0,a=e.slates;s<a.length;s++){var l=a[s];if(null!=i){var u=l.canvas&&l.canvas.id;if(-1===i.indexOf(u))continue}var c=l.lookupElement(t);null!=c&&(c.emphasized=n,l.update(),o++)}return o},e.diagnostics=function(t){for(var n=t&&t.canvasids,r=null,i=0,o=[],s=0;s<e.slates.length;s++){var a=e.slates[s],l=a.canvas&&a.canvas.id||null;if(null==n||null!=l&&-1!==n.indexOf(l)){var u=a.diagnostics;0!==u.length&&(r=(0,p.worstSeverity)(r,a.diagnosticSeverity),i+=u.length,o.push({canvasid:l,index:s,severity:a.diagnosticSeverity,entries:u}))}}for(var c=0,h=e.initDiagnostics;c<h.length;c++){var f=h[c];r=(0,p.worstSeverity)(r,f.severity),i++}return{severity:r,count:i,slates:o,init:e.initDiagnostics.slice()}},e.parseParam=d,e.revealNoscriptFallback=y,e.markInitFailure=_,e.init=function(t){var n=null!=t.canvasid?t.canvasid:"canvasid",i=document.getElementById(n);try{!function(t,n){var i=null!=t.align?t.align:r.Align.CENTRAL,o=function(t,e){var n=e,r=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*px\s*$/.exec("string"==typeof t?t:"");return e?parseFloat(e[1]):0},i=n.style||{},o=function(t){return"function"==typeof n.getAttribute&&parseInt(n.getAttribute(t)||"0",10)||0},s=t.width||r(i.width)||o("width")||n.clientWidth||e.width,a=t.height||r(i.height)||o("height")||n.clientHeight||e.height;return[s,a]}(t,n),p=o[0],f=o[1];!function(t){var e="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.round(t.clientWidth*e),r=Math.round(t.clientHeight*e);t.width==n&&t.height==r||(t.width=n,t.height=r)}(n);var y=new a.Slate(n);y.setLogicalSize(p,f),y.recomputeFitScale(),e.slates.push(y);var _=null!=t.font?t.font:"Times New Roman",g=null!=t.fontsize?t.fontsize:18;r.GeomElement.setFont(_,g),y.bgcolor=(0,c.parseColor)(t.background,"#ffffff","#ffffff");for(var v=0,m=0,P=t.elements;m<P.length;m++){var C=P[m],b="string"==typeof C?d(C):C,w=y.createElement(b.construction,b.params,b.name);if(w.align=i,w instanceof u.AngleMarkerElement){var x=c.anglePalette[v%c.anglePalette.length];v++,w.nameColor=(0,c.parseColor)(b.nameColor,null,y.bgcolor),w.vertexColor=(0,c.parseColor)(b.vertexColor,null,y.bgcolor),w.edgeColor=(0,c.parseColor)(b.edgeColor,x.edge,y.bgcolor),null!=b.faceColor?w.faceColor=(0,c.parseColor)(b.faceColor,x.edge,y.bgcolor):w.faceColor=x.face}else{var E=w instanceof s.PointElement?"black":null;w.nameColor=(0,c.parseColor)(b.nameColor,E,y.bgcolor);var A=w.draggable?w instanceof l.PlaneSlider?"red":"orange":"black";w.vertexColor=(0,c.parseColor)(b.vertexColor,A,y.bgcolor),w.edgeColor=(0,c.parseColor)(b.edgeColor,"black",y.bgcolor);var S=(0,c.lighten)(y.bgcolor),O=2==w.dimension?S:null;w.faceColor=(0,c.parseColor)(b.faceColor,O,y.bgcolor)}}null!=t.aliases&&y.addAliases(t.aliases);null!=t.deferDraggables&&y.deferDraggables(t.deferDraggables);null!=t.highlightOnTop&&(y.highlightOnTop=t.highlightOnTop);if(!t.showAngles)for(var M=0,T=y.elements;M<T.length;M++){(N=T[M])instanceof u.AngleMarkerElement&&null!=N.name&&y.setInitiallyHidden(N.name)}if(null!=t.initiallyHidden)for(var j=0,k=t.initiallyHidden;j<k.length;j++){var L=k[j];y.setInitiallyHidden(L)}for(var B=new Map,z=0,I=y.elements;z<I.length;z++){var N;if((N=I[z])instanceof u.AngleMarkerElement){var R=B.get(N.vertex);null==R&&(R=[],B.set(N.vertex,R)),R.push(N)}}B.forEach((function(t){if(!(t.length<=1)){t.sort((function(t,e){return t.spanRadians()-e.spanRadians()}));var e=0;t.forEach((function(t,n){if(c.anglePalette.some((function(e){return e.face===t.faceColor}))){var r=c.anglePalette[n%c.anglePalette.length];t.edgeColor=r.edge,t.faceColor=r.face}t.hasRadiusOverride||(t.ringIndex=e,e++)}))}})),null!=t.slides&&t.slides.length>0&&(y.slides=t.slides,function(t,e){for(var n=0;n<e.length;n++){for(var r=e[n],i=0,o=["visible","highlighted"];i<o.length;i++){var s=o[i],a=r[s];if(null!=a)for(var l=0,u=a;l<u.length;l++){var c=u[l];null==t.lookupElement(c)&&t.reportDiagnostic({code:"unknown-slide-name",key:s+":"+c,message:"slide "+(n+1)+" lists '"+c+"' in "+s+", but no element or alias resolves to it \u2014 the name is ignored. Check for a typo, or for a target left behind by a figure change.",detail:{slide:n+1,field:s,name:c}})}}var h=r.transition&&r.transition.animations;if(null!=h)for(var p=0,f=h;p<f.length;p++){var d=f[p];null!=d.elem&&(null==t.lookupElement(d.elem)&&t.reportDiagnostic({code:"unknown-element",key:String(d.elem),message:"slide "+(n+1)+" animates '"+d.elem+"', but no element or alias resolves to it \u2014 the step is skipped. Check for a typo, or for a target left behind by a figure change.",detail:{slide:n+1,elem:d.elem}}))}}}(y,t.slides));null!=t.resolveJustification&&(y.resolveJustification=t.resolveJustification);null!=t.animationConfig&&(y.animationConfig=t.animationConfig);null!=t.pivot&&y.setPivot(t.pivot);y.update(),y.updateCoordinates(0),n&&n.parentElement&&(0,h.createControls)(y,n,t)}(t,i)}catch(t){throw console.error("[geomlib] init failed:",t),e.initDiagnostics.push({severity:"error",code:"init-failed",message:"init failed: "+String(t),detail:{canvasid:n},at:Date.now(),count:1}),_(i,n),y(i),t}};var r=n(8020);Object.defineProperty(e,"Align",{enumerable:!0,get:function(){return r.Align}});var i=n(7658);Object.defineProperty(e,"E",{enumerable:!0,get:function(){return i.E}});var o=n(7233);Object.defineProperty(e,"AllAnimations",{enumerable:!0,get:function(){return o.AllAnimations}}),Object.defineProperty(e,"A",{enumerable:!0,get:function(){return o.A}}),n(2872),n(1910),n(9222),n(3712),n(3702),n(4580);var s=n(6091),a=n(8041),l=n(4994),u=n(320),c=n(1454),h=n(3267),p=n(9196);e.BUILD_MARKER="pointer-events-refactor-v1 (Slate.ts #55)",e.slates=[];var f={point:"Point",line:"Line",circle:"Circle",polygon:"Polygon",sector:"Sector",plane:"Plane",sphere:"Sphere",polyhedron:"Polyhedra"};function d(t){var e=t.split(";");if(e.length<4)throw new Error("parseParam: expected at least 4 semicolon-separated fields, got ".concat(e.length,': "').concat(t,'"'));var n=e[0],r=e[1],o=e[2],s=e[3],a=f[r];if(null==a)throw new Error('parseParam: unknown element type "'.concat(r,'" in "').concat(t,'"'));var l=i.E[a]["3points"===o?"threePoints":o];if(null==l)throw new Error('parseParam: unknown construction "'.concat(r,";").concat(o,'" in "').concat(t,'"'));var u={name:n,construction:l,params:s.split(",").map((function(t){var e=Number(t);return""===t||isNaN(e)?t:e}))};return e.length>4&&void 0!==e[4]&&(u.nameColor=e[4]),e.length>5&&void 0!==e[5]&&(u.vertexColor=e[5]),e.length>6&&void 0!==e[6]&&(u.edgeColor=e[6]),e.length>7&&void 0!==e[7]&&(u.faceColor=e[7]),u}function y(t){var e;if(t)try{for(var n=t.nextElementSibling,r=0;n&&r++<5&&"NOSCRIPT"!==n.tagName;)n=n.nextElementSibling;if(!n||"NOSCRIPT"!==n.tagName)return;var i=n.innerHTML;if(!i)return;var o=document.createElement("div");o.innerHTML=i,null===(e=n.parentNode)||void 0===e||e.insertBefore(o,n),t.style.display="none"}catch(t){}}function _(t,e){try{if("undefined"==typeof document)return;var n=t||document.getElementById(e);if(!n)return;var r=n.parentElement;if(!r)return;var i=(0,h.createDiagnosticBadge)("error");i.style.position="static",i.style.display="inline-block",i.style.verticalAlign="top",r.insertBefore(i,n)}catch(t){}}e.initDiagnostics=[]},7680(t,e){function n(t,e){for(var n=new Set,r=[],i=0,o=e||[];i<o.length;i++){var s=o[i],a=t.lookupElement(s);null!=a&&null!=a.name?n.add(a.name):(n.add(s),r.push(s))}return{canonical:n,unmatched:r}}function r(t,e,n,r){for(var i=0,o=e;i<o.length;i++){var s=o[i];t.reportDiagnostic({code:"unknown-slide-name",key:r+":"+s,message:"slide "+(n+1)+" lists '"+s+"' in "+r+", but no element or alias resolves to it \u2014 the name is ignored. Check for a typo, or for a target left behind by a figure change.",detail:{slide:n+1,field:r,name:s}})}}Object.defineProperty(e,"__esModule",{value:!0}),e.canonicaliseSlideNames=n,e.computeSlideState=function(t,e,i){for(var o=[],s=i,a=i;a>=0;a--)if(null!=e[a].visible){o=e[a].visible,s=a;break}var l=n(t,o),u=l.canonical;r(t,l.unmatched,s,"visible");var c=e[i],h=n(t,c.highlighted||[]),p=h.canonical;r(t,h.unmatched,i,"highlighted");for(var f=0,d=t.elements;f<d.length;f++){var y=d[f];y.draggable&&null!=y.name&&!t.deferredDraggables.has(y.name)&&u.add(y.name)}return p.forEach((function(t){return u.add(t)})),{visible:u,highlighted:p}}}},e={};var n=function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}(8156);geomlib=n})();
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|