UNPKG

vue-drag-resize-rotate

Version:

a vue2 component. Taking a cue from react-resizable and react-draggable.

1 lines 26.9 kB
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.VueDragResizeRotate=n():t.VueDragResizeRotate=n()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=e(62),o=r(i);t.exports=o.default},function(t,n,e){var r=e(23)("wks"),i=e(24),o=e(2).Symbol,s="function"==typeof o,a=t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))};a.store=r},function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,n,e){var r=e(11),i=e(21);t.exports=e(7)?function(t,n,e){return r.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n){t.exports={}},function(t,n,e){var r=e(10);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)},function(t,n,e){t.exports=!e(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,e){var r=e(5),i=e(39),o=e(54),s=Object.defineProperty;n.f=e(7)?Object.defineProperty:function(t,n,e){if(r(t),n=o(n,!0),r(e),i)try{return s(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){var r=e(23)("keys"),i=e(24);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,n){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,n,e){var r=e(40),i=e(9);t.exports=function(t){return r(i(t))}},function(t,n,e){var r=e(16),i=e(1)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,n){try{return t[n]}catch(t){}};t.exports=function(t){var n,e,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=s(n=Object(t),i))?e:o?r(n):"Object"==(a=r(n))&&"function"==typeof n.callee?"Arguments":a}},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n,e){var r=e(10),i=e(2).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,e){"use strict";var r=e(43),i=e(37),o=e(49),s=e(3),a=e(8),u=e(4),c=e(41),f=e(22),h=e(46),p=e(1)("iterator"),l=!([].keys&&"next"in[].keys()),d="@@iterator",y="keys",g="values",v=function(){return this};t.exports=function(t,n,e,x,m,b,w){c(e,n,x);var M,I,S,A=function(t){if(!l&&t in D)return D[t];switch(t){case y:return function(){return new e(this,t)};case g:return function(){return new e(this,t)}}return function(){return new e(this,t)}},C=n+" Iterator",j=m==g,z=!1,D=t.prototype,Y=D[p]||D[d]||m&&D[m],L=Y||A(m),T=m?j?A("entries"):L:void 0,X="Array"==n?D.entries||Y:Y;if(X&&(S=h(X.call(new t)),S!==Object.prototype&&(f(S,C,!0),r||a(S,p)||s(S,p,v))),j&&Y&&Y.name!==g&&(z=!0,L=function(){return Y.call(this)}),r&&!w||!l&&!z&&D[p]||s(D,p,L),u[n]=L,u[C]=v,m)if(M={values:j?L:A(g),keys:b?L:A(y),entries:T},w)for(I in M)I in D||o(D,I,M[I]);else i(i.P+i.F*(l||z),n,M);return M}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,e){var r=e(11).f,i=e(8),o=e(1)("toStringTag");t.exports=function(t,n,e){t&&!i(t=e?t:t.prototype,o)&&r(t,o,{configurable:!0,value:n})}},function(t,n,e){var r=e(2),i="__core-js_shared__",o=r[i]||(r[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,n){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,n,e){"use strict";var r=e(50)(!0);e(20)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,e=this._i;return e>=n.length?{value:void 0,done:!0}:(t=r(n,e),this._i+=t.length,{value:t,done:!1})})},function(t,n,e){e(58);for(var r=e(2),i=e(3),o=e(4),s=e(1)("toStringTag"),a=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var c=a[u],f=r[c],h=f&&f.prototype;h&&!h[s]&&i(h,s,c),o[c]=o.Array}},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i=e(30),o=r(i),s=e(61),a=r(s),u=function(t,n){for(var e=0,r=t.length;e<r;e++)if(n.apply(n,[t[e],e,t]))return t[e]},c=function(t){return"function"==typeof t||"[object Function]"===Object.prototype.toString.call(t)},f=function(t){return"number"==typeof t&&!isNaN(t)},h=function(t){return parseInt(t,10)},p=function(t){var n=t.clientHeight,e=window.getComputedStyle(t);return n+=h(e.borderTopWidth),n+=h(e.borderBottomWidth)},l=function(t){var n=t.clientWidth,e=window.getComputedStyle(t);return n+=h(e.borderLeftWidth),n+=h(e.borderRightWidth)},d=function(t){var n=t.clientHeight,e=window.getComputedStyle(t);return n-=h(e.paddingTop),n-=h(e.paddingBottom)},y=function(t){var n=t.clientWidth,e=window.getComputedStyle(t);return n-=h(e.paddingLeft),n-=h(e.paddingRight)},g="",v=function(t,n){return g||(g=u(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return c(t[n])})),t[g].call(t,n)},x=function(t,n,e,r){if(!t)return[e,r];var i=n.parentNode;if(t.parent){var o=window.getComputedStyle(n),s=window.getComputedStyle(i);t={left:-n.offsetLeft+h(s.paddingLeft)+h(o.borderLeftWidth)+h(o.marginLeft),top:-n.offsetTop+h(s.paddingTop)+h(o.borderTopWidth)+h(o.marginTop),right:y(i)-n.offsetLeft-l(n),bottom:d(i)-p(n)-n.offsetTop}}return f(t.right)&&(e=Math.min(e,t.right)),f(t.bottom)&&(r=Math.min(r,t.bottom)),f(t.left)&&(e=Math.max(e,t.left)),f(t.top)&&(r=Math.max(r,t.top)),[e,r]};n.default={replace:!0,name:"dragable",props:{w:{type:Number,default:200},h:{type:Number,default:200},x:{type:Number,default:0},y:{type:Number,default:0},r:{type:Number,default:0},rotatable:{type:Boolean,default:!1},axis:{type:String,default:"both"},handle:{type:String,default:""},cancel:{type:String,default:""},grid:{type:Array,default:function(){return[0,0]}},bounds:{type:Object,default:null}},mounted:function(){var t=document.documentElement,n="mousemove",e=this.handleMove;t.attachEvent?t.attachEvent("on"+n,e):t.addEventListener?t.addEventListener(n,e,!0):t["on"+n]=e,this.rotatable?this.rotate=this.r:this.$el.getElementsByClassName("rotate")[0].className=""},beforeDestroy:function(){var t=document.documentElement,n="mousemove",e=this.handleMove;t.detachEvent?t.detachEvent("on"+n,e):t.removeEventListener?t.removeEventListener(n,e,!0):t["on"+n]=null},methods:{getRotateAngle:function(t,n){var e=this._getCenter(),r=new a.default(this.rotateStartX-e.x,this.rotateStartY-e.y),i=new a.default(t-e.x,n-e.y);return i.angleDeg()-r.angleDeg()},_getCenter:function(){var t=this.$el.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.bottom+t.top)/2}},rotateStart:function(t){this.rotatable&&(this.rotateStartX=t.clientX,this.rotateStartY=t.clientY,this.rotating=!0)},resizeStart:function(t){this.resizeStartX=t.clientX,this.resizeStartY=t.clientY,this.resizing=!0,this.lastW=this.localw,this.lastH=this.localh},handleDown:function(t){this.handle&&!v(t.target,this.handle)||this.cancel&&v(t.target,this.cancel)||(this.lastX||(this.lastX=t.clientX,this.lastY=t.clientY),this.dragging=!0)},handleUp:function(t){this.dragging=!1,this.resizing=!1,this.rotating=!1,this.$emit("handleUp",{x:this.localx,y:this.localy,w:this.localw,h:this.localh,r:this.localr})},handleMove:function(t){if(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),this.dragging){var n=t.clientX-this.lastX,e=t.clientY-this.lastY,r=Math.round(n/this.grid[0])*this.grid[0],i=Math.round(e/this.grid[1])*this.grid[1],s=this.localx,a=this.localy;if(this.grid[0]>0&&this.grid[1]>0?"both"===this.axis?(s=r,a=i):"x"===this.axis?s=r:"y"===this.axis&&(a=i):"both"===this.axis?(s=t.clientX-this.lastX,a=t.clientY-this.lastY):"x"===this.axis?s=t.clientX-this.lastX:"y"===this.axis&&(a=t.clientY-this.lastY),this.bounds){var u=x(this.bounds,this.$el,s,a),c=(0,o.default)(u,2);s=c[0],a=c[1]}this.localx=s,this.localy=a}this.resizing&&(this.localw=parseInt(this.lastW)+parseInt(t.clientX)-parseInt(this.resizeStartX),this.localh=parseInt(this.lastH)+parseInt(t.clientY)-parseInt(this.resizeStartY)),this.rotating&&(this.localr=parseInt(this.r)+this.getRotateAngle(t.clientX,t.clientY))}},data:function(){return{localx:this.x,localy:this.y,localw:this.w,localh:this.h,localr:this.r,lastX:0,lastY:0,dragging:!1,rotate:0,resizeStartX:0,resizeStartY:0,rotateStartX:0,rotateStartY:0,resizing:!1}},computed:{boxStyle:function(){return{width:this.localw+"px",height:this.localh+"px",transform:"translate("+this.localx+"px,"+this.localy+"px) rotate("+this.localr+"deg)"}}}}},function(t,n,e){t.exports={default:e(31),__esModule:!0}},function(t,n,e){t.exports={default:e(32),__esModule:!0}},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var i=e(29),o=r(i),s=e(28),a=r(s);n.default=function(){function t(t,n){var e=[],r=!0,i=!1,o=void 0;try{for(var s,u=(0,a.default)(t);!(r=(s=u.next()).done)&&(e.push(s.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return e}return function(n,e){if(Array.isArray(n))return n;if((0,o.default)(Object(n)))return t(n,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(t,n,e){e(26),e(25),t.exports=e(56)},function(t,n,e){e(26),e(25),t.exports=e(57)},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){t.exports=function(){}},function(t,n,e){var r=e(14),i=e(52),o=e(51);t.exports=function(t){return function(n,e,s){var a,u=r(n),c=i(u.length),f=o(s,c);if(t&&e!=e){for(;c>f;)if(a=u[f++],a!=a)return!0}else for(;c>f;f++)if((t||f in u)&&u[f]===e)return t||f||0;return!t&&-1}}},function(t,n,e){var r=e(33);t.exports=function(t,n,e){if(r(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,i){return t.call(n,e,r,i)}}return function(){return t.apply(n,arguments)}}},function(t,n,e){var r=e(2),i=e(6),o=e(36),s=e(3),a="prototype",u=function(t,n,e){var c,f,h,p=t&u.F,l=t&u.G,d=t&u.S,y=t&u.P,g=t&u.B,v=t&u.W,x=l?i:i[n]||(i[n]={}),m=x[a],b=l?r:d?r[n]:(r[n]||{})[a];l&&(e=n);for(c in e)f=!p&&b&&void 0!==b[c],f&&c in x||(h=f?b[c]:e[c],x[c]=l&&"function"!=typeof b[c]?e[c]:g&&f?o(h,r):v&&b[c]==h?function(t){var n=function(n,e,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,r)}return t.apply(this,arguments)};return n[a]=t[a],n}(h):y&&"function"==typeof h?o(Function.call,h):h,y&&((x.virtual||(x.virtual={}))[c]=h,t&u.R&&m&&!m[c]&&s(m,c,h)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,n,e){t.exports=e(2).document&&document.documentElement},function(t,n,e){t.exports=!e(7)&&!e(19)(function(){return 7!=Object.defineProperty(e(17)("div"),"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(16);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n,e){"use strict";var r=e(44),i=e(21),o=e(22),s={};e(3)(s,e(1)("iterator"),function(){return this}),t.exports=function(t,n,e){t.prototype=r(s,{next:i(1,e)}),o(t,n+" Iterator")}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n){t.exports=!0},function(t,n,e){var r=e(5),i=e(45),o=e(18),s=e(12)("IE_PROTO"),a=function(){},u="prototype",c=function(){var t,n=e(17)("iframe"),r=o.length,i="<",s=">";for(n.style.display="none",e(38).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(i+"script"+s+"document.F=Object"+i+"/script"+s),t.close(),c=t.F;r--;)delete c[u][o[r]];return c()};t.exports=Object.create||function(t,n){var e;return null!==t?(a[u]=r(t),e=new a,a[u]=null,e[s]=t):e=c(),void 0===n?e:i(e,n)}},function(t,n,e){var r=e(11),i=e(5),o=e(48);t.exports=e(7)?Object.defineProperties:function(t,n){i(t);for(var e,s=o(n),a=s.length,u=0;a>u;)r.f(t,e=s[u++],n[e]);return t}},function(t,n,e){var r=e(8),i=e(53),o=e(12)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,n,e){var r=e(8),i=e(14),o=e(35)(!1),s=e(12)("IE_PROTO");t.exports=function(t,n){var e,a=i(t),u=0,c=[];for(e in a)e!=s&&r(a,e)&&c.push(e);for(;n.length>u;)r(a,e=n[u++])&&(~o(c,e)||c.push(e));return c}},function(t,n,e){var r=e(47),i=e(18);t.exports=Object.keys||function(t){return r(t,i)}},function(t,n,e){t.exports=e(3)},function(t,n,e){var r=e(13),i=e(9);t.exports=function(t){return function(n,e){var o,s,a=String(i(n)),u=r(e),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):(o-55296<<10)+(s-56320)+65536)}}},function(t,n,e){var r=e(13),i=Math.max,o=Math.min;t.exports=function(t,n){return t=r(t),t<0?i(t+n,0):o(t,n)}},function(t,n,e){var r=e(13),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,n,e){var r=e(9);t.exports=function(t){return Object(r(t))}},function(t,n,e){var r=e(10);t.exports=function(t,n){if(!r(t))return t;var e,i;if(n&&"function"==typeof(e=t.toString)&&!r(i=e.call(t)))return i;if("function"==typeof(e=t.valueOf)&&!r(i=e.call(t)))return i;if(!n&&"function"==typeof(e=t.toString)&&!r(i=e.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,n,e){var r=e(15),i=e(1)("iterator"),o=e(4);t.exports=e(6).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,n,e){var r=e(5),i=e(55);t.exports=e(6).getIterator=function(t){var n=i(t);if("function"!=typeof n)throw TypeError(t+" is not iterable!");return r(n.call(t))}},function(t,n,e){var r=e(15),i=e(1)("iterator"),o=e(4);t.exports=e(6).isIterable=function(t){var n=Object(t);return void 0!==n[i]||"@@iterator"in n||o.hasOwnProperty(r(n))}},function(t,n,e){"use strict";var r=e(34),i=e(42),o=e(4),s=e(14);t.exports=e(20)(Array,"Array",function(t,n){this._t=s(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,i(1)):"keys"==n?i(0,e):"values"==n?i(0,t[e]):i(0,[e,t[e]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,n,e){n=t.exports=e(60)(),n.push([t.id,'.dragable[data-v-b85935aa]{position:relative;border:1px solid #000;text-align:center;padding:10px;background:#fff;box-sizing:border-box;overflow:hidden;float:left;margin:10px}.scale[data-v-b85935aa]{bottom:0;background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=");background-position:100% 100%;padding:0 3px 3px 0;background-repeat:no-repeat;background-origin:content-box}.rotate[data-v-b85935aa],.scale[data-v-b85935aa]{position:absolute;width:20px;height:20px;right:0;box-sizing:border-box;cursor:se-resize}.rotate[data-v-b85935aa]{top:0;background:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxzdmcgd2lkdGg9IjYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCiA8Zz4KICA8dGl0bGU+YmFja2dyb3VuZDwvdGl0bGU+CiAgPHJlY3QgZmlsbD0ibm9uZSIgaWQ9ImNhbnZhc19iYWNrZ3JvdW5kIiBoZWlnaHQ9IjQwMiIgd2lkdGg9IjU4MiIgeT0iLTEiIHg9Ii0xIi8+CiA8L2c+CiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPGcgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDMuMDAwMDAwMDAwMDAwMDAwNCwzKSAiIGlkPSJzdmdfMSIgb3BhY2l0eT0iMC4zMDIiPgogICA8cGF0aCBpZD0ic3ZnXzIiIGZpbGw9IiMwMDAwMDAiIGQ9Im02LDZsLTYsMGwwLC0xLjhsNCwwbDAuMiwwbDAsLTQuMmwxLjgsMGwwLDZsMCwweiIvPgogIDwvZz4KIDwvZz4KPC9zdmc+");background-position:100% 0;padding:3px 3px 0 0;background-repeat:no-repeat;background-origin:content-box}',""])},function(t,n){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],n=0;n<this.length;n++){var e=this[n];e[2]?t.push("@media "+e[2]+"{"+e[1]+"}"):t.push(e[1])}return t.join("")},t.i=function(n,e){"string"==typeof n&&(n=[[null,n,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<n.length;i++){var s=n[i];"number"==typeof s[0]&&r[s[0]]||(e&&!s[2]?s[2]=e:e&&(s[2]="("+s[2]+") and ("+e+")"),t.push(s))}},t}},function(t,n){function e(t,n){return this instanceof e?(this.x=t||0,void(this.y=n||0)):new e(t,n)}function r(t,n){return Math.floor(Math.random()*(n-t+1)+t)}function i(t){return t*s}function o(t){return t/s}n=t.exports=e,e.fromArray=function(t){return new e(t[0]||0,t[1]||0)},e.fromObject=function(t){return new e(t.x||0,t.y||0)},e.prototype.addX=function(t){return this.x+=t.x,this},e.prototype.addY=function(t){return this.y+=t.y,this},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.addScalar=function(t){return this.x+=t,this.y+=t,this},e.prototype.addScalarX=function(t){return this.x+=t,this},e.prototype.addScalarY=function(t){return this.y+=t,this},e.prototype.subtractX=function(t){return this.x-=t.x,this},e.prototype.subtractY=function(t){return this.y-=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.subtractScalar=function(t){return this.x-=t,this.y-=t,this},e.prototype.subtractScalarX=function(t){return this.x-=t,this},e.prototype.subtractScalarY=function(t){return this.y-=t,this},e.prototype.divideX=function(t){return this.x/=t.x,this},e.prototype.divideY=function(t){return this.y/=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.divideScalar=function(t){return 0!==t?(this.x/=t,this.y/=t):(this.x=0,this.y=0),this},e.prototype.divideScalarX=function(t){return 0!==t?this.x/=t:this.x=0,this},e.prototype.divideScalarY=function(t){return 0!==t?this.y/=t:this.y=0,this},e.prototype.invertX=function(){return this.x*=-1,this},e.prototype.invertY=function(){return this.y*=-1,this},e.prototype.invert=function(){return this.invertX(),this.invertY(),this},e.prototype.multiplyX=function(t){return this.x*=t.x,this},e.prototype.multiplyY=function(t){return this.y*=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this},e.prototype.multiplyScalarX=function(t){return this.x*=t,this},e.prototype.multiplyScalarY=function(t){return this.y*=t,this},e.prototype.normalize=function(){var t=this.length();return 0===t?(this.x=1,this.y=0):this.divide(e(t,t)),this},e.prototype.norm=e.prototype.normalize,e.prototype.limit=function(t,n){return Math.abs(this.x)>t&&(this.x*=n),Math.abs(this.y)>t&&(this.y*=n),this},e.prototype.randomize=function(t,n){return this.randomizeX(t,n),this.randomizeY(t,n),this},e.prototype.randomizeX=function(t,n){var e=Math.min(t.x,n.x),i=Math.max(t.x,n.x);return this.x=r(e,i),this},e.prototype.randomizeY=function(t,n){var e=Math.min(t.y,n.y),i=Math.max(t.y,n.y);return this.y=r(e,i),this},e.prototype.randomizeAny=function(t,n){return Math.round(Math.random())?this.randomizeX(t,n):this.randomizeY(t,n),this},e.prototype.unfloat=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.prototype.toFixed=function(t){return"undefined"==typeof t&&(t=8),this.x=this.x.toFixed(t),this.y=this.y.toFixed(t),this},e.prototype.mixX=function(t,n){return"undefined"==typeof n&&(n=.5),this.x=(1-n)*this.x+n*t.x,this},e.prototype.mixY=function(t,n){return"undefined"==typeof n&&(n=.5),this.y=(1-n)*this.y+n*t.y,this},e.prototype.mix=function(t,n){return this.mixX(t,n),this.mixY(t,n),this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copyX=function(t){return this.x=t.x,this},e.prototype.copyY=function(t){return this.y=t.y,this},e.prototype.copy=function(t){return this.copyX(t),this.copyY(t),this},e.prototype.zero=function(){return this.x=this.y=0,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.cross=function(t){return this.x*t.y-this.y*t.x},e.prototype.projectOnto=function(t){var n=(this.x*t.x+this.y*t.y)/(t.x*t.x+t.y*t.y);return this.x=n*t.x,this.y=n*t.y,this},e.prototype.horizontalAngle=function(){return Math.atan2(this.y,this.x)},e.prototype.horizontalAngleDeg=function(){return i(this.horizontalAngle())},e.prototype.verticalAngle=function(){return Math.atan2(this.x,this.y)},e.prototype.verticalAngleDeg=function(){return i(this.verticalAngle())},e.prototype.angle=e.prototype.horizontalAngle,e.prototype.angleDeg=e.prototype.horizontalAngleDeg,e.prototype.direction=e.prototype.horizontalAngle,e.prototype.rotate=function(t){var n=this.x*Math.cos(t)-this.y*Math.sin(t),e=this.x*Math.sin(t)+this.y*Math.cos(t);return this.x=n,this.y=e,this},e.prototype.rotateDeg=function(t){return t=o(t),this.rotate(t)},e.prototype.rotateTo=function(t){return this.rotate(t-this.angle())},e.prototype.rotateToDeg=function(t){return t=o(t),this.rotateTo(t)},e.prototype.rotateBy=function(t){var n=this.angle()+t;return this.rotate(n)},e.prototype.rotateByDeg=function(t){return t=o(t),this.rotateBy(t)},e.prototype.distanceX=function(t){return this.x-t.x},e.prototype.absDistanceX=function(t){return Math.abs(this.distanceX(t))},e.prototype.distanceY=function(t){return this.y-t.y},e.prototype.absDistanceY=function(t){return Math.abs(this.distanceY(t))},e.prototype.distance=function(t){return Math.sqrt(this.distanceSq(t))},e.prototype.distanceSq=function(t){var n=this.distanceX(t),e=this.distanceY(t);return n*n+e*e},e.prototype.length=function(){return Math.sqrt(this.lengthSq())},e.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y},e.prototype.magnitude=e.prototype.length,e.prototype.isZero=function(){return 0===this.x&&0===this.y},e.prototype.isEqualTo=function(t){return this.x===t.x&&this.y===t.y},e.prototype.toString=function(){return"x:"+this.x+", y:"+this.y},e.prototype.toArray=function(){return[this.x,this.y]},e.prototype.toObject=function(){return{x:this.x,y:this.y}};var s=180/Math.PI},function(t,n,e){var r,i;e(65),r=e(27);var o=e(63);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,i._scopeId="data-v-b85935aa",t.exports=r},function(t,n){t.exports={render:function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"dragable",style:t.boxStyle,on:{mousedown:t.handleDown,mouseup:t.handleUp}},[t._t("default"),t._v(" "),e("div",{staticClass:"rotate",on:{mousedown:function(n){n.stopPropagation(),t.rotateStart(n)}}}),t._v(" "),e("div",{staticClass:"scale",on:{mousedown:function(n){n.stopPropagation(),t.resizeStart(n)}}})],2)},staticRenderFns:[]}},function(t,n,e){function r(t,n){for(var e=0;e<t.length;e++){var r=t[e],i=h[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(u(r.parts[o],n))}else{for(var s=[],o=0;o<r.parts.length;o++)s.push(u(r.parts[o],n));h[r.id]={id:r.id,refs:1,parts:s}}}}function i(t){for(var n=[],e={},r=0;r<t.length;r++){var i=t[r],o=i[0],s=i[1],a=i[2],u=i[3],c={css:s,media:a,sourceMap:u};e[o]?e[o].parts.push(c):n.push(e[o]={id:o,parts:[c]})}return n}function o(t,n){var e=d(),r=v[v.length-1];if("top"===t.insertAt)r?r.nextSibling?e.insertBefore(n,r.nextSibling):e.appendChild(n):e.insertBefore(n,e.firstChild),v.push(n);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");e.appendChild(n)}}function s(t){t.parentNode.removeChild(t);var n=v.indexOf(t);n>=0&&v.splice(n,1)}function a(t){var n=document.createElement("style");return n.type="text/css",o(t,n),n}function u(t,n){var e,r,i;if(n.singleton){var o=g++;e=y||(y=a(n)),r=c.bind(null,e,o,!1),i=c.bind(null,e,o,!0)}else e=a(n),r=f.bind(null,e),i=function(){s(e)};return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else i()}}function c(t,n,e,r){var i=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(n,i);else{var o=document.createTextNode(i),s=t.childNodes;s[n]&&t.removeChild(s[n]),s.length?t.insertBefore(o,s[n]):t.appendChild(o)}}function f(t,n){var e=n.css,r=n.media,i=n.sourceMap;if(r&&t.setAttribute("media",r),i&&(e+="\n/*# sourceURL="+i.sources[0]+" */",e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}var h={},p=function(t){var n;return function(){return"undefined"==typeof n&&(n=t.apply(this,arguments)),n}},l=p(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),d=p(function(){return document.head||document.getElementsByTagName("head")[0]}),y=null,g=0,v=[];t.exports=function(t,n){n=n||{},"undefined"==typeof n.singleton&&(n.singleton=l()),"undefined"==typeof n.insertAt&&(n.insertAt="bottom");var e=i(t);return r(e,n),function(t){for(var o=[],s=0;s<e.length;s++){var a=e[s],u=h[a.id];u.refs--,o.push(u)}if(t){var c=i(t);r(c,n)}for(var s=0;s<o.length;s++){var u=o[s];if(0===u.refs){for(var f=0;f<u.parts.length;f++)u.parts[f]();delete h[u.id]}}}};var x=function(){var t=[];return function(n,e){return t[n]=e,t.filter(Boolean).join("\n")}}()},function(t,n,e){var r=e(59);"string"==typeof r&&(r=[[t.id,r,""]]);e(64)(r,{});r.locals&&(t.exports=r.locals)}])});