diff --git "a/static/js/main.550af4c9.js" "b/static/js/main.550af4c9.js" new file mode 100644--- /dev/null +++ "b/static/js/main.550af4c9.js" @@ -0,0 +1,3 @@ +/*! For license information please see main.550af4c9.js.LICENSE.txt */ +!function(){var e={2110:function(e,t,n){"use strict";var r=n(8309),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?o:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=o;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var a=h(n);a&&a!==p&&e(t,a,r)}var o=c(n);d&&(o=o.concat(d(n)));for(var l=s(t),v=s(n),g=0;g0?e:[e]:[],this.layers=t,this}},{key:"getLayers",value:function(){return this.layers}},{key:"addLayer",value:function(e){var t,n=this.layers,r=n.length;for(t=0;t0?Math.sqrt(d*d+f):0,p=c*c+f>0?Math.sqrt(c*c+f):0,v=c+Math.sqrt(c*c+f)!==0?f*Math.log(Math.abs((d+h)/(c+p))):0;return Math.sqrt(l)/2*(d*h-c*p+v)};var r=function e(n,r,a){var i,o,l=a.length-1;if(0===l)return 0;if(0===n){o=0;for(var s=0;s<=l;s++)o+=t.binomialCoefficients[l][s]*Math.pow(1-r,l-s)*Math.pow(r,s)*a[s];return o}i=new Array(l);for(var u=0;u.001;){var l=n(a+i),s=Math.abs(e-l)/t;if(s500)break}return a}},6689:function(e,t,n){"use strict";var r=n(6115).default,a=n(1655).default,i=n(6389).default,o=n(6690).default,l=n(9728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.HitCanvas=t.SceneCanvas=t.Canvas=void 0;var s,u=n(2264),c=n(3110),d=n(2683),f=n(6534),h=n(8999);var p=function(){function e(t){o(this,e),this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=(t||{}).pixelRatio||d.Konva.pixelRatio||function(){if(s)return s;var e=u.Util.createCanvasElement(),t=e.getContext("2d");return s=(d.Konva._global.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),u.Util.releaseCanvas(e),s}();this.pixelRatio=n,this._canvas=u.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}return l(e,[{key:"getContext",value:function(){return this.context}},{key:"getPixelRatio",value:function(){return this.pixelRatio}},{key:"setPixelRatio",value:function(e){var t=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/t,this.getHeight()/t)}},{key:"setWidth",value:function(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";var t=this.pixelRatio;this.getContext()._context.scale(t,t)}},{key:"setHeight",value:function(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";var t=this.pixelRatio;this.getContext()._context.scale(t,t)}},{key:"getWidth",value:function(){return this.width}},{key:"getHeight",value:function(){return this.height}},{key:"setSize",value:function(e,t){this.setWidth(e||0),this.setHeight(t||0)}},{key:"toDataURL",value:function(e,t){try{return this._canvas.toDataURL(e,t)}catch(n){try{return this._canvas.toDataURL()}catch(r){return u.Util.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}]),e}();t.Canvas=p,f.Factory.addGetterSetter(p,"pixelRatio",void 0,(0,h.getNumberValidator)());var v=function(e){a(n,e);var t=i(n);function n(){var e,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:0,height:0,willReadFrequently:!1};return o(this,n),(e=t.call(this,a)).context=new c.SceneContext(r(e),{willReadFrequently:a.willReadFrequently}),e.setSize(a.width,a.height),e}return l(n)}(p);t.SceneCanvas=v;var g=function(e){a(n,e);var t=i(n);function n(){var e,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:0,height:0};return o(this,n),(e=t.call(this,a)).hitCanvas=!0,e.context=new c.HitContext(r(e)),e.setSize(a.width,a.height),e}return l(n)}(p);t.HitCanvas=g},3890:function(e,t,n){"use strict";var r=n(4704).default,a=n(6690).default,i=n(9728).default,o=n(1588).default,l=n(3808).default,s=n(1655).default,u=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Container=void 0;var c=n(6534),d=n(2585),f=n(8999),h=function(e){s(n,e);var t=u(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).children=[],e}return i(n,[{key:"getChildren",value:function(e){if(!e)return this.children||[];var t=this.children||[],n=[];return t.forEach((function(t){e(t)&&n.push(t)})),n}},{key:"hasChildren",value:function(){return this.getChildren().length>0}},{key:"removeChildren",value:function(){return this.getChildren().forEach((function(e){e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}},{key:"destroyChildren",value:function(){return this.getChildren().forEach((function(e){e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}},{key:"add",value:function(){if(0===arguments.length)return this;if(arguments.length>1){for(var e=0;e0?t[0]:void 0}},{key:"_generalFind",value:function(e,t){var n=[];return this._descendants((function(r){var a=r._isMatch(e);return a&&n.push(r),!(!a||!t)})),n}},{key:"_descendants",value:function(e){var t,n=this.getChildren(),a=r(n);try{for(a.s();!(t=a.n()).done;){var i=t.value;if(e(i))return!0;if(i.hasChildren()&&i._descendants(e))return!0}}catch(o){a.e(o)}finally{a.f()}return!1}},{key:"toObject",value:function(){var e=d.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((function(t){e.children.push(t.toObject())})),e}},{key:"isAncestorOf",value:function(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}},{key:"clone",value:function(e){var t=d.Node.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}},{key:"getAllIntersections",value:function(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}},{key:"_clearSelfAndDescendantCache",value:function(e){var t;o(l(n.prototype),"_clearSelfAndDescendantCache",this).call(this,e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}},{key:"_setChildrenIndices",value:function(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}},{key:"drawScene",value:function(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),a=r&&r.getContext(),i=this._getCanvasCache(),o=i&&i.scene,l=r&&r.isCache;if(!this.isVisible()&&!l)return this;if(o){a.save();var s=this.getAbsoluteTransform(t).getMatrix();a.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",r,t);return this}},{key:"drawHit",value:function(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,a=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){a.save();var o=this.getAbsoluteTransform(t).getMatrix();a.transform(o[0],o[1],o[2],o[3],o[4],o[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",r,t);return this}},{key:"_drawChildren",value:function(e,t,n){var r,a=t&&t.getContext(),i=this.clipWidth(),o=this.clipHeight(),l=this.clipFunc(),s=i&&o||l,u=n===this;if(s){a.save();var c,d=this.getAbsoluteTransform(n),f=d.getMatrix();if(a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),a.beginPath(),l)c=l.call(this,a,this);else{var h=this.clipX(),p=this.clipY();a.rect(h,p,i,o)}a.clip.apply(a,c),f=d.copy().invert().getMatrix(),a.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var v=!u&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;v&&(a.save(),a._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),v&&a.restore(),s&&a.restore()}},{key:"getClientRect",value:function(e){var t,n,r,a,i,o=(e=e||{}).skipTransform,l=e.relativeTo,s={x:1/0,y:1/0,width:0,height:0},u=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var o=t.getClientRect({relativeTo:u,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===o.width&&0===o.height||(void 0===n?(n=o.x,r=o.y,a=o.x+o.width,i=o.y+o.height):(n=Math.min(n,o.x),r=Math.min(r,o.y),a=Math.max(a,o.x+o.width),i=Math.max(i,o.y+o.height)))}}));for(var c=this.find("Shape"),d=!1,f=0;f=100&&t.shift()}},{key:"reset",value:function(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"clear",value:function(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}},{key:"_applyLineCap",value:function(e){var t=e.attrs.lineCap;t&&this.setAttr("lineCap",t)}},{key:"_applyOpacity",value:function(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}},{key:"_applyLineJoin",value:function(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}},{key:"setAttr",value:function(e,t){this._context[e]=t}},{key:"arc",value:function(e,t,n,r,a,i){this._context.arc(e,t,n,r,a,i)}},{key:"arcTo",value:function(e,t,n,r,a){this._context.arcTo(e,t,n,r,a)}},{key:"beginPath",value:function(){this._context.beginPath()}},{key:"bezierCurveTo",value:function(e,t,n,r,a,i){this._context.bezierCurveTo(e,t,n,r,a,i)}},{key:"clearRect",value:function(e,t,n,r){this._context.clearRect(e,t,n,r)}},{key:"clip",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{}).willReadFrequently,o=void 0!==a&&a;return i(this,n),(r=t.call(this,e))._context=e._canvas.getContext("2d",{willReadFrequently:o}),r}return o(n,[{key:"_fillColor",value:function(e){var t=e.fill();this.setAttr("fillStyle",t),e._fillFunc(this)}},{key:"_fillPattern",value:function(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}},{key:"_fillLinearGradient",value:function(e){var t=e._getLinearGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}},{key:"_fillRadialGradient",value:function(e){var t=e._getRadialGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}},{key:"_fill",value:function(e){var t=e.fill(),n=e.getFillPriority();if(t&&"color"===n)this._fillColor(e);else{var r=e.getFillPatternImage();if(r&&"pattern"===n)this._fillPattern(e);else{var a=e.getFillLinearGradientColorStops();if(a&&"linear-gradient"===n)this._fillLinearGradient(e);else{var i=e.getFillRadialGradientColorStops();i&&"radial-gradient"===n?this._fillRadialGradient(e):t?this._fillColor(e):r?this._fillPattern(e):a?this._fillLinearGradient(e):i&&this._fillRadialGradient(e)}}}}},{key:"_strokeLinearGradient",value:function(e){var t=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint(),r=e.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(t.x,t.y,n.x,n.y);if(r){for(var i=0;i0?{antialiased:!0}:{}}},{key:"drawScene",value:function(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),c.Container.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}},{key:"drawHit",value:function(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),c.Container.prototype.drawHit.call(this,r,t),this}},{key:"enableHitGraph",value:function(){return this.hitGraphEnabled(!0),this}},{key:"disableHitGraph",value:function(){return this.hitGraphEnabled(!1),this}},{key:"setHitGraphEnabled",value:function(e){u.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}},{key:"getHitGraphEnabled",value:function(e){return u.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}},{key:"toggleHitCanvas",value:function(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}},{key:"destroy",value:function(){return u.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),i(o(n.prototype),"destroy",this).call(this)}}]),n}(c.Container);t.Layer=b,b.prototype.nodeType="Layer",(0,g._registerNode)(b),f.Factory.addGetterSetter(b,"imageSmoothingEnabled",!0),f.Factory.addGetterSetter(b,"clearBeforeDraw",!0),f.Factory.addGetterSetter(b,"hitGraphEnabled",!0,(0,p.getBooleanValidator)())},2585:function(e,t,n){"use strict";var r=n(861).default,a=n(6690).default,i=n(9728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;var o=n(2264),l=n(6534),s=n(6689),u=n(2683),c=n(8252),d=n(8999),f="absoluteOpacity",h="allEventListeners",p="absoluteTransform",v="absoluteScale",g="canvas",m="listening",y="mouseenter",b="mouseleave",x="Shape",k=" ",S="stage",w="transform",_="visible",C=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(k),P=1,E=function(){function e(t){a(this,e),this._id=P++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}return i(e,[{key:"hasChildren",value:function(){return!1}},{key:"_clearCache",value:function(e){e!==w&&e!==p||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}},{key:"_getCache",value:function(e,t){var n=this._cache.get(e);return(void 0===n||(e===w||e===p)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}},{key:"_calculate",value:function(e,t,n){var r=this;if(!this._attachedDepsListeners.get(e)){var a=t.map((function(e){return e+"Change.konva"})).join(k);this.on(a,(function(){r._clearCache(e)})),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}},{key:"_getCanvasCache",value:function(){return this._cache.get(g)}},{key:"_clearSelfAndDescendantCache",value:function(e){this._clearCache(e),e===p&&this.fire("absoluteTransformChange")}},{key:"clearCache",value:function(){if(this._cache.has(g)){var e=this._cache.get(g),t=e.scene,n=e.filter,r=e.hit;o.Util.releaseCanvas(t,n,r),this._cache.delete(g)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}},{key:"cache",value:function(e){var t=e||{},n={};void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||n.width),a=Math.ceil(t.height||n.height),i=t.pixelRatio,l=void 0===t.x?Math.floor(n.x):t.x,u=void 0===t.y?Math.floor(n.y):t.y,c=t.offset||0,d=t.drawBorder||!1,h=t.hitCanvasPixelRatio||1;if(r&&a){r+=2*c+1,a+=2*c+1,l-=c,u-=c;var p=new s.SceneCanvas({pixelRatio:i,width:r,height:a}),m=new s.SceneCanvas({pixelRatio:i,width:0,height:0,willReadFrequently:!0}),y=new s.HitCanvas({pixelRatio:h,width:r,height:a}),b=p.getContext(),x=y.getContext();return y.isCache=!0,p.isCache=!0,this._cache.delete(g),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(p.getContext()._context.imageSmoothingEnabled=!1,m.getContext()._context.imageSmoothingEnabled=!1),b.save(),x.save(),b.translate(-l,-u),x.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(f),this._clearSelfAndDescendantCache(v),this.drawScene(p,this),this.drawHit(y,this),this._isUnderCache=!1,b.restore(),x.restore(),d&&(b.save(),b.beginPath(),b.rect(0,0,r,a),b.closePath(),b.setAttr("strokeStyle","red"),b.setAttr("lineWidth",5),b.stroke(),b.restore()),this._cache.set(g,{scene:p,filter:m,hit:y,x:l,y:u}),this._requestDraw(),this}o.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}},{key:"isCached",value:function(){return this._cache.has(g)}},{key:"getClientRect",value:function(e){throw new Error('abstract "getClientRect" method call')}},{key:"_transformedRect",value:function(e,t){var n,r,a,i,o=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],l=this.getAbsoluteTransform(t);return o.forEach((function(e){var t=l.point(e);void 0===n&&(n=a=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),a=Math.max(a,t.x),i=Math.max(i,t.y)})),{x:n,y:r,width:a-n,height:i-r}}},{key:"_drawCachedSceneCanvas",value:function(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);var t=this._getCanvasCache();e.translate(t.x,t.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}},{key:"_drawCachedHitCanvas",value:function(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}},{key:"_getCachedSceneCanvas",value:function(){var e,t,n,r,a=this.filters(),i=this._getCanvasCache(),l=i.scene,s=i.filter,u=s.getContext();if(a){if(!this._filterUpToDate){var c=l.pixelRatio;s.setSize(l.width/l.pixelRatio,l.height/l.pixelRatio);try{for(e=a.length,u.clear(),u.drawImage(l._canvas,0,0,l.getWidth()/c,l.getHeight()/c),t=u.getImageData(0,0,s.getWidth(),s.getHeight()),n=0;n1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;c.DD._dragElements.forEach((function(e){"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var a=!t&&!u.Konva.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!a}},{key:"show",value:function(){return this.visible(!0),this}},{key:"hide",value:function(){return this.visible(!1),this}},{key:"getZIndex",value:function(){return this.index||0}},{key:"getAbsoluteZIndex",value:function(){var e,t,n,r,a=this.getDepth(),i=this,o=0;return"Stage"!==i.nodeType&&function l(s){for(e=[],t=s.length,n=0;n0&&e[0].getDepth()<=a&&l(e)}(i.getStage().getChildren()),o}},{key:"getDepth",value:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}},{key:"_batchTransformChanges",value:function(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(w),this._clearSelfAndDescendantCache(p)),this._needClearTransformCache=!1}},{key:"setPosition",value:function(e){var t=this;return this._batchTransformChanges((function(){t.x(e.x),t.y(e.y)})),this}},{key:"getPosition",value:function(){return{x:this.x(),y:this.y()}}},{key:"getRelativePointerPosition",value:function(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}},{key:"getAbsolutePosition",value:function(e){for(var t=!1,n=this.parent;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),a=new o.Transform,i=this.offset();return a.m=r.slice(),a.translate(i.x,i.y),a.getTranslation()}},{key:"setAbsolutePosition",value:function(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(w);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(w),this._clearSelfAndDescendantCache(p),this}},{key:"_setTransform",value:function(e){var t;for(t in e)this.attrs[t]=e[t]}},{key:"_clearTransform",value:function(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}},{key:"move",value:function(e){var t=e.x,n=e.y,r=this.x(),a=this.y();return void 0!==t&&(r+=t),void 0!==n&&(a+=n),this.setPosition({x:r,y:a}),this}},{key:"_eachAncestorReverse",value:function(e,t){var n,r,a=[],i=this.getParent();if(!t||t._id!==this._id){for(a.unshift(this);i&&(!t||i._id!==t._id);)a.unshift(i),i=i.parent;for(n=a.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}},{key:"moveToBottom",value:function(){if(!this.parent)return o.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}},{key:"setZIndex",value:function(e){if(!this.parent)return o.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&o.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}},{key:"getAbsoluteOpacity",value:function(){return this._getCache(f,this._getAbsoluteOpacity)}},{key:"_getAbsoluteOpacity",value:function(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}},{key:"moveTo",value:function(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}},{key:"toObject",value:function(){var e,t,n,r,a={},i=this.getAttrs();for(e in a.attrs={},i)t=i[e],o.Util.isObject(t)&&!o.Util._isPlainObject(t)&&!o.Util._isArray(t)||(n="function"===typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(a.attrs[e]=t));return a.className=this.getClassName(),o.Util._prepareToStringify(a)}},{key:"toJSON",value:function(){return JSON.stringify(this.toObject())}},{key:"getParent",value:function(){return this.parent}},{key:"findAncestors",value:function(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var a=this.parent;a;){if(a===n)return r;a._isMatch(e)&&r.push(a),a=a.parent}return r}},{key:"isAncestorOf",value:function(e){return!1}},{key:"findAncestor",value:function(e,t,n){return this.findAncestors(e,t,n)[0]}},{key:"_isMatch",value:function(e){if(!e)return!1;if("function"===typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),a=r.length;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return t.target=t.target||this,n?this._fireAndBubble(e,t):this._fire(e,t),this}},{key:"getAbsoluteTransform",value:function(e){return e?this._getAbsoluteTransform(e):this._getCache(p,this._getAbsoluteTransform)}},{key:"_getAbsoluteTransform",value:function(e){var t;if(e)return t=new o.Transform,this._eachAncestorReverse((function(e){var n=e.transformsEnabled();"all"===n?t.multiply(e.getTransform()):"position"===n&&t.translate(e.x()-e.offsetX(),e.y()-e.offsetY())}),e),t;t=this._cache.get(p)||new o.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(t):t.reset();var n=this.transformsEnabled();if("all"===n)t.multiply(this.getTransform());else if("position"===n){var r=this.attrs.x||0,a=this.attrs.y||0,i=this.attrs.offsetX||0,l=this.attrs.offsetY||0;t.translate(r-i,a-l)}return t.dirty=!1,t}},{key:"getAbsoluteScale",value:function(e){for(var t=this;t;)t._isUnderCache&&(e=t),t=t.getParent();var n=this.getAbsoluteTransform(e).decompose();return{x:n.scaleX,y:n.scaleY}}},{key:"getAbsoluteRotation",value:function(){return this.getAbsoluteTransform().decompose().rotation}},{key:"getTransform",value:function(){return this._getCache(w,this._getTransform)}},{key:"_getTransform",value:function(){var e,t,n=this._cache.get(w)||new o.Transform;n.reset();var r=this.x(),a=this.y(),i=u.Konva.getAngle(this.rotation()),l=null!==(e=this.attrs.scaleX)&&void 0!==e?e:1,s=null!==(t=this.attrs.scaleY)&&void 0!==t?t:1,c=this.attrs.skewX||0,d=this.attrs.skewY||0,f=this.attrs.offsetX||0,h=this.attrs.offsetY||0;return 0===r&&0===a||n.translate(r,a),0!==i&&n.rotate(i),0===c&&0===d||n.skew(c,d),1===l&&1===s||n.scale(l,s),0===f&&0===h||n.translate(-1*f,-1*h),n.dirty=!1,n}},{key:"clone",value:function(e){var t,n,r,a,i,l=o.Util.cloneObject(this.attrs);for(t in e)l[t]=e[t];var s=new this.constructor(l);for(t in this.eventListeners)for(r=(n=this.eventListeners[t]).length,a=0;a1&&void 0!==arguments[1])||arguments[1];c.DD._dragElements.has(this._id)||this._createDragElement(e),c.DD._dragElements.get(this._id).dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},t)}},{key:"_setDragPosition",value:function(e,t){var n=this.getStage()._getPointerById(t.pointerId);if(n){var r={x:n.x-t.offset.x,y:n.y-t.offset.y},a=this.dragBoundFunc();if(void 0!==a){var i=a.call(this,r,e);i?r=i:o.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===r.x&&this._lastPos.y===r.y||(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}},{key:"stopDrag",value:function(e){var t=c.DD._dragElements.get(this._id);t&&(t.dragStatus="stopped"),c.DD._endDragBefore(e),c.DD._endDragAfter(e)}},{key:"setDraggable",value:function(e){this._setAttr("draggable",e),this._dragChange()}},{key:"isDragging",value:function(){var e=c.DD._dragElements.get(this._id);return!!e&&"dragging"===e.dragStatus}},{key:"_listenDrag",value:function(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",(function(e){var t=this;if((!(void 0!==e.evt.button)||u.Konva.dragButtons.indexOf(e.evt.button)>=0)&&!this.isDragging()){var n=!1;c.DD._dragElements.forEach((function(e){t.isAncestorOf(e.node)&&(n=!0)})),n||this._createDragElement(e)}}))}},{key:"_dragChange",value:function(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;var e=c.DD._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&c.DD._dragElements.delete(this._id)}}},{key:"_dragCleanup",value:function(){this.off("mousedown.konva"),this.off("touchstart.konva")}},{key:"isClientRectOnScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0},t=this.getStage();if(!t)return!1;var n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return o.Util.haveIntersection(n,this.getClientRect())}}],[{key:"create",value:function(e,t){return o.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}},{key:"_createNode",value:function(t,n){var r,a,i,l=e.prototype.getClassName.call(t),s=t.children;if(n&&(t.attrs.container=n),u.Konva[l]||(o.Util.warn('Can not find a node with class name "'+l+'". Fallback to "Shape".'),l="Shape"),r=new(0,u.Konva[l])(t.attrs),s)for(a=s.length,i=0;i0}},{key:"destroy",value:function(){return f.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}},{key:"_useBufferCanvas",value:function(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;var n=e||this.hasFill(),r=this.hasStroke(),a=1!==this.getAbsoluteOpacity();if(n&&r&&a)return!0;var i=this.hasShadow(),o=this.shadowForStrokeEnabled();return!!(n&&r&&i&&o)}},{key:"setStrokeHitEnabled",value:function(e){c.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}},{key:"getStrokeHitEnabled",value:function(){return 0!==this.hitStrokeWidth()}},{key:"getSelfRect",value:function(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}},{key:"getClientRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),a=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,i=r.width+a,o=r.height+a,l=!e.skipShadow&&this.hasShadow(),s=l?this.shadowOffsetX():0,u=l?this.shadowOffsetY():0,c=i+Math.abs(s),d=o+Math.abs(u),f=l&&this.shadowBlur()||0,h={width:c+2*f,height:d+2*f,x:-(a/2+f)+Math.min(s,0)+r.x,y:-(a/2+f)+Math.min(u,0)+r.y};return t?h:this._transformedRect(h,n)}},{key:"drawScene",value:function(e,t){var n,r,a=this.getLayer(),i=e||a.getCanvas(),o=i.getContext(),l=this._getCanvasCache(),s=this.getSceneFunc(),u=this.hasShadow(),c=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(l){o.save();var f=this.getAbsoluteTransform(t).getMatrix();return o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!c){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var h=this.getAbsoluteTransform(t).getMatrix();r.transform(h[0],h[1],h[2],h[3],h[4],h[5]),s.call(this,r,this),r.restore();var p=n.pixelRatio;u&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(o._applyLineJoin(this),!d){h=this.getAbsoluteTransform(t).getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}u&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}},{key:"drawHit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),a=e||r.hitCanvas,i=a&&a.getContext(),o=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),s=l&&l.hit;if(this.colorKey||c.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),s){i.save();var u=this.getAbsoluteTransform(t).getMatrix();return i.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!o)return this;if(i.save(),i._applyLineJoin(this),!(this===t)){var d=this.getAbsoluteTransform(t).getMatrix();i.transform(d[0],d[1],d[2],d[3],d[4],d[5])}return o.call(this,i,this),i.restore(),this}},{key:"drawHitFromCache",value:function(){var e,t,n,r,a,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=this._getCanvasCache(),l=this._getCachedSceneCanvas(),s=o.hit,u=s.getContext(),d=s.getWidth(),f=s.getHeight();u.clear(),u.drawImage(l._canvas,0,0,d,f);try{for(n=(t=(e=u.getImageData(0,0,d,f)).data).length,r=c.Util._hexToRgb(this.colorKey),a=0;ai?(t[a]=r.r,t[a+1]=r.g,t[a+2]=r.b,t[a+3]=255):t[a+3]=0;u.putImageData(e,0,0)}catch(h){c.Util.error("Unable to draw hit graph from cached scene canvas. "+h.message)}return this}},{key:"hasPointerCapture",value:function(e){return v.hasPointerCapture(e,this)}},{key:"setPointerCapture",value:function(e){v.setPointerCapture(e,this)}},{key:"releaseCapture",value:function(e){v.releaseCapture(e,this)}}]),s}(f.Node);t.Shape=S,S.prototype._fillFunc=function(e){var t=this.attrs.fillRule;t?e.fill(t):e.fill()},S.prototype._strokeFunc=function(e){e.stroke()},S.prototype._fillFuncHit=function(e){e.fill()},S.prototype._strokeFuncHit=function(e){e.stroke()},S.prototype._centroid=!1,S.prototype.nodeType="Shape",(0,p._registerNode)(S),S.prototype.eventListeners={},S.prototype.on.call(S.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(g)})),S.prototype.on.call(S.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(m)})),S.prototype.on.call(S.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(y)})),S.prototype.on.call(S.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(b)})),S.prototype.on.call(S.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(x)})),d.Factory.addGetterSetter(S,"stroke",void 0,(0,h.getStringOrGradientValidator)()),d.Factory.addGetterSetter(S,"strokeWidth",2,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"fillAfterStrokeEnabled",!1),d.Factory.addGetterSetter(S,"hitStrokeWidth","auto",(0,h.getNumberOrAutoValidator)()),d.Factory.addGetterSetter(S,"strokeHitEnabled",!0,(0,h.getBooleanValidator)()),d.Factory.addGetterSetter(S,"perfectDrawEnabled",!0,(0,h.getBooleanValidator)()),d.Factory.addGetterSetter(S,"shadowForStrokeEnabled",!0,(0,h.getBooleanValidator)()),d.Factory.addGetterSetter(S,"lineJoin"),d.Factory.addGetterSetter(S,"lineCap"),d.Factory.addGetterSetter(S,"sceneFunc"),d.Factory.addGetterSetter(S,"hitFunc"),d.Factory.addGetterSetter(S,"dash"),d.Factory.addGetterSetter(S,"dashOffset",0,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"shadowColor",void 0,(0,h.getStringValidator)()),d.Factory.addGetterSetter(S,"shadowBlur",0,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"shadowOpacity",1,(0,h.getNumberValidator)()),d.Factory.addComponentsGetterSetter(S,"shadowOffset",["x","y"]),d.Factory.addGetterSetter(S,"shadowOffsetX",0,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"shadowOffsetY",0,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"fillPatternImage"),d.Factory.addGetterSetter(S,"fill",void 0,(0,h.getStringOrGradientValidator)()),d.Factory.addGetterSetter(S,"fillPatternX",0,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"fillPatternY",0,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"fillLinearGradientColorStops"),d.Factory.addGetterSetter(S,"strokeLinearGradientColorStops"),d.Factory.addGetterSetter(S,"fillRadialGradientStartRadius",0),d.Factory.addGetterSetter(S,"fillRadialGradientEndRadius",0),d.Factory.addGetterSetter(S,"fillRadialGradientColorStops"),d.Factory.addGetterSetter(S,"fillPatternRepeat","repeat"),d.Factory.addGetterSetter(S,"fillEnabled",!0),d.Factory.addGetterSetter(S,"strokeEnabled",!0),d.Factory.addGetterSetter(S,"shadowEnabled",!0),d.Factory.addGetterSetter(S,"dashEnabled",!0),d.Factory.addGetterSetter(S,"strokeScaleEnabled",!0),d.Factory.addGetterSetter(S,"fillPriority","color"),d.Factory.addComponentsGetterSetter(S,"fillPatternOffset",["x","y"]),d.Factory.addGetterSetter(S,"fillPatternOffsetX",0,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"fillPatternOffsetY",0,(0,h.getNumberValidator)()),d.Factory.addComponentsGetterSetter(S,"fillPatternScale",["x","y"]),d.Factory.addGetterSetter(S,"fillPatternScaleX",1,(0,h.getNumberValidator)()),d.Factory.addGetterSetter(S,"fillPatternScaleY",1,(0,h.getNumberValidator)()),d.Factory.addComponentsGetterSetter(S,"fillLinearGradientStartPoint",["x","y"]),d.Factory.addComponentsGetterSetter(S,"strokeLinearGradientStartPoint",["x","y"]),d.Factory.addGetterSetter(S,"fillLinearGradientStartPointX",0),d.Factory.addGetterSetter(S,"strokeLinearGradientStartPointX",0),d.Factory.addGetterSetter(S,"fillLinearGradientStartPointY",0),d.Factory.addGetterSetter(S,"strokeLinearGradientStartPointY",0),d.Factory.addComponentsGetterSetter(S,"fillLinearGradientEndPoint",["x","y"]),d.Factory.addComponentsGetterSetter(S,"strokeLinearGradientEndPoint",["x","y"]),d.Factory.addGetterSetter(S,"fillLinearGradientEndPointX",0),d.Factory.addGetterSetter(S,"strokeLinearGradientEndPointX",0),d.Factory.addGetterSetter(S,"fillLinearGradientEndPointY",0),d.Factory.addGetterSetter(S,"strokeLinearGradientEndPointY",0),d.Factory.addComponentsGetterSetter(S,"fillRadialGradientStartPoint",["x","y"]),d.Factory.addGetterSetter(S,"fillRadialGradientStartPointX",0),d.Factory.addGetterSetter(S,"fillRadialGradientStartPointY",0),d.Factory.addComponentsGetterSetter(S,"fillRadialGradientEndPoint",["x","y"]),d.Factory.addGetterSetter(S,"fillRadialGradientEndPointX",0),d.Factory.addGetterSetter(S,"fillRadialGradientEndPointY",0),d.Factory.addGetterSetter(S,"fillPatternRotation",0),d.Factory.addGetterSetter(S,"fillRule",void 0,(0,h.getStringValidator)()),d.Factory.backCompat(S,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})},7580:function(e,t,n){"use strict";var r,a,i,o=n(7424).default,l=n(6690).default,s=n(9728).default,u=n(6115).default,c=n(1588).default,d=n(3808).default,f=n(1655).default,h=n(6389).default,p=n(8416).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;var v=n(2264),g=n(6534),m=n(3890),y=n(2683),b=n(6689),x=n(8252),k=n(2683),S=n(2090),w="mouseleave",_="mouseover",C="mouseenter",P="mousemove",E="mousedown",T="mouseup",A="pointermove",R="pointerdown",M="pointerup",F="pointercancel",N="pointerout",z="pointerleave",O="pointerover",D="pointerenter",L="contextmenu",I="touchstart",j="touchend",B="touchmove",U="touchcancel",V="wheel",G=[[C,"_pointerenter"],[E,"_pointerdown"],[P,"_pointermove"],[T,"_pointerup"],[w,"_pointerleave"],[I,"_pointerdown"],[B,"_pointermove"],[j,"_pointerup"],[U,"_pointercancel"],[_,"_pointerover"],[V,"_wheel"],[L,"_contextmenu"],[R,"_pointerdown"],[A,"_pointermove"],[M,"_pointerup"],[F,"_pointercancel"],["lostpointercapture","_lostpointercapture"]],W={mouse:(r={},p(r,N,"mouseout"),p(r,z,w),p(r,O,_),p(r,D,C),p(r,A,P),p(r,R,E),p(r,M,T),p(r,F,"mousecancel"),p(r,"pointerclick","click"),p(r,"pointerdblclick","dblclick"),r),touch:(a={},p(a,N,"touchout"),p(a,z,"touchleave"),p(a,O,"touchover"),p(a,D,"touchenter"),p(a,A,B),p(a,R,I),p(a,M,j),p(a,F,U),p(a,"pointerclick","tap"),p(a,"pointerdblclick","dbltap"),a),pointer:(i={},p(i,N,N),p(i,z,z),p(i,O,O),p(i,D,D),p(i,A,A),p(i,R,R),p(i,M,M),p(i,F,F),p(i,"pointerclick","pointerclick"),p(i,"pointerdblclick","pointerdblclick"),i)},H=function(e){return e.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse"},$=function(e){var t=H(e);return"pointer"===t?y.Konva.pointerEventsEnabled&&W.pointer:"touch"===t?W.touch:"mouse"===t?W.mouse:void 0};function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.clipFunc||e.clipWidth||e.clipHeight)&&v.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}t.stages=[];var Y=function(e){f(r,e);var n=h(r);function r(e){var a;return l(this,r),(a=n.call(this,q(e)))._pointerPositions=[],a._changedPointerPositions=[],a._buildDOM(),a._bindContentEvents(),t.stages.push(u(a)),a.on("widthChange.konva heightChange.konva",a._resizeDOM),a.on("visibleChange.konva",a._checkVisibility),a.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(function(){q(a.attrs)})),a._checkVisibility(),a}return s(r,[{key:"_validateAdd",value:function(e){var t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||v.Util.throw("You may only add layers to the stage.")}},{key:"_checkVisibility",value:function(){if(this.content){var e=this.visible()?"":"none";this.content.style.display=e}}},{key:"setContainer",value:function(e){if("string"===typeof e){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}},{key:"shouldDrawHit",value:function(){return!0}},{key:"clear",value:function(){var e,t=this.children,n=t.length;for(e=0;e-1&&t.stages.splice(n,1),v.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}},{key:"getPointerPosition",value:function(){var e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(v.Util.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}},{key:"_getPointerById",value:function(e){return this._pointerPositions.find((function(t){return t.id===e}))}},{key:"getPointersPositions",value:function(){return this._pointerPositions}},{key:"getStage",value:function(){return this}},{key:"getContent",value:function(){return this.content}},{key:"_toKonvaCanvas",value:function(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new b.SceneCanvas({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}},{key:"getIntersection",value:function(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){var r=n[t].getIntersection(e);if(r)return r}return null}},{key:"_resizeDOM",value:function(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((function(n){n.setSize({width:e,height:t}),n.draw()}))}},{key:"add",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a1){for(var i=0;i5&&v.Util.warn("The stage has "+o+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),y.Konva.isBrowser&&this.content.appendChild(e.canvas._canvas),this}},{key:"getParent",value:function(){return null}},{key:"getLayer",value:function(){return null}},{key:"hasPointerCapture",value:function(e){return S.hasPointerCapture(e,this)}},{key:"setPointerCapture",value:function(e){S.setPointerCapture(e,this)}},{key:"releaseCapture",value:function(e){S.releaseCapture(e,this)}},{key:"getLayers",value:function(){return this.children}},{key:"_bindContentEvents",value:function(){var e=this;y.Konva.isBrowser&&G.forEach((function(t){var n=o(t,2),r=n[0],a=n[1];e.content.addEventListener(r,(function(t){e[a](t)}),{passive:!1})}))}},{key:"_pointerenter",value:function(e){this.setPointersPositions(e);var t=$(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}},{key:"_pointerover",value:function(e){this.setPointersPositions(e);var t=$(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}},{key:"_getTargetShape",value:function(e){var t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}},{key:"_pointerleave",value:function(e){var t=$(e.type),n=H(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),a=!x.DD.isDragging||y.Konva.hitOnDragEnabled;r&&a?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):a&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}},{key:"_pointerdown",value:function(e){var t=this,n=$(e.type),r=H(e.type);if(n){this.setPointersPositions(e);var a=!1;this._changedPointerPositions.forEach((function(i){var o=t.getIntersection(i);if(x.DD.justDragged=!1,y.Konva["_"+r+"ListenClick"]=!0,o&&o.isListening()){y.Konva.capturePointerEventsEnabled&&o.setPointerCapture(i.id),t[r+"ClickStartShape"]=o,o._fireAndBubble(n.pointerdown,{evt:e,pointerId:i.id}),a=!0;var l=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&l&&e.preventDefault()}})),a||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}},{key:"_pointermove",value:function(e){var t=this,n=$(e.type),r=H(e.type);if(n&&(x.DD.isDragging&&x.DD.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!x.DD.isDragging||y.Konva.hitOnDragEnabled)){var a={},i=!1,o=this._getTargetShape(r);this._changedPointerPositions.forEach((function(l){var s=S.getCapturedShape(l.id)||t.getIntersection(l),u=l.id,c={evt:e,pointerId:u},d=o!==s;if(d&&o&&(o._fireAndBubble(n.pointerout,Object.assign({},c),s),o._fireAndBubble(n.pointerleave,Object.assign({},c),s)),s){if(a[s._id])return;a[s._id]=!0}s&&s.isListening()?(i=!0,d&&(s._fireAndBubble(n.pointerover,Object.assign({},c),o),s._fireAndBubble(n.pointerenter,Object.assign({},c),o),t[r+"targetShape"]=s),s._fireAndBubble(n.pointermove,Object.assign({},c))):o&&(t._fire(n.pointerover,{evt:e,target:t,currentTarget:t,pointerId:u}),t[r+"targetShape"]=null)})),i||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}}},{key:"_pointerup",value:function(e){var t=this,n=$(e.type),r=H(e.type);if(n){this.setPointersPositions(e);var a=this[r+"ClickStartShape"],i=this[r+"ClickEndShape"],o={},l=!1;this._changedPointerPositions.forEach((function(s){var u=S.getCapturedShape(s.id)||t.getIntersection(s);if(u){if(u.releaseCapture(s.id),o[u._id])return;o[u._id]=!0}var c=s.id,d={evt:e,pointerId:c},f=!1;y.Konva["_"+r+"InDblClickWindow"]?(f=!0,clearTimeout(t[r+"DblTimeout"])):x.DD.justDragged||(y.Konva["_"+r+"InDblClickWindow"]=!0,clearTimeout(t[r+"DblTimeout"])),t[r+"DblTimeout"]=setTimeout((function(){y.Konva["_"+r+"InDblClickWindow"]=!1}),y.Konva.dblClickWindow),u&&u.isListening()?(l=!0,t[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},d)),y.Konva["_"+r+"ListenClick"]&&a&&a===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},d)),f&&i&&i===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},d)))):(t[r+"ClickEndShape"]=null,y.Konva["_"+r+"ListenClick"]&&t._fire(n.pointerclick,{evt:e,target:t,currentTarget:t,pointerId:c}),f&&t._fire(n.pointerdblclick,{evt:e,target:t,currentTarget:t,pointerId:c}))})),l||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),y.Konva["_"+r+"ListenClick"]=!1,e.cancelable&&"touch"!==r&&e.preventDefault()}}},{key:"_contextmenu",value:function(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(L,{evt:e}):this._fire(L,{evt:e,target:this,currentTarget:this})}},{key:"_wheel",value:function(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(V,{evt:e}):this._fire(V,{evt:e,target:this,currentTarget:this})}},{key:"_pointercancel",value:function(e){this.setPointersPositions(e);var t=S.getCapturedShape(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(M,S.createEvent(e)),S.releaseCapture(e.pointerId)}},{key:"_lostpointercapture",value:function(e){S.releaseCapture(e.pointerId)}},{key:"setPointersPositions",value:function(e){var t=this,n=this._getContentPosition(),r=null,a=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(function(e){t._pointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(function(e){t._changedPointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})}))):(r=(e.clientX-n.left)/n.scaleX,a=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:a},this._pointerPositions=[{x:r,y:a,id:v.Util._getFirstPointerId(e)}],this._changedPointerPositions=[{x:r,y:a,id:v.Util._getFirstPointerId(e)}])}},{key:"_setPointerPosition",value:function(e){v.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}},{key:"_getContentPosition",value:function(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}},{key:"_buildDOM",value:function(){if(this.bufferCanvas=new b.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new b.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),y.Konva.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}},{key:"cache",value:function(){return v.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}},{key:"clearCache",value:function(){return this}},{key:"batchDraw",value:function(){return this.getChildren().forEach((function(e){e.batchDraw()})),this}}]),r}(m.Container);t.Stage=Y,Y.prototype.nodeType="Stage",(0,k._registerNode)(Y),g.Factory.addGetterSetter(Y,"container")},7483:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;var i=n(2264),o=n(8660),l=n(2585),s=n(2683),u={node:1,duration:1,easing:1,onFinish:1,yoyo:1},c=0,d=["fill","stroke","shadowColor"],f=function(){function e(t,n,a,i,o,l,s){r(this,e),this.prop=t,this.propFunc=n,this.begin=i,this._pos=i,this.duration=l,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=a,this._change=o-this.begin,this.pause()}return a(e,[{key:"fire",value:function(e){var t=this[e];t&&t()}},{key:"setTime",value:function(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}},{key:"getTime",value:function(){return this._time}},{key:"setPosition",value:function(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}},{key:"getPosition",value:function(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}},{key:"play",value:function(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}},{key:"reverse",value:function(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}},{key:"seek",value:function(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}},{key:"reset",value:function(){this.pause(),this._time=0,this.update(),this.fire("onReset")}},{key:"finish",value:function(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}},{key:"update",value:function(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}},{key:"onEnterFrame",value:function(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}},{key:"pause",value:function(){this.state=1,this.fire("onPause")}},{key:"getTimer",value:function(){return(new Date).getTime()}}]),e}(),h=function(){function e(n){r(this,e);var a,l,d=this,h=n.node,p=h._id,v=n.easing||t.Easings.Linear,g=!!n.yoyo;a="undefined"===typeof n.duration?.3:0===n.duration?.001:n.duration,this.node=h,this._id=c++;var m=h.getLayer()||(h instanceof s.Konva.Stage?h.getLayers():null);for(l in m||i.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new o.Animation((function(){d.tween.onEnterFrame()}),m),this.tween=new f(l,(function(e){d._tweenFunc(e)}),v,0,1,1e3*a,g),this._addListeners(),e.attrs[p]||(e.attrs[p]={}),e.attrs[p][this._id]||(e.attrs[p][this._id]={}),e.tweens[p]||(e.tweens[p]={}),n)void 0===u[l]&&this._addAttr(l,n[l]);this.reset(),this.onFinish=n.onFinish,this.onReset=n.onReset,this.onUpdate=n.onUpdate}return a(e,[{key:"_addAttr",value:function(t,n){var r,a,o,l,s,u,c,f,h=this.node,p=h._id;if((o=e.tweens[p][t])&&delete e.attrs[p][o][t],r=h.getAttr(t),i.Util._isArray(n))if(a=[],s=Math.max(n.length,r.length),"points"===t&&n.length!==r.length&&(n.length>r.length?(c=r,r=i.Util._prepareArrayForTween(r,n,h.closed())):(u=n,n=i.Util._prepareArrayForTween(n,r,h.closed()))),0===t.indexOf("fill"))for(l=0;l0&&void 0!==arguments[0]?arguments[0]:[1,0,0,1,0,0];a(this,e),this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}return i(e,[{key:"reset",value:function(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}},{key:"copy",value:function(){return new e(this.m)}},{key:"copyInto",value:function(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}},{key:"point",value:function(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}},{key:"translate",value:function(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}},{key:"scale",value:function(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,a=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,o=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=a,this.m[2]=i,this.m[3]=o,this}},{key:"getTranslation",value:function(){return{x:this.m[4],y:this.m[5]}}},{key:"skew",value:function(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,a=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=a,this.m[3]=i,this}},{key:"multiply",value:function(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],a=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],o=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=a,this.m[4]=i,this.m[5]=o,this}},{key:"invert",value:function(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,a=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=a,this.m[4]=i,this.m[5]=o,this}},{key:"getMatrix",value:function(){return this.m}},{key:"decompose",value:function(){var e=this.m[0],n=this.m[1],r=this.m[2],a=this.m[3],i=e*a-n*r,o={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=n){var l=Math.sqrt(e*e+n*n);o.rotation=n>0?Math.acos(e/l):-Math.acos(e/l),o.scaleX=l,o.scaleY=i/l,o.skewX=(e*r+n*a)/i,o.skewY=0}else if(0!=r||0!=a){var s=Math.sqrt(r*r+a*a);o.rotation=Math.PI/2-(a>0?Math.acos(-r/s):-Math.acos(r/s)),o.scaleX=i/s,o.scaleY=s,o.skewX=0,o.skewY=(e*r+n*a)/i}return o.rotation=t.Util._getRotation(o.rotation),o}}]),e}();t.Transform=l;var s=Math.PI/180,u=180/Math.PI,c="Konva error: ",d={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},f=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,h=[],p="undefined"!==typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)};t.Util={_isElement:function(e){return!(!e||1!=e.nodeType)},_isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject:function(e){return!!e&&e.constructor===Object},_isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},_isNumber:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e)},_isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},_isBoolean:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},isObject:function(e){return e instanceof Object},isValidSelector:function(e){if("string"!==typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:function(e){return 0===e||e>0?1:-1},requestAnimFrame:function(e){h.push(e),1===h.length&&p((function(){var e=h;h=[],e.forEach((function(e){e()}))}))},createCanvasElement:function(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(t){}return e},createImageElement:function(){return document.createElement("img")},_isInDocument:function(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage:function(e,n){var r=t.Util.createImageElement();r.onload=function(){n(r)},r.src=e},_rgbToHex:function(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb:function(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor:function(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB:function(e){var t;return e in d?{r:(t=d[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=f.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:function(e){return e=e||"black",t.Util._namedColorToRBA(e)||t.Util._hex3ColorToRGBA(e)||t.Util._hex4ColorToRGBA(e)||t.Util._hex6ColorToRGBA(e)||t.Util._hex8ColorToRGBA(e)||t.Util._rgbColorToRGBA(e)||t.Util._rgbaColorToRGBA(e)||t.Util._hslColorToRGBA(e)},_namedColorToRBA:function(e){var t=d[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA:function(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA:function(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map((function(e,t){return"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)}));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA:function(e){if("#"===e[0]&&9===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA:function(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA:function(e){if("#"===e[0]&&5===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA:function(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA:function(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){var t,n,a,i=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),o=r(i),l=(o[0],o.slice(1)),s=Number(l[0])/360,u=Number(l[1])/100,c=Number(l[2])/100;if(0===u)return a=255*c,{r:Math.round(a),g:Math.round(a),b:Math.round(a),a:1};for(var d=2*c-(t=c<.5?c*(1+u):c+u-c*u),f=[0,0,0],h=0;h<3;h++)(n=s+1/3*-(h-1))<0&&n++,n>1&&n--,a=6*n<1?d+6*(t-d)*n:2*n<1?t:3*n<2?d+(t-d)*(2/3-n)*6:d,f[h]=255*a;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[2]),a:1}}},haveIntersection:function(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(o=n,l=r,s=(n-a)*(n-a)+(r-i)*(r-i)):s=((o=e+c*(n-e))-a)*(o-a)+((l=t+c*(r-t))-i)*(l-i)}return[o,l,s]},_getProjectionToLine:function(e,n,r){var a=t.Util.cloneObject(e),i=Number.MAX_VALUE;return n.forEach((function(o,l){if(r||l!==n.length-1){var s=n[(l+1)%n.length],u=t.Util._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),c=u[0],d=u[1],f=u[2];fn.length){var l=n;n=e,e=l}for(a=0;a255?255:e<0?0:Math.round(e)},t.alphaComponent=function(e){return e>1?1:e<1e-4?1e-4:e},t.getNumberValidator=function(){if(r.Konva.isUnminified)return function(e,t){return a.Util._isNumber(e)||a.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}},t.getNumberOrArrayOfNumbersValidator=function(e){if(r.Konva.isUnminified)return function(t,n){var r=a.Util._isNumber(t),o=a.Util._isArray(t)&&t.length==e;return r||o||a.Util.warn(i(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}},t.getNumberOrAutoValidator=function(){if(r.Konva.isUnminified)return function(e,t){return a.Util._isNumber(e)||"auto"===e||a.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}},t.getStringValidator=function(){if(r.Konva.isUnminified)return function(e,t){return a.Util._isString(e)||a.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}},t.getStringOrGradientValidator=function(){if(r.Konva.isUnminified)return function(e,t){var n=a.Util._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||a.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}},t.getFunctionValidator=function(){if(r.Konva.isUnminified)return function(e,t){return a.Util._isFunction(e)||a.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}},t.getNumberArrayValidator=function(){if(r.Konva.isUnminified)return function(e,t){var n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(a.Util._isArray(e)?e.forEach((function(e){a.Util._isNumber(e)||a.Util.warn('"'+t+'" attribute has non numeric element '+e+". Make sure that all elements are numbers.")})):a.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}},t.getBooleanValidator=function(){if(r.Konva.isUnminified)return function(e,t){return!0===e||!1===e||a.Util.warn(i(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}},t.getComponentValidator=function(e){if(r.Konva.isUnminified)return function(t,n){return void 0===t||null===t||a.Util.isObject(t)||a.Util.warn(i(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}},518:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=n(2683),a=n(2264),i=n(2585),o=n(3890),l=n(7580),s=n(115),u=n(5573),c=n(7675),d=n(8252),f=n(9132),h=n(8660),p=n(7483),v=n(3110),g=n(6689);t.Konva=a.Util._assign(r.Konva,{Util:a.Util,Transform:a.Transform,Node:i.Node,Container:o.Container,Stage:l.Stage,stages:l.stages,Layer:s.Layer,FastLayer:u.FastLayer,Group:c.Group,DD:d.DD,Shape:f.Shape,shapes:f.shapes,Animation:h.Animation,Tween:p.Tween,Easings:p.Easings,Context:v.Context,Canvas:g.Canvas}),t.default=t.Konva},805:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=n(518),a=n(2012),i=n(2830),o=n(2259),l=n(4321),s=n(6487),u=n(9962),c=n(1384),d=n(5355),f=n(8240),h=n(9237),p=n(1623),v=n(462),g=n(9954),m=n(5215),y=n(9667),b=n(9382),x=n(8861),k=n(7406),S=n(5068),w=n(6010),_=n(1463),C=n(7266),P=n(5776),E=n(2794),T=n(1499),A=n(7099),R=n(3905),M=n(3753),F=n(8447),N=n(4652),z=n(9224),O=n(7116),D=n(1027),L=n(1686),I=n(8958),j=n(7121);t.Konva=r.Konva.Util._assign(r.Konva,{Arc:a.Arc,Arrow:i.Arrow,Circle:o.Circle,Ellipse:l.Ellipse,Image:s.Image,Label:u.Label,Tag:u.Tag,Line:c.Line,Path:d.Path,Rect:f.Rect,RegularPolygon:h.RegularPolygon,Ring:p.Ring,Sprite:v.Sprite,Star:g.Star,Text:m.Text,TextPath:y.TextPath,Transformer:b.Transformer,Wedge:x.Wedge,Filters:{Blur:k.Blur,Brighten:S.Brighten,Contrast:w.Contrast,Emboss:_.Emboss,Enhance:C.Enhance,Grayscale:P.Grayscale,HSL:E.HSL,HSV:T.HSV,Invert:A.Invert,Kaleidoscope:R.Kaleidoscope,Mask:M.Mask,Noise:F.Noise,Pixelate:N.Pixelate,Posterize:z.Posterize,RGB:O.RGB,RGBA:D.RGBA,Sepia:L.Sepia,Solarize:I.Solarize,Threshold:j.Threshold}})},7406:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Blur=void 0;var r=n(6534),a=n(2585),i=n(8999);function o(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var l=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],s=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];t.Blur=function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,a,i,u,c,d,f,h,p,v,g,m,y,b,x,k,S,w,_,C,P,E,T,A=e.data,R=e.width,M=e.height,F=t+t+1,N=R-1,z=M-1,O=t+1,D=O*(O+1)/2,L=new o,I=null,j=L,B=null,U=null,V=l[t],G=s[t];for(a=1;a>G,0!==E?(E=255/E,A[c]=(f*V>>G)*E,A[c+1]=(h*V>>G)*E,A[c+2]=(p*V>>G)*E):A[c]=A[c+1]=A[c+2]=0,f-=g,h-=m,p-=y,v-=b,g-=B.r,m-=B.g,y-=B.b,b-=B.a,i=d+((i=n+t+1)>G,E>0?(E=255/E,A[i]=(f*V>>G)*E,A[i+1]=(h*V>>G)*E,A[i+2]=(p*V>>G)*E):A[i]=A[i+1]=A[i+2]=0,f-=g,h-=m,p-=y,v-=b,g-=B.r,m-=B.g,y-=B.b,b-=B.a,i=n+((i=r+O)255?255:i,o=(o*=255)<0?0:o>255?255:o,l=(l*=255)<0?0:l>255?255:l,r[t]=i,r[t+1]=o,r[t+2]=l},r.Factory.addGetterSetter(a.Node,"contrast",0,(0,i.getNumberValidator)(),r.Factory.afterSetFilter)},1463:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Emboss=void 0;var r=n(6534),a=n(2585),i=n(2264),o=n(8999);t.Emboss=function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),a=this.embossBlend(),o=0,l=0,s=e.data,u=e.width,c=e.height,d=4*u,f=c;switch(r){case"top-left":o=-1,l=-1;break;case"top":o=-1,l=0;break;case"top-right":o=-1,l=1;break;case"right":o=0,l=1;break;case"bottom-right":o=1,l=1;break;case"bottom":o=1,l=0;break;case"bottom-left":o=1,l=-1;break;case"left":o=0,l=-1;break;default:i.Util.error("Unknown emboss direction: "+r)}do{var h=(f-1)*d,p=o;f+p<1&&(p=0),f+p>c&&(p=0);var v=(f-1+p)*u*4,g=u;do{var m=h+4*(g-1),y=l;g+y<1&&(y=0),g+y>u&&(y=0);var b=v+4*(g-1+y),x=s[m]-s[b],k=s[m+1]-s[b+1],S=s[m+2]-s[b+2],w=x,_=w>0?w:-w;if((k>0?k:-k)>_&&(w=k),(S>0?S:-S)>_&&(w=S),w*=t,a){var C=s[m]+w,P=s[m+1]+w,E=s[m+2]+w;s[m]=C>255?255:C<0?0:C,s[m+1]=P>255?255:P<0?0:P,s[m+2]=E>255?255:E<0?0:E}else{var T=n-w;T<0?T=0:T>255&&(T=255),s[m]=s[m+1]=s[m+2]=T}}while(--g)}while(--f)},r.Factory.addGetterSetter(a.Node,"embossStrength",.5,(0,o.getNumberValidator)(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(a.Node,"embossWhiteLevel",.5,(0,o.getNumberValidator)(),r.Factory.afterSetFilter),r.Factory.addGetterSetter(a.Node,"embossDirection","top-left",null,r.Factory.afterSetFilter),r.Factory.addGetterSetter(a.Node,"embossBlend",!1,null,r.Factory.afterSetFilter)},7266:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enhance=void 0;var r=n(6534),a=n(2585),i=n(8999);function o(e,t,n,r,a){var i=n-t,o=a-r;return 0===i?r+o/2:0===o?r:o*((e-t)/i)+r}t.Enhance=function(e){var t,n,r,a,i=e.data,l=i.length,s=i[0],u=s,c=i[1],d=c,f=i[2],h=f,p=this.enhance();if(0!==p){for(a=0;au&&(u=t),(n=i[a+1])d&&(d=n),(r=i[a+2])h&&(h=r);var v,g,m,y,b,x,k,S,w;for(u===s&&(u=255,s=0),d===c&&(d=255,c=0),h===f&&(h=255,f=0),p>0?(g=u+p*(255-u),m=s-p*(s-0),b=d+p*(255-d),x=c-p*(c-0),S=h+p*(255-h),w=f-p*(f-0)):(g=u+p*(u-(v=.5*(u+s))),m=s+p*(s-v),b=d+p*(d-(y=.5*(d+c))),x=c+p*(c-y),S=h+p*(h-(k=.5*(h+f))),w=f+p*(f-k)),a=0;am?o:m;var y,b,x,k,S=c,w=u,_=360/w*Math.PI/180;for(b=0;bd&&(x=b,k=0,S=-1),n=0;nb?s:b;var x,k,S,w=f,_=d,C=n.polarRotation||0;for(a=0;a=0&&h=0&&p=0&&h=0&&p=1020?255:0}return o}(t=function(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],a=Math.round(Math.sqrt(r.length)),i=Math.floor(a/2),o=[],l=0;l=0&&h=0&&p=m))for(n=d;n=y||(i+=k[(r=4*(m*n+t))+0],o+=k[r+1],l+=k[r+2],s+=k[r+3],v+=1);for(i/=v,o/=v,l/=v,s/=v,t=u;t=m))for(n=d;n=y||(k[(r=4*(m*n+t))+0]=i,k[r+1]=o,k[r+2]=l,k[r+3]=s)}},r.Factory.addGetterSetter(i.Node,"pixelSize",8,(0,o.getNumberValidator)(),r.Factory.afterSetFilter)},9224:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Posterize=void 0;var r=n(6534),a=n(2585),i=n(8999);t.Posterize=function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,a=r.length,i=255/n;for(t=0;t255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(a.Node,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(a.Node,"blue",0,i.RGBComponent,r.Factory.afterSetFilter)},1027:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RGBA=void 0;var r=n(6534),a=n(2585),i=n(8999);t.RGBA=function(e){var t,n,r=e.data,a=r.length,i=this.red(),o=this.green(),l=this.blue(),s=this.alpha();for(t=0;t255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(a.Node,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),r.Factory.addGetterSetter(a.Node,"blue",0,i.RGBComponent,r.Factory.afterSetFilter),r.Factory.addGetterSetter(a.Node,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}))},1686:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sepia=void 0;t.Sepia=function(e){var t,n,r,a,i=e.data,o=i.length;for(t=0;t127&&(s=255-s),u>127&&(u=255-u),c>127&&(c=255-c),t[l]=s,t[l+1]=u,t[l+2]=c}while(--o)}while(--a)}},7121:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Threshold=void 0;var r=n(6534),a=n(2585),i=n(8999);t.Threshold=function(e){var t,n=255*this.threshold(),r=e.data,a=r.length;for(t=0;t0?e:t),s=i*(i>0?e:t),c=o*(o>0?t:e);return{x:l,y:n?-1*c:s,width:1*t-l,height:c-s}}}]),n}(s.Shape);t.Arc=f,f.prototype._centroid=!0,f.prototype.className="Arc",f.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,d._registerNode)(f),l.Factory.addGetterSetter(f,"innerRadius",0,(0,c.getNumberValidator)()),l.Factory.addGetterSetter(f,"outerRadius",0,(0,c.getNumberValidator)()),l.Factory.addGetterSetter(f,"angle",0,(0,c.getNumberValidator)()),l.Factory.addGetterSetter(f,"clockwise",!1,(0,c.getBooleanValidator)())},2830:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1588).default,o=n(3808).default,l=n(1655).default,s=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Arrow=void 0;var u=n(6534),c=n(1384),d=n(8999),f=n(2683),h=n(5355),p=function(e){l(n,e);var t=s(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"_sceneFunc",value:function(e){i(o(n.prototype),"_sceneFunc",this).call(this,e);var t=2*Math.PI,r=this.points(),a=r,l=0!==this.tension()&&r.length>4;l&&(a=this.getTensionPoints());var s,u,c=this.pointerLength(),d=r.length;if(l){var f=[a[a.length-4],a[a.length-3],a[a.length-2],a[a.length-1],r[d-2],r[d-1]],p=h.Path.calcLength(a[a.length-4],a[a.length-3],"C",f),v=h.Path.getPointOnQuadraticBezier(Math.min(1,1-c/p),f[0],f[1],f[2],f[3],f[4],f[5]);s=r[d-2]-v.x,u=r[d-1]-v.y}else s=r[d-2]-r[d-4],u=r[d-1]-r[d-3];var g=(Math.atan2(u,s)+t)%t,m=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[d-2],r[d-1]),e.rotate(g),e.moveTo(0,0),e.lineTo(-c,m/2),e.lineTo(-c,-m/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),l?(s=(a[0]+a[2])/2-r[0],u=(a[1]+a[3])/2-r[1]):(s=r[2]-r[0],u=r[3]-r[1]),e.rotate((Math.atan2(-u,-s)+t)%t),e.moveTo(0,0),e.lineTo(-c,m/2),e.lineTo(-c,-m/2),e.closePath(),e.restore(),this.__fillStroke(e))}},{key:"__fillStroke",value:function(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}},{key:"getSelfRect",value:function(){var e=i(o(n.prototype),"getSelfRect",this).call(this),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}]),n}(c.Line);t.Arrow=p,p.prototype.className="Arrow",(0,f._registerNode)(p),u.Factory.addGetterSetter(p,"pointerLength",10,(0,d.getNumberValidator)()),u.Factory.addGetterSetter(p,"pointerWidth",10,(0,d.getNumberValidator)()),u.Factory.addGetterSetter(p,"pointerAtBeginning",!1),u.Factory.addGetterSetter(p,"pointerAtEnding",!0)},2259:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1655).default,o=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Circle=void 0;var l=n(6534),s=n(9132),u=n(8999),c=n(2683),d=function(e){i(n,e);var t=o(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"_sceneFunc",value:function(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radius()}},{key:"getHeight",value:function(){return 2*this.radius()}},{key:"setWidth",value:function(e){this.radius()!==e/2&&this.radius(e/2)}},{key:"setHeight",value:function(e){this.radius()!==e/2&&this.radius(e/2)}}]),n}(s.Shape);t.Circle=d,d.prototype._centroid=!0,d.prototype.className="Circle",d.prototype._attrsAffectingSize=["radius"],(0,c._registerNode)(d),l.Factory.addGetterSetter(d,"radius",0,(0,u.getNumberValidator)())},4321:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1655).default,o=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Ellipse=void 0;var l=n(6534),s=n(9132),u=n(8999),c=n(2683),d=function(e){i(n,e);var t=o(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"_sceneFunc",value:function(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radiusX()}},{key:"getHeight",value:function(){return 2*this.radiusY()}},{key:"setWidth",value:function(e){this.radiusX(e/2)}},{key:"setHeight",value:function(e){this.radiusY(e/2)}}]),n}(s.Shape);t.Ellipse=d,d.prototype.className="Ellipse",d.prototype._centroid=!0,d.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,c._registerNode)(d),l.Factory.addComponentsGetterSetter(d,"radius",["x","y"]),l.Factory.addGetterSetter(d,"radiusX",0,(0,u.getNumberValidator)()),l.Factory.addGetterSetter(d,"radiusY",0,(0,u.getNumberValidator)())},6487:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1588).default,o=n(3808).default,l=n(1655).default,s=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Image=void 0;var u=n(2264),c=n(6534),d=n(9132),f=n(2683),h=n(8999),p=function(e){l(n,e);var t=s(n);function n(e){var a;return r(this,n),(a=t.call(this,e)).on("imageChange.konva",(function(){a._setImageLoad()})),a._setImageLoad(),a}return a(n,[{key:"_setImageLoad",value:function(){var e=this,t=this.image();t&&t.complete||t&&4===t.readyState||t&&t.addEventListener&&t.addEventListener("load",(function(){e._requestDraw()}))}},{key:"_useBufferCanvas",value:function(){return i(o(n.prototype),"_useBufferCanvas",this).call(this,!0)}},{key:"_sceneFunc",value:function(e){var t,n=this.getWidth(),r=this.getHeight(),a=this.cornerRadius(),i=this.attrs.image;if(i){var o=this.attrs.cropWidth,l=this.attrs.cropHeight;t=o&&l?[i,this.cropX(),this.cropY(),o,l,0,0,n,r]:[i,0,0,n,r]}(this.hasFill()||this.hasStroke()||a)&&(e.beginPath(),a?u.Util.drawRoundedRectPath(e,n,r,a):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),i&&(a&&e.clip(),e.drawImage.apply(e,t))}},{key:"_hitFunc",value:function(e){var t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?u.Util.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}},{key:"getHeight",value:function(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}}],[{key:"fromURL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=u.Util.createImageElement();a.onload=function(){var e=new n({image:a});t(e)},a.onerror=r,a.crossOrigin="Anonymous",a.src=e}}]),n}(d.Shape);t.Image=p,p.prototype.className="Image",(0,f._registerNode)(p),c.Factory.addGetterSetter(p,"cornerRadius",0,(0,h.getNumberOrArrayOfNumbersValidator)(4)),c.Factory.addGetterSetter(p,"image"),c.Factory.addComponentsGetterSetter(p,"crop",["x","y","width","height"]),c.Factory.addGetterSetter(p,"cropX",0,(0,h.getNumberValidator)()),c.Factory.addGetterSetter(p,"cropY",0,(0,h.getNumberValidator)()),c.Factory.addGetterSetter(p,"cropWidth",0,(0,h.getNumberValidator)()),c.Factory.addGetterSetter(p,"cropHeight",0,(0,h.getNumberValidator)())},9962:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1655).default,o=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=t.Label=void 0;var l=n(6534),s=n(9132),u=n(7675),c=n(8999),d=n(2683),f=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],h="up",p="right",v="down",g="left",m=f.length,y=function(e){i(n,e);var t=o(n);function n(e){var a;return r(this,n),(a=t.call(this,e)).on("add.konva",(function(e){this._addListeners(e.child),this._sync()})),a}return a(n,[{key:"getText",value:function(){return this.find("Text")[0]}},{key:"getTag",value:function(){return this.find("Tag")[0]}},{key:"_addListeners",value:function(e){var t,n=this,r=function(){n._sync()};for(t=0;t4){for(n=(t=this.getTensionPoints()).length,r=l?0:4,l||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);ru?s:u,v=s>u?1:s/u,g=s>u?u/s:1;e.translate(o,l),e.rotate(f),e.scale(v,g),e.arc(0,0,p,c,c+d,1-h),e.scale(1/v,1/g),e.rotate(-f),e.translate(-o,-l);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}},{key:"getSelfRect",value:function(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var r=t.points[4],a=t.points[5],i=t.points[4]+a,o=Math.PI/180;if(Math.abs(r-i)i;l-=o){var s=n.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],l,0);e.push(s.x,s.y)}else for(var u=r+o;ut[a].pathLength;)e-=t[a].pathLength,++a;if(a===i)return{x:(r=t[a-1].points.slice(-2))[0],y:r[1]};if(e<.01)return{x:(r=t[a].points.slice(0,2))[0],y:r[1]};var o=t[a],l=o.points;switch(o.command){case"L":return n.getPointOnLine(e,o.start.x,o.start.y,l[0],l[1]);case"C":return n.getPointOnCubicBezier((0,c.t2length)(e,n.getPathLength(t),(function(e){return(0,c.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],e)})),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return n.getPointOnQuadraticBezier((0,c.t2length)(e,n.getPathLength(t),(function(e){return(0,c.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],e)})),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var s=l[0],u=l[1],d=l[2],f=l[3],h=l[4],p=l[5],v=l[6];return h+=p*e/o.pathLength,n.getPointOnEllipticalArc(s,u,d,f,h,v)}return null}},{key:"getPointOnLine",value:function(e,t,n,r,a,i,o){void 0===i&&(i=t),void 0===o&&(o=n);var l=(a-n)/(r-t+1e-8),s=Math.sqrt(e*e/(1+l*l));r0&&!isNaN(h[0]);){var m,y,b,x,k,S,w,_,C,P,E=null,T=[],A=s,R=u;switch(f){case"l":s+=h.shift(),u+=h.shift(),E="L",T.push(s,u);break;case"L":s=h.shift(),u=h.shift(),T.push(s,u);break;case"m":var M=h.shift(),F=h.shift();if(s+=M,u+=F,E="M",o.length>2&&"z"===o[o.length-1].command)for(var N=o.length-2;N>=0;N--)if("M"===o[N].command){s=o[N].points[0]+M,u=o[N].points[1]+F;break}T.push(s,u),f="l";break;case"M":s=h.shift(),u=h.shift(),E="M",T.push(s,u),f="L";break;case"h":s+=h.shift(),E="L",T.push(s,u);break;case"H":s=h.shift(),E="L",T.push(s,u);break;case"v":u+=h.shift(),E="L",T.push(s,u);break;case"V":u=h.shift(),E="L",T.push(s,u);break;case"C":T.push(h.shift(),h.shift(),h.shift(),h.shift()),s=h.shift(),u=h.shift(),T.push(s,u);break;case"c":T.push(s+h.shift(),u+h.shift(),s+h.shift(),u+h.shift()),s+=h.shift(),u+=h.shift(),E="C",T.push(s,u);break;case"S":y=s,b=u,"C"===(m=o[o.length-1]).command&&(y=s+(s-m.points[2]),b=u+(u-m.points[3])),T.push(y,b,h.shift(),h.shift()),s=h.shift(),u=h.shift(),E="C",T.push(s,u);break;case"s":y=s,b=u,"C"===(m=o[o.length-1]).command&&(y=s+(s-m.points[2]),b=u+(u-m.points[3])),T.push(y,b,s+h.shift(),u+h.shift()),s+=h.shift(),u+=h.shift(),E="C",T.push(s,u);break;case"Q":T.push(h.shift(),h.shift()),s=h.shift(),u=h.shift(),T.push(s,u);break;case"q":T.push(s+h.shift(),u+h.shift()),s+=h.shift(),u+=h.shift(),E="Q",T.push(s,u);break;case"T":y=s,b=u,"Q"===(m=o[o.length-1]).command&&(y=s+(s-m.points[0]),b=u+(u-m.points[1])),s=h.shift(),u=h.shift(),E="Q",T.push(y,b,s,u);break;case"t":y=s,b=u,"Q"===(m=o[o.length-1]).command&&(y=s+(s-m.points[0]),b=u+(u-m.points[1])),s+=h.shift(),u+=h.shift(),E="Q",T.push(y,b,s,u);break;case"A":x=h.shift(),k=h.shift(),S=h.shift(),w=h.shift(),_=h.shift(),C=s,P=u,s=h.shift(),u=h.shift(),E="A",T=this.convertEndpointToCenterParameterization(C,P,s,u,w,_,x,k,S);break;case"a":x=h.shift(),k=h.shift(),S=h.shift(),w=h.shift(),_=h.shift(),C=s,P=u,s+=h.shift(),u+=h.shift(),E="A",T=this.convertEndpointToCenterParameterization(C,P,s,u,w,_,x,k,S)}o.push({command:E||f,points:T,start:{x:A,y:R},pathLength:this.calcLength(A,R,E||f,T)})}"z"!==f&&"Z"!==f||o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}},{key:"calcLength",value:function(e,t,r,a){var i,o,l,s,u=n;switch(r){case"L":return u.getLineLength(e,t,a[0],a[1]);case"C":return(0,c.getCubicArcLength)([e,a[0],a[2],a[4]],[t,a[1],a[3],a[5]],1);case"Q":return(0,c.getQuadraticArcLength)([e,a[0],a[2]],[t,a[1],a[3]],1);case"A":i=0;var d=a[4],f=a[5],h=a[4]+f,p=Math.PI/180;if(Math.abs(d-h)h;s-=p)l=u.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],s,0),i+=u.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(s=d+p;s1&&(o*=Math.sqrt(f),l*=Math.sqrt(f));var h=Math.sqrt((o*o*(l*l)-o*o*(d*d)-l*l*(c*c))/(o*o*(d*d)+l*l*(c*c)));a===i&&(h*=-1),isNaN(h)&&(h=0);var p=h*o*d/l,v=h*-l*c/o,g=(e+n)/2+Math.cos(u)*p-Math.sin(u)*v,m=(t+r)/2+Math.sin(u)*p+Math.cos(u)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},x=function(e,t){return(e[0]*t[1]=1&&(_=0),0===i&&_>0&&(_-=2*Math.PI),1===i&&_<0&&(_+=2*Math.PI),[g,m,o,l,k,_,u,i]}}]),n}(s.Shape);t.Path=d,d.prototype.className="Path",d.prototype._attrsAffectingSize=["data"],(0,u._registerNode)(d),l.Factory.addGetterSetter(d,"data")},8240:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1655).default,o=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Rect=void 0;var l=n(6534),s=n(9132),u=n(2683),c=n(2264),d=n(8999),f=function(e){i(n,e);var t=o(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"_sceneFunc",value:function(e){var t=this.cornerRadius(),n=this.width(),r=this.height();e.beginPath(),t?c.Util.drawRoundedRectPath(e,n,r,t):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}}]),n}(s.Shape);t.Rect=f,f.prototype.className="Rect",(0,u._registerNode)(f),l.Factory.addGetterSetter(f,"cornerRadius",0,(0,d.getNumberOrArrayOfNumbersValidator)(4))},9237:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1655).default,o=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.RegularPolygon=void 0;var l=n(6534),s=n(9132),u=n(8999),c=n(2683),d=function(e){i(n,e);var t=o(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"_sceneFunc",value:function(e){var t=this._getPoints();e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var n=1;n1&&(x+=o)}}}},{key:"_hitFunc",value:function(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}},{key:"setText",value:function(e){var t=l.Util._isString(e)?e:null===e||void 0===e?"":e+"";return this._setAttr("text",t),this}},{key:"getWidth",value:function(){return this.attrs.width===p||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}},{key:"getHeight",value:function(){return this.attrs.height===p||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}},{key:"getTextWidth",value:function(){return this.textWidth}},{key:"getTextHeight",value:function(){return l.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}},{key:"measureSize",value:function(e){var t,n=w(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}},{key:"_getContextFont",value:function(){return this.fontStyle()+b+this.fontVariant()+b+(this.fontSize()+"px ")+this.fontFamily().split(",").map((function(e){var t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e='"'.concat(e,'"')),e})).join(", ")}},{key:"_addTextLine",value:function(e){this.align()===v&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}},{key:"_getTextWidth",value:function(e){var t=this.letterSpacing(),n=e.length;return w().measureText(e).width+(n?t*(n-1):0)}},{key:"_setTextData",value:function(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,a=this.attrs.width,i=this.attrs.height,o=a!==p&&void 0!==a,l=i!==p&&void 0!==i,s=this.padding(),u=a-2*s,c=i-2*s,d=0,f=this.wrap(),h="char"!==f&&f!==x,v=this.ellipsis();this.textArr=[],w().font=this._getContextFont();for(var g=v?this._getTextWidth("\u2026"):0,m=0,y=e.length;mu)for(;k.length>0;){for(var _=0,C=k.length,P="",E=0;_>>1,A=k.slice(0,T+1),R=this._getTextWidth(A)+g;R<=u?(_=T+1,P=A,E=R):C=T}if(!P)break;if(h){var M,F=k[P.length];(M=(F===b||"-"===F)&&E<=u?P.length:Math.max(P.lastIndexOf(b),P.lastIndexOf("-"))+1)>0&&(_=M,P=P.slice(0,_),E=this._getTextWidth(P))}if(P=P.trimRight(),this._addTextLine(P),n=Math.max(n,E),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((k=(k=k.slice(_)).trimLeft()).length>0&&(S=this._getTextWidth(k))<=u){this._addTextLine(k),d+=r,n=Math.max(n,S);break}}else this._addTextLine(k),d+=r,n=Math.max(n,S),this._shouldHandleEllipsis(d)&&mc)break}this.textHeight=t,this.textWidth=n}},{key:"_shouldHandleEllipsis",value:function(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,a=r!==p&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==x)||a&&e+n>i}},{key:"_tryToAddEllipsisToLastLine",value:function(){var e=this.attrs.width,t=e!==p&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(a&&r){if(t)this._getTextWidth(a.text+"\u2026")this.pathLength?null:f.Path.getPointAtLengthOfDataArray(e,this.dataArray):null}},{key:"_readDataAttribute",value:function(){this.dataArray=f.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}},{key:"_sceneFunc",value:function(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var t=this.textDecoration(),n=this.fill(),r=this.fontSize(),a=this.glyphInfo;"underline"===t&&e.beginPath();for(var i=0;i=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[];this._nodes&&this._nodes.length&&this.detach();var n=t.filter((function(t){return!t.isAncestorOf(e)||(c.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1)}));return this._nodes=t=n,1===t.length&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((function(t){var n=function(){1===e.nodes().length&&e.useSingleNodeRotation()&&e.rotation(e.nodes()[0].getAbsoluteRotation()),e._resetTransformCache(),e._transforming||e.isDragging()||e.update()},r=t._attrsAffectingSize.map((function(t){return t+"Change."+e._getEventNamespace()})).join(" ");t.on(r,n),t.on(S.map((function(t){return t+".".concat(e._getEventNamespace())})).join(" "),n),t.on("absoluteTransformChange.".concat(e._getEventNamespace()),n),e._proxyDrag(t)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}},{key:"_proxyDrag",value:function(e){var t,n=this;e.on("dragstart.".concat(this._getEventNamespace()),(function(r){t=e.getAbsolutePosition(),n.isDragging()||e===n.findOne(".back")||n.startDrag(r,!1)})),e.on("dragmove.".concat(this._getEventNamespace()),(function(r){if(t){var a=e.getAbsolutePosition(),i=a.x-t.x,o=a.y-t.y;n.nodes().forEach((function(t){if(t!==e&&!t.isDragging()){var n=t.getAbsolutePosition();t.setAbsolutePosition({x:n.x+i,y:n.y+o}),t.startDrag(r)}})),t=null}}))}},{key:"getNodes",value:function(){return this._nodes||[]}},{key:"getActiveAnchor",value:function(){return this._movingAnchorName}},{key:"detach",value:function(){var e=this;this._nodes&&this._nodes.forEach((function(t){t.off("."+e._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}},{key:"_resetTransformCache",value:function(){this._clearCache(k),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}},{key:"_getNodeRect",value:function(){return this._getCache(k,this.__getNodeRect)}},{key:"__getNodeShape",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rotation(),n=arguments.length>2?arguments[2]:void 0,r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),o=r.x*a.x-e.offsetX()*a.x,l=r.y*a.y-e.offsetY()*a.y,s=(g.Konva.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return P({x:i.x+o*Math.cos(s)+l*Math.sin(-s),y:i.y+l*Math.cos(s)+o*Math.sin(s),width:r.width*a.x,height:r.height*a.y,rotation:s},-g.Konva.getAngle(t),{x:0,y:0})}},{key:"__getNodeRect",value:function(){var e=this;if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};var t=[];this.nodes().map((function(n){var r=n.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:e.ignoreStroke()}),a=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}],i=n.getAbsoluteTransform();a.forEach((function(e){var n=i.point(e);t.push(n)}))}));var n,r,a,i,o=new c.Transform;o.rotate(-g.Konva.getAngle(this.rotation())),t.forEach((function(e){var t=o.point(e);void 0===n&&(n=a=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),a=Math.max(a,t.x),i=Math.max(i,t.y)})),o.invert();var l=o.point({x:n,y:r});return{x:l.x,y:l.y,width:a-n,height:i-r,rotation:g.Konva.getAngle(this.rotation())}}},{key:"getX",value:function(){return this._getNodeRect().x}},{key:"getY",value:function(){return this._getNodeRect().y}},{key:"getWidth",value:function(){return this._getNodeRect().width}},{key:"getHeight",value:function(){return this._getNodeRect().height}},{key:"_createElements",value:function(){this._createBack(),C.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}},{key:"_createAnchor",value:function(e){var t=this,n=new p.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:_?10:"auto"}),r=this;n.on("mousedown touchstart",(function(e){r._handleMouseDown(e)})),n.on("dragstart",(function(e){n.stopDrag(),e.cancelBubble=!0})),n.on("dragend",(function(e){e.cancelBubble=!0})),n.on("mouseenter",(function(){var r=g.Konva.getAngle(t.rotation()),a=function(e,t){if("rotater"===e)return"crosshair";t+=c.Util.degToRad(w[e]||0);var n=(c.Util.radToDeg(t)%360+360)%360;return c.Util._inRange(n,337.5,360)||c.Util._inRange(n,0,22.5)?"ns-resize":c.Util._inRange(n,22.5,67.5)?"nesw-resize":c.Util._inRange(n,67.5,112.5)?"ew-resize":c.Util._inRange(n,112.5,157.5)?"nwse-resize":c.Util._inRange(n,157.5,202.5)?"ns-resize":c.Util._inRange(n,202.5,247.5)?"nesw-resize":c.Util._inRange(n,247.5,292.5)?"ew-resize":c.Util._inRange(n,292.5,337.5)?"nwse-resize":(c.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,r);n.getStage().content&&(n.getStage().content.style.cursor=a),t._cursorChange=!0})),n.on("mouseout",(function(){n.getStage().content&&(n.getStage().content.style.cursor=""),t._cursorChange=!1})),this.add(n)}},{key:"_createBack",value:function(){var e=this,t=new h.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc:function(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*c.Util._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:function(t,n){if(e.shouldOverdrawWholeArea()){var r=e.padding();t.beginPath(),t.rect(-r,-r,n.width()+2*r,n.height()+2*r),t.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",(function(e){e.cancelBubble=!0})),t.on("dragmove",(function(e){e.cancelBubble=!0})),t.on("dragend",(function(e){e.cancelBubble=!0})),this.on("dragmove",(function(t){e.update()}))}},{key:"_handleMouseDown",value:function(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/a),this.cos=Math.abs(n/a),"undefined"!==typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var i=e.target.getAbsolutePosition(),o=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-i.x,y:o.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((function(t){t._fire("transformstart",{evt:e.evt,target:t})}))}},{key:"_handleMouseMove",value:function(e){var t,n,r,a=this.findOne("."+this._movingAnchorName),i=a.getStage();i.setPointersPositions(e);var o=i.getPointerPosition(),l={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y},s=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(s,l,e)),a.setAbsolutePosition(l);var u=a.getAbsolutePosition();if(s.x!==u.x||s.y!==u.y)if("rotater"!==this._movingAnchorName){var c,d=this.shiftBehavior();c="inverted"===d?this.keepRatio()&&!e.shiftKey:"none"===d?this.keepRatio():this.keepRatio()||e.shiftKey;var f=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(c){var h=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(h.x-a.x(),2)+Math.pow(h.y-a.y(),2));var p=this.findOne(".top-left").x()>h.x?-1:1,v=this.findOne(".top-left").y()>h.y?-1:1;t=r*this.cos*p,n=r*this.sin*v,this.findOne(".top-left").x(h.x-t),this.findOne(".top-left").y(h.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(a.y());else if("top-right"===this._movingAnchorName){if(c){h=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(a.x()-h.x,2)+Math.pow(h.y-a.y(),2));p=this.findOne(".top-right").x()h.y?-1:1;t=r*this.cos*p,n=r*this.sin*v,this.findOne(".top-right").x(h.x+t),this.findOne(".top-right").y(h.y-n)}var m=a.position();this.findOne(".top-left").y(m.y),this.findOne(".bottom-right").x(m.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(a.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(a.x());else if("bottom-left"===this._movingAnchorName){if(c){h=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(h.x-a.x(),2)+Math.pow(a.y()-h.y,2));p=h.x=0){var o=i.point({x:2*-this.padding(),y:0});if(e.x+=o.x,e.y+=o.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,!a)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){var l=i.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=l.x,this._anchorDragOffset.y-=l.y,e.width+=2*this.padding(),!a)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){var s=i.point({x:0,y:2*-this.padding()});if(e.x+=s.x,e.y+=s.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=s.x,this._anchorDragOffset.y-=s.y,e.height+=2*this.padding(),!a)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){var u=i.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,e.height+=2*this.padding(),!a)return void this.update()}if(this.boundBoxFunc()){var d=this.boundBoxFunc()(r,e);d?e=d:c.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}var f=1e7,h=new c.Transform;h.translate(r.x,r.y),h.rotate(r.rotation),h.scale(r.width/f,r.height/f);var p=new c.Transform;p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.width/f,e.height/f);var v=p.multiply(h.invert());this._nodes.forEach((function(e){var r,a=e.getParent().getAbsoluteTransform(),i=e.getTransform().copy();i.translate(e.offsetX(),e.offsetY());var o=new c.Transform;o.multiply(a.copy().invert()).multiply(v).multiply(a).multiply(i);var l=o.decompose();e.setAttrs(l),n._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(r=e.getLayer())||void 0===r||r.batchDraw()})),this.rotation(c.Util._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}}},{key:"forceUpdate",value:function(){this._resetTransformCache(),this.update()}},{key:"_batchChangeChild",value:function(e,t){this.findOne(e).setAttrs(t)}},{key:"update",value:function(){var e,t=this,n=this._getNodeRect();this.rotation(c.Util._getRotation(n.rotation));var r=n.width,a=n.height,i=this.enabledAnchors(),o=this.resizeEnabled(),l=this.padding(),s=this.anchorSize(),u=this.find("._anchor");u.forEach((function(e){e.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:t.anchorStroke(),strokeWidth:t.anchorStrokeWidth(),fill:t.anchorFill(),cornerRadius:t.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+l,offsetY:s/2+l,visible:o&&i.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:s/2+l,visible:o&&i.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:s/2-l,offsetY:s/2+l,visible:o&&i.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:a/2,offsetX:s/2+l,visible:o&&i.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:a/2,offsetX:s/2-l,visible:o&&i.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:a,offsetX:s/2+l,offsetY:s/2-l,visible:o&&i.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:a,offsetY:s/2-l,visible:o&&i.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:a,offsetX:s/2-l,offsetY:s/2-l,visible:o&&i.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*c.Util._sign(a)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:a,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});var d=this.anchorStyleFunc();d&&u.forEach((function(e){d(e)})),null===(e=this.getLayer())||void 0===e||e.batchDraw()}},{key:"isTransforming",value:function(){return this._transforming}},{key:"stopTransform",value:function(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}},{key:"destroy",value:function(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),v.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}},{key:"toObject",value:function(){return f.Node.prototype.toObject.call(this)}},{key:"clone",value:function(e){return f.Node.prototype.clone.call(this,e)}},{key:"getClientRect",value:function(){return this.nodes().length>0?o(l(n.prototype),"getClientRect",this).call(this):{x:0,y:0,width:0,height:0}}}]),n}(v.Group);t.Transformer=T,T.prototype.className="Transformer",(0,y._registerNode)(T),d.Factory.addGetterSetter(T,"enabledAnchors",C,(function(e){return e instanceof Array||c.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===C.indexOf(e)&&c.Util.warn("Unknown anchor name: "+e+". Available names are: "+C.join(", "))})),e||[]})),d.Factory.addGetterSetter(T,"flipEnabled",!0,(0,m.getBooleanValidator)()),d.Factory.addGetterSetter(T,"resizeEnabled",!0),d.Factory.addGetterSetter(T,"anchorSize",10,(0,m.getNumberValidator)()),d.Factory.addGetterSetter(T,"rotateEnabled",!0),d.Factory.addGetterSetter(T,"rotationSnaps",[]),d.Factory.addGetterSetter(T,"rotateAnchorOffset",50,(0,m.getNumberValidator)()),d.Factory.addGetterSetter(T,"rotationSnapTolerance",5,(0,m.getNumberValidator)()),d.Factory.addGetterSetter(T,"borderEnabled",!0),d.Factory.addGetterSetter(T,"anchorStroke","rgb(0, 161, 255)"),d.Factory.addGetterSetter(T,"anchorStrokeWidth",1,(0,m.getNumberValidator)()),d.Factory.addGetterSetter(T,"anchorFill","white"),d.Factory.addGetterSetter(T,"anchorCornerRadius",0,(0,m.getNumberValidator)()),d.Factory.addGetterSetter(T,"borderStroke","rgb(0, 161, 255)"),d.Factory.addGetterSetter(T,"borderStrokeWidth",1,(0,m.getNumberValidator)()),d.Factory.addGetterSetter(T,"borderDash"),d.Factory.addGetterSetter(T,"keepRatio",!0),d.Factory.addGetterSetter(T,"shiftBehavior","default"),d.Factory.addGetterSetter(T,"centeredScaling",!1),d.Factory.addGetterSetter(T,"ignoreStroke",!1),d.Factory.addGetterSetter(T,"padding",0,(0,m.getNumberValidator)()),d.Factory.addGetterSetter(T,"node"),d.Factory.addGetterSetter(T,"nodes"),d.Factory.addGetterSetter(T,"boundBoxFunc"),d.Factory.addGetterSetter(T,"anchorDragBoundFunc"),d.Factory.addGetterSetter(T,"anchorStyleFunc"),d.Factory.addGetterSetter(T,"shouldOverdrawWholeArea",!1),d.Factory.addGetterSetter(T,"useSingleNodeRotation",!0),d.Factory.backCompat(T,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"})},8861:function(e,t,n){"use strict";var r=n(6690).default,a=n(9728).default,i=n(1655).default,o=n(6389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Wedge=void 0;var l=n(6534),s=n(9132),u=n(2683),c=n(8999),d=n(2683),f=function(e){i(n,e);var t=o(n);function n(){return r(this,n),t.apply(this,arguments)}return a(n,[{key:"_sceneFunc",value:function(e){e.beginPath(),e.arc(0,0,this.radius(),0,u.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radius()}},{key:"getHeight",value:function(){return 2*this.radius()}},{key:"setWidth",value:function(e){this.radius(e/2)}},{key:"setHeight",value:function(e){this.radius(e/2)}}]),n}(s.Shape);t.Wedge=f,f.prototype.className="Wedge",f.prototype._centroid=!0,f.prototype._attrsAffectingSize=["radius"],(0,d._registerNode)(f),l.Factory.addGetterSetter(f,"radius",0,(0,c.getNumberValidator)()),l.Factory.addGetterSetter(f,"angle",0,(0,c.getNumberValidator)()),l.Factory.addGetterSetter(f,"clockwise",!1),l.Factory.backCompat(f,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"})},6198:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",a=9007199254740991,i="[object Arguments]",o="[object AsyncFunction]",l="[object Function]",s="[object GeneratorFunction]",u="[object Null]",c="[object Object]",d="[object Proxy]",f="[object Undefined]",h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[i]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[l]=v["[object Map]"]=v["[object Number]"]=v[c]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,y=g||m||Function("return this")(),b=t&&!t.nodeType&&t,x=b&&e&&!e.nodeType&&e,k=x&&x.exports===b,S=k&&g.process,w=function(){try{var e=x&&x.require&&x.require("util").types;return e||S&&S.binding&&S.binding("util")}catch(t){}}(),_=w&&w.isTypedArray;var C,P,E=Array.prototype,T=Function.prototype,A=Object.prototype,R=y["__core-js_shared__"],M=T.toString,F=A.hasOwnProperty,N=function(){var e=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),z=A.toString,O=M.call(Object),D=RegExp("^"+M.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=k?y.Buffer:void 0,I=y.Symbol,j=y.Uint8Array,B=L?L.allocUnsafe:void 0,U=(C=Object.getPrototypeOf,P=Object,function(e){return C(P(e))}),V=Object.create,G=A.propertyIsEnumerable,W=E.splice,H=I?I.toStringTag:void 0,$=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),q=L?L.isBuffer:void 0,Y=Math.max,X=Date.now,K=ye(y,"Map"),Q=ye(Object,"create"),Z=function(){function e(){}return function(t){if(!Re(t))return{};if(V)return V(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function J(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},ee.prototype.set=function(e,t){var n=this.__data__,r=oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(K||ee),string:new J}},te.prototype.delete=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return me(this,e).get(e)},te.prototype.has=function(e){return me(this,e).has(e)},te.prototype.set=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ne.prototype.clear=function(){this.__data__=new ee,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ee){var r=n.__data__;if(!K||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(r)}return n.set(e,t),this.size=n.size,this};var se,ue=function(e,t,n){for(var r=-1,a=Object(e),i=n(e),o=i.length;o--;){var l=i[se?o:++r];if(!1===t(a[l],l,a))break}return e};function ce(e){return null==e?void 0===e?f:u:H&&H in Object(e)?function(e){var t=F.call(e,H),n=e[H];try{e[H]=void 0;var r=!0}catch(i){}var a=z.call(e);r&&(t?e[H]=n:delete e[H]);return a}(e):function(e){return z.call(e)}(e)}function de(e){return Me(e)&&ce(e)==i}function fe(e){return!(!Re(e)||function(e){return!!N&&N in e}(e))&&(Te(e)?D:h).test(function(e){if(null!=e){try{return M.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function he(e){if(!Re(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=xe(e),n=[];for(var r in e)("constructor"!=r||!t&&F.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,a){e!==t&&ue(t,(function(i,o){if(a||(a=new ne),Re(i))!function(e,t,n,r,a,i,o){var l=ke(e,n),s=ke(t,n),u=o.get(s);if(u)return void ae(e,n,u);var d=i?i(l,s,n+"",e,t,o):void 0,f=void 0===d;if(f){var h=Ce(s),p=!h&&Ee(s),v=!h&&!p&&Fe(s);d=s,h||p||v?Ce(l)?d=l:Me(g=l)&&Pe(g)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ge);function we(e,t){return e===t||e!==e&&t!==t}var _e=de(function(){return arguments}())?de:function(e){return Me(e)&&F.call(e,"callee")&&!G.call(e,"callee")},Ce=Array.isArray;function Pe(e){return null!=e&&Ae(e.length)&&!Te(e)}var Ee=q||function(){return!1};function Te(e){if(!Re(e))return!1;var t=ce(e);return t==l||t==s||t==o||t==d}function Ae(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Re(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Me(e){return null!=e&&"object"==typeof e}var Fe=_?function(e){return function(t){return e(t)}}(_):function(e){return Me(e)&&Ae(e.length)&&!!v[ce(e)]};function Ne(e){return Pe(e)?re(e,!0):he(e)}var ze,Oe=(ze=function(e,t,n,r){pe(e,t,n,r)},ve((function(e,t){var n=-1,r=t.length,a=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(a=ze.length>3&&"function"==typeof a?(r--,a):void 0,i&&function(e,t,n){if(!Re(n))return!1;var r=typeof t;return!!("number"==r?Pe(n)&&be(t,n.length):"string"==r&&t in n)&&we(n[t],e)}(t[0],t[1],i)&&(a=r<3?void 0:a,r=1),e=Object(e);++n