returnvoid0!==e&&(a+=e),void0!==n&&(i+=n),this.setPosition({x:a,y:i}),this},_eachAncestorReverse:function(t,e){varn,a,i=[],o=this.getParent();if(e&&e._id===this._id)returnt(this),!0;for(i.unshift(this);o&&(!e||o._id!==e._id);)i.unshift(o),o=o.parent;for(n=i.length,a=0;n>a;a++)t(i[a])},rotate:function(t){returnthis.setRotation(this.getRotation()+t),this},moveToTop:function(){if(!this.parent)returnvoidKonva.Util.warn("Node has no parent. moveToTop function is ignored.");vart=this.index;returnthis.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0},moveUp:function(){if(!this.parent)returnvoidKonva.Util.warn("Node has no parent. moveUp function is ignored.");vart=this.index,e=this.parent.getChildren().length;returne-1>t?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1},moveDown:function(){if(!this.parent)returnvoidKonva.Util.warn("Node has no parent. moveDown function is ignored.");vart=this.index;returnt>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1},moveToBottom:function(){if(!this.parent)returnvoidKonva.Util.warn("Node has no parent. moveToBottom function is ignored.");vart=this.index;returnt>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1},setZIndex:function(t){if(!this.parent)returnvoidKonva.Util.warn("Node has no parent. zIndex parameter is ignored.");vare=this.index;returnthis.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this},getAbsoluteOpacity:function(){returnthis._getCache(t,this._getAbsoluteOpacity)},_getAbsoluteOpacity:function(){vart=this.getOpacity();returnthis.getParent()&&(t*=this.getParent().getAbsoluteOpacity()),t},moveTo:function(t){returnthis.getParent()!==t&&(this.remove(),t.add(this)),this},toObject:function(){vart,e,n,a,i={},o=this.getAttrs();i.attrs={};for(tino)e=o[t],Konva.Util._isFunction(e)||Konva.Util._isElement(e)||Konva.Util._isObject(e)||Konva.Util._hasMethods(e)||(n=this[t],deleteo[t],a=n?n.call(this):null,o[t]=e,a!==e&&(i.attrs[t]=e));returni.className=this.getClassName(),i},toJSON:function(){returnJSON.stringify(this.toObject())},getParent:function(){returnthis.parent},getLayer:function(){vart=this.getParent();returnt?t.getLayer():null},getStage:function(){returnthis._getCache(p,this._getStage)},_getStage:function(){vart=this.getParent();returnt?t.getStage():void0},fire:function(t,e,n){returnn?this._fireAndBubble(t,e||{}):this._fire(t,e||{}),this},getAbsoluteTransform:function(t){returnt?this._getAbsoluteTransform(t):this._getCache(e,this._getAbsoluteTransform)},_getAbsoluteTransform:function(t){vare,n,a=newKonva.Transform;returnthis._eachAncestorReverse(function(t){e=t.transformsEnabled(),n=t.getTransform(),"all"===e?a.multiply(n):"position"===e&&a.translate(t.x(),t.y())},t),a},getTransform:function(){returnthis._getCache(K,this._getTransform)},_getTransform:function(){vart=newKonva.Transform,e=this.getX(),n=this.getY(),a=Konva.getAngle(this.getRotation()),i=this.getScaleX(),o=this.getScaleY(),r=this.getSkewX(),s=this.getSkewY(),h=this.getOffsetX(),c=this.getOffsetY();return(0!==e||0!==n)&&t.translate(e,n),0!==a&&t.rotate(a),(0!==r||0!==s)&&t.skew(r,s),(1!==i||1!==o)&&t.scale(i,o),(0!==h||0!==c)&&t.translate(-1*h,-1*c),t},clone:function(t){vare,n,a,i,o,r=this.getClassName(),s=Konva.Util.cloneObject(this.attrs);for(varciny){varl=y[c];deletes[l]}for(eint)s[e]=t[e];vard=newKonva[r](s);for(einthis.eventListeners)for(n=this.eventListeners[e],a=n.length,i=0;a>i;i++)o=n[i],o.name.indexOf(h)<0&&(d.eventListeners[e]||(d.eventListeners[e]=[]),d.eventListeners[e].push(o));returnd},toDataURL:function(t){t=t||{};vare=t.mimeType||null,n=t.quality||null,a=this.getStage(),i=t.x||0,o=t.y||0,r=newKonva.SceneCanvas({width:t.width||this.getWidth()||(a?a.getWidth():0),height:t.height||this.getHeight()||(a?a.getHeight():0),pixelRatio:1}),s=r.getCont
returnthis.getClearBeforeDraw()&&n.getContext().clear(),Konva.Container.prototype.drawScene.call(this,n),this},_applyTransform:function(t,e,n){if(!n||n._id!==this._id){vara=t.getTransform().getMatrix();e.transform(a[0],a[1],a[2],a[3],a[4],a[5])}},draw:function(){returnthis.drawScene(),this},setVisible:function(t){returnKonva.Node.prototype.setVisible.call(this,t),this.getCanvas()._canvas.style.display=t?"block":"none",this}}),Konva.Util.extend(Konva.FastLayer,Konva.BaseLayer),Konva.Collection.mapMethods(Konva.FastLayer)}(),function(){Konva.Group=function(t){this.___init(t)},Konva.Util.addMethods(Konva.Group,{___init:function(t){this.nodeType="Group",Konva.Container.call(this,t)},_validateAdd:function(t){vare=t.getType();"Group"!==e&&"Shape"!==e&&Konva.Util.error("You may only add groups and shapes to groups.")}}),Konva.Util.extend(Konva.Group,Konva.Container),Konva.Collection.mapMethods(Konva.Group)}(),function(){functiont(t){setTimeout(t,1e3/60)}functione(){returni.apply(Konva.root,arguments)}varn=500,a=function(){returnKonva.root.performance&&Konva.root.performance.now?function(){returnKonva.root.performance.now()}:function(){return(newDate).getTime()}}(),i=function(){returnKonva.root.requestAnimationFrame||Konva.root.webkitRequestAnimationFrame||Konva.root.mozRequestAnimationFrame||Konva.root.oRequestAnimationFrame||Konva.root.msRequestAnimationFrame||t}();Konva.Animation=function(t,e){varn=Konva.Animation;this.func=t,this.setLayers(e),this.id=n.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:a()}},Konva.Animation.prototype={setLayers:function(t){vare=[];e=t?t.length>0?t:[t]:[],this.layers=e},getLayers:function(){returnthis.layers},addLayer:function(t){vare,n,a=this.layers;if(a){for(e=a.length,n=0;e>n;n++)if(a[n]._id===t._id)return!1}elsethis.layers=[];returnthis.layers.push(t),!0},isRunning:function(){vart,e=Konva.Animation,n=e.animations,a=n.length;for(t=0;a>t;t++)if(n[t].id===this.id)return!0;return!1},start:function(){vart=Konva.Animation;this.stop(),this.frame.timeDiff=0,this.frame.lastTime=a(),t._addAnimation(this)},stop:function(){Konva.Animation._removeAnimation(this)},_updateFrameObject:function(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}},Konva.Animation.animations=[],Konva.Animation.animIdCounter=0,Konva.Animation.animRunning=!1,Konva.Animation._addAnimation=function(t){this.animations.push(t),this._handleAnimation()},Konva.Animation._removeAnimation=function(t){vare,n=t.id,a=this.animations,i=a.length;for(e=0;i>e;e++)if(a[e].id===n){this.animations.splice(e,1);break}},Konva.Animation._runFrames=function(){vart,e,n,i,o,r,s,h,c,l={},d=this.animations;for(i=0;i<d.length;i++)if(t=d[i],e=t.layers,n=t.func,t._updateFrameObject(a()),r=e.length,c=n?n.call(t,t.frame)!==!1:!0)for(o=0;r>o;o++)s=e[o],void0!==s._id&&(l[s._id]=s);for(hinl)l[h].draw()},Konva.Animation._animationLoop=function(){vart=Konva.Animation;t.animations.length?(e(t._animationLoop),t._runFrames()):t.animRunning=!1},Konva.Animation._handleAnimation=function(){vart=this;this.animRunning||(this.animRunning=!0,t._animationLoop())};varo=Konva.Node.prototype.moveTo;Konva.Node.prototype.moveTo=function(t){o.call(this,t)},Konva.BaseLayer.prototype.batchDraw=function(){vart=this,e=Konva.Animation;this.batchAnim||(this.batchAnim=newe(function(){t.lastBatchDrawTime&&a()-t.lastBatchDrawTime>n&&t.batchAnim.stop()},this)),this.lastBatchDrawTime=a(),this.batchAnim.isRunning()||(this.draw(),this.batchAnim.start())},Konva.Stage.prototype.batchDraw=function(){this.getChildren().each(function(t){t.batchDraw()})}}(this),function(){vart={node:1,duration:1,easing:1,onFinish:1,yoyo:1},e=1,n=2,a=3,i=0,o=["fill","stroke","shadowColor"];Konva.Tween=function(e){varn,a,o=this,s=e.node,h=s._id,c=e.easing||Konva.Easings.Linear,l=!!e.yoyo;n="undefined"==typeofe.duration?1:0===e.duration?.001:e.duration,this.node=s,this._id=i++,this.anim=newKonva.Animation(function(){o.tween.onEnterFrame()},s.getLayer()||(sinstanceofKonva.Stage?s.g