PageSourceSearch

https://www.bilketa.eus/appstatic/js/262.a08e2d6242e4036fac27.chunk.js

js bilketa.eus collected 2026-09-24 21:41:39 UTC 746,390 bytes, 2 lines download raw bytes

1/*! For license information please see 262.a08e2d6242e4036fac27.chunk.js.LICENSE.txt */
2(self.webpackChunkmondoin_mobile_ui=self.webpackChunkmondoin_mobile_ui||[]).push([[262],{80262:(e,t,n)=>{e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=n(67294)},function(e,t){e.exports=n(8618)},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return m}));var i=n(0),r=n.n(i),o=n(1),s=n.n(o);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function h(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?f(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=function(e){function t(){var e,n;c(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return g(f(n=h(this,(e=d(t)).call.apply(e,[this].concat(o)))),"rootEl",r.a.createRef()),g(f(n),"imageEditorInst",null),n}var n,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),n=t,(i=[{key:"componentDidMount",value:function(){this.imageEditorInst=new s.a(this.rootEl.current,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},this.props)),this.bindEventHandlers(this.props)}},{key:"componentWillUnmount",value:function(){this.unbindEventHandlers(),this.imageEditorInst.destroy(),this.imageEditorInst=null}},{key:"shouldComponentUpdate",value:function(e){return this.bindEventHandlers(this.props,e),!1}},{key:"getInstance",value:function(){return this.imageEditorInst}},{key:"getRootElement",value:function(){return this.rootEl.current}},{key:"bindEventHandlers",value:function(e,t){var n=this;Object.keys(e).filter(this.isEventHandlerKeys).forEach((function(i){var r=i[2].toLowerCase()+i.slice(3);t&&t[i]!==e[i]&&n.imageEditorInst.off(r),n.imageEditorInst.on(r,e[i])}))}},{key:"unbindEventHandlers",value:function(){var e=this;
vendor: 4,809 bytes, line 2
2Object.keys(this.props).filter(this.isEventHandlerKeys).forEach((function(t){var n=t[2].toLowerCase()+t.slice(3);e.imageEditorInst.off(n)}))}},{key:"isEventHandlerKeys",value:function(e){return/on[A-Z][a-zA-Z]+/.test(e)}},{key:"render",value:function(){return r.a.createElement("div",{ref:this.rootEl})}}])&&u(n.prototype,i),t}(r.a.Component)}])},32777:(e,t,n)=>{var i,r,o,s,a,l,c,u,h,d,f,p,g,m,v,y,_,b,x,C,j,w,S=S||{version:"4.6.0"};if(t.fabric=S,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?S.document=document:S.document=document.implementation.createHTMLDocument(""),S.window=window;else{var k=new(n(24960).JSDOM)(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;S.document=k.document,S.jsdomImplForWrapper=n(26759).implForWrapper,S.nodeCanvas=n(56272).Canvas,S.window=k,DOMParser=S.window.DOMParser}function O(e,t){var n=e.canvas,i=t.targetCanvas,r=i.getContext("2d");r.translate(0,i.height),r.scale(1,-1);var o=n.height-i.height;r.drawImage(n,0,o,i.width,i.height,0,0,i.width,i.height)}function E(e,t){var n=t.targetCanvas.getContext("2d"),i=t.destinationWidth,r=t.destinationHeight,o=i*r*4,s=new Uint8Array(this.imageBuffer,0,o),a=new Uint8ClampedArray(this.imageBuffer,0,o);e.readPixels(0,0,i,r,e.RGBA,e.UNSIGNED_BYTE,s);var l=new ImageData(a,i,r);n.putImageData(l,0,0)}S.isTouchSupported="ontouchstart"in S.window||"ontouchstart"in S.document||S.window&&S.window.navigator&&S.window.navigator.maxTouchPoints>0,S.isLikelyNode="undefined"!=typeof Buffer&&"undefined"==typeof window,S.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],S.DPI=96,S.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",S.commaWsp="(?:\\s+,?\\s*|,\\s*)",S.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,S.reNonWord=/[ \n\.,;!\?\-]/,S.fontPaths={},S.iMatrix=[1,0,0,1,0,0],S.svgNS="http://www.w3.org/2000/svg",S.perfLimitSizeTotal=2097152,S.maxCacheSideLimit=4096,S.minCacheSideLimit=256,S.charWidthsCache={},S.textureSize=2048,S.disableStyleCopyPaste=!1,S.enableGLFiltering=!0,S.devicePixelRatio=S.window.devicePixelRatio||S.window.webkitDevicePixelRatio||S.window.mozDevicePixelRatio||1,S.browserShadowBlurConstant=1,S.arcToSegmentsCache={},S.boundsOfCurveCache={},S.cachesBoundsOfCurve=!0,S.forceGLPutImageData=!1,S.initFilterBackend=function(){return S.enableGLFiltering&&S.isWebglSupported&&S.isWebglSupported(S.textureSize)?(console.log("max texture size: "+S.maxTextureSize),new S.WebglFilterBackend({tileSize:S.textureSize})):S.Canvas2dFilterBackend?new S.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=S),function(){function e(e,t){if(this.__eventListeners[e]){var n=this.__eventListeners[e];t?n[n.indexOf(t)]=!1:S.util.array.fill(n,!1)}}function t(e,t){var n=function(){t.apply(this,arguments),this.off(e,n)}.bind(this);this.on(e,n)}S.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var n=this.__eventListeners[e];if(!n)return this;for(var i=0,r=n.length;i<r;i++)n[i]&&n[i].call(this,t||{});return this.__eventListeners[e]=n.filter((function(e){return!1!==e})),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var n in e)this.on(n,e[n]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,n){if(1===arguments.length)for(var i in e)t.call(this,i,e[i]);else t.call(this,e,n);return this},off:function(t,n){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var i in t)e.call(this,i,t[i]);else e.call(this,t,n);return this}}}(),S.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,n){var i=this._objects;return n?i[t]=e:i.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,n=!1,i=0,r=arguments.length;i<r;i++)-1!==(e=t.indexOf(arguments[i]))&&(n=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[i]));return this.renderOnAddRemove&&n&&this.requestRenderAll(),this}
vendor: 20,429 bytes, line 2
2,forEachObject:function(e,t){for(var n=this.getObjects(),i=0,r=n.length;i<r;i++)e.call(t,n[i],i,n);return this},getObjects:function(e){return void 0===e?this._objects.concat():this._objects.filter((function(t){return t.type===e}))},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some((function(t){return"function"==typeof t.contains&&t.contains(e,!0)}))},complexity:function(){return this._objects.reduce((function(e,t){return e+=t.complexity?t.complexity():0}),0)}},S.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,t){!e||!e.colorStops||e instanceof S.Gradient||this.set(t,new S.Gradient(e))},_initPattern:function(e,t,n){!e||!e.source||e instanceof S.Pattern?n&&n():this.set(t,new S.Pattern(e,n))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},i=t,r=Math.sqrt,o=Math.atan2,s=Math.pow,a=Math.PI/180,l=Math.PI/2,S.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/l){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/l){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var n=e.indexOf(t);return-1!==n&&e.splice(n,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*a},radiansToDegrees:function(e){return e/a},rotatePoint:function(e,t,n){var i=new S.Point(e.x-t.x,e.y-t.y),r=S.util.rotateVector(i,n);return new S.Point(r.x,r.y).addEquals(t)},rotateVector:function(e,t){var n=S.util.sin(t),i=S.util.cos(t);return{x:e.x*i-e.y*n,y:e.x*n+e.y*i}},transformPoint:function(e,t,n){return n?new S.Point(t[0]*e.x+t[2]*e.y,t[1]*e.x+t[3]*e.y):new S.Point(t[0]*e.x+t[2]*e.y+t[4],t[1]*e.x+t[3]*e.y+t[5])},makeBoundingBoxFromPoints:function(e,t){if(t)for(var n=0;n<e.length;n++)e[n]=S.util.transformPoint(e[n],t);var i=[e[0].x,e[1].x,e[2].x,e[3].x],r=S.util.array.min(i),o=S.util.array.max(i)-r,s=[e[0].y,e[1].y,e[2].y,e[3].y],a=S.util.array.min(s);return{left:r,top:a,width:o,height:S.util.array.max(s)-a}},invertTransform:function(e){var t=1/(e[0]*e[3]-e[1]*e[2]),n=[t*e[3],-t*e[1],-t*e[2],t*e[0]],i=S.util.transformPoint({x:e[4],y:e[5]},n,!0);return n[4]=-i.x,n[5]=-i.y,n},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,t){var n=/\D{0,2}$/.exec(e),i=parseFloat(e);switch(t||(t=S.Text.DEFAULT_SVG_FONT_SIZE),n[0]){case"mm":return i*S.DPI/25.4;case"cm":return i*S.DPI/2.54;case"in":return i*S.DPI;case"pt":return i*S.DPI/72;case"pc":return i*S.DPI/72*12;case"em":return i*t;default:return i}},falseFunction:function(){return!1},getKlass:function(e,t){return e=S.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),S.util.resolveNamespace(t)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(e){if(!e)return S;var t,n=e.split("."),r=n.length,o=i||S.window;for(t=0;t<r;++t)o=o[n[t]];return o},loadImage:function(e,t,n,i){if(e){var r=S.util.createImage(),o=function(){t&&t.call(n,r,!1),r=r.onload=r.onerror=null};r.onload=o,r.onerror=function(){S.log("Error loading "+r.src),t&&t.call(n,null,!0),r=r.onload=r.onerror=null},0!==e.indexOf("data")&&null!=i&&(r.crossOrigin=i),"data:image/svg"===e.substring(0,14)&&(r.onload=null,S.util.loadImageInDom(r,o)),r.src=e}else t&&t.call(n,e)},loadImageInDom:function(e,t){var n=S.document.createElement("div");n.style.width=n.style.height="1px",n.style.left=n.style.top="-100%",n.style.position="absolute",n.appendChild(e),S.document.querySelector("body").appendChild(n),e.onload=function(){t(),n.parentNode.removeChild(n),n=null}},enlivenObjects:function(e,t,n,i){var r=[],o=0,s=(e=e||[]).length;function a(){++o===s&&t&&t(r.filter((function(e){return e})))}s?e.forEach((function(e,t){e&&e.type?S.util.getKlass(e.type,n).fromObject(e,(function(n,o){o||(r[t]=n),i&&i(e,n,o),a()})):a()})):t&&t(r)},enlivenPatterns:function(e,t){function n(){++r===o&&t&&t(i)}var i=[],r=0,o=(e=e||[]).length;o?e.forEach((function(e,t){e&&e.source?new S.Pattern(e,(function(e){i[t]=e,n()})):(i[t]=e,n())})):t&&t(i)},groupSVGElements:function(e,t,n){var i;return e&&1===e.length?e[0]:(t&&(t.width&&t.height?t.centerPoint={x:t.width/2,y:t.height/2}:(delete t.width,delete t.height)),i=new S.Group(e,t),void 0!==n&&(i.sourcePath=n),i)},populateWithProperties:function(e,t,n){if(n&&"[object Array]"===Object.prototype.toString.call(n))for(var i=0,r=n.length;i<r;i++)n[i]in e&&(t[n[i]]=e[n[i]])},drawDashedLine:function(e,t,n,i,s,a){var l=i-t,c=s-n,u=r(l*l+c*c),h=o(c,l),d=a.length,f=0,p=!0;for(e.save(),e.translate(t,n),e.moveTo(0,0),e.rotate(h),t=0;u>t;)(t+=a[f++%d])>u&&(t=u),e[p?"lineTo":"moveTo"](t,0),p=!p;e.restore()},createCanvasElement:function(){return S.document.createElement("canvas")},copyCanvasElement:function(e){var t=S.util.createCanvasElement();return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},toDataURL:function(e,t,n){return e.toDataURL("image/"+t,n)},createImage:function(){return S.document.createElement("img")},multiplyTransformMatrices:function(e,t,n){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],n?0:e[0]*t[4]+e[2]*t[5]+e[4],n?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=o(e[1],e[0]),n=s(e[0],2)+s(e[1],2),i=r(n),l=(e[0]*e[3]-e[2]*e[1])/i,c=o(e[0]*e[2]+e[1]*e[3],n);return{angle:t/a,scaleX:i,scaleY:l,skewX:c/a,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return S.iMatrix.concat();var t=S.util.degreesToRadians(e.angle),n=S.util.cos(t),i=S.util.sin(t);return[n,i,-i,n,0,0]},calcDimensionsMatrix:function(e){var t=void 0===e.scaleX?1:e.scaleX,n=void 0===e.scaleY?1:e.scaleY,i=[e.flipX?-t:t,0,0,e.flipY?-n:n,0,0],r=S.util.multiplyTransformMatrices,o=S.util.degreesToRadians;return e.skewX&&(i=r(i,[1,0,Math.tan(o(e.skewX)),1],!0)),e.skewY&&(i=r(i,[1,Math.tan(o(e.skewY)),0,1],!0)),i},composeMatrix:function(e){var t=[1,0,0,1,e.translateX||0,e.translateY||0],n=S.util.multiplyTransformMatrices;return e.angle&&(t=n(t,S.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(t=n(t,S.util.calcDimensionsMatrix(e))),t},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,n,i){i>0&&(t>i?t-=i:t=0,n>i?n-=i:n=0);var r,o=!0,s=e.getImageData(t,n,2*i||1,2*i||1),a=s.data.length;for(r=3;r<a&&!1!=(o=s.data[r]<=0);r+=4);return s=null,o},parsePreserveAspectRatioAttribute:function(e){var t,n="meet",i=e.split(" ");return i&&i.length&&("meet"!==(n=i.pop())&&"slice"!==n?(t=n,n="meet"):i.length&&(t=i.pop())),{meetOrSlice:n,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?S.charWidthsCache[e]&&delete S.charWidthsCache[e]:S.charWidthsCache={}},limitDimsByArea:function(e,t){var n=Math.sqrt(t*e),i=Math.floor(t/n);return{x:Math.floor(n),y:i}},capValue:function(e,t,n){return Math.max(e,Math.min(t,n))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map((function(e){return S.util.toFixed(e,S.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(e,t){var n=S.util.invertTransform(t),i=S.util.multiplyTransformMatrices(n,e.calcOwnMatrix());S.util.applyTransformToObject(e,i)},addTransformToObject:function(e,t){S.util.applyTransformToObject(e,S.util.multiplyTransformMatrices(t,e.calcOwnMatrix()))},applyTransformToObject:function(e,t){var n=S.util.qrDecompose(t),i=new S.Point(n.translateX,n.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",n.scaleX),e.set("scaleY",n.scaleY),e.skewX=n.skewX,e.skewY=n.skewY,e.angle=n.angle,e.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(e,t,n){var i=e/2,r=t/2,o=[{x:-i,y:-r},{x:i,y:-r},{x:-i,y:r},{x:i,y:r}],s=S.util.calcDimensionsMatrix(n),a=S.util.makeBoundingBoxFromPoints(o,s);return{x:a.width,y:a.height}}},function(){var e=Array.prototype.join,t={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},n={m:"l",M:"L"};function i(e,t,n,i,r,o,s,a,l,c,u){var h=S.util.cos(e),d=S.util.sin(e),f=S.util.cos(t),p=S.util.sin(t),g=n*r*f-i*o*p+s,m=i*r*f+n*o*p+a;return["C",c+l*(-n*r*d-i*o*h),u+l*(-i*r*d+n*o*h),g+l*(n*r*p+i*o*f),m+l*(i*r*p-n*o*f),g,m]}function r(e,t,n,r,s,a,l){var c=Math.PI,u=l*c/180,h=S.util.sin(u),d=S.util.cos(u),f=0,p=0,g=-d*e*.5-h*t*.5,m=-d*t*.5+h*e*.5,v=(n=Math.abs(n))*n,y=(r=Math.abs(r))*r,_=m*m,b=g*g,x=v*y-v*_-y*b,C=0;if(x<0){var j=Math.sqrt(1-x/(v*y));n*=j,r*=j}else C=(s===a?-1:1)*Math.sqrt(x/(v*_+y*b));var w=C*n*m/r,k=-C*r*g/n,O=d*w-h*k+.5*e,E=h*w+d*k+.5*t,T=o(1,0,(g-w)/n,(m-k)/r),M=o((g-w)/n,(m-k)/r,(-g-w)/n,(-m-k)/r);0===a&&M>0?M-=2*c:1===a&&M<0&&(M+=2*c);for(var P=Math.ceil(Math.abs(M/c*2)),A=[],I=M/P,D=8/3*Math.sin(I/4)*Math.sin(I/4)/Math.sin(I/2),L=T+I,R=0;R<P;R++)A[R]=i(T,L,d,h,n,r,O,E,D,f,p),f=A[R][5],p=A[R][6],T=L,L+=I;return A}function o(e,t,n,i){var r=Math.atan2(t,e),o=Math.atan2(i,n);return o>=r?o-r:2*Math.PI-(r-o)}function s(t,n,i,r,o,s,a,l){var c;if(S.cachesBoundsOfCurve&&(c=e.call(arguments),S.boundsOfCurveCache[c]))return S.boundsOfCurveCache[c];var u,h,d,f,p,g,m,v,y=Math.sqrt,_=Math.min,b=Math.max,x=Math.abs,C=[],j=[[],[]];h=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*a,d=3*i-3*t;for(var w=0;w<2;++w)if(w>0&&(h=6*n-12*r+6*s,u=-3*n+9*r-9*s+3*l,d=3*r-3*n),x(u)<1e-12){if(x(h)<1e-12)continue;0<(f=-d/h)&&f<1&&C.push(f)}else(m=h*h-4*d*u)<0||(0<(p=(-h+(v=y(m)))/(2*u))&&p<1&&C.push(p),0<(g=(-h-v)/(2*u))&&g<1&&C.push(g));for(var k,O,E,T=C.length,M=T;T--;)k=(E=1-(f=C[T]))*E*E*t+3*E*E*f*i+3*E*f*f*o+f*f*f*a,j[0][T]=k,O=E*E*E*n+3*E*E*f*r+3*E*f*f*s+f*f*f*l,j[1][T]=O;j[0][M]=t,j[1][M]=n,j[0][M+1]=a,j[1][M+1]=l;var P=[{x:_.apply(null,j[0]),y:_.apply(null,j[1])},{x:b.apply(null,j[0]),y:b.apply(null,j[1])}];return S.cachesBoundsOfCurve&&(S.boundsOfCurveCache[c]=P),P}function a(e,t,n){for(var i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=r(n[6]-e,n[7]-t,i,o,a,l,s),u=0,h=c.length;u<h;u++)c[u][1]+=e,c[u][2]+=t,c[u][3]+=e,c[u][4]+=t,c[u][5]+=e,c[u][6]+=t;return c}function l(e,t,n,i){return Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))}function c(e,t,n,i,r,o,s,a){return function(l){var c,u=(c=l)*c*c,h=function(e){return 3*e*e*(1-e)}(l),d=function(e){return 3*e*(1-e)*(1-e)}(l),f=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:s*u+r*h+n*d+e*f,y:a*u+o*h+i*d+t*f}}}function u(e,t,n,i,r,o,s,a){return function(l){var c=1-l,u=3*c*c*(n-e)+6*c*l*(r-n)+3*l*l*(s-r),h=3*c*c*(i-t)+6*c*l*(o-i)+3*l*l*(a-o);return Math.atan2(h,u)}}function h(e,t,n,i,r,o){return function(s){var a,l=(a=s)*a,c=function(e){return 2*e*(1-e)}(s),u=function(e){return(1-e)*(1-e)}(s);return{x:r*l+n*c+e*u,y:o*l+i*c+t*u}}}function d(e,t,n,i,r,o){return function(s){var a=1-s,l=2*a*(n-e)+2*s*(r-n),c=2*a*(i-t)+2*s*(o-i);return Math.atan2(c,l)}}function f(e,t,n){var i,r,o={x:t,y:n},s=0;for(r=1;r<=100;r+=1)i=e(r/100),s+=l(o.x,o.y,i.x,i.y),o=i;return s}function p(e,t){for(var n,i,r,o=0,s=0,a=e.iterator,c={x:e.x,y:e.y},u=.01,h=e.angleFinder;s<t&&o<=1&&u>1e-4;)n=a(o),r=o,(i=l(c.x,c.y,n.x,n.y))+s>t?o-=u/=2:(c=n,o+=u,s+=i);return n.angle=h(r),n}function g(e){for(var t,n,i,r,o=0,s=e.length,a=0,p=0,g=0,m=0,v=[],y=0;y<s;y++){switch(i={x:a,y:p,command:(t=e[y])[0]},t[0]){case"M":i.length=0,g=a=t[1],m=p=t[2];break;case"L":i.length=l(a,p,t[1],t[2]),a=t[1],p=t[2];break;case"C":n=c(a,p,t[1],t[2],t[3],t[4],t[5],t[6]),r=u(a,p,t[1],t[2],t[3],t[4],t[5],t[6]),i.iterator=n,i.angleFinder=r,i.length=f(n,a,p),a=t[5],p=t[6];break;case"Q":n=h(a,p,t[1],t[2],t[3],t[4]),r=d(a,p,t[1],t[2],t[3],t[4]),i.iterator=n,i.angleFinder=r,i.length=f(n,a,p),a=t[3],p=t[4];break;case"Z":case"z":i.destX=g,i.destY=m,i.length=l(a,p,g,m),a=g,p=m}o+=i.length,v.push(i)}return v.push({length:o,x:a,y:p}),v}S.util.joinPath=function(e){return e.map((function(e){return e.join(" ")})).join(" ")},S.util.parsePath=function(e){var i,r,o,s,a,l=[],c=[],u=S.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",d="("+h+")"+S.commaWsp,f="([01])"+S.commaWsp+"?",p=new RegExp(d+"?"+d+"?"+d+f+f+d+"?("+h+")","g");if(!e||!e.match)return l;for(var g,m=0,v=(a=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;m<v;m++){s=(i=a[m]).slice(1).trim(),c.length=0;var y=i.charAt(0);if(g=[y],"a"===y.toLowerCase())for(var _;_=p.exec(s);)for(var b=1;b<_.length;b++)c.push(_[b]);else for(;o=u.exec(s);)c.push(o[0]);b=0;for(var x=c.length;b<x;b++)r=parseFloat(c[b]),isNaN(r)||g.push(r);var C=t[y.toLowerCase()],j=n[y]||y;if(g.length-1>C)for(var w=1,k=g.length;w<k;w+=C)l.push([y].concat(g.slice(w,w+C))),y=j;else l.push(g)}return l},S.util.makePathSimpler=function(e){var t,n,i,r,o,s,l=0,c=0,u=e.length,h=0,d=0,f=[];for(n=0;n<u;++n){switch(i=!1,(t=e[n].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],h=t[1],d=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":o=t[3],s=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===r?(o=2*l-o,s=2*c-s):(o=l,s=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=o,t[2]=s,o=t[3],s=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":o=t[1],s=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===r?(o=2*l-o,s=2*c-s):(o=l,s=c),t[0]="Q",l=t[1],c=t[2],t[1]=o,t[2]=s,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":i=!0,f=f.concat(a(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=h,c=d}i||f.push(t),r=t[0]}return f},S.util.getSmoothPathFromPoints=function(e,t){var n,i=[],r=new S.Point(e[0].x,e[0].y),o=new S.Point(e[1].x,e[1].y),s=e.length,a=1,l=0,c=s>2;for(t=t||0,c&&(a=e[2].x<o.x?-1:e[2].x===o.x?0:1,l=e[2].y<o.y?-1:e[2].y===o.y?0:1),i.push(["M",r.x-a*t,r.y-l*t]),n=1;n<s;n++){if(!r.eq(o)){var u=r.midPointFrom(o);i.push(["Q",r.x,r.y,u.x,u.y])}r=e[n],n+1<e.length&&(o=e[n+1])}return c&&(a=r.x>e[n-2].x?1:r.x===e[n-2].x?0:-1,l=r.y>e[n-2].y?1:r.y===e[n-2].y?0:-1),i.push(["L",r.x+a*t,r.y+l*t]),i},S.util.getPathSegmentsInfo=g,S.util.getBoundsOfCurve=s,S.util.getPointOnPath=function(e,t,n){n||(n=g(e));for(var i=0;t-n[i].length>0&&i<n.length-2;)t-=n[i].length,i++;var r,o=n[i],s=t/o.length,a=o.command,l=e[i];switch(a){case"M":return{x:o.x,y:o.y,angle:0};case"Z":case"z":return(r=new S.Point(o.x,o.y).lerp(new S.Point(o.destX,o.destY),s)).angle=Math.atan2(o.destY-o.y,o.destX-o.x),r;case"L":return(r=new S.Point(o.x,o.y).lerp(new S.Point(l[1],l[2]),s)).angle=Math.atan2(l[2]-o.y,l[1]-o.x),r;case"C":case"Q":return p(o,t)}},S.util.transformPath=function(e,t,n){return n&&(t=S.util.multiplyTransformMatrices(t,[1,0,0,1,-n.x,-n.y])),e.map((function(e){for(var n=e.slice(0),i={},r=1;r<e.length-1;r+=2)i.x=e[r],i.y=e[r+1],i=S.util.transformPoint(i,t),n[r]=i.x,n[r+1]=i.y;return n}))},S.util.fromArcToBeizers=a,S.util.getBoundsOfArc=function(e,t,n,i,o,a,l,c,u){for(var h,d=0,f=0,p=[],g=r(c-e,u-t,n,i,a,l,o),m=0,v=g.length;m<v;m++)h=s(d,f,g[m][1],g[m][2],g[m][3],g[m][4],g[m][5],g[m][6]),p.push({x:h[0].x+e,y:h[0].y+t}),p.push({x:h[1].x+e,y:h[1].y+t}),d=g[m][5],f=g[m][6];return p},S.util.drawArc=function(e,t,n,i){a(t,n,i=i.slice(0).unshift("X")).forEach((function(t){e.bezierCurveTo.apply(e,t.slice(1))}))}}(),function(){var e=Array.prototype.slice;function t(e,t,n){if(e&&0!==e.length){var i=e.length-1,r=t?e[i][t]:e[i];if(t)for(;i--;)n(e[i][t],r)&&(r=e[i][t]);else for(;i--;)n(e[i],r)&&(r=e[i]);return r}}S.util.array={fill:function(e,t){for(var n=e.length;n--;)e[n]=t;return e},invoke:function(t,n){for(var i=e.call(arguments,2),r=[],o=0,s=t.length;o<s;o++)r[o]=i.length?t[o][n].apply(t[o],i):t[o][n].call(t[o]);return r},min:function(e,n){return t(e,n,(function(e,t){return e<t}))},max:function(e,n){return t(e,n,(function(e,t){return e>=t}))}}}(),function(){function e(t,n,i){if(i)if(!S.isLikelyNode&&n instanceof Element)t=n;else if(n instanceof Array){t=[];for(var r=0,o=n.length;r<o;r++)t[r]=e({},n[r],i)}else if(n&&"object"==typeof n)for(var s in n)"canvas"===s||"group"===s?t[s]=null:n.hasOwnProperty(s)&&(t[s]=e({},n[s],i));else t=n;else for(var s in n)t[s]=n[s];return t}S.util.object={extend:e,clone:function(t,n){return e({},t,n)}},S.util.object.extend(S.util,S.Observable)}(),function(){function e(e,t){var n=e.charCodeAt(t);if(isNaN(n))return"";if(n<55296||n>57343)return e.charAt(t);if(55296<=n&&n<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var i=e.charCodeAt(t+1);if(56320>i||i>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var r=e.charCodeAt(t-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}S.util.string={camelize:function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},graphemeSplit:function(t){var n,i=0,r=[];for(i=0;i<t.length;i++)!1!==(n=e(t,i))&&r.push(n);return r}}}(),function(){var e=Array.prototype.slice,t=function(){},n=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),i=function(e,t,i){for(var r in t)r in e.prototype&&"function"==typeof e.prototype[r]&&(t[r]+"").indexOf("callSuper")>-1?e.prototype[r]=function(e){return function(){var n=this.constructor.superclass;this.constructor.superclass=i;var r=t[e].apply(this,arguments);if(this.constructor.superclass=n,"initialize"!==e)return r}}(r):e.prototype[r]=t[r],n&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function r(){}function o(t){for(var n=null,i=this;i.constructor.superclass;){var r=i.constructor.superclass.prototype[t];if(i[t]!==r){n=r;break}i=i.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}S.util.createClass=function(){var n=null,s=e.call(arguments,0);function a(){this.initialize.apply(this,arguments)}"function"==typeof s[0]&&(n=s.shift()),a.superclass=n,a.subclasses=[],n&&(r.prototype=n.prototype,a.prototype=new r,n.subclasses.push(a));for(var l=0,c=s.length;l<c;l++)i(a,s[l],n);return a.prototype.initialize||(a.prototype.initialize=t),a.prototype.constructor=a,a.prototype.callSuper=o,a}}(),c=!!S.document.createElement("div").attachEvent,u=["touchstart","touchmove","touchend"],S.util.addListener=function(e,t,n,i){e&&e.addEventListener(t,n,!c&&i)},S.util.removeListener=function(e,t,n,i){e&&e.removeEventListener(t,n,!c&&i)},S.util.getPointer=function(e){var t=e.target,n=S.util.getScrollLeftTop(t),i=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:i.clientX+n.left,y:i.clientY+n.top}},S.util.isTouchEvent=function(e){return u.indexOf(e.type)>-1||"touch"===e.pointerType},h=S.document.createElement("div"),d="string"==typeof h.style.opacity,f="string"==typeof h.style.filter,p=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,g=function(e){return e},d?g=function(e,t){return e.style.opacity=t,e}:f&&(g=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),p.test(n.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",n.filter=n.filter.replace(p,t)):n.filter+=" alph
2a(opacity="+100*t+")",e}),S.util.setStyle=function(e,t){var n=e.style;if(!n)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?g(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var i in t)"opacity"===i?g(e,t[i]):n["float"===i||"cssFloat"===i?void 0===n.styleFloat?"cssFloat":"styleFloat":i]=t[i];return e},function(){var e=Array.prototype.slice;var t,n,i,r,o=function(t){return e.call(t,0)};try{t=o(S.document.childNodes)instanceof Array}catch(e){}function s(e,t){var n=S.document.createElement(e);for(var i in t)"class"===i?n.className=t[i]:"for"===i?n.htmlFor=t[i]:n.setAttribute(i,t[i]);return n}function a(e){for(var t=0,n=0,i=S.document.documentElement,r=S.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===S.document?(t=r.scrollLeft||i.scrollLeft||0,n=r.scrollTop||i.scrollTop||0):(t+=e.scrollLeft||0,n+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:t,top:n}}t||(o=function(e){for(var t=new Array(e.length),n=e.length;n--;)t[n]=e[n];return t}),n=S.document.defaultView&&S.document.defaultView.getComputedStyle?function(e,t){var n=S.document.defaultView.getComputedStyle(e,null);return n?n[t]:void 0}:function(e,t){var n=e.style[t];return!n&&e.currentStyle&&(n=e.currentStyle[t]),n},i=S.document.documentElement.style,r="userSelect"in i?"userSelect":"MozUserSelect"in i?"MozUserSelect":"WebkitUserSelect"in i?"WebkitUserSelect":"KhtmlUserSelect"in i?"KhtmlUserSelect":"",S.util.makeElementUnselectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=S.util.falseFunction),r?e.style[r]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},S.util.makeElementSelectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=null),r?e.style[r]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},S.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},S.util.getById=function(e){return"string"==typeof e?S.document.getElementById(e):e},S.util.toArray=o,S.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},S.util.makeElement=s,S.util.wrapElement=function(e,t,n){return"string"==typeof t&&(t=s(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},S.util.getScrollLeftTop=a,S.util.getElementOffset=function(e){var t,i,r=e&&e.ownerDocument,o={left:0,top:0},s={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return s;for(var c in l)s[l[c]]+=parseInt(n(e,c),10)||0;return t=r.documentElement,void 0!==e.getBoundingClientRect&&(o=e.getBoundingClientRect()),i=a(e),{left:o.left+i.left-(t.clientLeft||0)+s.left,top:o.top+i.top-(t.clientTop||0)+s.top}},S.util.getNodeCanvas=function(e){var t=S.jsdomImplForWrapper(e);return t._canvas||t._image},S.util.cleanUpJsdomNode=function(e){if(S.isLikelyNode){var t=S.jsdomImplForWrapper(e);t&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)}}}(),function(){function e(){}S.util.request=function(t,n){n||(n={});var i=n.method?n.method.toUpperCase():"GET",r=n.onComplete||function(){},o=new S.window.XMLHttpRequest,s=n.body||n.parameters;return o.onreadystatechange=function(){4===o.readyState&&(r(o),o.onreadystatechange=e)},"GET"===i&&(s=null,"string"==typeof n.parameters&&(t=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(t,n.parameters))),o.open(i,t,!0),"POST"!==i&&"PUT"!==i||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(s),o}}(),S.log=console.log,S.warn=console.warn,function(){function e(){return!1}function t(e,t,n,i){return-n*Math.cos(e/i*(Math.PI/2))+n+t}var n=S.window.requestAnimationFrame||S.window.webkitRequestAnimationFrame||S.window.mozRequestAnimationFrame||S.window.oRequestAnimationFrame||S.window.msRequestAnimationFrame||function(e){return S.window.setTimeout(e,1e3/60)},i=S.window.cancelAnimationFrame||S.window.clearTimeout;function r(){return n.apply(S.window,arguments)}S.util.animate=function(n){var i=!1;return r((function(o){n||(n={});var s,a=o||+new Date,l=n.duration||500,c=a+l,u=n.onChange||e,h=n.abort||e,d=n.onComplete||e,f
vendor: 8,143 bytes, line 2
2=n.easing||t,p="startValue"in n?n.startValue:0,g="endValue"in n?n.endValue:100,m=n.byValue||g-p;n.onStart&&n.onStart(),function e(t){var n=(s=t||+new Date)>c?l:s-a,o=n/l,v=f(n,p,m,l),y=Math.abs((v-p)/m);if(!i){if(!h(v,y,o))return s>c?(u(g,1,1),void d(g,1,1)):(u(v,y,o),void r(e));d(g,1,1)}}(a)})),function(){i=!0}},S.util.requestAnimFrame=r,S.util.cancelAnimFrame=function(){return i.apply(S.window,arguments)}}(),function(){function e(e,t,n){var i="rgba("+parseInt(e[0]+n*(t[0]-e[0]),10)+","+parseInt(e[1]+n*(t[1]-e[1]),10)+","+parseInt(e[2]+n*(t[2]-e[2]),10);return i+=","+(e&&t?parseFloat(e[3]+n*(t[3]-e[3])):1),i+=")"}S.util.animateColor=function(t,n,i,r){var o=new S.Color(t).getSource(),s=new S.Color(n).getSource(),a=r.onComplete,l=r.onChange;return r=r||{},S.util.animate(S.util.object.extend(r,{duration:i||500,startValue:o,endValue:s,byValue:s,easing:function(t,n,i,o){return e(n,i,r.colorEasing?r.colorEasing(t,o):1-Math.cos(t/o*(Math.PI/2)))},onComplete:function(t,n,i){if(a)return a(e(s,s,0),n,i)},onChange:function(t,n,i){if(l){if(Array.isArray(t))return l(e(t,t,0),n,i);l(t,n,i)}}}))}}(),function(){function e(e,t,n,i){return e<Math.abs(t)?(e=t,i=n/4):i=0===t&&0===e?n/(2*Math.PI)*Math.asin(1):n/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:n,s:i}}function t(e,t,n){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*n-e.s)*(2*Math.PI)/e.p)}function n(e,t,n,r){return n-i(r-e,0,n,r)+t}function i(e,t,n,i){return(e/=i)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}S.util.ease={easeInQuad:function(e,t,n,i){return n*(e/=i)*e+t},easeOutQuad:function(e,t,n,i){return-n*(e/=i)*(e-2)+t},easeInOutQuad:function(e,t,n,i){return(e/=i/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,i){return n*(e/=i)*e*e+t},easeOutCubic:function(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,i){return(e/=i/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,i){return n*(e/=i)*e*e*e+t},easeOutQuart:function(e,t,n,i){return-n*((e=e/i-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,i){return(e/=i/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,i){return n*(e/=i)*e*e*e*e+t},easeOutQuint:function(e,t,n,i){return n*((e=e/i-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,i){return(e/=i/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,i){return-n*Math.cos(e/i*(Math.PI/2))+n+t},easeOutSine:function(e,t,n,i){return n*Math.sin(e/i*(Math.PI/2))+t},easeInOutSine:function(e,t,n,i){return-n/2*(Math.cos(Math.PI*e/i)-1)+t},easeInExpo:function(e,t,n,i){return 0===e?t:n*Math.pow(2,10*(e/i-1))+t},easeOutExpo:function(e,t,n,i){return e===i?t+n:n*(1-Math.pow(2,-10*e/i))+t},easeInOutExpo:function(e,t,n,i){return 0===e?t:e===i?t+n:(e/=i/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,n,i){return-n*(Math.sqrt(1-(e/=i)*e)-1)+t},easeOutCirc:function(e,t,n,i){return n*Math.sqrt(1-(e=e/i-1)*e)+t},easeInOutCirc:function(e,t,n,i){return(e/=i/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(n,i,r,o){var s=0;return 0===n?i:1===(n/=o)?i+r:(s||(s=.3*o),-t(e(r,r,s,1.70158),n,o)+i)},easeOutElastic:function(t,n,i,r){var o=0;if(0===t)return n;if(1===(t/=r))return n+i;o||(o=.3*r);var s=e(i,i,o,1.70158);return s.a*Math.pow(2,-10*t)*Math.sin((t*r-s.s)*(2*Math.PI)/s.p)+s.c+n},easeInOutElastic:function(n,i,r,o){var s=0;if(0===n)return i;if(2===(n/=o/2))return i+r;s||(s=o*(.3*1.5));var a=e(r,r,s,1.70158);return n<1?-.5*t(a,n,o)+i:a.a*Math.pow(2,-10*(n-=1))*Math.sin((n*o-a.s)*(2*Math.PI)/a.p)*.5+a.c+i},easeInBack:function(e,t,n,i,r){return void 0===r&&(r=1.70158),n*(e/=i)*e*((r+1)*e-r)+t},easeOutBack:function(e,t,n,i,r){return void 0===r&&(r=1.70158),n*((e=e/i-1)*e*((r+1)*e+r)+1)+t},easeInOutBack:function(e,t,n,i,r){return void 0===r&&(r=1.70158),(e/=i/2)<1?n/2*(e*e*((1+(r*=1.525))*e-r))+t:n/2*((e-=2)*e*((1+(r*=1.525))*e+r)+2)+t},easeInBounce:n,easeOutBounce:i,easeInOutBounce:function(e,t,r,o){return e<o/2?.5*n(2*e,0,r,o)+t:.5*i(2*e-o,0,r,o)+.5*r+t}}}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,i=t.util.object.clone,r=t.util.toFixed,o=t.util.parseUnit,s=t.util.multiplyTransformMatrices,a={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},l={stroke:"strokeOpacity",fill:"fillOpacity"},c="font-size",u="clip-path";function h(e){return e in a?a[e]:e}function d(e,n,i,r){var a,l="[object Array]"===Object.prototype.toString.call(n);if("fill"!==e&&"stroke"!==e||"none"!==n){if("strokeUniform"===e)return"non-scaling-stroke"===n;if("strokeDashArray"===e)n="none"===n?null:n.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)n=i&&i.transformMatrix?s(i.transformMatrix,t.parseTransformAttribute(n)):t.parseTransformAttribute(n);else if("visible"===e)n="none"!==n&&"hidden"!==n,i&&!1===i.visible&&(n=!1);else if("opacity"===e)n=parseFloat(n),i&&void 0!==i.opacity&&(n*=i.opacity);else if("textAnchor"===e)n="start"===n?"left":"end"===n?"right":"center";else if("charSpacing"===e)a=o(n,r)/r*1e3;else if("paintFirst"===e){var c=n.indexOf("fill"),u=n.indexOf("stroke");n="fill";(c>-1&&u>-1&&u<c||-1===c&&u>-1)&&(n="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return n;if("imageSmoothing"===e)return"optimizeQuality"===n;a=l?n.map(o):o(n,r)}}else n="";return!l&&isNaN(a)?n:a}function f(e){return new RegExp("^("+e.join("|")+")\\b","i")}function p(e,t){var n,i,r,o,s=[];for(r=0,o=t.length;r<o;r++)n=t[r],i=e.getElementsByTagName(n),s=s.concat(Array.prototype.slice.call(i));return s}function g(e,t){var n,i=!0;return(n=m(e,t.pop()))&&t.length&&(i=function(e,t){var n,i=!0;for(;e.parentNode&&1===e.parentNode.nodeType&&t.length;)i&&(n=t.pop()),i=m(e=e.parentNode,n);return 0===t.length}(e,t)),n&&i&&0===t.length}function m(e,t){var n,i,r=e.nodeName,o=e.getAttribute("class"),s=e.getAttribute("id");if(n=new RegExp("^"+r,"i"),t=t.replace(n,""),s&&t.length&&(n=new RegExp("#"+s+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"")),o&&t.length)for(i=(o=o.split(" ")).length;i--;)n=new RegExp("\\."+o[i]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"");return 0===t.length}function v(e,t){var n;if(e.getElementById&&(n=e.getElementById(t)),n)return n;var i,r,o,s=e.getElementsByTagName("*");for(r=0,o=s.length;r<o;r++)if(t===(i=s[r]).getAttribute("id"))return i}t.svgValidTagNamesRegEx=f(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=f(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=f(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=f(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,n,i){e[i]=Math.tan(t.util.degreesToRadians(n[0]))}var n=t.iMatrix,i=t.reNum,r=t.commaWsp,o="(?:"+("(?:(matrix)\\s*\\(\\s*("+i+")"+r+"("+i+")"+r+"("+i+")"+r+"("+i+")"+r+"("+i+")"+r+"("+i+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+i+")(?:"+r+"("+i+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+i+")(?:"+r+"("+i+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+i+")(?:"+r+"("+i+")"+r+"("+i+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+i+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+i+")\\s*\\))")+")",s=new RegExp("^\\s*(?:"+("(?:"+o+"(?:"+r+"*"+o+")*)")+"?)\\s*$"),a=new RegExp(o,"g");return function(i){var r=n.concat(),l=[];
vendor: 6,354 bytes, line 2
2if(!i||i&&!s.test(i))return r;i.replace(a,(function(i){var s=new RegExp(o).exec(i).filter((function(e){return!!e})),a=s[1],c=s.slice(2).map(parseFloat);switch(a){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(r,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,n){var i=t.util.cos(n[0]),r=t.util.sin(n[0]),o=0,s=0;3===n.length&&(o=n[1],s=n[2]),e[0]=i,e[1]=r,e[2]=-r,e[3]=i,e[4]=o-(i*o-r*s),e[5]=s-(r*o+i*s)}(r,c);break;case"scale":!function(e,t){var n=t[0],i=2===t.length?t[1]:t[0];e[0]=n,e[3]=i}(r,c);break;case"skewX":e(r,c,2);break;case"skewY":e(r,c,1);break;case"matrix":r=c}l.push(r.concat()),r=n.concat()}));for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var y=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function _(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var n,i,r,s,a,l,c=e.getAttribute("viewBox"),u=1,h=1,d=e.getAttribute("width"),f=e.getAttribute("height"),p=e.getAttribute("x")||0,g=e.getAttribute("y")||0,m=e.getAttribute("preserveAspectRatio")||"",v=!c||!(c=c.match(y)),_=!d||!f||"100%"===d||"100%"===f,b=v&&_,x={},C="",j=0,w=0;if(x.width=0,x.height=0,x.toBeParsed=b,v&&(p||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") ",a=(e.getAttribute("transform")||"")+C,e.setAttribute("transform",a),e.removeAttribute("x"),e.removeAttribute("y")),b)return x;if(v)return x.width=o(d),x.height=o(f),x;if(n=-parseFloat(c[1]),i=-parseFloat(c[2]),r=parseFloat(c[3]),s=parseFloat(c[4]),x.minX=n,x.minY=i,x.viewBoxWidth=r,x.viewBoxHeight=s,_?(x.width=r,x.height=s):(x.width=o(d),x.height=o(f),u=x.width/r,h=x.height/s),"none"!==(m=t.util.parsePreserveAspectRatioAttribute(m)).alignX&&("meet"===m.meetOrSlice&&(h=u=u>h?h:u),"slice"===m.meetOrSlice&&(h=u=u>h?u:h),j=x.width-r*u,w=x.height-s*u,"Mid"===m.alignX&&(j/=2),"Mid"===m.alignY&&(w/=2),"Min"===m.alignX&&(j=0),"Min"===m.alignY&&(w=0)),1===u&&1===h&&0===n&&0===i&&0===p&&0===g)return x;if((p||g)&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") "),a=C+" matrix("+u+" 0 0 "+h+" "+(n*u+j)+" "+(i*h+w)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),a=l.getAttribute("transform")+a;return l.setAttribute("transform",a),x}function b(e,t){var n="xlink:href",i=v(e,t.getAttribute(n).substr(1));if(i&&i.getAttribute(n)&&b(e,i),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach((function(e){i&&!t.hasAttribute(e)&&i.hasAttribute(e)&&t.setAttribute(e,i.getAttribute(e))})),!t.children.length)for(var r=i.cloneNode(!0);r.firstChild;)t.appendChild(r.firstChild);t.removeAttribute(n)}t.parseSVGDocument=function(e,n,r,o){if(e){!function(e){for(var n=p(e,["use","svg:use"]),i=0;n.length&&i<n.length;){var r=n[i],o=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===o)return;var s,a,l,c,u=o.substr(1),h=r.getAttribute("x")||0,d=r.getAttribute("y")||0,f=v(e,u).cloneNode(!0),g=(f.getAttribute("transform")||"")+" translate("+h+", "+d+")",m=n.length,y=t.svgNS;if(_(f),/^svg$/i.test(f.nodeName)){var b=f.ownerDocument.createElementNS(y,"g");for(a=0,c=(l=f.attributes).length;a<c;a++)s=l.item(a),b.setAttributeNS(y,s.nodeName,s.nodeValue);for(;f.firstChild;)b.appendChild(f.firstChild);f=b}for(a=0,c=(l=r.attributes).length;a<c;a++)"x"!==(s=l.item(a)).nodeName&&"y"!==s.nodeName&&"xlink:href"!==s.nodeName&&"href"!==s.nodeName&&("transform"===s.nodeName?g=s.nodeValue+" "+g:f.setAttribute(s.nodeName,s.nodeValue));f.setAttribute("transform",g),f.setAttribute("instantiated_by_use","1"),f.removeAttribute("id"),r.parentNode.replaceChild(f,r),n.length===m&&i++}}(e);var s,a,l=t.Object.__uid++,c=_(e),u=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===u.length&&t.isLikelyNode){var h=[];for(s=0,a=(u=e.selectNodes('//*[name(.)!="svg"]')).length;s<a;s++)h[s]=u[s];u=h}var d=u.filter((function(e){return _(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)}));if(!d||d&&!d.length)n&&n([],{});else{var f={};u.filter((function(e){return"clipPath"===e.nodeName.replace("svg:","")})).forEach((function(e){var n=e.getAttribute("id");f[n]=t.util.toArray(e.getElementsByTagName("*")).filter((function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))}))})),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=f,t.parseElements(d,(function(e,i){n&&(n(e,c,i,u),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])}),i(c),r,o)}}};var x=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");n(t,{parseFontDeclaration:function(e,t){var n=e.match(x);if(n){var i=n[1],r=n[3],s=n[4],a=n[5],l=n[6];i&&(t.fontStyle=i),r&&(t.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),s&&(t.fontSize=o(s)),l&&(t.fontFamily=l),a&&(t.lineHeight="normal"===a?1:a)}},getGradientDefs:function(e){var t,n=p(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),i=0,r={};for(i=n.length;i--;)(t=n[i]).getAttribute("xlink:href")&&b(e,t),r[t.getAttribute("id")]=t;return r},parseAttributes:function(e,i,s){if(e){var a,f,p,m={};void 0===s&&(s=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,i,s));var v=i.reduce((function(t,n){return(a=e.getAttribute(n))&&(t[n]=a),t}),{}),y=n(function(e,n){var i={};for(var r in t.cssRules[n])if(g(e,r.split(" ")))for(var o in t.cssRules[n][r])i[o]=t.cssRules[n][r][o];return i}(e,s),t.parseStyleAttribute(e));v=n(v,y),y[u]&&e.setAttribute(u,y[u]),f=p=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,v[c]&&(v[c]=f=o(v[c],p));var _,b,x={};for(var C in v)b=d(_=h(C),v[C],m,f),x[_]=b;x&&x.font&&t.parseFontDeclaration(x.font,x);var j=n(m,x);return t.svgValidParentsRegEx.test(e.nodeName)?j:function(e){for(var n in l)if(void 0!==e[l[n]]&&""!==e[n]){if
vendor: 31,543 bytes, line 2
2(void 0===e[n]){if(!t.Object.prototype[n])continue;e[n]=t.Object.prototype[n]}if(0!==e[n].indexOf("url(")){var i=new t.Color(e[n]);e[n]=i.setAlpha(r(i.getAlpha()*e[l[n]],2)).toRgba()}}return e}(j)}},parseElements:function(e,n,i,r,o){new t.ElementsParser(e,n,i,r,o).parse()},parseStyleAttribute:function(e){var t={},n=e.getAttribute("style");return n?("string"==typeof n?function(e,t){var n,i;e.replace(/;\s*$/,"").split(";").forEach((function(e){var r=e.split(":");n=r[0].trim().toLowerCase(),i=r[1].trim(),t[n]=i}))}(n,t):function(e,t){var n,i;for(var r in e)void 0!==e[r]&&(n=r.toLowerCase(),i=e[r],t[n]=i)}(n,t),t):t},parsePointsAttribute:function(e){if(!e)return null;var t,n,i=[];for(t=0,n=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<n;t+=2)i.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return i},getCSSRules:function(e){var n,i,r=e.getElementsByTagName("style"),o={};for(n=0,i=r.length;n<i;n++){var s=r[n].textContent;""!==(s=s.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&s.match(/[^{]*\{[\s\S]*?\}/g).map((function(e){return e.trim()})).forEach((function(e){var r=e.match(/([\s\S]*?)\s*\{([^}]*)\}/),s={},a=r[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(n=0,i=a.length;n<i;n++){var l=a[n].split(/\s*:\s*/),c=l[0],u=l[1];s[c]=u}(e=r[1]).split(",").forEach((function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(o[e]?t.util.object.extend(o[e],s):o[e]=t.util.object.clone(s))}))}))}return o},loadSVGFromURL:function(e,n,i,r){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var o=e.responseXML;if(!o||!o.documentElement)return n&&n(null),!1;t.parseSVGDocument(o.documentElement,(function(e,t,i,r){n&&n(e,t,i,r)}),i,r)}})},loadSVGFromString:function(e,n,i,r){var o=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(o.documentElement,(function(e,t,i,r){n(e,t,i,r)}),i,r)}})}(t),S.ElementsParser=function(e,t,n,i,r,o){this.elements=e,this.callback=t,this.options=n,this.reviver=i,this.svgUid=n&&n.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},(m=S.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},m.createObjects=function(){var e=this;this.elements.forEach((function(t,n){t.setAttribute("svgUid",e.svgUid),e.createObject(t,n)}))},m.findTag=function(e){return S[S.util.string.capitalize(e.tagName.replace("svg:",""))]},m.createObject=function(e,t){var n=this.findTag(e);if(n&&n.fromElement)try{n.fromElement(e,this.createCallback(t,e),this.options)}catch(e){S.log(e)}else this.checkIfDone()},m.createCallback=function(e,t){var n=this;return function(i){var r;n.resolveGradient(i,t,"fill"),n.resolveGradient(i,t,"stroke"),i instanceof S.Image&&i._originalElement&&(r=i.parsePreserveAspectRatioAttribute(t)),i._removeTransformMatrix(r),n.resolveClipPath(i,t),n.reviver&&n.reviver(t,i),n.instances[e]=i,n.checkIfDone()}},m.extractPropertyDefinition=function(e,t,n){var i=e[t],r=this.regexUrl;if(r.test(i)){r.lastIndex=0;var o=r.exec(i)[1];return r.lastIndex=0,S[n][this.svgUid][o]}},m.resolveGradient=function(e,t,n){var i=this.extractPropertyDefinition(e,n,"gradientDefs");if(i){var r=t.getAttribute(n+"-opacity"),o=S.Gradient.fromElement(i,e,r,this.options);e.set(n,o)}},m.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},m.resolveClipPath=function(e,t){var n,i,r,o,s=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(s){r=[],i=S.util.invertTransform(e.calcTransformMatrix());for(var a=s[0].parentNode,l=t;l.parentNode&&l.getAttribute("clip-path")!==e.clipPath;)l=l.parentNode;l.parentNode.appendChild(a);for(var c=0;c<s.length;c++)n=s[c],this.findTag(n).fromElement(n,this.createClipPathCallback(e,r),this.options);s=1===r.length?r[0]:new S.Group(r),o=S.util.multiplyTransformMatrices(i,s.calcTransformMatrix()),s.clipPath&&this.resolveClipPath(s,l);var u=S.util.qrDecompose(o);s.flipX=!1,s.flipY=!1,s.set("scaleX",u.scaleX),s.set("scaleY",u.scaleY),s.angle=u.angle,s.skewX=u.skewX,s.skewY=0,s.setPositionByOrigin({x:u.translateX,y:u.translateY},"center","center"),e.clipPath=s}else delete e.clipPath},m.checkIfDone=function(){0==--this.numElements&&(this.instances=this.instances.filter((function(e){return null!=e})),this.callback(this.instances,this.elements))},function(e){"use strict";var t=e.fabric||(e.fabric={});function n(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=n,n.prototype={type:"point",constructor:n,add:function(e){return new n(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new n(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new n(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new n(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new n(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new n(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return void 0===t&&(t=.5),t=Math.max(Math.min(1,t),0),new n(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new n(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new n(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,n=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=n},clone:function(){return new n(this.x,this.y)}})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function n(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=n,t.Intersection.prototype={constructor:n,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,i,r,o){var s,a=(o.x-r.x)*(e.y-r.y)-(o.y-r.y)*(e.x-r.x),l=(i.x-e.x)*(e.y-r.y)-(i.y-e.y)*(e.x-r.x),c=(o.y-r.y)*(i.x-e.x)-(o.x-r.x)*(i.y-e.y);if(0!==c){var u=a/c,h=l/c;0<=u&&u<=1&&0<=h&&h<=1?(s=new n("Intersection")).appendPoint(new t.Point(e.x+u*(i.x-e.x),e.y+u*(i.y-e.y))):s=new n}else s=new n(0===a||0===l?"Coincident":"Parallel");return s},t.Intersection.intersectLinePolygon=function(e,t,i){var r,o,s,a,l=new n,c=i.length;for(a=0;a<c;a++)r=i[a],o=i[(a+1)%c],s=n.intersectLineLine(e,t,r,o),l.appendPoints(s.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var i,r=new n,o=e.length;for(i=0;i<o;i++){var s=e[i],a=e[(i+1)%o],l=n.intersectLinePolygon(s,a,t);r.appendPoints(l.points)}return r.points.length>0&&(r.status="Intersection"),r},t.Intersection.intersectPolygonRectangle=function(e,i,r){var o=i.min(r),s=i.max(r),a=new t.Point(s.x,o.y),l=new t.Point(o.x,s.y),c=n.intersectLinePolygon(o,a,e),u=n.intersectLinePolygon(a,s,e),h=n.intersectLinePolygon(s,l,e),d=n.intersectLinePolygon(l,o,e),f=new n;return f.appendPoints(c.points),f.appendPoints(u.points),f.appendPoints(h.points),f.appendPoints(d.points),f.points.length>0&&(f.status="Intersection"),f})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function n(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function i(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=n,t.Color.prototype={_tryParsingColor:function(e){var t;e in n.colorNameMap&&(e=n.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=n.sourceFromHex(e)),t||(t=n.sourceFromRgb(e)),t||(t=n.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,n,i){e/=255,n/=255,i/=255;var r,o,s,a=t.util.array.max([e,n,i]),l=t.util.array.min([e,n,i]);if(s=(a+l)/2,a===l)r=o=0;else{var c=a-l;switch(o=s>.5?c/(2-a-l):c/(a+l),a){case e:r=(n-i)/c+(n<i?6:0);break;case n:r=(i-e)/c+2;break;case i:r=(e-n)/c+4}r/=6}return[Math.round(360*r),Math.round(100*o),Math.round(100*s)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,n,i=this.getSource();return e=1===(e=i[0].toString(16)).length?"0"+e:e,t=1===(t=i[1].toString(16)).length?"0"+t:t,n=1===(n=i[2].toString(16)).length?"0"+n:n,e.toUpperCase()+t.toUpperCase()+n.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),n=e[3];return this.setSource([t,t,t,n]),this},toBlackWhite:function(e){var t=this.getSource(),n=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),i=t[3];return e=e||127,n=Number(n)<Number(e)?0:255,this.setSource([n,n,n,i]),this},overlayWith:function(e){e instanceof n||(e=new n(e));var t,i=[],r=this.getAlpha(),o=this.getSource(),s=e.getSource();for(t=0;t<3;t++)i.push(Math.round(.5*o[t]+.5*s[t]));return i[3]=r,this.setSource(i),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},t.Color.fromRgb=function(e){return n.fromSource(n.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(n.reRGBa);if(t){var i=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),r=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),o=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(i,10),parseInt(r,10),parseInt(o,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=n.fromRgb,t.Color.fromHsl=function(e){return n.fromSource(n.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(n.reHSLa);if(t){var r,o,s,a=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)r=o=s=c;else{var u=c<=.5?c*(l+1):c+l-c*l,h=2*c-u;r=i(h,u,a+1/3),o=i(h,u,a),s=i(h,u,a-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*s),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=n.fromHsl,t.Color.fromHex=function(e){return n.fromSource(n.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(n.reHex)){var t=e.slice(e.indexOf("#")+1),i=3===t.length||4===t.length,r=8===t.length||4===t.length,o=i?t.charAt(0)+t.charAt(0):t.substring(0,2),s=i?t.charAt(1)+t.charAt(1):t.substring(2,4),a=i?t.charAt(2)+t.charAt(2):t.substring(4,6),l=r?i?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(o,16),parseInt(s,16),parseInt(a,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new n;return t.setSource(e),t})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=["e","se","s","sw","w","nw","n","ne","e"],i=["ns","nesw","ew","nwse"],r={},o="left",s="top",a="right",l="bottom",c="center",u={top:l,bottom:s,left:a,right:o,center:c},h=t.util.radiansToDegrees,d=Math.sign||function(e){return(e>0)-(e<0)||+e};function f(e,t){var n=e.angle+h(Math.atan2(t.y,t.x))+360;return Math.round(n%360/45)}function p(e,n){var i=n.transform.target,r=i.canvas,o=t.util.object.clone(n);o.target=i,r&&r.fire("object:"+e,o),i.fire(e,n)}function g(e,t){var n=t.canvas,i=e[n.uniScaleKey];return n.uniformScaling&&!i||!n.uniformScaling&&i}function m(e){return e.originX===c&&e.originY===c}function v(e,t,n){var i=e.lockScalingX,r=e.lockScalingY;return!(!i||!r)||(!(t||!i&&!r||!n)||(!(!i||"x"!==t)||!(!r||"y"!==t)))}function y(e,t,n,i){return{e,transform:t,pointer:{x:n,y:i}}}function _(e){return function(t,n,i,r){var o=n.target,s=o.getCenterPoint(),a=o.translateToOriginPoint(s,n.originX,n.originY),l=e(t,n,i,r);return o.setPositionByOrigin(a,n.originX,n.originY),l}}function b(e,t){return function(n,i,r,o){var s=t(n,i,r,o);return s&&p(e,y(n,i,r,o)),s}}function x(e,n,i,r,o){var s=e.target,a=s.controls[e.corner],l=s.canvas.getZoom(),c=s.padding/l,u=s.toLocalPoint(new t.Point(r,o),n,i);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=a.offsetX,u.y-=a.offsetY,u}function C(e){return e.flipX!==e.flipY}function j(e,t,n,i,r){if(0!==e[t]){var o=r/e._getTransformedDimensions()[i]*e[n];e.set(n,o)}}function w(e,t,n,i){var r,c=t.target,u=c._getTransformedDimensions(0,c.skewY),d=x(t,t.originX,t.originY,n,i),f=Math.abs(2*d.x)-u.x,p=c.skewX;f<2?r=0:(r=h(Math.atan2(f/c.scaleX,u.y/c.scaleY)),t.originX===o&&t.originY===l&&(r=-r),t.originX===a&&t.originY===s&&(r=-r),C(c)&&(r=-r));var g=p!==r;if(g){var m=c._getTransformedDimensions().y;c.set("skewX",r),j(c,"skewY","scaleY","y",m)}return g}function S(e,t,n,i){var r,c=t.target,u=c._getTransformedDimensions(c.skewX,0),d=x(t,t.originX,t.originY,n,i),f=Math.abs(2*d.y)-u.y,p=c.skewY;f<2?r=0:(r=h(Math.atan2(f/c.scaleY,u.x/c.scaleX)),t.originX===o&&t.originY===l&&(r=-r),t.originX===a&&t.originY===s&&(r=-r),C(c)&&(r=-r));var g=p!==r;if(g){var m=c._getTransformedDimensions().x;c.set("skewY",r),j(c,"skewX","scaleX","x",m)}return g}function k(e,t,n,i,r){r=r||{};var o,s,a,l,c,h,f=t.target,p=f.lockScalingX,y=f.lockScalingY,_=r.by,b=g(e,f),C=v(f,_,b),j=t.gestureScale;if(C)return!1;if(j)s=t.scaleX*j,a=t.scaleY*j;else{if(o=x(t,t.originX,t.originY,n,i),c="y"!==_?d(o.x):1,h="x"!==_?d(o.y):1,t.signX||(t.signX=c),t.signY||(t.signY=h),f.lockScalingFlip&&(t.signX!==c||t.signY!==h))return!1;if(l=f._getTransformedDimensions(),b&&!_){var w=Math.abs(o.x)+Math.abs(o.y),S=t.original,k=w/(Math.abs(l.x*S.scaleX/f.scaleX)+Math.abs(l.y*S.scaleY/f.scaleY));s=S.scaleX*k,a=S.scaleY*k}else s=Math.abs(o.x*f.scaleX/l.x),a=Math.abs(o.y*f.scaleY/l.y);m(t)&&(s*=2,a*=2),t.signX!==c&&"y"!==_&&(t.originX=u[t.originX],s*=-1,t.signX=c),t.signY!==h&&"x"!==_&&(t.originY=u[t.originY],a*=-1,t.signY=h)}var O=f.scaleX,E=f.scaleY;return _?("x"===_&&f.set("scaleX",s),"y"===_&&f.set("scaleY",a)):(!p&&f.set("scaleX",s),!y&&f.set("scaleY",a)),O!==f.scaleX||E!==f.scaleY}r.scaleCursorStyleHandler=function(e,t,i){var r=g(e,i),o="";if(0!==t.x&&0===t.y?o="x":0===t.x&&0!==t.y&&(o="y"),v(i,o,r))return"not-allowed";var s=f(i,t);return n[s]+"-resize"},r.skewCursorStyleHandler=function(e,t,n){var r="not-allowed";if(0!==t.x&&n.lockSkewingY)return r;if(0!==t.y&&n.lockSkewingX)return r;var o=f(n,t)%4;return i[o]+"-resize"},r.scaleSkewCursorStyleHandler=function(e,t,n){return e[n.canvas.altActionKey]?r.skewCursorStyleHandler(e,t,n):r.scaleCursorStyleHandler(e,t,n)},r.rotationWithSnapping=b("rotating",_((function(e,t,n,i){var r=t,o=r.target,s=o.translateToOriginPoint(o.getCenterPoint(),r.originX,r.originY);if(o.lockRotation)return!1;var a,l=Math.atan2(r.ey-s.y,r.ex-s.x),c=Math.atan2(i-s.y,n-s.x),u=h(c-l+r.theta);if(o.snapAngle>0){var d=o.snapAngle,f=o.snapThreshold||d,p=Math.ceil(u/d)*d,g=Math.floor(u/d)*d;Math.abs(u-g)<f?u=g:Math.abs(u-p)<f&&(u=p)}return u<0&&(u=360+u),u%=360,a=o.angle!==u,o.angle=u,a}))),r.scalingEqually=b("scaling",_((function(e,t,n,i){return k(e,t,n,i)}))),r.scalingX=b("scaling",_((function(e,t,n,i){return k(e,t,n,i,{by:"x"})}))),r.scalingY=b("scaling",_((function(e,t,n,i){return k(e,t,n,i,{by:"y"})}))),r.scalingYOrSkewingX=function(e,t,n,i){return e[t.target.canvas.altActionKey]?r.skewHandlerX(e,t,n,i):r.scalingY(e,t,n,i)},r.scalingXOrSkewingY=function(e,t,n,i){return e[t.target.canvas.altActionKey]?r.skewHandlerY(e,t,n,i):r.scalingX(e,t,n,i)},r.changeWidth=b("resizing",_((function(e,t,n,i){var r=t.target,o=x(t,t.originX,t.originY,n,i),s=r.strokeWidth/(r.strokeUniform?r.scaleX:1),a=m(t)?2:1,l=r.width,c=Math.abs(o.x*a/r.scaleX)-s;return r.set("width",Math.max(c,0)),l!==c}))),r.skewHandlerX=function(e,t,n,i){var r,l=t.target,u=l.skewX,h=t.originY;return!l.lockSkewingX&&(0===u?r=x(t,c,c,n,i).x>0?o:a:(u>0&&(r=h===s?o:a),u<0&&(r=h===s?a:o),C(l)&&(r=r===o?a:o)),t.originX=r,b("skewing",_(w))(e,t,n,i))},r.skewHandlerY=function(e,t,n,i){var r,a=t.target,u=a.skewY,h=t.originX;return!a.lockSkewingY&&(0===u?r=x(t,c,c,n,i).y>0?s:l:(u>0&&(r=h===o?s:l),u<0&&(r=h===o?l:s),C(a)&&(r=r===s?l:s)),t.originY=r,b("skewing",_(S))(e,t,n,i))},r.dragHandler=function(e,t,n,i){var r=t.target,o=n-t.offsetX,s=i-t.offsetY,a=!r.get("lockMovementX")&&r.left!==o,l=!r.get("lockMovementY")&&r.top!==s;return a&&r.set("left",o),l&&r.set("top",s),(a||l)&&p("moving",y(e,t,n,i)),a||l},r.scaleOrSkewActionName=function(e,t,n){var i=e[n.canvas.altActionKey];return 0===t.x?i?"skewX":"scaleY":0===t.y?i?"skewY":"scaleX":void 0},r.rotationStyleHandler=function(e,t,n){return n.lockRotation?"not-allowed":t.cursorStyle},r.fireEvent=p,r.wrapWithFixedAnchor=_,r.wrapWithFireEvent=b,r.getLocalPoint=x,t.controlsUtils=r}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.degreesToRadians,i=t.controlsUtils;i.renderCircleControl=function(e,t,n,i,r){i=i||{};var o,s=this.sizeX||i.cornerSize||r.cornerSize,a=this.sizeY||i.cornerSize||r.cornerSize,l=void 0!==i.transparentCorners?i.transparentCorners:r.transparentCorners,c=l?"stroke":"fill",u=!l&&(i.cornerStrokeColor||r.cornerStrokeColor),h=t,d=n;e.save(),e.fillStyle=i.cornerColor||r.cornerColor,e.strokeStyle=i.cornerStrokeColor||r.cornerStrokeColor,s>a?(o=s,e.scale(1,a/s),d=n*s/a):a>s?(o=a,e.scale(s/a,1),h=t*a/s):o=s,e.lineWidth=1,e.beginPath(),e.arc(h,d,o/2,0,2*Math.PI,!1),e[c](),u&&e.stroke(),e.restore()},i.renderSquareControl=function(e,t,i,r,o){r=r||{};var s=this.sizeX||r.cornerSize||o.cornerSize,a=this.sizeY||r.cornerSize||o.cornerSize,l=void 0!==r.transparentCorners?r.transparentCorners:o.transparentCorners,c=l?"stroke":"fill",u=!l&&(r.cornerStrokeColor||o.cornerStrokeColor),h=s/2,d=a/2;e.save(),e.fillStyle=r.cornerColor||o.cornerColor,e.strokeStyle=r.cornerStrokeColor||o.cornerStrokeColor,e.lineWidth=1,e.translate(t,i),e.rotate(n(o.angle)),e[c+"Rect"](-h,-d,s,a),u&&e.strokeRect(-h,-d,s,a),e.restore()}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var n=e._controlsVisibility;return n&&void 0!==n[t]?n[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,n){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},n)},calcCornerCoords:function(e,n,i,r,o){var s,a,l,c,u=o?this.touchSizeX:this.sizeX,h=o?this.touchSizeY:this.sizeY;if(u&&h&&u!==h){var d=Math.atan2(h,u),f=Math.sqrt(u*u+h*h)/2,p=d-t.util.degreesToRadians(e),g=Math.PI/2-d-t.util.degreesToRadians(e);s=f*t.util.cos(p),a=f*t.util.sin(p),l=f*t.util.cos(g),c=f*t.util.sin(g)}else{f=.7071067812*(u&&h?u:n);p=t.util.degreesToRadians(45-e);s=l=f*t.util.cos(p),a=c=f*t.util.sin(p)}return{tl:{x:i-c,y:r-l},tr:{x:i+s,y:r-a},bl:{x:i-s,y:r+a},br:{x:i+c,y:r+l}}},render:function(e,n,i,r,o){if("circle"===((r=r||{}).cornerStyle||o.cornerStyle))t.controlsUtils.renderCircleControl.call(this,e,n,i,r,o);else t.controlsUtils.renderSquareControl.call(this,e,n,i,r,o)}}}(t),function(){function e(e,t){var n,i,r,o,s=e.getAttribute("style"),a=e.getAttribute("offset")||0;if(a=(a=parseFloat(a)/(/%$/.test(a)?100:1))<0?0:a>1?1:a,s){var l=s.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),o=l.length;o--;){var c=l[o].split(/\s*:\s*/),u=c[0].trim(),h=c[1].trim();"stop-color"===u?n=h:"stop-opacity"===u&&(r=h)}}return n||(n=e.getAttribute("stop-color")||"rgb(0,0,0)"),r||(r=e.getAttribute("stop-opacity")),i=(n=new S.Color(n)).getAlpha(),r=isNaN(parseFloat(r))?1:parseFloat(r),r*=i*t,{offset:a,color:n.toRgb(),opacity:r}}var t=S.util.object.clone;S.Gradient=S.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var t,n=this;Object.keys(e).forEach((function(t){n[t]=e[t]})),this.id?this.id+="_"+S.Object.__uid++:this.id=S.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var t in e){var n=new S.Color(e[t]);this.colorStops.push({offset:parseFloat(t),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(e){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return S.util.populateWithProperties(this,t,e),t},toSVG:function(e,n){var i,r,o,s,a=t(this.coords,!0),l=(n=n||{},t(this.colorStops,!0)),c=a.r1>a.r2,u=this.gradientTransform?this.gradientTransform.concat():S.iMatrix.concat(),h=-this.offsetX,d=-this.offsetY,f=!!n.additionalTransform,p="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort((function(e,t){return e.offset-t.offset})),"objectBoundingBox"===p?(h/=e.width,d/=e.height):(h+=e.width/2,d+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(h-=e.pathOffset.x,d-=e.pathOffset.y),u[4]-=h,u[5]-=d,s='id="SVGID_'+this.id+'" gradientUnits="'+p+'"',s+=' gradientTransform="'+(f?n.additionalTransform+" ":"")+S.util.matrixToSVG(u)+'" ',"linear"===this.type?o=["<linearGradient ",s,' x1="',a.x1,'" y1="',a.y1,'" x2="',a.x2,'" y2="',a.y2,'">\n']:"radial"===this.type&&(o=["<radialGradient ",s,' cx="',c?a.x1:a.x2,'" cy="',c?a.y1:a.y2,'" r="',c?a.r1:a.r2,'" fx="',c?a.x2:a.x1,'" fy="',c?a.y2:a.y1,'">\n']),"radial"===this.type){if(c)for((l=l.concat()).reverse(),i=0,r=l.length;i<r;i++)l[i].offset=1-l[i].offset;var g=Math.min(a.r1,a.r2);if(g>0){var m=g/Math.max(a.r1,a.r2);for(i=0,r=l.length;i<r;i++)l[i].offset+=m*(1-l[i].offset)}}for(i=0,r=l.length;i<r;i++){var v=l[i];o.push("<stop ",'offset="',100*v.offset+"%",'" style="stop-color:',v.color,void 0!==v.opacity?";stop-opacity: "+v.opacity:";",'"/>\n')}return o.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),o.join("")},toLive:function(e){var t,n,i,r=S.util.object.clone(this.coords);if(this.type){for("linear"===this.type?t=e.createLinearGradient(r.x1,r.y1,r.x2,r.y2):"radial"===this.type&&(t=e.createRadialGradient(r.x1,r.y1,r.r1,r.x2,r.y2,r.r2)),n=0,i=this.colorStops.length;n<i;n++){var o=this.colorStops[n].color,s=this.colorStops[n].opacity,a=this.colorStops[n].offset;void 0!==s&&(o=new S.Color(o).setAlpha(s).toRgba()),t.addColorStop(a,o)}return t}}}),S.util.object.extend(S.Gradient,{fromElement:function(t,n,i,r){var o=parseFloat(i)/(/%$/.test(i)?100:1);o=o<0?0:o>1?1:o,isNaN(o)&&(o=1);var s,a,l,c,u=t.getElementsByTagName("stop"),h="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",d=t.getAttribute("gradientTransform")||"",f=[],p=0,g=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(s="linear",a=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(t)):(s="radial",a=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(t)),l=u.length;l--;)f.push(e(u[l],o));return c=S.parseTransformAttribute(d),function(e,t,n,i){var r,o;Object.keys(t).forEach((function(e){"Infinity"===(r=t[e])?o=1:"-Infinity"===r?o=0:(o=parseFloat(t[e],10),"string"==typeof r&&/^(\d+\.\d+)%|(\d+)%$/.test(r)&&(o*=.01,"pixels"===i&&("x1"!==e&&"x2"!==e&&"r2"!==e||(o*=n.viewBoxWidth||n.width),"y1"!==e&&"y2"!==e||(o*=n.viewBoxHeight||n.height)))),t[e]=o}))}(0,a,r,h),"pixels"===h&&(p=-n.left,g=-n.top),new S.Gradient({id:t.getAttribute("id"),type:s,coords:a,colorStops:f,gradientUnits:h,gradientTransform:c,offsetX:p,offsetY:g})}})}(),function(){"use strict";var e=S.util.toFixed;S.Pattern=S.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,t){if(e||(e={}),this.id=S.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)t&&t(this);else{var n=this;this.source=S.util.createImage(),S.util.loadImage(e.source,(function(e,i){n.source=e,t&&t(n,i)}),null,this.crossOrigin)}},toObject:function(t){var n,i,r=S.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?n=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(n=this.source.toDataURL()),i={type:"pattern",source:n,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,r),offsetY:e(this.offsetY,r),patternTransform:this.patternTransform?this.patternTransform.concat():null},S.util.populateWithProperties(this,i,t),i},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,n=t.width/e.width,i=t.height/e.height,r=this.offsetX/e.width,o=this.offsetY/e.height,s="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,o&&(i+=Math.abs(o))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,r&&(n+=Math.abs(r))),t.src?s=t.src:t.toDataURL&&(s=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+o+'" width="'+n+'" height="'+i+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+s+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;if(!t)return"";if(void 0!==t.src){if(!t.complete)return"";if(0===t.naturalWidth||0===t.naturalHeight)return""}return e.createPattern(t,this.repeat)}})}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var n in"string"==typeof e&&(e=this._parseShadow(e)),e)this[n]=e[n];this.id=t.Object.__uid++},_parseShadow:function(e){var n=e.trim(),i=t.Shadow.reOffsetsAndBlur.exec(n)||[];return{color:(n.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(i[1],10)||0,offsetY:parseFloat(i[2],10)||0,blur:parseFloat(i[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var i=40,r=40,o=t.Object.NUM_FRACTION_DIGITS,s=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),a=new t.Color(this.color);return e.width&&e.height&&(i=100*n((Math.abs(s.x)+this.blur)/e.width,o)+20,r=100*n((Math.abs(s.y)+this.blur)/e.height,o)+20),e.flipX&&(s.x*=-1),e.flipY&&(s.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+i+'%" width="'+(100+2*i)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+n(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+n(s.x,o)+'" dy="'+n(s.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+a.toRgb()+'" flood-opacity="'+a.getAlpha()+'"/>
2\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},n=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(t){this[t]!==n[t]&&(e[t]=this[t])}),this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(t),function(){"use strict";if(S.StaticCanvas)S.warn("fabric.StaticCanvas is already defined.");else{var e=S.util.object.extend,t=S.util.getElementOffset,n=S.util.removeFromArray,i=S.util.toFixed,r=S.util.transformPoint,o=S.util.invertTransform,s=S.util.getNodeCanvas,a=S.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");S.StaticCanvas=S.util.createClass(S.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:S.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var n=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,n),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,n),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,n),t.overlayColor&&this.setOverlayColor(t.overlayColor,n),this.calcOffset()},_isRetinaScaling:function(){return 1!==S.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?S.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=S.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,n){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),n.scale(e,e)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(e,t,n){return this.__setBgOverlayImage("overlayImage",e,t,n)},setBackgroundImage:function(e,t,n){return this.__setBgOverlayImage("backgroundImage",e,t,n)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,t,n,i){return"string"==typeof t?S.util.loadImage(t,(function(t,r){if(t){var o=new S.Image(t,i);this[e]=o,o.canvas=this}n&&n(t,r)}),this,i&&i.crossOrigin):(i&&t.setOptions(i),this[e]=t,t&&(t.canvas=this),n&&n(t,!1)),this},__setBgOverlayColor:function(e,t,n){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,n),this},_createCanvasElement:function(){var e=a();if(!e)throw l;if(e.style||(e.style={}),void 0===e.getContext)throw l;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=S.util.getById(e)||this._createCanvasElement(),S.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var n;for(var i in t=t||{},e)n=e[i],t.cssOnly||(this._setBackstoreDimension(i,e[i]),n+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(i,n);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.up
vendor: 4,223 bytes, line 2
2perCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,n,i,r=this._activeObject,o=this.backgroundImage,s=this.overlayImage;for(this.viewportTransform=e,n=0,i=this._objects.length;n<i;n++)(t=this._objects[n]).group||t.setCoords(!0);return r&&r.setCoords(),o&&o.setCoords(!0),s&&s.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var n=e,i=this.viewportTransform.slice(0);e=r(e,o(this.viewportTransform)),i[0]=t,i[3]=t;var s=r(e,i);return i[4]+=n.x-s.x,i[5]+=n.y-s.y,this.setViewportTransform(i)},setZoom:function(e){return this.zoomToPoint(new S.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new S.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=S.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},t=this.width,n=this.height,i=o(this.viewportTransform);return e.tl=r({x:0,y:0},i),e.br=r({x:t,y:n},i),e.tr=new S.Point(e.br.x,e.tl.y),e.bl=new S.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(S.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,t){var n=this.viewportTransform,i=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),S.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this._renderObjects(e,t),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),i&&(i.canvas=this,i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,n=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var n,i;for(n=0,i=t.length;n<i;++n)t[n]&&t[n].render(e)},_renderBackgroundOrOverlay:function(e,t){var n=this[t+"Color"],i=this[t+"Image"],r=this.viewportTransform,o=this[t+"Vpt"];if(n||i){if(n){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=n.toLive?n.toLive(e,this):n,o&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.transform(1,0,0,1,n.offsetX||0,n.offsetY||0);var s=n.gradientTransform||n.patternTransform;s&&e.transform(s[0],s[1],s[2],s[3],s[4],s[5]),e.fill(),e.restore(
vendor: 3,284 bytes, line 2
2)}i&&(e.save(),o&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),i.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(e){return this._centerObject(e,new S.Point(this.getCenter().left,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new S.Point(e.getCenterPoint().x,this.getCenter().top))},centerObject:function(e){var t=this.getCenter();return this._centerObject(e,new S.Point(t.left,t.top))},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var t=this.getVpCenter();return this._centerObject(e,new S.Point(t.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var t=this.getVpCenter();return this._centerObject(e,new S.Point(e.getCenterPoint().x,t.y))},getVpCenter:function(){var e=this.getCenter(),t=o(this.viewportTransform);return r({x:e.left,y:e.top},t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(t,n){var i=this.clipPath,r={version:S.version,objects:this._toObjects(t,n)};return i&&!i.excludeFromExport&&(r.clipPath=this._toObject(this.clipPath,t,n)),e(r,this.__serializeBgOverlay(t,n)),S.util.populateWithProperties(this,r,n),r},_toObjects:function(e,t){return this._objects.filter((function(e){return!e.excludeFromExport})).map((function(n){return this._toObject(n,e,t)}),this)},_toObject:function(e,t,n){var i;this.includeDefaultValues||(i=e.includeDefaultValues,e.includeDefaultValues=!1);var r=e[t](n);return this.includeDefaultValues||(e.includeDefaultValues=i),r},__serializeBgOverlay:function(e,t){var n={},i=this.backgroundImage,r=this.overlayImage,o=this.backgroundColor,s=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(n.background=o.toObject(t)):o&&(n.background=o),s&&s.toObject?s.excludeFromExport||(n.overlay=s.toObject(t)):s&&(n.overlay=s),i&&!i.excludeFromExport&&(n.backgroundImage=this._toObject(i,e,t)),r&&!r.excludeFromExport&&(n.overlayImage=this._toObject(r,e,t)),n},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var n=[];return this._setSVGPreamble(n,e),this._setSVGHeader(n,e),this.clipPath&&n.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(n,"background"),this._setSVGBgOverlayImage(n,"backgroundImage",t),this._setSVGObjects(n,t),this.clipPath&&n.push("</g>\n"),this._setSVGBgOverlayColor(n,"overlay"),this._setSVGBgOverlayImage(n,"overlayImage",t),n.push("</svg>"),n.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,t){var n,r=t.width||this.width,o=t.height||this.height,s='viewB
2ox="0 0 '+this.width+" "+this.height+'" ',a=S.Object.NUM_FRACTION_DIGITS;t.viewBox?s='viewBox="'+t.viewBox.x+" "+t.viewBox.y+" "+t.viewBox.width+" "+t.viewBox.height+'" ':this.svgViewportTransformation&&(n=this.viewportTransform,s='viewBox="'+i(-n[4]/n[0],a)+" "+i(-n[5]/n[3],a)+" "+i(this.width/n[0],a)+" "+i(this.height/n[3],a)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',r,'" ','height="',o,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",S.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(t),"</defs>\n")},createSVGClipPathMarkup:function(e){var t=this.clipPath;return t?(t.clipPathId="CLIPPATH_"+S.Object.__uid++,'<clipPath id="'+t.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map((function(t){var n=e[t+"Color"];if(n&&n.toLive){var i=e[t+"Vpt"],r=e.viewportTransform,o={width:e.width/(i?r[0]:1),height:e.height/(i?r[3]:1)};return n.toSVG(o,{additionalTransform:i?S.util.matrixToSVG(r):""})}})).join("")},createSVGFontFacesMarkup:function(){var e,t,n,i,r,o,s,a,l="",c={},u=S.fontPaths,h=[];for(this._objects.forEach((function e(t){h.push(t),t._objects&&t._objects.forEach(e)})),s=0,a=h.length;s<a;s++)if(t=(e=h[s]).fontFamily,-1!==e.type.indexOf("text")&&!c[t]&&u[t]&&(c[t]=!0,e.styles))for(r in n=e.styles)for(o in i=n[r])!c[t=i[o].fontFamily]&&u[t]&&(c[t]=!0);for(var d in c)l+=["\t\t@font-face {\n","\t\t\tfont-family: '",d,"';\n","\t\t\tsrc: url('",u[d],"');\n","\t\t}\n"].join("");return l&&(l=['\t<style type="text/css">',"<![CDATA[\n",l,"]]>","</style>\n"].join("")),l},_setSVGObjects:function(e,t){var n,i,r,o=this._objects;for(i=0,r=o.length;i<r;i++)(n=o[i]).excludeFromExport||this._setSVGObject(e,n,t)},_setSVGObject:function(e,t,n){e.push(t.toSVG(n))},_setSVGBgOverlayImage:function(e,t,n){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(n))},_setSVGBgOverlayColor:function(e,t){var n=this[t+"Color"],i=this.viewportTransform,r=this.width,o=this.height;if(n)if(n.toLive){var s=n.repeat,a=S.util.invertTransform(i),l=this[t+"Vpt"]?S.util.matrixToSVG(a):"";e.push('<rect transform="'+l+" translate(",r/2,",",o/2,')"',' x="',n.offsetX-r/2,'" y="',n.offsetY-o/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?n.source.width:r,'" height="',"repeat-x"===s||"no-repeat"===s?n.source.height:o,'" fill="url(#SVGID_'+n.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',n,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,i,r,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(t=(r=o._objects).length;t--;)i=r[t],n(this._objects,i),this._objects.unshift(i);else n(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,i,r,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(r=o._objects,t=0;t<r.length;t++)i=r[t],n(this._objects,i),this._objects.push(i);else n(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var i,r,o,s,a,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(a=l._objects,i=0;i<a.length;i++)r=a[i],(o=this._objects.indexOf(r))>0+c&&(s=o-1,n(this._objects,r),this._objects.splice(s,0,r)),c++;else 0!==(o=this._objects.indexOf(e))&&(s=this._findNewLowerIndex(e,o,t),n(this._objects,e),this._objects.splice(s,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,n){var i,r;if(n)for(i=t,r=t-1;r>=0;--r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){i=r;break}}else i=t-1;return i},bringForward:function(e,t){if(!e)return this;var i,r,o,s,a,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(i=(a=l._objects).length;i--;)r=a[i],(o=this._objects.indexOf(r))<this._objects.length-1-c&&(s=o+1,n(this._objects,r),this._objects.splice(s,0,r)),c++;else(o=this._objects.indexOf(e))!==this._objects.length-1&&(s=this._findNewUpperIndex(e,o,t),n(this._objects,e),this._objects.splice(s,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,n){var i,r,o;
vendor: 4,531 bytes, line 2
2if(n)for(i=t,r=t+1,o=this._objects.length;r<o;++r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){i=r;break}}else i=t+1;return i},moveTo:function(e,t){return n(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(S.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject((function(e){e.dispose&&e.dispose()})),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),S.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(S.StaticCanvas.prototype,S.Observable),e(S.StaticCanvas.prototype,S.Collection),e(S.StaticCanvas.prototype,S.DataURLExporter),e(S.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=a();if(!t||!t.getContext)return null;var n=t.getContext("2d");return n&&"setLineDash"===e?void 0!==n.setLineDash:null}}),S.StaticCanvas.prototype.toJSON=S.StaticCanvas.prototype.toObject,S.isLikelyNode&&(S.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},S.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),S.BaseBrush=S.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var e=this.canvas.contextTop;e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,t=this.shadow,n=e.contextTop,i=e.getZoom();e&&e._isRetinaScaling()&&(i*=S.devicePixelRatio),n.shadowColor=t.color,n.shadowBlur=t.blur*i,n.shadowOffsetX=t.offsetX*i,n.shadowOffsetY=t.offsetY*i}},needsFullRender:function(){return new S.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),S.PencilBrush=S.util.createClass(S.BaseBrush,{decimate:.4,initialize:function(e){this.canvas=e,this._points=[]},_drawSegment:function(e,t,n){var i=t.midPointFrom(n);return e.quadraticCurveTo(t.x,t.y,i.x,i.y),i},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var n=this._points,i=n.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,n[i-2],n[i-1],!0),r.stroke(),r.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var t=new S.Point(e.x,e.y);this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(e){var t=new S.Point(e.x,e.y);return this._addPoint(t)},_render:function(){var e,t,n=this.canvas.contextTop,i=this._points[0],r=this._points[1];if(this._saveAndTransform(n),n.beginPath(),2===this._points.length&&i.x===r.x&&i.y===r.y){var o=this.width/1e3;
vendor: 4,746 bytes, line 2
2i=new S.Point(i.x,i.y),r=new S.Point(r.x,r.y),i.x-=o,r.x+=o}for(n.moveTo(i.x,i.y),e=1,t=this._points.length;e<t;e++)this._drawSegment(n,i,r),i=this._points[e],r=this._points[e+1];n.lineTo(i.x,i.y),n.stroke(),n.restore()},convertPointsToSVGPath:function(e){var t=this.width/1e3;return S.util.getSmoothPathFromPoints(e,t)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===S.util.joinPath(e)},createPath:function(e){var t=new S.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,t.shadow=new S.Shadow(this.shadow)),t},decimatePoints:function(e,t){if(e.length<=2)return e;var n,i=this.canvas.getZoom(),r=Math.pow(t/i,2),o=e.length-1,s=e[0],a=[s];for(n=1;n<o-1;n++)Math.pow(s.x-e[n].x,2)+Math.pow(s.y-e[n].y,2)>=r&&(s=e[n],a.push(s));return a.push(e[o]),a},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),S.CircleBrush=S.util.createClass(S.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),n=this.canvas.contextTop;this._saveAndTransform(n),this.dot(n,t),n.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,n=this.canvas.contextTop,i=this.points;for(this._saveAndTransform(n),e=0,t=i.length;e<t;e++)this.dot(n,i[e]);n.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,t,n=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var i=[];for(e=0,t=this.points.length;e<t;e++){var r=this.points[e],o=new S.Circle({radius:r.radius,left:r.x,top:r.y,originX:"center",originY:"center",fill:r.fill});this.shadow&&(o.shadow=new S.Shadow(this.shadow)),i.push(o)}var s=new S.Group(i);s.canvas=this.canvas,this.canvas.fire("before:path:created",{path:s}),this.canvas.add(s),this.canvas.fire("path:created",{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=n,this.canvas.requestRenderAll()},addPoint:function(e){var t=new S.Point(e.x,e.y),n=S.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new S.Color(this.color).setAlpha(S.util.getRandomInt(0,100)/100).toRgba();return t.radius=n,t.fill=i,this.points.push(t),t}}),S.SprayBrush=S.util.createClass(S.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var t=[],n=0,i=this.sprayChunks.length;n<i;n++)for(var r=this.sprayChunks[n],o=0,s=r.length;o<s;o++){var a=new S.Rect({width:r[o].width,height:r[o].width,left:r[o].x+1,top:r[o].y+1,originX:"center",originY:"center",fill:this.color});t.push(a)}this.optimizeOverlapping&&(t=this._getOptimizedRects(t));var l=new S.Group(t);this.shadow&&l.set("shadow",new S.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,n,i,r={};for(n=0,i=e.length;n<i;n++)r[t=e[n].left+""+e[n].top]||(r[t]=e[n]);var o=[];for(t in r)o.push(r[t]);return o},render:function(e){var t,n,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),t=0,n=e.length;t<n;t++){var r=e[t];void 0!==r.opacity&&(i.globalAlpha=r.opacity),i.fillRect(r.x,r.y,r.width,r.width)}
vendor: 7,818 bytes, line 2
2i.restore()},_render:function(){var e,t,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);n.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var t,n,i,r,o=this.width/2;for(r=0;r<this.density;r++){t=S.util.getRandomInt(e.x-o,e.x+o),n=S.util.getRandomInt(e.y-o,e.y+o),i=this.dotWidthVariance?S.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new S.Point(t,n);s.width=i,this.randomOpacity&&(s.opacity=S.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),S.PatternBrush=S.util.createClass(S.PencilBrush,{getPatternSrc:function(){var e=S.util.createCanvasElement(),t=e.getContext("2d");return e.width=e.height=25,t.fillStyle=this.color,t.beginPath(),t.arc(10,10,10,0,2*Math.PI,!1),t.closePath(),t.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(e){var t=this.callSuper("createPath",e),n=t._getLeftTopCoords().scalarAdd(t.strokeWidth/2);return t.stroke=new S.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-n.x,offsetY:-n.y}),t}}),function(){var e=S.util.getPointer,t=S.util.degreesToRadians,n=S.util.isTouchEvent;for(var i in S.Canvas=S.util.createClass(S.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=S.PencilBrush&&new S.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,n,i=this.getActiveObjects();if(i.length>0&&!this.preserveObjectStacking){t=[],n=[];for(var r=0,o=this._objects.length;r<o;r++)e=this._objects[r],-1===i.indexOf(e)?t.push(e):n.push(e);i.length>1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,t){var n=e.calcTransformMatrix(),i=S.util.invertTransform(n),r=this.restorePointerVpt(t);return S.util.transformPoint(r,i)},isTargetTransparent:function(e,t,n){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var i=this._normalizePointer(e,{x:t,y:n}),r=Math.max(e.cacheTranslationX+i.x*e.zoomX,0),o=Math.max(e.cacheTranslationY+i.y*e.zoomY,0);return S.util.isTransparent(e._cacheContext,Math.round(r),Math.round(o),this.targetFindTolerance)}var s=this.contextCache,a=e.selectionBackgroundColor,l=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(s),s.save(),s.transform(l[0],l[1],l[2],l[3],l[4],l[5]),e.render(s),s.restore(),e.selectionBackgroundColor=a,S.util.isTransparent(s,t,n,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(t){return!0===e[t]})):e[this.selectionKey]},_shouldClearSelection:function(e,t){var n=this.getActiveObjects(),i=this._activeObject;return!t||t&&i&&n.length>1&&-1===n.indexOf(t)&&i!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&i&&i!==t},_shouldCenterTransform:function(e,t,n){var i;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?i=this.centeredScaling||e.centeredScaling:"rotate"===t&&(i=this.centeredRotation||e.centeredRotation),i?!n:n},_getOriginFromCorner:function(e,t){var n={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?n.x="right":"mr"!==t&&"tr"!==t&&"br"!==t||(n.x="left"),"tl"===t||"mt"===t||"tr"===t?n.y="bottom":"bl"!==t&&"mb"!==t&&"br"!==t||(n.y="top"),n},_getActionFromCorner:function(e,t,n,i){if(!t||!e)return"drag";var r=i.controls[t];return r.getActionName(n,r,i)},_setupCurrentTransform:function(e,n,i){if(n){var r=this.getPointer(e),o=n.__corner,s=n.controls[o],a=i&&o?s.getActionHandler(e,n,s):S.controlsUtils.dragHandler,l=this._getActionFromCorner(i,o,e,n),c=this._getOriginFromCorner(n,o),u=e[this.centeredKey],h={target:n,action:l,actionHandler:a,corner:o,scaleX:n.scaleX,scaleY:n.scaleY,skewX:n.skewX,skewY:n.skewY,offsetX:r.x-n.left,offsetY:r.y-n.top,originX:c.x,originY:c.y,ex:r.x,ey:r.y,lastX:r.x,lastY:r.y,theta:t(n.angle),width:n.width*n.scaleX,shiftKey:e.shiftKey,altKey:u,original:S.util.saveObjectTransform(n)};this._shouldCenterTransform(n,l,u)&&(h.originX="center",h.originY="center"),h.original.originX=c.x,h.original.originY=c.y,this._currentTransform=h,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var t=this._groupSelector,n=new S.Point(t.ex,t.ey),i=S.util.transformPoint(n,this.viewportTransform),r=new S.Point(t.ex+t.left,t.ey+t.top),o=S.util.transformPoint(r,this.viewportTransform),s=Math.min(i.x,o.x),a=Math.min(i.y,o.y),l=Math.max(i.x,o.x),c=Math.max(i.y,o.y),u=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,a,l-s,c-a)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=u,a+=u,l-=u,c-=u,S.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,a,l-s,c-a))},findTarget:function(e,t){if(!this.skipTargetFind){var i,r,o=this.getPointer(e,!0),s=this._activeObject,a=this.getActiveObjects(),l=n(e),c=a.length>1&&!t||1===a.length;if(this.targets=[],c&&s._findTargetCorner(o,l))return s;if(a.length>1&&!t&&s===this._searchPossibleTargets([s],o))return s;if(1===a.length&&s===this._searchPossibleTargets([s],o)){if(!this.preserveObjectStacking)return s;i=s,r=this.targets,this.targets=[]}var u=this._searchPossibleTargets(this._objects,o);return e[this.altSelectionKey]&&u&&i&&u!==i&&(u=i,this.targets=r),u}},_checkTarget:function(e,t,n){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;
vendor: 2,372 bytes, line 2
2if(!this.isTargetTransparent(t,n.x,n.y))return!0}},_searchPossibleTargets:function(e,t){for(var n,i,r=e.length;r--;){var o=e[r],s=o.group?this._normalizePointer(o.group,t):t;if(this._checkTarget(s,o,t)){(n=e[r]).subTargetCheck&&n instanceof S.Group&&(i=this._searchPossibleTargets(n._objects,t))&&this.targets.push(i);break}}return n},restorePointerVpt:function(e){return S.util.transformPoint(e,S.util.invertTransform(this.viewportTransform))},getPointer:function(t,n){if(this._absolutePointer&&!n)return this._absolutePointer;if(this._pointer&&n)return this._pointer;var i,r=e(t),o=this.upperCanvasEl,s=o.getBoundingClientRect(),a=s.width||0,l=s.height||0;a&&l||("top"in s&&"bottom"in s&&(l=Math.abs(s.top-s.bottom)),"right"in s&&"left"in s&&(a=Math.abs(s.right-s.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,n||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),i=0===a||0===l?{width:1,height:1}:{width:o.width/a,height:o.height/l},{x:r.x*i.width,y:r.y*i.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),t=this.lowerCanvasEl,n=this.upperCanvasEl;n?n.className="":(n=this._createCanvasElement(),this.upperCanvasEl=n),S.util.addClass(n,"upper-canvas "+e),this.wrapperEl.appendChild(n),this._copyCanvasStyle(t,n),this._applyCanvasStyle(n),this.contextTop=n.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=S.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),S.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),S.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var t=this.width||e.width,n=this.height||e.height;S.util.setStyle(e,{position:"absolute",width:t+"px",height:n+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=t,e.height=n,S.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop}
vendor: 6,129 bytes, line 2
2,getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var n=!1,i=this.getActiveObjects(),r=[],o=[];e.forEach((function(e){-1===i.indexOf(e)&&(n=!0,e.fire("deselected",{e:t,target:e}),o.push(e))})),i.forEach((function(i){-1===e.indexOf(i)&&(n=!0,i.fire("selected",{e:t,target:i}),r.push(i))})),e.length>0&&i.length>0?n&&this.fire("selection:updated",{e:t,selected:r,deselected:o,updated:r[0]||o[0],target:this._activeObject}):i.length>0?this.fire("selection:created",{e:t,selected:r,target:this._activeObject}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:o})},setActiveObject:function(e,t){var n=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(n,t),this},_setActiveObject:function(e,t){return this._activeObject!==e&&(!!this._discardActiveObject(t,e)&&(!e.onSelect({e:t})&&(this._activeObject=e,!0)))},_discardActiveObject:function(e,t){var n=this._activeObject;if(n){if(n.onDeselect({e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),n=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:n,e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){S.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,S.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,n){var i=this._realizeGroupTransformOnObject(e),r=this.callSuper("_toObject",e,t,n);return this._unwindGroupTransformOnObject(e,i),r},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var t={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach((function(n){t[n]=e[n]})),S.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,n){var i=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,n),this._unwindGroupTransformOnObject(t,i)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),S.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),S.StaticCanvas)"prototype"!==i&&(S.Canvas[i]=S.StaticCanvas[i])}(),function(){var e=S.util.addListener,t=S.util.removeListener,n={passive:!1};function i(e,t){return e.button&&e.button===t-1}S.util.object.extend(S.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,t){var i=this.upperCanvasEl,r=this._getEventPrefix();e(S.window,"resize",this._onResize),e(i,r+"down",this._onMouseDown),e(i,r+"move",this._onMouseMove,n),e(i,r+"out",this._onMouseOut),e(i,r+"enter",this._onMouseEnter),e(i,"wheel",this._onMouseWheel),e(i,"contextmenu",this._onContextMenu),e(i,"dblclick",this._onDoubleClick),e(i,"dragover",this._onDragOver),e(i,"dragenter",this._onDragEnter),e(i,"dragleave",this._onDragLeave),e(i,"drop",this._onDrop),this.enablePointerEvents||e(i,"touchstart",this._onTouchStart,n),"undefined"!=typeof eventjs&&t in eventjs&&(eventjs[t](i,"gesture",this._onGesture),eventjs[t](i,"drag",this._onDrag),eventjs[t](i,"orientation",this._onOrientationChange),eventjs[t](i,"shake",this._onShake),eventjs[t](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(t,"remove");var e=this._getEventPrefix();t(S.document,e+"up",this._onMouseUp),t(S.document,"touchend",this._onTouchEnd,n),t(S.document,e+"move",this._onMouseMove,n),t(S.document,"touchmove",this._onMouseMove,n)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e});var n=this;
vendor: 4,240 bytes, line 2
2this._hoveredTargets.forEach((function(i){n.fire("mouse:out",{target:t,e}),i&&t.fire("mouseout",{e})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(e){e.isEditing&&e.hiddenTextarea.focus()}))},_onMouseEnter:function(e){this._currentTransform||this.findTarget(e)||(this.fire("mouse:over",{target:null,e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||(!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(i){i.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();e(S.document,"touchend",this._onTouchEnd,n),e(S.document,"touchmove",this._onMouseMove,n),t(r,o+"down",this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();t(r,o+"move",this._onMouseMove,n),e(S.document,o+"up",this._onMouseUp),e(S.document,o+"move",this._onMouseMove,n)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var r=this._getEventPrefix();t(S.document,"touchend",this._onTouchEnd,n),t(S.document,"touchmove",this._onMouseMove,n);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){e(o.upperCanvasEl,r+"down",o._onMouseDown),o._willAddMouseDown=0}),400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(i)&&(t(S.document,o+"up",this._onMouseUp),t(S.document,o+"move",this._onMouseMove,n),e(r,o+"move",this._onMouseMove,n))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var t,n=this._currentTransform,r=this._groupSelector,o=!1,s=!r||0===r.left&&0===r.top;if(this._cacheTransformEventData(e),t=this._target,this._handleEvent(e,"up:before"),i(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,s);else{if(i(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(n&&(this._finalizeCurrentTransform(e),o=n.actionPerformed),!s){var a=t===this._activeObject;this._maybeGroupObjects(e),o||(o=this._shouldRender(t)||!a&&t===this._activeObject)}if(t){if(t.selectable&&t!==this._activeObject&&"up"===t.activeOn)this.setActiveObject(t,e),o=!0;else{var l=t._findTargetCorner(this.getPointer(e,!0),S.util.isTouchEvent(e)),c=t.controls[l],u=c&&c.getMouseUpHandler(e,t,c);if(u){var h=this.getPointer(e);u(e,n,h.x,h.y)}}t.isMoving=!1}this._setCursorFromEvent(e,t),this._handleEvent(e,"up",1,s),this._groupSelector=null,this._currentTransform=null,t&&(t.__corner=0),o?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(e,t){var n=this.findTarget(t),i=this.targets,r={e:t,target:n,subTargets:i};if(this.fire(e,r),n&&n.fire(e,r),!i)return n;for(var o=0;o<i.length;o++)i[o].fire(e,r);return n},_handleEvent:function(e,t,n,i){var r=this._target,o=this.targets||[],s={e,target:r,subTargets:o,button:n||1,isCl
vendor: 5,433 bytes, line 2
2ick:i||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(s.currentTarget=this.findTarget(e),s.currentSubTargets=this.targets),this.fire("mouse:"+t,s),r&&r.fire("mouse"+t,s);for(var a=0;a<o.length;a++)o[a].fire("mouse"+t,s)},_finalizeCurrentTransform:function(e){var t,n=this._currentTransform,i=n.target,r={e,target:i,transform:n,action:n.action};i._scaling&&(i._scaling=!1),i.setCoords(),(n.actionPerformed||this.stateful&&i.hasStateChanged())&&(n.actionPerformed&&(t=this._addEventOptions(r,n),this._fire(t,r)),this._fire("modified",r))},_addEventOptions:function(e,t){var n,i;switch(t.action){case"scaleX":n="scaled",i="x";break;case"scaleY":n="scaled",i="y";break;case"skewX":n="skewed",i="x";break;case"skewY":n="skewed",i="y";break;case"scale":n="scaled",i="equally";break;case"rotate":n="rotated";break;case"drag":n="moved"}return e.by=i,n},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var t=this._target;if(i(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(i(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var n=this._pointer;this._previousPointer=n;var r=this._shouldRender(t),o=this._shouldGroup(e,t);if(this._shouldClearSelection(e,t)?this.discardActiveObject(e):o&&(this._handleGrouping(e,t),t=this._activeObject),!this.selection||t&&(t.selectable||t.isEditing||t===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),t){var s=t===this._activeObject;t.selectable&&"down"===t.activeOn&&this.setActiveObject(t,e);var a=t._findTargetCorner(this.getPointer(e,!0),S.util.isTouchEvent(e));if(t.__corner=a,t===this._activeObject&&(a||!o)){this._setupCurrentTransform(e,t,s);var l=t.controls[a],c=(n=this.getPointer(e),l&&l.getMouseDownHandler(e,t,l));c&&c(e,this._currentTransform,n.x,n.y)}}this._handleEvent(e,"down"),(r||o)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e,transform:t})},__onMouseMove:function(e){var t,n;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var i=this._groupSelector;i?(n=this._absolutePointer,i.left=n.x-i.ex,i.top=n.y-i.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var n=this._hoveredTarget,i=this._hoveredTargets,r=this.targets,o=Math.max(i.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var s=0;s<o;s++)this.fireSyntheticInOutEvents(r[s],t,{oldTarget:i[s],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var n=this._draggedoverTarget,i=this._hoveredTargets,r=this.targets,o=Math.max(i.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:"dragleave",evtIn:"dragenter"});for(var s=0;s<o;s++)this.fireSyntheticInOutEvents(r[s],t,{oldTarget:i[s],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,n){var i,r,o,s=n.oldTarget,a=s!==e,l=n.canvasEvtIn,c=n.canvasEvtOut;a&&(i={e:t,target:e,previousTarget:s},r={e:t,target:s,nextTarget:e}),o=e&&a,s&&a&&(c&&this.fire(c,r),s.fire(n.evtOut,r)),o&&(l&&this.fire(l,i),e.fire(n.evtIn,i))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),n=this._currentTransform;n.reset=!1,n.shiftKey=e.shiftKey,n.altKey=e[this.centeredKey],this._performTransformAction(e,n,t),n.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,n){var i=n.x,r=n.y,o=t.action,s=!1,a=t.actionHandler;a&&(s=a(e,t,i,r)),"drag"===o&&s&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||s},_fire:S.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;
vendor: 5,447 bytes, line 2
2var n=t.hoverCursor||this.hoverCursor,i=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!i||!i.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));r?this.setCursor(this.getCornerCursor(r,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map((function(e){n=e.hoverCursor||n})),this.setCursor(n))},getCornerCursor:function(e,t,n){var i=t.controls[e];return i.cursorStyleHandler(n,i,t)}})}(),v=Math.min,y=Math.max,S.util.object.extend(S.Canvas.prototype,{_shouldGroup:function(e,t){var n=this._activeObject;return n&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(n!==t||"activeSelection"===n.type)&&!t.onSelect({e})},_handleGrouping:function(e,t){var n=this._activeObject;n.__corner||(t!==n||(t=this.findTarget(e,!0))&&t.selectable)&&(n&&"activeSelection"===n.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var n=this._activeObject,i=n._objects.slice(0);n.contains(e)?(n.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===n.size()&&this._setActiveObject(n.item(0),t)):(n.addWithUpdate(e),this._hoveredTarget=n,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(i,t)},_createActiveSelection:function(e,t){var n=this.getActiveObjects(),i=this._createGroup(e);this._hoveredTarget=i,this._setActiveObject(i,t),this._fireSelectionEvents(n,t)},_createGroup:function(e){var t=this._objects,n=t.indexOf(this._activeObject)<t.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new S.ActiveSelection(n,{canvas:this})},_groupSelectedObjects:function(e){var t,n=this._collectObjects(e);1===n.length?this.setActiveObject(n[0],e):n.length>1&&(t=new S.ActiveSelection(n.reverse(),{canvas:this}),this.setActiveObject(t,e))},_collectObjects:function(e){for(var t,n=[],i=this._groupSelector.ex,r=this._groupSelector.ey,o=i+this._groupSelector.left,s=r+this._groupSelector.top,a=new S.Point(v(i,o),v(r,s)),l=new S.Point(y(i,o),y(r,s)),c=!this.selectionFullyContained,u=i===o&&r===s,h=this._objects.length;h--&&!((t=this._objects[h])&&t.selectable&&t.visible&&(c&&t.intersectsWithRect(a,l,!0)||t.isContainedWithinRect(a,l,!0)||c&&t.containsPoint(a,null,!0)||c&&t.containsPoint(l,null,!0))&&(n.push(t),u)););return n.length>1&&(n=n.filter((function(t){return!t.onSelect({e})}))),n},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}}),S.util.object.extend(S.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var t=e.format||"png",n=e.quality||1,i=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),r=this.toCanvasElement(i,e);return S.util.toDataURL(r,t,n)},toCanvasElement:function(e,t){e=e||1;var n=((t=t||{}).width||this.width)*e,i=(t.height||this.height)*e,r=this.getZoom(),o=this.width,s=this.height,a=r*e,l=this.viewportTransform,c=(l[4]-(t.left||0))*e,u=(l[5]-(t.top||0))*e,h=this.interactive,d=[a,0,0,a,c,u],f=this.enableRetinaScaling,p=S.util.createCanvasElement(),g=this.contextTop;return p.width=n,p.height=i,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=d,this.width=n,this.height=i,this.calcViewportBoundaries(),this.renderCanvas(p.getContext("2d"),this._objects),this.viewportTransform=l,this.width=o,this.height=s,this.calcViewportBoundaries(),this.interactive=h,this.enableRetinaScaling=f,this.contextTop=g,p}}),S.util.object.extend(S.StaticCanvas.prototype,{loadFromJSON:function(e,t,n){if(e){var i="string"==typeof e?JSON.parse(e):S.util.object.clone(e),r=this,o=i.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete i.clipPath,this._enlivenObjects(i.objects,(function(e){r.clear(),r._setBgOverlay(i,(function(){o?r._enlivenObjects([o],(function(n){r.clipPath=n[0],r.__setupCanvas.call(r,i,e,s,t)})):r.__setupCanvas.call(r,i,e,s,t)}))}),n),this}},__setupCanvas:function(e,t,n,i){var r=this;t.forEach((function(e,t){r.insertAt(e,t)})),this.renderOnAddRemove=n,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),i&&i()},_setBgOverlay:function(e,t){var n={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var i=function(){n.backgroundImage&&n.overlayImage&&n.backgroundColor&&n.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,n,i),this.__setBgOverlay("overlayImage",e.overlayImage,n,i),this.__setBgOverlay("backgroundColor",e.background,n,i),this.__setBgOverlay("overlayColor",e.overlay,n,i)}else t&&t()},__setBgOverlay:function(e,t,n,i){var r=this;if(!t)return n[e]=!0,void(i&&i());"backgroundImage"===e||"overlayImage"===e?S.util.enlivenObjects([t],(function(t){r[e]=t[0],n[e]=!0,i&&i()})):this["set"+S.util.string.capitalize(e,!0)](t,(function(){n[e]=!0,i&&i()}))},_enlivenObjects:function(e,t,n){e&&0!==e.length?S.util.enlivenObjects(e,(function(e){t&&t(e)}),null,n):t&&t([])},_toDataURL:function(e,t){this.clone((function(n){t(n.toDataURL(e))}))},_toDataURLWithMultiplier:function(e,t,n){this.clone((function(i){n(i.toDataURLWithMultiplier(e,t))}))},clone:function(e,t){var n=JSON.stringify(this.toJSON(t));this.cloneWithoutData((function(t){t.loadFromJSON(n,(function(){e&&e(t)}
vendor: 28,651 bytes, line 2
2))}))},cloneWithoutData:function(e){var t=S.util.createCanvasElement();t.width=this.width,t.height=this.height;var n=new S.Canvas(t);this.backgroundImage?(n.setBackgroundImage(this.backgroundImage.src,(function(){n.renderAll(),e&&e(n)})),n.backgroundImageOpacity=this.backgroundImageOpacity,n.backgroundImageStretch=this.backgroundImageStretch):e&&e(n)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,i=t.util.object.clone,r=t.util.toFixed,o=t.util.string.capitalize,s=t.util.degreesToRadians,a=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:a,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var n=t.perfLimitSizeTotal,i=e.width,r=e.height,o=t.maxCacheSideLimit,s=t.minCacheSideLimit;if(i<=o&&r<=o&&i*r<=n)return i<s&&(e.width=s),r<s&&(e.height=s),e;var a=i/r,l=t.util.limitDimsByArea(a,n),c=t.util.capValue,u=c(s,l.x,o),h=c(s,l.y,o);return i>u&&(e.zoomX/=i/u,e.width=u,e.capped=!0),r>h&&(e.zoomY/=r/h,e.height=h,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),n=t.x*e.scaleX/this.scaleX,i=t.y*e.scaleY/this.scaleY;return{width:n+2,height:i+2,zoomX:e.scaleX,zoomY:e.scaleY,x:n,y:i}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var n=e._currentTransform.target,i=e._currentTransform.action;if(this===n&&i.slice&&"scale"===i.slice(0,5))return!1}var r,o,s=this._cacheCanvas,a=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=a.width,u=a.height,h=a.zoomX,d=a.zoomY,f=c!==this.cacheWidth||u!==this.cacheHeight,p=this.zoomX!==h||this.zoomY!==d,g=f||p,m=0,v=0,y=!1;if(f){var _=this._cacheCanvas.width,b=this._cacheCanvas.height,x=c>_||u>b;y=x||(c<.9*_||u<.9*b)&&_>l&&b>l,x&&!a.capped&&(c>l||u>l)&&(m=.1*c,v=.1*u)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,m+=this.getHeightOfLine(0)*this.zoomX,v+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(s.width=Math.ceil(c+m),s.height=Math.ceil(u+v)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,s.width,s.height)),r=a.x/2,o=a.y/2,this.cacheTranslationX=Math.round(s.width/2-r)+r,this.cacheTranslationY=Math.round(s.height/2-o)+o,this.cacheWidth=c,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(h,d),this.zoomX=h,this.zoomY=d,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,n=this.calcTransformMatrix(!t);e.transform(n[0],n[1],n[2],n[3],n[4],n[5])},toObject:function(e){var n=t.Object.NUM_FRACTION_DIGITS,i={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:r(this.left,n),top:r(this.top,n),width:r(this.width,n),height:r(this.height,n),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,n),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,n),scaleX:r(this.scaleX,n),scaleY:r(this.scaleY,n),angle:r(this.angle,n),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,n),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,n),skewY:r(this.skewY,n)};return this.clipPath&&!this.clipPath.excludeFromExport&&(i.clipPath=this.clipPath.toObject(e),i.clipPath.inverted=this.clipPath.inverted,i.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,i,e),this.includeDefaultValues||(i=this._removeDefaultValues(i)),i},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var n=t.util.getKlass(e.type).prototype;return n.stateProperties.forEach((function(t){"left"!==t&&"top"!==t&&(e[t]===n[t]&&delete e[t],"[object Array]"===Object.prototype.toString.call(e[t])&&"[object Array]"===Object.prototype.toString.call(n[t])&&0===e[t].length&&0===n[t].length&&delete e[t])})),e},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,n=e.scaleY;if(this.canvas){var i=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();t*=i*r,n*=i*r}return{scaleX:t,scaleY:n}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,n){var i="scaleX"===e||"scaleY"===e,r=this[e]!==n,o=!1;return i&&(n=this._constrainScale(n)),"scaleX"===e&&n<0?(this.flipX=!this.flipX,n*=-1):"scaleY"===e&&n<0?(this.flipY=!this.flipY,n*=-1):"shadow"!==e||!n||n instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",n):n=new t.Shadow(n),this[e]=n,r&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!=typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e){var n=this.clipPath;if(e.save(),n.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",n.absolutePositioned){var i=t.util.invertTransform(this.calcTransformMatrix());e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},drawObject:function(e,t){var n=this.fill,i=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e),this.fill=n,this.stroke=i},_drawClipPath:function(e){var t=this.clipPath;t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!e){var t=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-n/2,t,n)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var n=t.stroke;n&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,n.toLive?"percentage"===n.gradientUnits||n.gradientTransform||n.patternTransform?this._applyPatternForTransformedGradient(e,n):(e.strokeStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var n=t.fill;n&&(n.toLive?(e.fillStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=n)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){t&&0!==t.length&&(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,n){var i,r,o,a=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(n=n||{}).hasBorders?n.hasBorders:this.hasBorders,o=void 0!==n.hasControls?n.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(a,l),i=t.util.qrDecompose(l),e.save(),e.translate(i.translateX,i.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),e.rotate(s(i.angle)),n.forActiveSelection||this.group?r&&this.drawBordersInGroup(e,i,n):r&&this.drawBorders(e,n),o&&this.drawControls(e,n),e.restore()},_setShadow:function(e){if(this.shadow){var n,i=this.shadow,r=this.canvas,o=r&&r.viewportTransform[0]||1,s=r&&r.viewportTransform[3]||1;n=i.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(o*=t.devicePixelRatio,s*=t.devicePixelRatio),e.shadowColor=i.color,e.shadowBlur=i.blur*t.browserShadowBlurConstant*(o+s)*(n.scaleX+n.scaleY)/4,e.shadowOffsetX=i.offsetX*o*n.scaleX,e.shadowOffsetY=i.offsetY*s*n.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var n=t.gradientTransform||t.patternTransform,i=-this.width/2+t.offsetX||0,r=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,i,r):e.transform(1,0,0,1,i,r),n&&e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),{offsetX:i,offsetY:r}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,n){var i,r=this._limitCacheSize(this._getCacheCanvasDimensions()),o=t.util.createCanvasElement(),s=this.canvas.getRetinaScaling(),a=r.x/this.scaleX/s,l=r.y/this.scaleY/s;o.width=a,o.height=l,(i=o.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(a,0),i.lineTo(a,l),i.lineTo(0,l),i.closePath(),i.translate(a/2,l/2),i.scale(r.zoomX/this.scaleX/s,r.zoomY/this.scaleY/s),this._applyPatternGradientTransform(i,n),i.fillStyle=n.toLive(e),i.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(s*this.scaleX/r.zoomX,s*this.scaleY/r.zoomY),e.strokeStyle=i.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var n=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),n=t.util.transformPoint(n,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,n.x+=e.offsetLeft,n.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(n,"center","center")},clone:function(e,n){var i=this.toObject(n);this.constructor.fromObject?this.constructor.fromObject(i,e):t.Object._fromObject("Object",i,e)},cloneAsImage:function(e,n){var i=this.toCanvasElement(n);return e&&e(new t.Image(i)),this},toCanvasElement:function(e){e||(e={});var n=t.util,i=n.saveObjectTransform(this),r=this.group,o=this.shadow,s=Math.abs,a=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&n.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,u,h,d=t.util.createCanvasElement(),f=this.getBoundingRect(!0,!0),p=this.shadow,g={x:0,y:0};p&&(c=p.blur,l=p.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(s(p.offsetX)+c)*s(l.scaleX),g.y=2*Math.round(s(p.offsetY)+c)*s(l.scaleY)),u=f.width+g.x,h=f.height+g.y,d.width=Math.ceil(u),d.height=Math.ceil(h);var m=new t.StaticCanvas(d,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(m.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(m.width/2,m.height/2),"center","center");var v=this.canvas;m.add(this);var y=m.toCanvasElement(a||1,e);return this.shadow=o,this.set("canvas",v),r&&(this.group=r),this.set(i).setCoords(),m._objects=[],m.dispose(),m=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,n){n=n||this.canvas.getPointer(e);var i=new t.Point(n.x,n.y),r=this._getLeftTopCoords();return this.angle&&(i=t.util.rotatePoint(i,r,s(-this.angle))),{x:i.x-r.x,y:i.y-r.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),n(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object._fromObject=function(e,n,r,o){var s=t[e];n=i(n,!0),t.util.enlivenPatterns([n.fill,n.stroke],(function(e){void 0!==e[0]&&(n.fill=e[0]),void 0!==e[1]&&(n.stroke=e[1]),t.util.enlivenObjects([n.clipPath],(function(e){n.clipPath=e[0];var t=o?new s(n[o],n):new s(n);r&&r(t)}))}))},t.Object.__uid=0)}(t),_=S.util.degreesToRadians,b={left:-.5,center:0,right:.5},x={top:-.5,center:0,bottom:.5},S.util.object.extend(S.Object.prototype,{translateToGivenOrigin:function(e,t,n,i,r){var o,s,a,l=e.x,c=e.y;return"string"==typeof t?t=b[t]:t-=.5,"string"==typeof i?i=b[i]:i-=.5,"string"==typeof n?n=x[n]:n-=.5,"string"==typeof r?r=x[r]:r-=.5,s=r-n,((o=i-t)||s)&&(a=this._getTransformedDimensions(),l=e.x+o*a.x,c=e.y+s*a.y),new S.Point(l,c)},translateToCenterPoint:function(e,t,n){var i=this.translateToGivenOrigin(e,t,n,"center","center");return this.angle?S.util.rotatePoint(i,e,_(this.angle)):i},translateToOriginPoint:function(e,t,n){var i=this.translateToGivenOrigin(e,"center","center",t,n);return this.angle?S.util.rotatePoint(i,e,_(this.angle)):i},getCenterPoint:function(){var e=new S.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var n=this.getCenterPoint();return this.translateToOriginPoint(n,e,t)},toLocalPoint:function(e,t,n){var i,r,o=this.getCenterPoint();return i=void 0!==t&&void 0!==n?this.translateToGivenOrigin(o,"center","center",t,n):new S.Point(this.left,this.top),r=new S.Point(e.x,e.y),this.angle&&(r=S.util.rotatePoint(r,o,-_(this.angle))),r.subtractEquals(i)},setPositionByOrigin:function(e,t,n){var i=this.translateToCenterPoint(e,t,n),r=this.translateToOriginPoint(i,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(e){var t,n,i=_(this.angle),r=this.getScaledWidth(),o=S.util.cos(i)*r,s=S.util.sin(i)*r;t="string"==typeof this.originX?b[this.originX]:this.originX-.5,n="string"==typeof e?b[e]:e-.5,this.left+=o*(n-t),this.top+=s*(n-t),this.setCoords(),this.originX=e},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}}),function(){var e=S.util,t=e.degreesToRadians,n=e.multiplyTransformMatrices,i=e.transformPoint;e.object.extend(S.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,t){return n=this._getCoords(e,t),[new S.Point(n.tl.x,n.tl.y),new S.Point(n.tr.x,n.tr.y),new S.Point(n.br.x,n.br.y),new S.Point(n.bl.x,n.bl.y)];var n},intersectsWithRect:function(e,t,n,i){var r=this.getCoords(n,i);return"Intersection"===S.Intersection.intersectPolygonRectangle(r,e,t).status},intersectsWithObject:function(e,t,n){return"Intersection"===S.Intersection.intersectPolygonPolygon(this.getCoords(t,n),e.getCoords(t,n)).status||e.isContainedWithinObject(this,t,n)||this.isContainedWithinObject(e,t,n)},isContainedWithinObject:function(e,t,n){for(var i=this.getCoords(t,n),r=t?e.aCoords:e.lineCoords,o=0,s=e._getImageLines(r);o<4;o++)if(!e.containsPoint(i[o],s))return!1;return!0},isContainedWithinRect:function(e,t,n,i){var r=this.getBoundingRect(n,i);return r.left>=e.x&&r.left+r.width<=t.x&&r.top>=e.y&&r.top+r.height<=t.y},containsPoint:function(e,t,n,i){var r=this._getCoords(n,i),o=(t=t||this._getImageLines(r),this._findCrossPoints(e,t));return 0!==o&&o%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!!this.getCoords(!0,e).some((function(e){return e.x<=n.x&&e.x>=t.x&&e.y<=n.y&&e.y>=t.y}))||(!!this.intersectsWithRect(t,n,!0,e)||this._containsCenterOfCanvas(t,n,e))},_containsCenterOfCanvas:function(e,t,n){var i={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(i,null,!0,n)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,n,!0,e)||this.getCoords(!0,e).every((function(e){return(e.x>=n.x||e.x<=t.x)&&(e.y>=n.y||e.y<=t.y)}))&&this._containsCenterOfCanvas(t,n,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var n,i,r,o=0;for(var s in t)if(!((r=t[s]).o.y<e.y&&r.d.y<e.y||r.o.y>=e.y&&r.d.y>=e.y||(r.o.x===r.d.x&&r.o.x>=e.x?i=r.o.x:(0,n=(r.d.y-r.o.y)/(r.d.x-r.o.x),i=-(e.y-0*e.x-(r.o.y-n*r.o.x))/(0-n)),i>=e.x&&(o+=1),2!==o)))break;return o},getBoundingRect:function(t,n){var i=this.getCoords(t,n);return e.makeBoundingBoxFromPoints(i)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var n=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/n)},scaleToHeight:function(e,t){var n=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/n)},calcCoords:function(e){return e?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var n=this.getViewportTransform(),r=this.padding,o=t(this.angle),s=e.cos(o)*r,a=e.sin(o)*r,l=s+a,c=s-a,u=this.calcACoords(),h={tl:i(u.tl,n),tr:i(u.tr,n),bl:i(u.bl,n),br:i(u.br,n)};return r&&(h.tl.x-=c,h.tl.y-=l,h.tr.x+=l,h.tr.y-=c,h.bl.x-=l,h.bl.y+=c,h.br.x+=c,h.br.y+=l),h},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),i=this.getViewportTransform(),r=n(i,t),o=n(r,e),s=(o=n(o,[1/i[0],0,0,1/i[3],0,0]),this._calculateCurrentDimensions()),a={};return this.forEachControl((function(e,t,n){a[t]=e.positionHandler(s,o,n)})),a},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=n(t,e),o=this._getTransformedDimensions(),s=o.x/2,a=o.y/2;return{tl:i({x:-s,y:-a},r),tr:i({x:s,y:-a},r),bl:i({x:-s,y:a},r),br:i({x:s,y:a},r)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="_",n="";return!e&&this.group&&(n=this.group.transformMatrixKey(e)+t),n+this.top+t+this.left+t+this.scaleX+t+this.scaleY+t+this.skewX+t+this.skewY+t+this.angle+t+this.originX+t+this.originY+t+this.width+t+this.height+t+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var i=this.transformMatrixKey(e),r=this.matrixCache||(this.matrixCache={});return r.key===i?r.value:(this.group&&(t=n(this.group.calcTransformMatrix(!1),t)),r.key=i,r.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),n=this.ownMatrixCache||(this.ownMatrixCache={});if(n.key===t)return n.value;var i=this._calcTranslateMatrix(),r={angle:this.angle,translateX:i[4],translateY:i[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return n.key=t,n.value=e.composeMatrix(r),n.value},_calcDimensionsTransformMatrix:function(t,n,i){return e.calcDimensionsMatrix({skewX:t,skewY:n,scaleX:this.scaleX*(i&&this.flipX?-1:1),scaleY:this.scaleY*(i&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,n){void 0===t&&(t=this.skewX),void 0===n&&(n=this.skewY);var i,r,o,s=0===t&&0===n;if(this.strokeUniform?(r=this.width,o=this.height):(r=(i=this._getNonTransformedDimensions()).x,o=i.y),s)return this._finalizeDimensions(r*this.scaleX,o*this.scaleY);var a=e.sizeAfterTransform(r,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:n});return this._finalizeDimensions(a.x,a.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return i(t,e,!0).scalarAdd(2*this.padding)}})}(),S.util.object.extend(S.Object.prototype,{sendToBack:function(){return this.group?S.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?S.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?S.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?S.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?S.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,t){if(t){if(t.toLive)return e+": url(#SVGID_"+t.id+"); ";var n=new S.Color(t),i=e+": "+n.toRgb()+"; ",r=n.getAlpha();return 1!==r&&(i+=e+"-opacity: "+r.toString()+"; "),i}return e+": none; "}var t=S.util.toFixed;S.util.object.extend(S.Object.prototype,{getSvgStyles:function(t){var n=this.fillRule?this.fillRule:"nonzero",i=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",s=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=void 0!==this.opacity?this.opacity:"1",u=this.visible?"":" visibility: hidden;",h=t?"":this.getSvgFilter(),d=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",i,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",s,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",l,"; ",d,"fill-rule: ",n,";
2 ","opacity: ",c,";",h,u].join("")},getSvgSpanStyles:function(t,n){var i="; ",r=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+i:"",o=t.strokeWidth?"stroke-width: "+t.strokeWidth+i:"",s=(r=r,t.fontSize?"font-size: "+t.fontSize+"px"+i:""),a=t.fontStyle?"font-style: "+t.fontStyle+i:"",l=t.fontWeight?"font-weight: "+t.fontWeight+i:"",c=t.fill?e("fill",t.fill):"",u=t.stroke?e("stroke",t.stroke):"",h=this.getSvgTextDecoration(t);return h&&(h="text-decoration: "+h+i),[u,o,r,s,a,l,h,c,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",n?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter((function(t){return e[t.replace("-","")]})).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(e,t){var n=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+S.util.matrixToSVG(n)+(t||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var n=S.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',t(-this.width/2,n),'" y="',t(-this.height/2,n),'" width="',t(this.width,n),'" height="',t(this.height,n),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var n=(t=t||{}).reviver,i=t.additionalTransform||"",r=[this.getSvgTransform(!0,i),this.getSvgCommons()].join(""),o=e.indexOf("COMMON_PARTS");return e[o]=r,n?n(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,t){var n,i,r=(t=t||{}).noStyle,o=t.reviver,s=r?"":'style="'+this.getSvgStyles()+'" ',a=t.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",u=l&&l.absolutePositioned,h=this.stroke,d=this.fill,f=this.shadow,p=[],g=e.indexOf("COMMON_PARTS"),m=t.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+S.Object.__uid++,i='<clipPath id="'+l.clipPathId+'" >\n'+l.toClipPathSVG(o)+"</clipPath>\n"),u&&p.push("<g ",a,this.getSvgCommons()," >\n"),p.push("<g ",this.getSvgTransform(!1),u?"":a+this.getSvgCommons()," >\n"),n=[s,c,r?"":this.addPaintOrder()," ",m?'transform="'+m+'" ':""].join(""),e[g]=n,d&&d.toLive&&p.push(d.toSVG(this)),h&&h.toLive&&p.push(h.toSVG(this)),f&&p.push(f.toSVG(this)),l&&p.push(i),p.push(e.join("")),p.push("</g>\n"),u&&p.push("</g>\n"),o?o(p.join("")):p.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=S.util.object.extend,t="stateProperties";function n(t,n,i){var r={};i.forEach((function(e){r[e]=t[e]})),e(t[n],r,!0)}function i(e,t,n){if(e===t)return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0,o=e.length;r<o;r++)if(!i(e[r],t[r]))return!1;return!0}if(e&&"object"==typeof e){var s,a=Object.keys(e);if(!t||"object"!=typeof t||!n&&a.length!==Object.keys(t).length)return!1;for(r=0,o=a.length;r<o;r++)if("canvas"!==(s=a[r])&&"group"!==s&&!i(e[s],t[s]))return!1;return!0}}S.util.object.extend(S.Object.prototype,{hasStateChanged:function(e){var n="_"+(e=e||t);return Object.keys(this[n]).length<this[e].length||!i(this[n],this,!0)},saveState:function(e){var i=e&&e.propertySet||t,r="_"+i;return this[r]?(n(this,r,this[i]),e&&e.stateProperties&&n(this,r,e.stateProperties),this):this.setupState(e)},setupState:function(e){var n=(e=e||{}).propertySet||t;return e.propertySet=n,this["_"+n]={},this.saveState(e),this}})}(),function(){var e=S.util.degreesToRadians;S.util.object.extend(S.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var n,i,r,o=e.x,s=e.y,a=Object.keys(this.oCoords),l=a.length-1;for(this.__corner=0;l>=0;l--)if(r=a[l],this.isControlVisible(r)&&(i=this._getImageLines(t?this.oCoords[r].touchCorner:this.oCoords[r].corner),0!==(n=this._findCrossPoints({x:o,y:s},i))&&n%2==1))return this.__corner=r,r;return!1}
vendor: 39,045 bytes, line 2
2,forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var n=this.controls[t];e[t].corner=n.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=n.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var n=this.getCenterPoint(),i=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return t.translate(n.x,n.y),t.scale(1/r[0],1/r[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-i.x/2,-i.y/2,i.x,i.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var n=this._calculateCurrentDimensions(),i=this.borderScaleFactor,r=n.x+i,o=n.y+i,s=void 0!==t.hasControls?t.hasControls:this.hasControls,a=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-r/2,-o/2,r,o),s&&(e.beginPath(),this.forEachControl((function(t,n,i){t.withConnection&&t.getVisibility(i,n)&&(a=!0,e.moveTo(t.x*r,t.y*o),e.lineTo(t.x*r+t.offsetX,t.y*o+t.offsetY))})),a&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,t,n){n=n||{};var i=S.util.sizeAfterTransform(this.width,this.height,t),r=this.strokeWidth,o=this.strokeUniform,s=this.borderScaleFactor,a=i.x+r*(o?this.canvas.getZoom():t.scaleX)+s,l=i.y+r*(o?this.canvas.getZoom():t.scaleY)+s;return e.save(),this._setLineDash(e,n.borderDashArray||this.borderDashArray),e.strokeStyle=n.borderColor||this.borderColor,e.strokeRect(-a/2,-l/2,a,l),e.restore(),this},drawControls:function(e,t){t=t||{},e.save();var n,i,r=this.canvas.getRetinaScaling();return e.setTransform(r,0,0,r,0,0),e.strokeStyle=e.fillStyle=t.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=t.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,t.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(n=this.group.calcTransformMatrix()),this.forEachControl((function(r,o,s){i=s.oCoords[o],r.getVisibility(s,o)&&(n&&(i=S.util.transformPoint(i,n)),r.render(e,i.x,i.y,t,s))})),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),S.util.object.extend(S.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){var n=function(){},i=(t=t||{}).onComplete||n,r=t.onChange||n,o=this;return S.util.animate({startValue:e.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),o.requestRenderAll(),r()},onComplete:function(){e.setCoords(),i()}}),this},fxCenterObjectV:function(e,t){var n=function(){},i=(t=t||{}).onComplete||n,r=t.onChange||n,o=this;return S.util.animate({startValue:e.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),o.requestRenderAll(),r()},onComplete:function(){e.setCoords(),i()}}),this},fxRemove:function(e,t){var n=function(){},i=(t=t||{}).onComplete||n,r=t.onChange||n,o=this;return S.util.animate({startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),o.requestRenderAll(),r()},onComplete:function(){o.remove(e),i()}}),this}}),S.util.object.extend(S.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,n=[];for(e in arguments[0])n.push(e);for(var i=0,r=n.length;i<r;i++)e=n[i],t=i!==r-1,this._animate(e,arguments[0][e],arguments[1],t)}else this._animate.apply(this,arguments);return this},_animate:function(e,t,n,i){var r,o=this;t=t.toString(),n=n?S.util.object.clone(n):{},~e.indexOf(".")&&(r=e.split("."));var s=o.colorProperties.indexOf(e)>-1||r&&o.colorProperties.indexOf(r[1])>-1,a=r?this.get(r[0])[r[1]]:this.get(e);"from"in n||(n.from=a),s||(t=~t.indexOf("=")?a+parseFloat(t.replace("=","")):parseFloat(t));var l={startValue:n.from,endValue:t,byValue:n.by,easing:n.easing,duration:n.duration,abort:n.abort&&function(e,t,i){return n.abort.call(o,e,t,i)},onChange:function(t,s,a){r?o[r[0]][r[1]]=t:o.set(e,t),i||n.onChange&&n.onChange(t,s,a)},onComplete:function(e,t,r){i||(o.setCoords(),n.onComplete&&n.onComplete(e,t,r))}};return s?S.util.animateColor(l.startValue,l.endValue,l.duration,l):S.util.animate(l)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,i=t.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};function o(e,t){var n=e.origin,i=e.axis1,r=e.axis2,o=e.dimension,s=t.nearest,a=t.center,l=t.farthest;return function(){switch(this.get(n)){case s:return Math.min(this.get(i),this.get(r));case a:return Math.min(this.get(i),this.get(r))+.5*this.get(o);case l:return Math.max(this.get(i),this.get(r))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),void 0!==r[e]&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var n=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=n},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return n(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,n=e*this.width*.5,i=t*this.height*.5;return{x1:n,x2:e*this.width*-.5,y1:i,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,i,r){r=r||{};var o=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),s=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];i(new t.Line(s,n(o,r)))},t.Line.fromObject=function(e,n){var r=i(e,!0);r.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",r,(function(e){delete e.points,n&&n(e)}),"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=Math.PI;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*n,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,i=(this.endAngle-this.startAngle)%(2*n);if(0===i)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var r=t.util.cos(this.startAngle)*this.radius,o=t.util.sin(this.startAngle)*this.radius,s=t.util.cos(this.endAngle)*this.radius,a=t.util.sin(this.endAngle)*this.radius,l=i>n?"1":"0";e=['<path d="M '+r+" "+o," A "+this.radius+" "+this.radius," 0 ",+l+" 1"," "+s+" "+a,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,n){var i,r=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!("radius"in(i=r)&&i.radius>=0))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,n(new t.Circle(r))},t.Circle.fromObject=function(e,n){t.Object._fromObject("Circle",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,n){return t.Object._fromObject("Triangle",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,n,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,n){var i=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);i.left=(i.left||0)-i.rx,i.top=(i.top||0)-i.ry,n(new t.Ellipse(i))},t.Ellipse.fromObject=function(e,n){t.Object._fromObject("Ellipse",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,n=this.ry?Math.min(this.ry,this.height/2):0,i=this.width,r=this.height,o=-this.width/2,s=-this.height/2,a=0!==t||0!==n,l=.4477152502;e.beginPath(),e.moveTo(o+t,s),e.lineTo(o+i-t,s),a&&e.bezierCurveTo(o+i-l*t,s,o+i,s+l*n,o+i,s+n),e.lineTo(o+i,s+r-n),a&&e.bezierCurveTo(o+i,s+r-l*n,o+i-l*t,s+r,o+i-t,s+r),e.lineTo(o+t,s+r),a&&e.bezierCurveTo(o+l*t,s+r,o,s+r-l*n,o,s+r-n),e.lineTo(o,s+n),a&&e.bezierCurveTo(o,s+l*n,o+l*t,s,o+t,s),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,i,r){if(!e)return i(null);r=r||{};var o=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var s=new t.Rect(n(r?t.util.object.clone(r):{},o));s.visible=s.visible&&s.width>0&&s.height>0,i(s)},t.Rect.fromObject=function(e,n){return t.Object._fromObject("Rect",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,i=t.util.array.min,r=t.util.array.max,o=t.util.toFixed;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_setPositionDimensions:function(e){var t,n=this._calcDimensions(e);this.width=n.width,this.height=n.height,e.fromSVG||(t=this.translateToGivenOrigin({x:n.left-this.strokeWidth/2,y:n.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),void 0===e.left&&(this.left=e.fromSVG?n.left:t.x),void 0===e.top&&(this.top=e.fromSVG?n.top:t.y),this.pathOffset={x:n.left+this.width/2,y:n.top+this.height/2}},_calcDimensions:function(){var e=this.points,t=i(e,"x")||0,n=i(e,"y")||0;return{left:t,top:n,width:(r(e,"x")||0)-t,height:(r(e,"y")||0)-n}},toObject:function(e){return n(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],n=this.pathOffset.x,i=this.pathOffset.y,r=t.Object.NUM_FRACTION_DIGITS,s=0,a=this.points.length;s<a;s++)e.push(o(this.points[s].x-n,r),",",o(this.points[s].y-i,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,n=this.points.length,i=this.pathOffset.x,r=this.pathOffset.y;if(!n||isNaN(this.points[n-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-i,this.points[0].y-r);for(var o=0;o<n;o++)t=this.points[o],e.lineTo(t.x-i,t.y-r);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(i,r,o){if(!i)return r(null);o||(o={});var s=t.parsePointsAttribute(i.getAttribute("points")),a=t.parseAttributes(i,t[e].ATTRIBUTE_NAMES);a.fromSVG=!0,r(new t[e](s,n(a,o)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,n){return t.Object._fromObject("Polyline",e,n,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,n){t.Object._fromObject("Polygon",e,n,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.array.min,i=t.util.array.max,r=t.util.object.extend,o=Object.prototype.toString,s=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,n){n=n||{},this.callSuper("initialize",n),e||(e=[]);var i="[object Array]"===o.call(e);this.path=t.util.makePathSimpler(i?e:t.util.parsePath(e)),this.path&&t.Polyline.prototype._setPositionDimensions.call(this,n)},_renderPathCommands:function(e){var t,n=0,i=0,r=0,o=0,s=0,a=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var u=0,h=this.path.length;u<h;++u)switch((t=this.path[u])[0]){case"L":r=t[1],o=t[2],e.lineTo(r+l,o+c);break;case"M":n=r=t[1],i=o=t[2],e.moveTo(r+l,o+c);break;case"C":r=t[5],o=t[6],s=t[3],a=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,s+l,a+c,r+l,o+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),r=t[3],o=t[4],s=t[1],a=t[2];break;case"z":case"Z":r=n,o=i,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return r(this.callSuper("toObject",e),{path:this.path.map((function(e){return e.slice()}))})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+s(-this.pathOffset.x,e)+", "+s(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,r,o=[],s=[],a=0,l=0,c=0,u=0,h=0,d=this.path.length;h<d;++h){switch((e=this.path[h])[0]){case"L":c=e[1],u=e[2],r=[];break;case"M":a=c=e[1],l=u=e[2],r=[];break;case"C":r=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],u=e[6];break;case"Q":r=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],u=e[4];break;case"z":case"Z":c=a,u=l}r.forEach((function(e){o.push(e.x),s.push(e.y)})),o.push(c),s.push(u)}var f=n(o)||0,p=n(s)||0;return{left:f,top:p,width:(i(o)||0)-f,height:(i(s)||0)-p}}}),t.Path.fromObject=function(e,n){if("string"==typeof e.sourcePath){var i=e.sourcePath;t.loadSVGFromURL(i,(function(t){var i=t[0];i.setOptions(e),n&&n(i)}))}else t.Object._fromObject("Path",e,n,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,n,i){var o=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,n(new t.Path(o.d,r(o,i)))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.array.min,i=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,n){t=t||{},this._objects=[],n&&this.callSuper("initialize",t),this._objects=e||[];for(var i=this._objects.length;i--;)this._objects[i].group=this;if(n)this._updateObjectsACoords();else{var r=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),r||this._calcBounds(),this._updateObjectsCoords(r),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(true)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var n=e.left,i=e.top;e.set({left:n-t.x,top:i-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var n=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(n&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,n?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,n){var i=this._objects.length;if(this.useSetOnGroup)for(;i--;)this._objects[i].setOnGroup(e,n);if("canvas"===e)for(;i--;)this._objects[i]._set(e,n);t.Object.prototype._set.call(this,e,n)},toObject:function(e){var n=this.includeDefaultValues,i=this._objects.filter((function(e){return!e.excludeFromExport})).map((function(t){var i=t.includeDefaultValues;t.includeDefaultValues=n;var r=t.toObject(e);return t.includeDefaultValues=i,r})),r=t.Object.prototype.toObject.call(this,e);return r.objects=i,r},toDatalessObject:function(e){var n,i=this.sourcePath;if(i)n=i;else{var r=this.includeDefaultValues;n=this._objects.map((function(t){var n=t.includeDefaultValues;t.includeDefaultValues=r;var i=t.toDatalessObject(e);return t.includeDefaultValues=n,i}))}var o=t.Object.prototype.toDatalessObject.call(this,e);return o.objects=n,o},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var n=0,i=this._objects.length;n<i;n++)if(this._objects[n].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,n=this._objects.length;e<n;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,n=this._objects.length;t<n;t++)this._objects[t].render(e);this._drawClipPath(e)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,n=this._objects.length;t<n;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var i=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-i/2,-r/2,i,r)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach((function(n){t.util.addTransformToObject(n,e),delete n.group,n.setCoords()})),this},realizeTransform:function(e,n){return t.util.addTransformToObject(e,n),e},destroy:function(){return this._objects.forEach((function(e){e.set("dirty",!0)})),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var e=this._objects,n=this.canvas;this._objects=[];var i=this.toObject();delete i.objects;var r=new t.ActiveSelection([]);return r.set(i),r.type="activeSelection",n.remove(this),e.forEach((function(e){e.group=r,e.dirty=!0,n.add(e)})),r.canvas=n,r._objects=e,n._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject((function(e){e.setCoords(true)})),this},_calcBounds:function(e){for(var t,n,i,r,o=[],s=[],a=["tr","br","bl","tl"],l=0,c=this._objects.length,u=a.length;l<c;++l){for(i=(t=this._objects[l]).calcACoords(),r=0;r<u;r++)n=a[r],o.push(i[n].x),s.push(i[n].y);t.aCoords=i}this._getBounds(o,s,e)},_getBounds:function(e,r,o){var s=new t.Point(n(e),n(r)),a=new t.Point(i(e),i(r)),l=s.y||0,c=s.x||0,u=a.x-s.x||0,h=a.y-s.y||0;this.width=u,this.height=h,o||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],n=0,i=this._objects.length;n<i;n++)t.push("\t\t",this._objects[n].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],n=0,i=this._objects.length;n<i;n++)t.push("\t",this._objects[n].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,n){var i=e.objects,r=t.util.object.clone(e,!0);delete r.objects,"string"!=typeof i?t.util.enlivenObjects(i,(function(i){t.util.enlivenObjects([e.clipPath],(function(r){var o=t.util.object.clone(e,!0);o.clipPath=r[0],delete o.objects,n&&n(new t.Group(i,o,!0))}))})):t.loadSVGFromURL(i,(function(o){var s=t.util.groupSVGElements(o,e,i);s.set(r),n&&n(s)}))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,n){n=n||{},this._objects=e||[];for(var i=this._objects.length;i--;)this._objects[i].group=this;n.originX&&(this.originX=n.originX),n.originY&&(this.originY=n.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,n),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var n=t.Object.prototype.toObject.call(this),i=new t.Group([]);if(delete n.type,i.set(n),e.forEach((function(e){e.canvas.remove(e),e.group=i})),i._objects=e,!this.canvas)return i;var r=this.canvas;return r.add(i),r._activeObject=i,i.setCoords(),i},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,n){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),void 0===(n=n||{}).hasControls&&(n.hasControls=!1),n.forActiveSelection=!0;for(var i=0,r=this._objects.length;i<r;i++)this._objects[i]._renderControls(e,n);e.restore()}}),t.ActiveSelection.fromObject=function(e,n){t.util.enlivenObjects(e.objects,(function(i){delete e.objects,n&&n(new t.ActiveSelection(i,e,!0))}))})}(t),function(e){"use strict";var t=S.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?S.warn("fabric.Image is already defined."):(S.Image=S.util.createClass(S.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:S.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:S.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,t){t||(t={}),this.filters=[],this.cacheKey="texture"+S.Object.__uid++,this.callSuper("initialize",t),this._initElement(e,t)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var t=S.filterBackend;t&&t.evictCachesForKey&&t.evictCachesForKey(e)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){S.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,-n),e.lineTo(t,-n),e.lineTo(t,n),e.lineTo(-t,n),e.lineTo(-t,-n),e.closePath()}},toObject:function(e){var n=[];this.filters.forEach((function(e){e&&n.push(e.toObject())}));var i=t(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:n});return this.resizeFilter&&(i.resizeFilter=this.resizeFilter.toObject()),i},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,t=[],n=[],i=this._element,r=-this.width/2,o=-this.height/2,s="",a="";if(!i)return[];if(this.hasCrop()){var l=S.Object.__uid++;t.push('<clipPath id="imageCrop_'+l+'">\n','\t<rect x="'+r+'" y="'+o+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),s=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(a='" image-rendering="optimizeSpeed'),n.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',r-this.cropX,'" y="',o-this.cropY,'" width="',i.width||i.naturalWidth,'" height="',i.height||i.height,a,'"',s,"></image>\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,e=["\t<rect ",'x="',r,'" y="',o,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=c}return t="fill"!==this.paintFirst?t.concat(e,n):t.concat(n,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,t,n){return S.util.loadImage(e,(function(e,i){this.setElement(e,n),this._setWidthHeight(),t&&t(this,i)}),this,n&&n.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,t=this.minimumScaleTrigger,n=this.getTotalObjectScaling(),i=n.scaleX,r=n.scaleY,o=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||i>t&&r>t)return this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=r);S.filterBackend||(S.filterBackend=S.initFilterBackend());var s=S.util.createCanvasElement(),a=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=o.width,c=o.height;s.width=l,s.height=c,this._element=s,this._lastScaleX=e.scaleX=i,this._lastScaleY=e.scaleY=r,S.filterBackend.applyFilters([e],o,l,c,this._element,a),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter((function(e){return e&&!e.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var t=this._originalElement,n=t.naturalWidth||t.width,i=t.naturalHeight||t.height;if(this._element===this._originalElement){var r=S.util.createCanvasElement();r.width=n,r.height=i,this._element=r,this._filteredEl=r}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,n,i),this._lastScaleX=1,this._lastScaleY=1;return S.filterBackend||(S.filterBackend=S.initFilterBackend()),S.filterBackend.applyFilters(e,this._originalElement,n,i,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){S.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){S.util.setImageSmoothing(e,this.imageSmoothing),S.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var n=this._filterScalingX,i=this._filterScalingY,r=this.width,o=this.height,s=Math.min,a=Math.max,l=a(this.cropX,0),c=a(this.cropY,0),u=t.naturalWidth||t.width,h=t.naturalHeight||t.height,d=l*n,f=c*i,p=s(r*n,u-d),g=s(o*i,h-f),m=-r/2,v=-o/2,y=s(r,u/n-l),_=s(o,h/i-c);t&&e.drawImage(t,d,f,p,g,m,v,y,_)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,t){this.setElement(S.util.getById(e),t),S.util.addClass(this.getElement(),S.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,t){e&&e.length?S.util.enlivenObjects(e,(function(e){t&&t(e)}),"fabric.Image.filters"):t&&t()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,t=S.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),n=this._element.width,i=this._element.height,r=1,o=1,s=0,a=0,l=0,c=0,u=this.width,h=this.height,d={width:u,height:h};return!t||"none"===t.alignX&&"none"===t.alignY?(r=u/n,o=h/i):("meet"===t.meetOrSlice&&(e=(u-n*(r=o=S.util.findScaleToFit(this._element,d)))/2,"Min"===t.alignX&&(s=-e),"Max"===t.alignX&&(s=e),e=(h-i*o)/2,"Min"===t.alignY&&(a=-e),"Max"===t.alignY&&(a=e)),"slice"===t.meetOrSlice&&(e=n-u/(r=o=S.util.findScaleToCover(this._element,d)),"Mid"===t.alignX&&(l=e/2),"Max"===t.alignX&&(l=e),e=i-h/o,"Mid"===t.alignY&&(c=e/2),"Max"===t.alignY&&(c=e),n=u/r,i=h/o)),{width:n,height:i,scaleX:r,scaleY:o,offsetLeft:s,offsetTop:a,cropX:l,cropY:c}}}),S.Image.CSS_CANVAS="canvas-img",S.Image.prototype.getSvgSrc=S.Image.prototype.getSrc,S.Image.fromObject=function(e,t){var n=S.util.object.clone(e);S.util.loadImage(n.src,(function(e,i){i?t&&t(null,!0):S.Image.prototype._initFilters.call(n,n.filters,(function(i){n.filters=i||[],S.Image.prototype._initFilters.call(n,[n.resizeFilter],(function(i){n.resizeFilter=i[0],S.util.enlivenObjects([n.clipPath],(function(i){n.clipPath=i[0];var r=new S.Image(e,n);t(r,!1)}))}))}))}),null,n.crossOrigin)},S.Image.fromURL=function(e,t,n){S.util.loadImage(e,(function(e,i){t&&t(new S.Image(e,n),i)}),null,n&&n.crossOrigin)},S.Image.ATTRIBUTE_NAMES=S.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),S.Image.fromElement=function(e,n,i){var r=S.parseAttributes(e,S.Image.ATTRIBUTE_NAMES);S.Image.fromURL(r["xlink:href"],n,t(i?S.util.object.clone(i):{},r))})}(t),S.util.object.extend(S.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(e){var t=function(){},n=(e=e||{}).onComplete||t,i=e.onChange||t,r=this;return S.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){r.rotate(e),i()},onComplete:function(){r.setCoords(),n()}}),this}}),S.util.object.extend(S.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function e(e,t){var n="precision "+t+" float;\nvoid main(){}",i=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(i,n),e.compileShader(i),!!e.getShaderParameter(i,e.COMPILE_STATUS)}function t(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}S.isWebglSupported=function(t){if(S.isLikelyNode)return!1;t=t||S.WebglFilterBackend.prototype.tileSize;var n=document.createElement("canvas"),i=n.getContext("webgl")||n.getContext("experimental-webgl"),r=!1;if(i){S.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),r=S.maxTextureSize>=t;for(var o=["highp","mediump","lowp"],s=0;s<3;s++)if(e(i,o[s])){S.webGlPrecision=o[s];break}}return this.isSupported=r,r},S.WebglFilterBackend=t,t.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,t){var n,i=void 0!==window.performance;try{new ImageData(1,1),n=!0}catch(e){n=!1}var r="undefined"!=typeof ArrayBuffer,o="undefined"!=typeof Uint8ClampedArray;if(i&&n&&r&&o){var s=S.util.createCanvasElement(),a=new ArrayBuffer(e*t*4);if(S.forceGLPutImageData)return this.imageBuffer=a,void(this.copyGLTo2D=E);var l,c,u={imageBuffer:a,destinationWidth:e,destinationHeight:t,targetCanvas:s};s.width=e,s.height=t,l=window.performance.now(),O.call(u,this.gl,u),c=window.performance.now()-l,l=window.performance.now(),E.call(u,this.gl,u),c>window.performance.now()-l?(this.imageBuffer=a,this.copyGLTo2D=E):this.copyGLTo2D=O}},createWebGLCanvas:function(e,t){var n=S.util.createCanvasElement();n.width=e,n.height=t;var i={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},r=n.getContext("webgl",i);r||(r=n.getContext("experimental-webgl",i)),r&&(r.clearColor(0,0,0,0),this.canvas=n,this.gl=r)},applyFilters:function(e,t,n,i,r,o){var s,a=this.gl;o&&(s=this.getCachedTexture(o,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:n,sourceHeight:i,destinationWidth:n,destinationHeight:i,context:a,sourceTexture:this.createTexture(a,n,i,!s&&t),targetTexture:this.createTexture(a,n,i),originalTexture:s||this.createTexture(a,n,i,!s&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},c=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,c),e.forEach((function(e){e&&e.applyTo(l)})),function(e){var t=e.targetCanvas,n=t.width,i=t.height,r=e.destinationWidth,o=e.destinationHeight;n===r&&i===o||(t.width=r,t.height=o)}(l),this.copyGLTo2D(a,l),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(l.sourceTexture),a.deleteTexture(l.targetTexture),a.deleteFramebuffer(c),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,n,i){var r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),r},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var n=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=n,n},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:O,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var n=e.getExtension("WEBGL_debug_renderer_info");if(n){var i=e.getParameter(n.UNMASKED_RENDERER_WEBGL),r=e.getParameter(n.UNMASKED_VENDOR_WEBGL);i&&(t.renderer=i.toLowerCase()),r&&(t.vendor=r.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){"use strict";var e=function(){};function t(){}
vendor: 4,429 bytes, line 2
2S.Canvas2dFilterBackend=t,t.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,n,i,r){var o=r.getContext("2d");o.drawImage(t,0,0,n,i);var s={sourceWidth:n,sourceHeight:i,imageData:o.getImageData(0,0,n,i),originalEl:t,originalImageData:o.getImageData(0,0,n,i),canvasEl:r,ctx:o,filterBackend:this};return e.forEach((function(e){e.applyTo(s)})),s.imageData.width===n&&s.imageData.height===i||(r.width=s.imageData.width,r.height=s.imageData.height),o.putImageData(s.imageData,0,0),s}}}(),S.Image=S.Image||{},S.Image.filters=S.Image.filters||{},S.Image.filters.BaseFilter=S.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,t,n){t=t||this.fragmentSource,n=n||this.vertexSource,"highp"!==S.webGlPrecision&&(t=t.replace(/precision highp float/g,"precision "+S.webGlPrecision+" float"));var i=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(i));var r=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(r));var o=e.createProgram();if(e.attachShader(o,i),e.attachShader(o,r),e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(o));var s=this.getAttributeLocations(e,o),a=this.getUniformLocations(e,o)||{};return a.uStepW=e.getUniformLocation(o,"uStepW"),a.uStepH=e.getUniformLocation(o,"uStepH"),{program:o,attributeLocations:s,uniformLocations:a}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,n){var i=t.aPosition,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.enableVertexAttribArray(i),e.vertexAttribPointer(i,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,n,i=e.context;e.passes>1?(t=e.destinationWidth,n=e.destinationHeight,e.sourceWidth===t&&e.sourceHeight===n||(i.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(i,t,n)),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e.targetTexture,0)):(i.bindFramebuffer(i.FRAMEBUFFER,null),i.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,t=S.Image.filters[this.type].prototype;if(e){if(Array.isArray(t[e])){for(var n=t[e].length;n--;)if(this[e][n]!==t[e][n])return!1;return!0}return t[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,n=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(n.program),this.sendAttributeData(t,n.attributeLocations,e.aPosition),t.uniform1f(n.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(n.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,n.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,n){e.activeTexture(n),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");
vendor: 23,539 bytes, line 2
2t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),S.Image.filters.BaseFilter.fromObject=function(e,t){var n=new S.Image.filters[e.type](e);return t&&t(n),n},function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.ColorMatrix=i(n.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,n,i,r,o,s=e.imageData.data,a=s.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<a;o+=4)t=s[o],n=s[o+1],i=s[o+2],c?(s[o]=t*l[0]+n*l[1]+i*l[2]+255*l[4],s[o+1]=t*l[5]+n*l[6]+i*l[7]+255*l[9],s[o+2]=t*l[10]+n*l[11]+i*l[12]+255*l[14]):(r=s[o+3],s[o]=t*l[0]+n*l[1]+i*l[2]+r*l[3]+255*l[4],s[o+1]=t*l[5]+n*l[6]+i*l[7]+r*l[8]+255*l[9],s[o+2]=t*l[10]+n*l[11]+i*l[12]+r*l[13]+255*l[14],s[o+3]=t*l[15]+n*l[16]+i*l[17]+r*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var n=this.matrix,i=[n[0],n[1],n[2],n[3],n[5],n[6],n[7],n[8],n[10],n[11],n[12],n[13],n[15],n[16],n[17],n[18]],r=[n[4],n[9],n[14],n[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,i),e.uniform4fv(t.uConstants,r)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Brightness=i(n.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,n=e.imageData.data,i=n.length,r=Math.round(255*this.brightness);for(t=0;t<i;t+=4)n[t]=n[t]+r,n[t+1]=n[t+1]+r,n[t+2]=n[t+2]+r}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,i=t.Image.filters,r=t.util.createClass;i.Convolute=r(i.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),n=this.type+"_"+t+"_"+(this.opaque?1:0),i=this.fragmentSource[n];return e.programCache.hasOwnProperty(n)||(e.programCache[n]=this.createProgram(e.context,i)),e.programCache[n]},applyTo2d:function(e){var t,n,i,r,o,s,a,l,c,u,h,d,f,p=e.imageData,g=p.data,m=this.matrix,v=Math.round(Math.sqrt(m.length)),y=Math.floor(v/2),_=p.width,b=p.height,x=e.ctx.createImageData(_,b),C=x.data,j=this.opaque?1:0;for(h=0;h<b;h++)for(u=0;u<_;u++){for(o=4*(h*_+u),t=0,n=0,i=0,r=0,f=0;f<v;f++)for(d=0;d<v;d++)s=u+d-y,(a=h+f-y)<0||a>=b||s<0||s>=_||(l=4*(a*_+s),c=m[f*v+d],t+=g[l]*c,n+=g[l+1]*c,i+=g[l+2]*c,j||(r+=g[l+3]*c));C[o]=t,C[o+1]=n,C[o+2]=i,C[o+3]=j?g[o+3]:r}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return n(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Grayscale=i(n.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,n,i=e.imageData.data,r=i.length,o=this.mode;for(t=0;t<r;t+=4)"average"===o?n=(i[t]+i[t+1]+i[t+2])/3:"lightness"===o?n=(Math.min(i[t],i[t+1],i[t+2])+Math.max(i[t],i[t+1],i[t+2]))/2:"luminosity"===o&&(n=.21*i[t]+.72*i[t+1]+.07*i[t+2]),i[t]=n,i[t+1]=n,i[t+2]=n},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var n=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,n)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Invert=i(n.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,n=e.imageData.data,i=n.length;for(t=0;t<i;t+=4)n[t]=255-n[t],n[t+1]=255-n[t+1],n[t+2]=255-n[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,i=t.Image.filters,r=t.util.createClass;i.Noise=r(i.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,n,i=e.imageData.data,r=i.length,o=this.noise;for(t=0,r=i.length;t<r;t+=4)n=(.5-Math.random())*o,i[t]+=n,i[t+1]+=n,i[t+2]+=n}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return n(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Pixelate=i(n.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,n,i,r,o,s,a,l,c,u,h,d=e.imageData,f=d.data,p=d.height,g=d.width;for(n=0;n<p;n+=this.blocksize)for(i=0;i<g;i+=this.blocksize)for(r=f[t=4*n*g+4*i],o=f[t+1],s=f[t+2],a=f[t+3],u=Math.min(n+this.blocksize,p),h=Math.min(i+this.blocksize,g),l=n;l<u;l++)for(c=i;c<h;c++)f[t=4*l*g+4*c]=r,f[t+1]=o,f[t+2]=s,f[t+3]=a},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,i=t.Image.filters,r=t.util.createClass;i.RemoveColor=r(i.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var n,i,r,o,s=e.imageData.data,a=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-a,l[1]-a,l[2]-a],u=[l[0]+a,l[1]+a,l[2]+a];for(n=0;n<s.length;n+=4)i=s[n],r=s[n+1],o=s[n+2],i>c[0]&&r>c[1]&&o>c[2]&&i<u[0]&&r<u[1]&&o<u[2]&&(s[n+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,n){var i=new t.Color(this.color).getSource(),r=parseFloat(this.distance),o=[0+i[0]/255-r,0+i[1]/255-r,0+i[2]/255-r,1],s=[i[0]/255+r,i[1]/255+r,i[2]/255+r,1];e.uniform4fv(n.uLow,o),e.uniform4fv(n.uHigh,s)},toObject:function(){return n(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var o in r)n[o]=i(n.ColorMatrix,{type:o,matrix:r[o],mainParameter:!1,colorsOnly:!0}),t.Image.filters[o].fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,n=t.Image.filters,i=t.util.createClass;n.BlendColor=i(n.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,n=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(n)||(t=this.buildSource(this.mode),e.programCache[n]=this.createProgram(e.context,t)),e.programCache[n]},applyTo2d:function(e){var n,i,r,o,s,a,l,c=e.imageData.data,u=c.length,h=1-this.alpha;n=(l=new t.Color(this.color).getSource())[0]*this.alpha,i=l[1]*this.alpha,r=l[2]*this.alpha;for(var d=0;d<u;d+=4)switch(o=c[d],s=c[d+1],a=c[d+2],this.mode){case"multiply":c[d]=o*n/255,c[d+1]=s*i/255,c[d+2]=a*r/255;break;case"screen":c[d]=255-(255-o)*(255-n)/255,c[d+1]=255-(255-s)*(255-i)/255,c[d+2]=255-(255-a)*(255-r)/255;break;case"add":c[d]=o+n,c[d+1]=s+i,c[d+2]=a+r;break;case"diff":case"difference":c[d]=Math.abs(o-n),c[d+1]=Math.abs(s-i),c[d+2]=Math.abs(a-r);break;case"subtract":c[d]=o-n,c[d+1]=s-i,c[d+2]=a-r;break;case"darken":c[d]=Math.min(o,n),c[d+1]=Math.min(s,i),c[d+2]=Math.min(a,r);break;case"lighten":c[d]=Math.max(o,n),c[d+1]=Math.max(s,i),c[d+2]=Math.max(a,r);break;case"overlay":c[d]=n<128?2*o*n/255:255-2*(255-o)*(255-n)/255,c[d+1]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255,c[d+2]=r<128?2*a*r/255:255-2*(255-a)*(255-r)/255;break;case"exclusion":c[d]=n+o-2*n*o/255,c[d+1]=i+s-2*i*s/255,c[d+2]=r+a-2*r*a/255;break;case"tint":c[d]=n+o*h,c[d+1]=i+s*h,c[d+2]=r+a*h}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,n){var i=new t.Color(this.color).getSource();i[0]=this.alpha*i[0]/255,i[1]=this.alpha*i[1]/255,i[2]=this.alpha*i[2]/255,i[3]=this.alpha,e.uniform4fv(n.uColor,i)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,n=t.Image.filters,i=t.util.createClass;n.BlendImage=i(n.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,n=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,n)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,n=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,n,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,n=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/n,1]},applyTo2d:function(e){var n,i,r,o,s,a,l,c,u,h,d,f=e.imageData,p=e.filterBackend.resources,g=f.data,m=g.length,v=f.width,y=f.height,_=this.image;p.blendImage||(p.blendImage=t.util.createCanvasElement()),h=(u=p.blendImage).getContext("2d"),u.width!==v||u.height!==y?(u.width=v,u.height=y):h.clearRect(0,0,v,y),h.setTransform(_.scaleX,0,0,_.scaleY,_.left,_.top),h.drawImage(_._element,0,0,v,y),d=h.getImageData(0,0,v,y).data;for(var b=0;b<m;b+=4)switch(s=g[b],a=g[b+1],l=g[b+2],c=g[b+3],n=d[b],i=d[b+1],r=d[b+2],o=d[b+3],this.mode){case"multiply":g[b]=s*n/255,g[b+1]=a*i/255,g[b+2]=l*r/255,g[b+3]=c*o/255;break;case"mask":g[b+3]=o}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var n=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,n)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,n){t.Image.fromObject(e.image,(function(i){var r=t.util.object.clone(e);r.image=i,n(new t.Image.filters.BlendImage(r))}))}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=Math.pow,i=Math.floor,r=Math.sqrt,o=Math.abs,s=Math.round,a=Math.sin,l=Math.ceil,c=t.Image.filters,u=t.util.createClass;c.Resize=u(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),n=this.type+"_"+t;if(!e.programCache.hasOwnProperty(n)){var i=this.generateShader(t);e.programCache[n]=this.createProgram(e.context,i)}return e.programCache[n]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,n=this.getFilterWindow(),i=new Array(n),r=1;r<=n;r++)i[r-1]=e(r*t);return i},generateShader:function(e){for(var t=new Array(e),n=this.fragmentSourceTOP,i=1;i<=e;i++)t[i-1]=i+".0 * uDelta";return n+="uniform float uTaps["+e+"];\n",n+="void main() {\n",n+="  vec4 color = texture2D(uTexture, vTexCoord);\n",n+="  float sum = 1.0;\n",t.forEach((function(e,t){n+="  color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",n+="  color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",n+="  sum += 2.0 * uTaps["+t+"];\n"})),n+="  gl_FragColor = color / sum;\n",n+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceW
vendor: 3,073 bytes, line 2
2idth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var n=(t*=Math.PI)/e;return a(t)/t*a(n)/n}},applyTo2d:function(e){var t=e.imageData,n=this.scaleX,i=this.scaleY;this.rcpScaleX=1/n,this.rcpScaleY=1/i;var r,o=t.width,a=t.height,l=s(o*n),c=s(a*i);"sliceHack"===this.resizeType?r=this.sliceByTwo(e,o,a,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(e,o,a,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(e,o,a,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(e,o,a,l,c)),e.imageData=r},sliceByTwo:function(e,n,r,o,s){var a,l,c=e.imageData,u=.5,h=!1,d=!1,f=n*u,p=r*u,g=t.filterBackend.resources,m=0,v=0,y=n,_=0;for(g.sliceByTwo||(g.sliceByTwo=document.createElement("canvas")),((a=g.sliceByTwo).width<1.5*n||a.height<r)&&(a.width=1.5*n,a.height=r),(l=a.getContext("2d")).clearRect(0,0,1.5*n,r),l.putImageData(c,0,0),o=i(o),s=i(s);!h||!d;)n=f,r=p,o<i(f*u)?f=i(f*u):(f=o,h=!0),s<i(p*u)?p=i(p*u):(p=s,d=!0),l.drawImage(a,m,v,n,r,y,_,f,p),m=y,v=_,_+=p;return l.getImageData(m,v,o,s)},lanczosResize:function(e,t,s,a,c){var u=e.imageData.data,h=e.ctx.createImageData(a,c),d=h.data,f=this.lanczosCreate(this.lanczosLobes),p=this.rcpScaleX,g=this.rcpScaleY,m=2/this.rcpScaleX,v=2/this.rcpScaleY,y=l(p*this.lanczosLobes/2),_=l(g*this.lanczosLobes/2),b={},x={},C={};return function e(l){var j,w,S,k,O,E,T,M,P,A,I;for(x.x=(l+.5)*p,C.x=i(x.x),j=0;j<c;j++){for(x.y=(j+.5)*g,C.y=i(x.y),O=0,E=0,T=0,M=0,P=0,w=C.x-y;w<=C.x+y;w++)if(!(w<0||w>=t)){A=i(1e3*o(w-x.x)),b[A]||(b[A]={});for(var D=C.y-_;D<=C.y+_;D++)D<0||D>=s||(I=i(1e3*o(D-x.y)),b[A][I]||(b[A][I]=f(r(n(A*m,2)+n(I*v,2))/1e3)),(S=b[A][I])>0&&(O+=S,E+=S*u[k=4*(D*t+w)],T+=S*u[k+1],M+=S*u[k+2],P+=S*u[k+3]))}d[k=4*(j*a+l)]=E/O,d[k+1]=T/O,d[k+2]=M/O,d[k+3]=P/O}return++l<a?e(l):h}(0)},bilinearFiltering:function(e,t,n,r,o){var s,a,l,c,u,h,d,f,p,g=0,m=this.rcpScaleX,v=this.rcpScaleY,y=4*(t-1),_=e.imageData.data,b=e.ctx.createImageData(r,o),x=b.data;for(l=0;l<o;l++)for(c=0;c<r;c++)for(u=m*c-(s=i(m*c)),h=v*l-(a=i(v*l)),p=4*(a*t+s),d=0;d<4;d++)f=_[p+d]*(1-u)*(1-h)+_[p+4+d]*u*(1-h)+_[p+y+d]*h*(1-u)+_[p+y+4+d]*u*h,x[g++]=f;return b},hermiteFastResize:function(e,t,n,s,a){for(var c=this.rcpScaleX,u=this.rcpScaleY,h=l(c/2),d=l(u/2),f=e.imageData.data,p=e.ctx.createImageData(s,a),g=p.data,m=0;m<a;m++)for(var v=0;v<s;v++){for(var y=4*(v+m*s),_=0,b=0,x=0,C=0,j=0,w=0,S=0,k=(m+.5)*u,O=i(m*u);O<(m+1)*u;
vendor: 13,481 bytes, line 2
2O++)for(var E=o(k-(O+.5))/d,T=(v+.5)*c,M=E*E,P=i(v*c);P<(v+1)*c;P++){var A=o(T-(P+.5))/h,I=r(M+A*A);I>1&&I<-1||(_=2*I*I*I-3*I*I+1)>0&&(S+=_*f[(A=4*(P+O*t))+3],x+=_,f[A+3]<255&&(_=_*f[A+3]/250),C+=_*f[A],j+=_*f[A+1],w+=_*f[A+2],b+=_)}g[y]=C/b,g[y+1]=j/b,g[y+2]=w/b,g[y+3]=S/x}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Contrast=i(n.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,n=e.imageData.data,i=n.length,r=Math.floor(255*this.contrast),o=259*(r+255)/(255*(259-r));for(t=0;t<i;t+=4)n[t]=o*(n[t]-128)+128,n[t+1]=o*(n[t+1]-128)+128,n[t+2]=o*(n[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Saturation=i(n.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,n,i=e.imageData.data,r=i.length,o=-this.saturation;for(t=0;t<r;t+=4)n=Math.max(i[t],i[t+1],i[t+2]),i[t]+=n!==i[t]?(n-i[t])*o:0,i[t+1]+=n!==i[t+1]?(n-i[t+1])*o:0,i[t+2]+=n!==i[t+2]?(n-i[t+2])*o:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Vibrance=i(n.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,n,i,r,o=e.imageData.data,s=o.length,a=-this.vibrance;for(t=0;t<s;t+=4)n=Math.max(o[t],o[t+1],o[t+2]),i=(o[t]+o[t+1]+o[t+2])/3,r=2*Math.abs(n-i)/255*a,o[t]+=n!==o[t]?(n-o[t])*r:0,o[t+1]+=n!==o[t+1]?(n-o[t+1])*r:0,o[t+2]+=n!==o[t+2]?(n-o[t+2])*r:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Blur=i(n.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var n,i,r=e.filterBackend.resources,o=e.imageData.width,s=e.imageData.height;r.blurLayer1||(r.blurLayer1=t.util.createCanvasElement(),r.blurLayer2=t.util.createCanvasElement()),n=r.blurLayer1,i=r.blurLayer2,n.width===o&&n.height===s||(i.width=n.width=o,i.height=n.height=s);var a,l,c,u,h=n.getContext("2d"),d=i.getContext("2d"),f=15,p=.06*this.blur*.5;for(h.putImageData(e.imageData,0,0),d.clearRect(0,0,o,s),u=-15;u<=f;u++)c=p*(l=u/f)*o+(a=(Math.random()-.5)/4),d.globalAlpha=1-Math.abs(l),d.drawImage(n,c,a),h.drawImage(i,0,0),d.globalAlpha=1,d.clearRect(0,0,i.width,i.height);for(u=-15;u<=f;u++)c=p*(l=u/f)*s+(a=(Math.random()-.5)/4),d.globalAlpha=1-Math.abs(l),d.drawImage(n,a,c),h.drawImage(i,0,0),d.globalAlpha=1,d.clearRect(0,0,i.width,i.height);e.ctx.drawImage(n,0,0);var g=e.ctx.getImageData(0,0,n.width,n.height);return h.globalAlpha=1,h.clearRect(0,0,n.width,n.height),g},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var n=this.chooseRightDelta();e.uniform2fv(t.delta,n)},chooseRightDelta:function(){var e,t=1,n=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?n[0]=e:n[1]=e,n}}),n.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Gamma=i(n.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],n.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,n=e.imageData.data,i=this.gamma,r=n.length,o=1/i[0],s=1/i[1],a=1/i[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,r=256;t<r;t++)this.rVals[t]=255*Math.pow(t/255,o),this.gVals[t]=255*Math.pow(t/255,s),this.bVals[t]=255*Math.pow(t/255,a);for(t=0,r=n.length;t<r;t+=4)n[t]=this.rVals[n[t]],n[t+1]=this.gVals[n[t+1]],n[t+2]=this.bVals[n[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.Composed=i(n.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach((function(t){t.applyTo(e)}))},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map((function(e){return e.toObject()}))})},isNeutralState:function(){return!this.subFilters.some((function(e){return!e.isNeutralState()}))}}),t.Image.filters.Composed.fromObject=function(e,n){var i=(e.subFilters||[]).map((function(e){return new t.Image.filters[e.type](e)})),r=new t.Image.filters.Composed({subFilters:i});return n&&n(r),r}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,i=t.util.createClass;n.HueRotation=i(n.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,n=t.util.cos(e),i=t.util.sin(e),r=1/3,o=Math.sqrt(r)*i,s=1-n;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=n+s/3,this.matrix[1]=r*s-o,this.matrix[2]=r*s+o,this.matrix[5]=r*s+o,this.matrix[6]=n+r*s,this.matrix[7]=r*s-o,this.matrix[10]=r*s-o,this.matrix[11]=r*s+o,this.matrix[12]=n+r*s},isNeutralState:function(e){return this.calculateMatrix(),n.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),n.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var i="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:t.Object.prototype.stateProperties.concat(i),cacheProperties:t.Object.prototype.cacheProperties.concat(i),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,n,i,r,o,s,a=0,l=this._textLines.length;a<l;a++)if(("justify"===this.textAlign||a!==l-1&&!this.isEndOfWrapping(a))&&(i=0,r=this._textLines[a],(t=this.getLineWidth(a))<this.width&&(s=this.textLines[a].match(this._reSpacesAndTabs)))){n=s.length,e=(this.width-t)/n;for(var c=0,u=r.length;c<=u;c++)o=this.__charBounds[a][c],this._reSpaceAndTab.test(r[c])?(o.width+=e,o.kernedWidth+=e,o.left+=i,i+=e):o.left+=i}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,n){e.textBaseline="alphabetic",e.font=this._getFontDeclaration(t,n)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,n=this._textLines.length;t<n;t++){var i=this.getLineWidth(t);i>e&&(e=i)}return e},_renderTextLine:function(e,t,n,i,r,o){this._renderChars(e,t,n,i,r,o)}
vendor: 4,275 bytes, line 2
2,_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,n,i,r,o,s,a,l=e.fillStyle,c=this._getLeftOffset(),u=this._getTopOffset(),h=0,d=0,f=this.path,p=0,g=this._textLines.length;p<g;p++)if(t=this.getHeightOfLine(p),this.textBackgroundColor||this.styleHas("textBackgroundColor",p)){i=this._textLines[p],n=this._getLineLeftOffset(p),d=0,h=0,r=this.getValueOfPropertyAt(p,0,"textBackgroundColor");for(var m=0,v=i.length;m<v;m++)o=this.__charBounds[p][m],s=this.getValueOfPropertyAt(p,m,"textBackgroundColor"),f?(e.save(),e.translate(o.renderLeft,o.renderTop),e.rotate(o.angle),e.fillStyle=s,s&&e.fillRect(-o.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),o.width,t/this.lineHeight),e.restore()):s!==r?(a=c+n+h,"rtl"===this.direction&&(a=this.width-a-d),e.fillStyle=r,r&&e.fillRect(a,u,d,t/this.lineHeight),h=o.left,d=o.width,r=s):d+=o.kernedWidth;s&&!f&&(a=c+n+h,"rtl"===this.direction&&(a=this.width-a-d),e.fillStyle=s,e.fillRect(a,u,d,t/this.lineHeight)),u+=t}else u+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var n=e.fontFamily.toLowerCase();t.charWidthsCache[n]||(t.charWidthsCache[n]={});var i=t.charWidthsCache[n],r=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return i[r]||(i[r]={}),i[r]},_measureChar:function(e,t,n,i){var r,o,s,a,l=this.getFontCache(t),c=n+e,u=this._getFontDeclaration(t)===this._getFontDeclaration(i),h=t.fontSize/this.CACHE_FONT_SIZE;if(n&&void 0!==l[n]&&(s=l[n]),void 0!==l[e]&&(a=r=l[e]),u&&void 0!==l[c]&&(a=(o=l[c])-s),void 0===r||void 0===s||void 0===o){var d=this.getMeasuringContext();this._setTextStyles(d,t,!0)}return void 0===r&&(a=r=d.measureText(e).width,l[e]=r),void 0===s&&u&&n&&(s=d.measureText(n).width,l[n]=s),u&&void 0===o&&(o=d.measureText(c).width,l[c]=o,a=o-s),{width:r*h,kernedWidth:a*h}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var n,i,r,o,s,a,l=0,c=this._textLines[e],u=new Array(c.length),h=0,d=this.path,f="right"===this.pathSide;for(this.__charBounds[e]=u,n=0;n<c.length;n++)i=c[n],o=this._getGraphemeBox(i,e,n,r),u[n]=o,l+=o.kernedWidth,r=i;if(u[n]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},d){switch(a=d.segmentsInfo[d.segmentsInfo.length-1].length,(s=t.util.getPointOnPath(d.path,0,d.segmentsInfo)).x+=d.pathOffset.x,s.y+=d.pathOffset.y,this.textAlign){case"left":h=f?a-l:0;break;case"center":h=(a-l)/2;break;case"right":h=f?0:a-l}for(h+=this.pathStartOffset*(f?-1:1),n=f?c.length-1:0;f?n>=0:n<c.length;f?n--:n++)o=u[n],h>a?h%=a:h<0&&(h+=a),this._setGraphemeOnPath(h,o,s),h+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,n,i){var r=e+n.kernedWidth/2,o=this.path,s=t.util.getPointOnPath(o.path,r,o.segmentsInfo);n.renderLeft=s.x-i.x,n.renderTop=s.y-i.y,n.angle=s.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,n,i,r){var o,s=this.getCompleteStyleDeclaration(t,n),a=i?this.getCompleteStyleDeclaration(t,n-1):{},l=this._measureChar(e,s,i,a),c=l.kernedWidth,u=l.width;0!==this.charSpacing&&(u+=o=this._getWidthOfCharSpacing(),c+=o);var h={width:u,left:0,height:s.fontSize,kernedWidth:c,deltaY:s.deltaY};if(n>0&&!r){var d=this.__charBounds[t][n-1];h.left=d.left+d.width+l.kernedWidth-l.width}return h},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],n=this.getHeightOfChar(e,0),i=1,r=t.length;i<r;i++)n=Math.max(this.getHeightOfChar(e,i),n);return this.__lineHeights[e]=n*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,n=0,i=this._textLines.length;n<i;n++)e=this.getHeightOfLine(n),t+=n===i-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var n=0,i=this._getLeftOffset(),r=this._getTopOffset(),o=0,s=this._textLines.length;o<s;o++){var a=this.getHeightOfLine(o),l=a/this.lineHeight,c=this._getLineLeftOffset(o);this._renderTextLine(t,e,this._textLines[o],i+c,r+n+l,o),n+=a}
vendor: 11,843 bytes, line 2
2e.restore()},_renderTextFill:function(e){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,t,n,i,r,o){var s,a,l,c,u,h=this.getHeightOfLine(o),d=-1!==this.textAlign.indexOf("justify"),f="",p=0,g=this.path,m=!d&&0===this.charSpacing&&this.isEmptyStyles(o)&&!g,v="ltr"===this.direction,y="ltr"===this.direction?1:-1;if(t.save(),r-=h*this._fontSizeFraction/this.lineHeight,m)return t.canvas.setAttribute("dir",v?"ltr":"rtl"),t.direction=v?"ltr":"rtl",t.textAlign=v?"left":"right",this._renderChar(e,t,o,0,n.join(""),i,r,h),void t.restore();for(var _=0,b=n.length-1;_<=b;_++)c=_===b||this.charSpacing||g,f+=n[_],l=this.__charBounds[o][_],0===p?(i+=y*(l.kernedWidth-l.width),p+=l.width):p+=l.kernedWidth,d&&!c&&this._reSpaceAndTab.test(n[_])&&(c=!0),c||(s=s||this.getCompleteStyleDeclaration(o,_),a=this.getCompleteStyleDeclaration(o,_+1),c=this._hasStyleChanged(s,a)),c&&(g?(t.save(),t.translate(l.renderLeft,l.renderTop),t.rotate(l.angle),this._renderChar(e,t,o,_,f,-p/2,0,h),t.restore()):(u=i,t.canvas.setAttribute("dir",v?"ltr":"rtl"),t.direction=v?"ltr":"rtl",t.textAlign=v?"left":"right",this._renderChar(e,t,o,_,f,u,r,h)),f="",s=a,i+=y*p,p=0);t.restore()},_applyPatternGradientTransformText:function(e){var n,i=t.util.createCanvasElement(),r=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return i.width=r,i.height=o,(n=i.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(r,0),n.lineTo(r,o),n.lineTo(0,o),n.closePath(),n.translate(r/2,o/2),n.fillStyle=e.toLive(n),this._applyPatternGradientTransform(n,e),n.fill(),n.createPattern(i,"no-repeat")},handleFiller:function(e,t,n){var i,r;return n.toLive?"percentage"===n.gradientUnits||n.gradientTransform||n.patternTransform?(i=-this.width/2,r=-this.height/2,e.translate(i,r),e[t]=this._applyPatternGradientTransformText(n),{offsetX:i,offsetY:r}):(e[t]=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):(e[t]=n,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,n,i,r,o,s){var a,l,c=this._getStyleDeclaration(n,i),u=this.getCompleteStyleDeclaration(n,i),h="fillText"===e&&u.fill,d="strokeText"===e&&u.stroke&&u.strokeWidth;(d||h)&&(t.save(),h&&(a=this._setFillStyles(t,u)),d&&(l=this._setStrokeStyles(t,u)),t.font=this._getFontDeclaration(u),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(s+=c.deltaY),h&&t.fillText(r,o-a.offsetX,s-a.offsetY),d&&t.strokeText(r,o-l.offsetX,s-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,n){var i=this.get2DCursorLocation(e,!0),r=this.getValueOfPropertyAt(i.lineIndex,i.charIndex,"fontSize"),o=this.getValueOfPropertyAt(i.lineIndex,i.charIndex,"deltaY"),s={fontSize:r*n.size,deltaY:o+r*n.baseline};return this.setSelectionStyles(s,e,t),this},_hasStyleChanged:function(e,t){return e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.deltaY!==t.deltaY},_hasStyleChangedForSvg:function(e,t){return this._hasStyleChanged(e,t)||e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),n=this.width-t,i=this.textAlign,r=this.direction,o=0,s=this.isEndOfWrapping(e);return"justify"===i||"justify-center"===i&&!s||"justify-right"===i&&!s||"justify-left"===i&&!s?0:("center"===i&&(o=n/2),"right"===i&&(o=n),"justify-center"===i&&(o=n/2),"justify-right"===i&&(o=n),"rtl"===r&&(o-=n),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){return this.__lineWidths[e]?this.__lineWidths[e]:(t=""===this._textLines[e]?0:this.measureLine(e).width,this.__lineWidths[e]=t,t);var t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,n){var i=this._getStyleDeclaration(e,t);return i&&void 0!==i[n]?i[n]:this[n]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var n,i,r,o,s,a,l,c,u,h,d,f,p,g,m,v,y=this._getLeftOffset(),_=this._getTopOffset(),b=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[t],j=0,w=this._textLines.length;j<w;j++)if(n=this.getHeightOfLine(j),this[t]||this.styleHas(t,j)){l=this._textLines[j],g=n/this.lineHeight,o=this._getLineLeftOffset(j),h=0,d=0,c=this.getValueOfPropertyAt(j,0,t),v=this.getValueOfPropertyAt(j,0,"fill"),u=_+g*(1-this._fontSizeFraction),i=this.getHeightOfChar(j,0),s=this.getValueOfPropertyAt(j,0,"deltaY");for(var S=0,k=l.length;S<k;S++)if(f=this.__charBounds[j][S],p=this.getValueOfPropertyAt(j,S,t),m=this.getValueOfPropertyAt(j,S,"fill"),r=this.getHeightOfChar(j,S),a=this.getValueOfPropertyAt(j,S,"deltaY"),b&&p&&m)e.save(),e.fillStyle=v,e.translate(f.renderLeft,f.renderTop),e.rotate(f.angle),e.fillRect(-f.kernedWidth/2,C*r+a,f.kernedWidth,this.fontSize/15),e.restore();else if((p!==c||m!==v||r!==i||a!==s)&&d>0){var O=y+o+h;"rtl"===this.direction&&(O=this.width-O-d),c&&v&&(e.fillStyle=v,e.fillRect(O,u+C*i+s,d,this.fontSize/15)),h=f.left,d=f.width,c=p,v=m,i=r,s=a}else d+=f.kernedWidth;O=y+o+h;"rtl"===this.direction&&(O=this.width-O-d),e.fillStyle=m,p&&m&&e.fillRect(O,u+C*i+s,d-x,this.fontSize/15),_+=n}else _+=n;this._removeShadow(e)}},_getFontDeclaration:function(e,n){var i=e||this,r=this.fontFamily,o=t.Text.genericFonts.indexOf(r.toLowerCase())>-1,s=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||o?i.fontFamily:'"'+i.fontFamily+'"';return[t.isLikelyNode?i.fontWeight:i.fontStyle,t.isLikelyNode?i.fontStyle:i.fontWeight,n?this.CACHE_FONT_SIZE+"px":i.fontSize+"px",s].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var n=e.split(this._reNewline),i=new Array(n.length),r=["\n"],o=[],s=0;s<n.length;s++)i[s]=t.util.string.graphemeSplit(n[s]),o=o.concat(i[s],r);return o.pop(),{_unwrappedLines:i,lines:n,graphemeText:o,graphemeLines:i}},toObject:function(e){var t=i.concat(e),r=this.callSuper("toObject",t);return r.styles=n(this.styles,!0),r.path&&(r.path=this.path.toObject()),r},set:function(e,t){this.callSuper("set",e,t);var n=!1,i=!1;if("object"==typeof e)for(var r in e)"path"===r&&this.setPathInfo(),n=n||-1!==this._dimensionAffectingProps.indexOf(r),i=i||"path"===r;else n=-1!==this._dimensionAffectingProps.indexOf(e),i="path"===e;return i&&this.setPathInfo(),n&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,i,r){if(!e)return i(null);var o=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),s=o.textAnchor||"left";if((r=t.util.object.extend(r?n(r):{},o)).top=r.top||0,r.left=r.left||0,o.textDecoration){var a=o.textDecoration;-1!==a.indexOf("underline")&&(r.underline=!0),-1!==a.indexOf("overline")&&(r.overline=!0),-1!==a.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in o&&(r.left+=o.dx),"dy"in o&&(r.top+=o.dy),"fontSize"in r||(r.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=r.strokeWidth;r.strokeWidth=0;var u=new t.Text(l,r),h=u.getScaledHeight()/u.height,d=((u.height+u.strokeWidth)*u.lineHeight-u.height)*h,f=u.getScaledHeight()+d,p=0;"center"===s&&(p=u.getScaledWidth()/2),"right"===s&&(p=u.getScaledWidth()),u.set({left:u.left-p,top:u.top-(f-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:void 0!==c?c:1}),i(u)},t.Text.fromObject=function(e,i){var r=n(e),o=e.path;return delete r.path,t.Object._fromObject("Text",r,(function(e){o?t.Object._fromObject("Path",o,(function(t){e.set("path",t),i(e)}),"path"):i(e)}),"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(t),S.util.object.extend(S.Text.prototype,{isEmptyStyles:function(e){if(!this.styles)return!0;if(void 0!==e&&!this.styles[e])return!0;var t=void 0===e?this.styles:{line:this.styles[e]};for(var n in t)for(var i in t[n])for(var r in t[n][i])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e)return!1;if(void 0!==t&&!this.styles[t])return!1;var n=void 0===t?this.styles:{0:this.styles[t]};for(var i in n)for(var r in n[i])if(void 0!==n[i][r][e])return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,n,i=this.styles,r=0,o=!0,s=0;for(var a in i){for(var l in t=0,i[a]){var c;r++,(c=i[a][l]).hasOwnProperty(e)?(n?c[e]!==n&&(o=!1):n=c[e],c[e]===this[e]&&delete c[e]):o=!1,0!==Object.keys(c).length?t++:delete i[a][l]}0===t&&delete i[a]}for(var u=0;u<this._textLines.length;u++)s+=this._textLines[u].length;o&&r===s&&(this[e]=n,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,n,i,r=this.styles;for(n in r){for(i in t=r[n])delete t[i][e],0===Object.keys(t[i]).length&&delete t[i];0===Object.keys(t).length&&delete r[n]}}},_extendStyles:function(e,t){var n=this.get2DCursorLocation(e);this._getLineStyle(n.lineIndex)||this._setLineStyle(n.lineIndex),this._getStyleDeclaration(n.lineIndex,n.charIndex)||this._setStyleDeclaration(n.lineIndex,n.charIndex,{}),S.util.object.extend(this._getStyleDeclaration(n.lineIndex,n.charIndex),t)},get2DCursorLocation:function(e,t){void 0===e&&(e=this.selectionStart);for(var n=t?this._unwrappedTextLines:this._textLines,i=n.length,r=0;r<i;r++){if(e<=n[r].length)return{lineIndex:r,charIndex:e};e-=n[r].length+this.missingNewlineOffset(r)}return{lineIndex:r-1,charIndex:n[r-1].length<e?n[r-1].length:e}},getSelectionStyles:function(e,t,n){void 0===e&&(e=this.selectionStart||0),void 0===t&&(t=this.selectionEnd||e);for(var i=[],r=e;r<t;r++)i.push(this.getStyleAtPosition(r,n));return i},getStyleAtPosition:function(e,t){var n=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(n.lineIndex,n.charIndex):this._getStyleDeclaration(n.lineIndex,n.charIndex))||{}},setSelectionStyles:function(e,t,n){void 0===t&&(t=this.selectionStart||0),void 0===n&&(n=this.selectionEnd||t);for(var i=t;i<n;i++)this._extendStyles(i,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var n=this.styles&&this.styles[e];return n?n[t]:null},getCompleteStyleDeclaration:function(e,t){for(var n,i=this._getStyleDeclaration(e,t)||{},r={},o=0;o<this._styleProperties.length;o++)r[n=this._styleProperties[o]]=void 0===i[n]?this[n]:i[n];return r},_setStyleDeclaration:function(e,t,n){this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]}
vendor: 9,619 bytes, line 2
2,_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}S.IText=S.util.createClass(S.Text,S.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,n=this.canvas.viewportTransform;t.save(),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,n=this.height+4;e.clearRect(-t/2,-n/2,t,n)},_getCursorBoundaries:function(e){void 0===e&&(e=this.selectionStart);var t=this._getLeftOffset(),n=this._getTopOffset(),i=this._getCursorBoundariesOffsets(e);return{left:t,top:n,leftOffset:i.left,topOffset:i.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,n,i,r,o=0,s=0,a=this.get2DCursorLocation(e);i=a.charIndex,n=a.lineIndex;for(var l=0;l<n;l++)o+=this.getHeightOfLine(l);t=this._getLineLeftOffset(n);var c=this.__charBounds[n][i];return c&&(s=c.left),0!==this.charSpacing&&i===this._textLines[n].length&&(s-=this._getWidthOfCharSpacing()),r={top:o,left:t+(s>0?s:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(e,t){var n=this.get2DCursorLocation(),i=n.lineIndex,r=n.charIndex>0?n.charIndex-1:0,o=this.getValueOfPropertyAt(i,r,"fontSize"),s=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/s,l=e.topOffset,c=this.getValueOfPropertyAt(i,r,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(i)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(i,r,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-a/2,l+e.top+c,a,o)},renderSelection:function(e,t){for(var n=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,i=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(n),s=this.get2DCursorLocation(i),a=o.lineIndex,l=s.lineIndex,c=o.charIndex<0?0:o.charIndex,u=s.charIndex<0?0:s.charIndex,h=a;h<=l;h++){var d,f=this._getLineLeftOffset(h)||0,p=this.getHeightOfLine(h),g=0,m=0;if(h===a&&(g=this.__charBounds[a][c].left),h>=a&&h<l)m=r&&!this.isEndOfWrapping(h)?this.width:this.getLineWidth(h)||5;else if(h===l)if(0===u)m=this.__charBounds[l][u].left;else{var v=this._getWidthOfCharSpacing();m=this.__charBounds[l][u-1].left+this.__charBounds[l][u-1].width-v}d=p,(this.lineHeight<1||h===l&&this.lineHeight>1)&&(p/=this.lineHeight);var y=e.left+f+g,_=m-g,b=p,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",b=1,x=p):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-_),t.fillRect(y,e.top+e.topOffset+x,_,b),e.topOffset+=d}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),S.IText.fromObject=function(t,n){if(e(t),t.styles)for(var i in t.styles)for(var r in t.styles[i])e(t.styles[i][r]);S.Object._fromObject("IText",t,n,"text")}}(),C=S.util.object.clone,S.util.object.extend(S.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",(function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))}))},initRemovedHandler:function(){var e=this;this.on("removed",(function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],S.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t)))}))},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.__isMousedown=!1}))},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,n,i){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:n,onComplete:function(){r.isAborted||e[i]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(e){var t=this,n=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){t._tick()}),n)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,n=e-1;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n--;for(;/\S/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findWordBoundaryRight:function(e){var t=0,n=e;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n++;for(;/\S/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,n=e-1;!/\n/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findLineBoundaryRight:function(e){for(var t=0,n=e;!/\n/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},searchWordBoundary:function(e,t){for(var n=this._text,i=this._reSpace.test(n[e])?e-1:e,r=n[i],o=S.reNonWord;!o.test(r)&&i>0&&i<n.length;)r=n[i+=t];return o.test(r)&&(i+=1===t?0:1),i},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),n=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),n=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEac
vendor: 11,479 bytes, line 2
2h((function(e){e.selected=!1,e.isEditing&&e.exitEditing()}))},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){var t=this.getSelectionStartFromPointer(e.e),n=this.selectionStart,i=this.selectionEnd;(t===this.__selectionStartOnMouseDown&&n!==i||n!==t&&i!==t)&&(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===n&&this.selectionEnd===i||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,t,n){var i=n.slice(0,e),r=S.util.string.graphemeSplit(i).length;if(e===t)return{selectionStart:r,selectionEnd:r};var o=n.slice(e,t);return{selectionStart:r,selectionEnd:r+S.util.string.graphemeSplit(o).length}},fromGraphemeToStringSelection:function(e,t,n){var i=n.slice(0,e).join("").length;return e===t?{selectionStart:i,selectionEnd:i}:{selectionStart:i,selectionEnd:i+n.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,t=this._getCursorBoundaries(e),n=this.get2DCursorLocation(e),i=n.lineIndex,r=n.charIndex,o=this.getValueOfPropertyAt(i,r,"fontSize")*this.lineHeight,s=t.leftOffset,a=this.calcTransformMatrix(),l={x:t.left+s,y:t.top+t.topOffset+o},c=this.canvas.getRetinaScaling(),u=this.canvas.upperCanvasEl,h=u.width/c,d=u.height/c,f=h-o,p=d-o,g=u.clientWidth/h,m=u.clientHeight/d;return l=S.util.transformPoint(l,a),(l=S.util.transformPoint(l,this.canvas.viewportTransform)).x*=g,l.y*=m,l.x<0&&(l.x=0),l.x>f&&(l.x=f),l.y<0&&(l.y=0),l.y>p&&(l.y=p),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:o+"px",charHeight:o}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var n,i,r=this.get2DCursorLocation(e,!0),o=this.get2DCursorLocation(t,!0),s=r.lineIndex,a=r.charIndex,l=o.lineIndex,c=o.charIndex;if(s!==l){if(this.styles[s])for(n=a;n<this._unwrappedTextLines[s].length;n++)delete this.styles[s][n];if(this.styles[l])for(n=c;n<this._unwrappedTextLines[l].length;n++)(i=this.styles[l][n])&&(this.styles[s]||(this.styles[s]={}),this.styles[s][a+n-c]=i);for(n=s+1;n<=l;n++)delete this.styles[n];this.shiftLineStyles(l,s-l)}else if(this.styles[s]){i=this.styles[s];var u,h,d=c-a;for(n=a;n<c;n++)delete i[n];for(h in this.styles[s])(u=parseInt(h,10))>=c&&(i[u-d]=i[h],delete i[h])}},shiftLineStyles:function(e,t){var n=C(this.styles);for(var i in this.styles){var r=parseInt(i,10);r>e&&(this.styles[r+t]=n[r],n[r-t]||delete this.styles[r])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(e,t,n,i){var r,o={},s=!1,a=this._unwrappedTextLines[e].length===t;for(var l in n||(n=1),this.shiftLineStyles(e,n),this.styles[e]&&(r=this.styles[e][0===t?t:t-1]),this.styles[e]){var c=parseInt(l,10);c>=t&&(s=!0,o[c-t]=this.styles[e][l],a&&0===t||delete this.styles[e][l])}var u=!1;for(s&&!a&&(this.styles[e+n]=o,u=!0),u&&n--;n>0;)i&&i[n-1]?this.styles[e+n]={0:C(i[n-1])}:r?this.styles[e+n]={0:C(r)}:delete this.styles[e+n],n--;this._forceClearCache=!0},insertCharStyleObject:function(e,t,n,i){this.styles||(this.styles={});var r=this.styles[e],o=r?C(r):{};for(var s in n||(n=1),o){var a=parseInt(s,10);a>=t&&(r[a+n]=o[a],o[a-n]||delete r[a])}if(this._forceClearCache=!0,i)for(;n--;)Object.keys(i[n]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][t+n]=C(i[n]));else if(r)for(var l=r[t?t-1:1];l&&n--;)this.styles[e][t+n]=C(l)},insertNewStyleBlock:function(e,t,n){for(var i=this.get2DCursorLocation(t,!0),r=[0],o=0,s=0;s<e.length;s++)"\n"===e[s]?r[++o]=0:r[o]++;for(r[0]>0&&(this.insertCharStyleObject(i.lineIndex,i.charIndex,r[0],n),n=n&&n.slice(r[0]+1)),o&&this.insertNewlineStyleObject(i.lineIndex,i.charIndex+r[0],o),s=1;s<o;s++)r[s]>0?this.insertCharStyleObject(i.lineIndex+s,0,r[s],n):n&&(this.styles[i.lineIndex+s][0]=n[0]),n=n&&n.slice(r[s]+1);r[s]>0&&this.insertCharStyleObject(i.lineIndex+s,0,r[s],n)},setSelectionStartEndWithShift:function(e,t,n){n<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=n):n>e&&n<t?"right"===this._selectionDirection?this.selectionEnd=n:this.selectionStart=n:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=n)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}}),S.util.object.extend(S.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),n=this.selectionStart,i=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(n,i,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,n=this.getLocalPointer(e),i=0,r=0,o=0,s=0,a=0,l=0,c=this._textLines.length;l<c&&o<=n.y;l++)o+=this.getHeightOfLine(l)*this.scaleY,a=l,l>0&&(s+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));r=this._getLineLeftOffset(a)*this.scaleX,t=this._textLines[a],"rtl"===this.direction&&(n.x=this.width*this.scaleX-n.x+r);for(var u=0,h=t.length;u<h&&(i=r,(r+=this.__charBounds[a][u].kernedWidth*this.scaleX)<=n.x);u++)s++;return this._getNewSelectionStartFromOffset(n,i,r,s,h)},_getNewSelectionStartFromOffset:function(e,t,n,i,r){var o=e.x-t,s=n-e.x,a=i+(s>o||s<0?0:1);return this.flipX&&(a=r-a),a>this._text.length&&(a=this._text.length),a}}),S.util.object.extend(S.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=S.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","fal
2se"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingï½°top: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):S.document.body.appendChild(this.hiddenTextarea),S.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),S.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),S.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),S.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),S.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),S.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(S.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var t=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var n,i,r,o,s,a=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,c=a.length,u=c-l,h=this.selectionStart,d=this.selectionEnd,f=h!==d;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),g=h>p.selectionStart;f?(n=this._text.slice(h,d),u+=d-h):c<l&&(n=g?this._text.slice(d+u,d):this._text.slice(h,h-u)),i=a.slice(p.selectionEnd-u,p.selectionEnd),n&&n.length&&(i.length&&(r=this.getSelectionStyles(h,h+1,!1),r=i.map((function(){return r[0]}))),f?(o=h,s=d):g?(o=d-n.length,s=d):(o=d,s=d+n.length),this.removeStyleFromTo(o,s)),i.length&&(t&&i.join("")===S.copiedText&&!S.disableStyleCopyPaste&&(r=S.copiedTextStyle),this.insertNewStyleBlock(i,h,r)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(S.copiedText=this.getSelectedText(),S.disableStyleCopyPaste?S.copiedTextStyle=null:S.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||S.window.clipboardData},_getWidthBeforeCursor:function(e,t){var n,i=this._getLineLeftOffset(e);return t>0&&(i+=(n=this.__charBounds[e][t-1]).left+n.width),i},getDownCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),i=this.get2DCursorLocation(n),r=i.lineIndex;if(r===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-n;var o=i.charIndex,s=this._getWidthBeforeCursor(r,o),a=this._getIndexOnLine(r+1,s);return this._textLines[r].slice(o).length+a+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),i=this.get2DCursorLocation(n),r=i.lineIndex;if(0===r||e.metaKey||33===e.keyCode)return-n;var o=i.charIndex,s=this._getWidthBeforeCursor(r,o),a=this._getIndexOnLine(r-1,s),l=this._textLines[r].slice(0,o),c=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+a-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var n,i,r=this._textLines[e],o=this._getLineLeftOffset(e),s=0,a=0,l=r.length;a<l;a++)if((o+=n=this.__charBounds[e][a].width)>t){i=!0;var c=o-n,u=o,h=Math.abs(c-t);s=Math.abs(u-t)<h?a:a-1;break}
vendor: 12,106 bytes, line 2
2return i||(s=r.length-1),s},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var n=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),0!==n&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,n){var i;if(e.altKey)i=this["findWordBoundary"+n](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===n?-1:1,!0;i=this["findLineBoundary"+n](this[t])}if(void 0!==typeof i&&this[t]!==i)return this[t]=i,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var n="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?n+="Shift":n+="outShift",this[n](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){void 0===t&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,t,n,i){void 0===i&&(i=n),i>n&&this.removeStyleFromTo(n,i);var r=S.util.string.graphemeSplit(e);this.insertNewStyleBlock(r,n,t),this._text=[].concat(this._text.slice(0,n),r,this._text.slice(i)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),j=S.util.toFixed,w=/  +/g,S.util.object.extend(S.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var n,i=[],r=[],o=e;this._setSVGBg(r);for(var s=0,a=this._textLines.length;s<a;s++)n=this._getLineLeftOffset(s),(this.textBackgroundColor||this.styleHas("textBackgroundColor",s))&&this._setSVGTextLineBg(r,s,t+n,o),this._setSVGTextLineText(i,s,t+n,o),o+=this.getHeightOfLine(s);return{textSpans:i,textBgRects:r}},_createTextCharSpan:function(e,t,n,i){var r=e!==e.trim()||e.match(w),o=this.getSvgSpanStyles(t,r),s=o?'style="'+o+'"':"",a=t.deltaY,l="",c=S.Object.NUM_FRACTION_DIGITS;return a&&(l=' dy="'+j(a,c)+'" '),['<tspan x="',j(n,c),'" y="',j(i,c),'" ',l,s,">",S.util.string.escapeXml(e),"</tspan>"].join("")},_setSVGTextLineText:function(e,t,n,i){var r,o,s,a,l,c=this.getHeightOfLine(t),u=-1!==this.textAlign.indexOf("justify"),h="",d=0,f=this._textLines[t];i+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var p=0,g=f.length-1;p<=g;p++)l=p===g||this.charSpacing,h+=f[p],s=this.__charBounds[t][p],0===d?(n+=s.kernedWidth-s.width,d+=s.width):d+=s.kernedWidth,u&&!l&&this._reSpaceAndTab.test(f[p])&&(l=!0),l||(r=r||this.getCompleteStyleDeclaration(t,p),o=this.getCompleteStyleDeclaration(t,p+1),l=this._hasStyleChangedForSvg(r,o)),l&&(a=this._getStyleDeclaration(t,p)||{},e.push(this._createTextCharSpan(h,a,n,i)),h="",r=o,n+=d,d=0)},_pushTextBgRect:function(e,t,n,i,r,o){var s=S.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(t),' x="',j(n,s),'" y="',j(i,s),'" width="',j(r,s),'" height="',j(o,s),'"></rect>\n')},_setSVGTextLineBg:function(e,t,n,i){for(var r,o,s=this._textLines[t],a=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,u=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),h=0,d=s.length;h<d;h++)r=this.__charBounds[t][h],(o=this.getValueOfPropertyAt(t,h,"textBackgroundColor"))!==u?(u&&this._pushTextBgRect(e,u,n+c,i,l,a),c=r.left,l=r.width,u=o):l+=r.kernedWidth;o&&this._pushTextBgRect(e,o,n+c,i,l,a)},_getFillAttributes:function(e){var t=e&&"string"==typeof e?new S.Color(e):"";return t&&t.getSource()&&1!==t.getAlpha()?'opacity="'+t.getAlpha()+'" fill="'+t.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,n=0,i=0;i<e;i++)n+=this.getHeightOfLine(i);return t=this.getHeightOfLine(i),{lineTop:n,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return S.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}}),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,n=0,i=0,r={},o=0;o<e.graphemeLines.length;o++)"\n"===e.graphemeText[i]&&o>0?(n=0,i++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[i])&&o>0&&(n++,i++),r[o]={line:t,offset:n},i+=e.graphemeLines[o].length,n+=e.graphemeLines[o].length;return r},styleHas:function(e,n){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[n];i&&(n=i.line)}return t.Text.prototype.styleHas.call(this,e,n)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,n,i=0,r=!1,o=this._styleMap[e],s=this._styleMap[e+1];for(var a in o&&(e=o.line,i=o.offset),s&&(r=s.line===e,t=s.offset),n=void 0===e?this.styles:{line:this.styles[e]})for(var l in n[a])if(l>=i&&(!r||l<t))for(var c in n[a][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[e];if(!n)return null;e=n.line,t=n.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,n){var i=this._styleMap[e];e=i.line,t=i.offset+t,this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){var n=this._styleMap[e];e=n.line,t=n.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var n,i=[];for(this.isWrapping=!0,n=0;n<e.length;n++)i=i.concat(this._wrapLine(e[n],n,t));return this.isWrapping=!1,i},_measureWord:function(e,t,n){var i,r=0;n=n||0;for(var o=0,s=e.length;o<s;o++){r+=this._getGraphemeBox(e[o],t,o+n,i,true).kernedWidth,i=e[o]}return r},_wrapLine:function(e,n,i,r){var o=0,s=this.splitByGrapheme,a=[],l=[],c=s?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),u="",h=0,d=s?"":" ",f=0,p=0,g=0,m=!0,v=this._getWidthOfCharSpacing();r=r||0;0===c.length&&c.push([]),i-=r;for(var y=0;y<c.length;y++)u=s?c[y]:t.util.string.graphemeSplit(c[y]),f=this._measureWord(u,n,h),h+=u.length,(o+=p+f-v)>i&&!m?(a.push(l),l=[],o=f,m=!0):o+=v,m||s||l.push(d),l=l.concat(u),p=s?0:this._measureWord([d],n,h),h++,m=!1,f>g&&(g=f);return y&&a.push(l),g+r>this.dynamicMinWidth&&(this.dynamicMinWidth=g-v+r),a},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var n=t.Text.prototype._splitTextIntoLines.call(this,e),i=this._wrapText(n.lines,this.width),r=new Array(i.length),o=0;o<i.length;o++)r[o]=i[o].join("");return n.lines=r,n.graphemeLines=i,n},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,n){return t.Object._fromObject("Textbox",e,n,"text")}}(t),function(){var e=S.controlsUtils,t=e.scaleSkewCursorStyleHandler,n=e.scaleCursorStyleHandler,i=e.scalingEqually,r=e.scalingYOrSkewingX,o=e.scalingXOrSkewingY,s=e.scaleOrSkewActionName,a=S.Object.prototype.controls;if(a.ml=new S.Control({x:-.5,y:0,cursorStyleHandler:t,actionHandler:o,getActionName:s}),a.mr=new S.Control({x:.5,y:0,cursorStyleHandler:t,actionHandler:o,getActionName:s}),a.mb=new S.Control({x:0,y:.5,cursorStyleHandler:t,actionHandler:r,getActionName:s}),a.mt=new S.Control({x:0,y:-.5,cursorStyleHandler:t,actionHandler:r,getActionName:s}),a.tl=new S.Control({x:-.5,y:-.5,cursorStyleHandler:n,actionHandler:i}),a.tr=new S.Control({x:.5,y:-.5,cursorStyleHandler:n,actionHandler:i}),a.bl=new S.Control({x:-.5,y:.5,cursorStyleHandler:n,actionHandler:i}),a.br=new S.Control({x:.5,y:.5,cursorStyleHandler:n,actionHandler:i}),a.mtr=new S.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),S.Textbox){var l=S.Textbox.prototype.controls={};l.mtr=a.mtr,l.tr=a.tr,l.br=a.br,l.tl=a.tl,l.bl=a.bl,l.mt=a.mt,l.mb=a.mb,l.mr=new S.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"}),l.ml=new S.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"})}}()},68738:function(e){var t;t=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={exports:{},id:i,loaded:!1};
2return e[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=e,n.c=t,n.p="dist",n(0)}([function(e,t,n){"use strict";var i={},r=n(1),o=r.extend;o(i,r),o(i,n(3)),o(i,n(2)),o(i,n(4)),o(i,n(5)),o(i,n(6)),o(i,n(7)),o(i,n(8)),o(i,n(9)),i.browser=n(10),i.popup=n(11),i.formatDate=n(12),i.defineClass=n(13),i.defineModule=n(14),i.defineNamespace=n(15),i.CustomEvents=n(16),i.Enum=n(17),i.ExMap=n(18),i.HashMap=n(20),i.Map=n(19),e.exports=i},function(e,t,n){"use strict";var i=n(2),r=n(3),o=0;function s(e,t){var n,o=[],a=[];if(isNaN(e)&&isNaN(t)&&i.isNumber(e)&&i.isNumber(t))return!0;if(e===t)return!0;if(i.isFunction(e)&&i.isFunction(t)||e instanceof Date&&t instanceof Date||e instanceof RegExp&&t instanceof RegExp||e instanceof String&&t instanceof String||e instanceof Number&&t instanceof Number)return e.toString()===t.toString();if(!(e instanceof Object&&t instanceof Object))return!1;if(e.isPrototypeOf(t)||t.isPrototypeOf(e)||e.constructor!==t.constructor||e.prototype!==t.prototype)return!1;if(r.inArray(e,o)>-1||r.inArray(t,a)>-1)return!1;for(n in t){if(t.hasOwnProperty(n)!==e.hasOwnProperty(n))return!1;if(typeof t[n]!=typeof e[n])return!1}for(n in e){if(t.hasOwnProperty(n)!==e.hasOwnProperty(n))return!1;if(typeof t[n]!=typeof e[n])return!1;if("object"==typeof e[n]||"function"==typeof e[n]){if(o.push(e),a.push(t),!s(e[n],t[n]))return!1;o.pop(),a.pop()}else if(e[n]!==t[n])return!1}return!0}function a(e,t){for(var n=arguments,r=n[0],o=1,s=n.length;o<s;o+=1){if(i.isUndefined(r)||i.isNull(r))return;r=r[n[o]]}return r}e.exports={extend:function(e,t){var n,i,r,o,s=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;r<o;r+=1)for(i in n=arguments[r])s.call(n,i)&&(e[i]=n[i]);return e},stamp:function(e){return e.__fe_id||(o+=1,e.__fe_id=o),e.__fe_id},hasStamp:function(e){return i.isExisty(a(e,"__fe_id"))},resetLastId:function(){o=0},keys:Object.prototype.keys||function(e){var t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},compareJSON:function(e){var t=arguments.length,n=1;if(t<1)return!0;for(;n<t;n+=1)if(!s(e,arguments[n]))return!1;return!0},pick:a}},function(e,t){"use strict";var n=Object.prototype.toString;function i(e){return!r(e)&&!o(e)}function r(e){return void 0===e}function o(e){return null===e}function s(e){return i(e)&&!1!==e}function a(e){return i(e)&&("[object Arguments]"===n.call(e)||!!e.callee)}function l(e){return e instanceof Array}function c(e){return e===Object(e)}function u(e){return e instanceof Function}function h(e){return"string"==typeof e||e instanceof String}function d(e){return!(i(e)&&!function(e){return h(e)&&""===e}(e)&&(l(e)||a(e)?0!==e.length:c(e)&&!u(e)&&function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}(e)))}e.exports={isExisty:i,isUndefined:r,isNull:o,isTruthy:s,isFalsy:function(e){return!s(e)},isArguments:a,isArray:l,isArraySafe:function(e){return"[object Array]"===n.call(e)},isObject:c,isFunction:u,isFunctionSafe:function(e){return"[object Function]"===n.call(e)},isNumber:function(e){return"number"==typeof e||e instanceof Number},isNumberSafe:function(e){return"[object Number]"===n.call(e)},isDate:function(e){return e instanceof Date},isDateSafe:function(e){return"[object Date]"===n.call(e)},isString:h,isStringSafe:function(e){return"[object String]"===n.call(e)},isBoolean:function(e){return"boolean"==typeof e||e instanceof Boolean},isBooleanSafe:function(e){return"[object Boolean]"===n.call(e)},isHTMLNode:function(e){return"object"==typeof HTMLElement?e&&(e instanceof HTMLElement||!!e.nodeType):!(!e||!e.nodeType)},isHTMLTag:function(e){return"object"==typeof HTMLElement?e&&e instanceof HTMLElement:!(!e||!e.nodeType||1!==e.nodeType)},isEmpty:d,isNotEmpty:function(e){return!d(e)}}},function(e,t,n){"use strict";var i,r=n(4),o=n(2),s=Array.prototype.slice;i={inArray:function(e,t,n){var i,r;if(n=n||0,!o.isArray(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(r=t.length,i=n;n>=0&&i<r;i+=1)if(t[i]===e)return i;return-1},range:function(e,t,n){var i,r=[];for(o.isUndefined(t)&&(t=e||0,e=0),t*=i=(n=n||1)<0?-1:1;e*i<t;e+=n)r.push(e);return r},zip:function(){var e=s.call(arguments),t=[];return r.forEach(e,(function(e){r.forEach(e,(function(e,n){t[n]||(t[n]=[]),t[n].push(e)}))})),t}}
2,e.exports=i},function(e,t,n){"use strict";var i=n(2),r=n(1);function o(e,t,n){var i=0,r=e.length;for(n=n||null;i<r&&!1!==t.call(n,e[i],i,e);i+=1);}function s(e,t,n){var i;for(i in n=n||null,e)if(e.hasOwnProperty(i)&&!1===t.call(n,e[i],i,e))break}function a(e,t,n){i.isArray(e)?o(e,t,n):s(e,t,n)}function l(e,t,n){var i=[];return n=n||null,a(e,(function(){i.push(t.apply(n,arguments))})),i}e.exports={forEachOwnProperties:s,forEachArray:o,forEach:a,toArray:function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],o(e,(function(e){t.push(e)}))}return t},map:l,reduce:function(e,t,n){var o,s,a,l=0;for(n=n||null,i.isArray(e)?(s=e.length,a=e[l]):(s=(o=r.keys(e)).length,a=e[o[l+=1]]),l+=1;l<s;l+=1)a=t.call(n,a,e[o?o[l]:l]);return a},filter:function(e,t,n){var r,o;if(n=n||null,!i.isObject(e)||!i.isFunction(t))throw new Error("wrong parameter");return i.isArray(e)?(r=[],o=function(e,t){e.push(t[0])}):(r={},o=function(e,t){e[t[1]]=t[0]}),a(e,(function(){t.apply(n,arguments)&&o(r,arguments)}),n),r},pluck:function(e,t){return l(e,(function(e){return e[t]}))}}},function(e,t){"use strict";e.exports={bind:function(e,t){var n,i=Array.prototype.slice;return e.bind?e.bind.apply(e,i.call(arguments,1)):(n=i.call(arguments,2),function(){return e.apply(t,n.length?n.concat(i.call(arguments)):arguments)})}}},function(e,t){"use strict";function n(e){function t(){}return t.prototype=e,new t}e.exports={createObject:n,inherit:function(e,t){var i=n(t.prototype);i.constructor=e,e.prototype=i}}},function(e,t,n){"use strict";var i=n(4),r=n(1);e.exports={decodeHTMLEntity:function(e){var t={"&quot;":'"',"&amp;":"&","&lt;":"<","&gt;":">","&#39;":"'","&nbsp;":" "};return e.replace(/&amp;|&lt;|&gt;|&quot;|&#39;|&nbsp;/g,(function(e){return t[e]?t[e]:e}))},encodeHTMLEntity:function(e){var t={'"':"quot","&":"amp","<":"lt",">":"gt","'":"#39"};return e.replace(/[<>&"']/g,(function(e){return t[e]?"&"+t[e]+";":e}))},hasEncodableString:function(e){return/[<>&"']/.test(e)},getDuplicatedChar:function(e,t){for(var n,o=0,s=e.length,a={};o<s;o+=1)a[n=e.charAt(o)]=1;for(o=0,s=t.length;o<s;o+=1)a[n=t.charAt(o)]&&(a[n]+=1);return a=i.filter(a,(function(e){return e>1})),(a=r.keys(a).sort()).join("")}}},function(e,t){"use strict";var n={},i=Array.prototype.slice;n.timestamp=function(){return Number(new Date)},n.debounce=function(e,t){var n,r;return t=t||0,function(){r=i.call(arguments),window.clearTimeout(n),n=window.setTimeout((function(){e.apply(null,r)}),t)}},n.throttle=function(e,t){var r,o,s,a,l=!0,c=function(t){e.apply(null,t),r=null};function u(){if(a=i.call(arguments),l)return c(a),void(l=!1);s=n.timestamp(),r=r||s,o(a),s-r>=t&&c(a)}return t=t||0,o=n.debounce(c,t),u.reset=function(){l=!0,r=null},u},e.exports=n},function(e,t,n){"use strict";var i=n(1),r=n(4),o=n(2);function s(e,t){var n=r.map(i.keys(t),(function(e,n){return(0===n?"":"&")+e+"="+t[e]})).join(""),o=document.createElement("img");return o.src=e+"?"+n,o.style.display="none",document.body.appendChild(o),document.body.removeChild(o),o}e.exports={imagePing:s,sendHostname:function(e,t){var n=location.hostname,i="TOAST UI "+e+" for "+n+": Statistics",r=window.localStorage.getItem(i);(o.isUndefined(window.tui)||!1!==window.tui.usageStatistics)&&(r&&!function(e){return(new Date).getTime()-e>6048e5}(r)||(window.localStorage.setItem(i,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||s("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})}),1e3)))}}},function(e,t){"use strict";var n,i,r,o,s,a,l,c,u,h,d={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};window&&window.navigator&&(r=window.navigator,o=r.appName.replace(/\s/g,"_"),s=r.userAgent,a=/MSIE\s([0-9]+[.0-9]*)/,l=/Trident.*rv:11\./,c=/Edge\/(\d+)\./,u={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},(h={Microsoft_Internet_Explorer:function(){var e=s.match(a);e?(d.msie=!0,d.version=parseFloat(e[1])):d.others=!0},Netscape:function(){var e=!1;if(l.exec(s))d.msie=!0,d.version=11,e=!0;else if(c.exec(s))d.edge=!0,d.version=s.match(c)[1],e=!0;else for(n in u)if(u.hasOwnProperty(n)&&(i=s.match(u[n]))&&i.length>1){d[n]=e=!0,d.version=parseFloat(i[1]||0);break}e||(d.others=!0)}})[o]&&h[o]()),e.exports=d},function(e,t,n){"use strict";var i=n(4),r=n(2),o=n(5),s=n(10),a=n(1),l=0;function c(){this.openedPopup={},this.closeWithParentPopup={},this.postBridgeUrl=""}c.prototype.getPopupList=function(e){return r.isExisty(e)?this.openedPopup[e]:this.openedPopup},c.prototype.openPopup=function(e,t){var n,i,c;if((t=a.extend({popupName:"popup_"+l+"_"+Number(new Date),popupOptionStr:"",useReload:!0,closeWithParent:!0,method:"get",param:{}},t||{})).method=t.method.toUpperCase(),this.postBridgeUrl=t.postBridgeUrl||this.postBridgeUrl,c="POST"===t.method&&t.param&&s.msie&&11===s.version,!r.isExisty(e))throw new Error("Popup#open() need popup url.");l+=1,t.param&&("GET"===t.method?e=e+(/\?/.test(e)?"&":"?")+this._parameterize(t.param):"POST"===t.method&&(c||(i=this.createForm(e,t.param,t.method,t.popupName),e="about:blank"))),n=this.openedPopup[t.popupName],r.isExisty(n)?n.closed?this.openedPopup[t.popupName]=n=this._open(c,t.param,e,t.popupName,t.popupOptionStr):(t.useReload&&n.location.replace(e),n.focus()):this.openedPopup[t.popupName]=n=this._open(c,t.param,e,t.popupName,t.popupOptionStr),this.closeWithParentPopup[t.popupName]=t.closeWithParent,(!n||n.closed||r.isUndefined(n.closed))&&alert("please enable popup windows for this website"),t.param&&"POST"===t.method&&!c&&(n&&i.submit(),i.parentNode&&i.parentNode.removeChild(i)),window.onunload=o.bind(this.closeAllPopup,this)},c.prototype.close=function(e,t){var n=t||window;(e=!!r.isExisty(e)&&e)&&(window.onunload=null),n.closed||(n.opener=window.location.href,n.close())},c.prototype.closeAllPopup=function(e){var t=r.isExisty(e);
2i.forEachOwnProperties(this.openedPopup,(function(e,n){(t&&this.closeWithParentPopup[n]||!t)&&this.close(!1,e)}),this)},c.prototype.focus=function(e){this.getPopupList(e).focus()},c.prototype.parseQuery=function(){var e,t,n={};return e=window.location.search.substr(1),i.forEachArray(e.split("&"),(function(e){t=e.split("="),n[decodeURIComponent(t[0])]=decodeURIComponent(t[1])})),n},c.prototype.createForm=function(e,t,n,r,o){var s,a=document.createElement("form");return o=o||document.body,a.method=n||"POST",a.action=e||"",a.target=r||"",a.style.display="none",i.forEachOwnProperties(t,(function(e,t){(s=document.createElement("input")).name=t,s.type="hidden",s.value=e,a.appendChild(s)})),o.appendChild(a),a},c.prototype._parameterize=function(e){var t=[];return i.forEachOwnProperties(e,(function(e,n){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})),t.join("&")},c.prototype._open=function(e,t,n,i,r){var o;return e?(o=window.open(this.postBridgeUrl,i,r),setTimeout((function(){o.redirect(n,t)}),100)):o=window.open(n,i,r),o},e.exports=new c},function(e,t,n){"use strict";var i=n(2),r=n(1),o=/[\\]*YYYY|[\\]*YY|[\\]*MMMM|[\\]*MMM|[\\]*MM|[\\]*M|[\\]*DD|[\\]*D|[\\]*HH|[\\]*H|[\\]*A/gi,s=["Invalid month","January","February","March","April","May","June","July","August","September","October","November","December"],a=[0,31,28,31,30,31,30,31,31,30,31,30,31],l={M:function(e){return Number(e.month)},MM:function(e){var t=e.month;return Number(t)<10?"0"+t:t},MMM:function(e){return s[Number(e.month)].substr(0,3)},MMMM:function(e){return s[Number(e.month)]},D:function(e){return Number(e.date)},d:function(e){return l.D(e)},DD:function(e){var t=e.date;return Number(t)<10?"0"+t:t},dd:function(e){return l.DD(e)},YY:function(e){return Number(e.year)%100},yy:function(e){return l.YY(e)},YYYY:function(e){var t="20",n=e.year;return n>69&&n<100&&(t="19"),Number(n)<100?t+String(n):n},yyyy:function(e){return l.YYYY(e)},A:function(e){return e.meridiem},a:function(e){return e.meridiem},hh:function(e){var t=e.hour;return Number(t)<10?"0"+t:t},HH:function(e){return l.hh(e)},h:function(e){return String(Number(e.hour))},H:function(e){return l.h(e)},m:function(e){return String(Number(e.minute))},mm:function(e){var t=e.minute;return Number(t)<10?"0"+t:t}};e.exports=function(e,t,n){var s,c,u=r.pick(n,"meridiemSet","AM")||"AM",h=r.pick(n,"meridiemSet","PM")||"PM";return!!function(e,t,n){var i;return e=Number(e),t=Number(t),n=Number(n),(e>-1&&e<100||e>1969&&e<2070)&&t>0&&t<13&&(i=a[t],2===t&&e%4==0&&(e%100==0&&e%400!=0||(i=29)),n>0&&n<=i)}((c=i.isDate(t)?{year:t.getFullYear(),month:t.getMonth()+1,date:t.getDate(),hour:t.getHours(),minute:t.getMinutes()}:{year:t.year,month:t.month,date:t.date,hour:t.hour,minute:t.minute}).year,c.month,c.date)&&(c.meridiem="",/([^\\]|^)[aA]\b/.test(e)&&(s=c.hour>11?h:u,c.hour>12&&(c.hour%=12),0===c.hour&&(c.hour=12),c.meridiem=s),e.replace(o,(function(e){return e.indexOf("\\")>-1?e.replace(/\\/,""):l[e](c)||""})))}},function(e,t,n){"use strict";var i=n(6).inherit,r=n(1).extend;e.exports=function(e,t){var n;return t||(t=e,e=null),n=t.init||function(){},e&&i(n,e),t.hasOwnProperty("static")&&(r(n,t.static),delete t.static),r(n.prototype,t),n}},function(e,t,n){"use strict";var i=n(15),r=n(2);e.exports=function(e,t){var n=t||{};return r.isFunction(n.initialize)&&n.initialize(),i(e,n)}},function(e,t,n){"use strict";var i=n(4),r=n(1);e.exports=function(e,t,n){var o,s,a;return(o=e.split(".")).unshift(window),s=i.reduce(o,(function(e,t){return e[t]=e[t]||{},e[t]})),n?(a=o.pop(),s=r.pick.apply(null,o)[a]=t):r.extend(s,t),s}},function(e,t,n){"use strict";var i=n(4),r=n(2),o=n(1),s=/\s+/g;function a(){this.events=null,this.contexts=null}a.mixin=function(e){o.extend(e.prototype,a.prototype)},a.prototype._getHandlerItem=function(e,t){var n={handler:e};return t&&(n.context=t),n},a.prototype._safeEvent=function(e){var t,n=this.events;return n||(n=this.events={}),e&&((t=n[e])||(t=[],n[e]=t),n=t),n},a.prototype._safeContext=function(){var e=this.contexts;return e||(e=this.contexts=[]),e},a.prototype._indexOfContext=function(e){for(var t=this._safeContext(),n=0;t[n];){if(e===t[n][0])return n;n+=1}return-1},a.prototype._memorizeContext=function(e){var t,n;r.isExisty(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1?t[n][1]+=1:t.push([e,1]))},a.prototype._forgetContext=function(e){var t,n;r.isExisty(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1&&(t[n][1]-=1,t[n][1]<=0&&t.splice(n,1)))},a.prototype._bindEvent=function(e,t,n){var i=this._safeEvent(e);this._memorizeContext(n),i.push(this._getHandlerItem(t,n))},a.prototype.on=function(e,t,n){var o=this;
2r.isString(e)?(e=e.split(s),i.forEach(e,(function(e){o._bindEvent(e,t,n)}))):r.isObject(e)&&(n=t,i.forEach(e,(function(e,t){o.on(t,e,n)})))},a.prototype.once=function(e,t,n){var o=this;if(r.isObject(e))return n=t,void i.forEach(e,(function(e,t){o.once(t,e,n)}));this.on(e,(function i(){t.apply(n,arguments),o.off(e,i,n)}),n)},a.prototype._spliceMatches=function(e,t){var n,i=0;if(r.isArray(e))for(n=e.length;i<n;i+=1)!0===t(e[i])&&(e.splice(i,1),n-=1,i-=1)},a.prototype._matchHandler=function(e){var t=this;return function(n){var i=e===n.handler;return i&&t._forgetContext(n.context),i}},a.prototype._matchContext=function(e){var t=this;return function(n){var i=e===n.context;return i&&t._forgetContext(n.context),i}},a.prototype._matchHandlerAndContext=function(e,t){var n=this;return function(i){var r=e===i.handler,o=t===i.context,s=r&&o;return s&&n._forgetContext(i.context),s}},a.prototype._offByEventName=function(e,t){var n=this,o=i.forEachArray,a=r.isFunction(t),l=n._matchHandler(t);e=e.split(s),o(e,(function(e){var t=n._safeEvent(e);a?n._spliceMatches(t,l):(o(t,(function(e){n._forgetContext(e.context)})),n.events[e]=[])}))},a.prototype._offByHandler=function(e){var t=this,n=this._matchHandler(e);i.forEach(this._safeEvent(),(function(e){t._spliceMatches(e,n)}))},a.prototype._offByObject=function(e,t){var n,o=this;this._indexOfContext(e)<0?i.forEach(e,(function(e,t){o.off(t,e)})):r.isString(t)?(n=this._matchContext(e),o._spliceMatches(this._safeEvent(t),n)):r.isFunction(t)?(n=this._matchHandlerAndContext(t,e),i.forEach(this._safeEvent(),(function(e){o._spliceMatches(e,n)}))):(n=this._matchContext(e),i.forEach(this._safeEvent(),(function(e){o._spliceMatches(e,n)})))},a.prototype.off=function(e,t){r.isString(e)?this._offByEventName(e,t):arguments.length?r.isFunction(e)?this._offByHandler(e):r.isObject(e)&&this._offByObject(e,t):(this.events={},this.contexts=[])},a.prototype.fire=function(e){this.invoke.apply(this,arguments)},a.prototype.invoke=function(e){var t,n,i,r;if(!this.hasListener(e))return!0;for(t=this._safeEvent(e),n=Array.prototype.slice.call(arguments,1),i=0;t[i];){if(!1===(r=t[i]).handler.apply(r.context,n))return!1;i+=1}return!0},a.prototype.hasListener=function(e){return this.getListenerLength(e)>0},a.prototype.getListenerLength=function(e){return this._safeEvent(e).length},e.exports=a},function(e,t,n){"use strict";var i=n(4),r=n(2),o=function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}(),s=0;function a(e){e&&this.set.apply(this,arguments)}a.prototype.set=function(e){var t=this;r.isArray(e)||(e=i.toArray(arguments)),i.forEach(e,(function(e){t._addItem(e)}))},a.prototype.getName=function(e){var t,n=this;return i.forEach(this,(function(i,r){if(n._isEnumItem(r)&&e===i)return t=r,!1})),t},a.prototype._addItem=function(e){var t;this.hasOwnProperty(e)||(t=this._makeEnumValue(),o?Object.defineProperty(this,e,{enumerable:!0,configurable:!1,writable:!1,value:t}):this[e]=t)},a.prototype._makeEnumValue=function(){var e;return e=s,s+=1,e},a.prototype._isEnumItem=function(e){return r.isNumber(this[e])},e.exports=a},function(e,t,n){"use strict";var i=n(4),r=n(19);function o(e){this._map=new r(e),this.size=this._map.size}i.forEachArray(["get","has","forEach","keys","values","entries"],(function(e){o.prototype[e]=function(){return this._map[e].apply(this._map,arguments)}})),i.forEachArray(["delete","clear"],(function(e){o.prototype[e]=function(){var t=this._map[e].apply(this._map,arguments);return this.size=this._map.size,t}})),o.prototype.set=function(){return this._map.set.apply(this._map,arguments),this.size=this._map.size,this},o.prototype.setObject=function(e){i.forEachOwnProperties(e,(function(e,t){this.set(t,e)}),this)},o.prototype.deleteByKeys=function(e){i.forEachArray(e,(function(e){this.delete(e)}),this)},o.prototype.merge=function(e){e.forEach((function(e,t){this.set(t,e)}),this)},o.prototype.filter=function(e){var t=new o;return this.forEach((function(n,i){e(n,i)&&t.set(i,n)})),t},e.exports=o},function(e,t,n){"use strict";var i=n(4),r=n(2),o=n(3),s=n(10),a=n(5),l={},c={};function u(e,t){this._keys=e,this._valueGetter=t,this._length=this._keys.length,this._index=-1,this._done=!1}function h(e){this._valuesForString={},this._valuesForIndex={},this._keys=[],e&&this._setInitData(e),this.size=0}u.prototype.next=function(){var e={};do{this._index+=1}while(r.isUndefined(this._keys[this._index])&&this._index<this._length);return this._index>=this._length?e.done=!0:(e.done=!1,e.value=this._valueGetter(this._keys[this._index],this._index)),e},h.prototype._setInitData=function(e){if(!r.isArray(e))throw new Error("Only Array is supported.");
2i.forEachArray(e,(function(e){this.set(e[0],e[1])}),this)},h.prototype._isNaN=function(e){return"number"==typeof e&&e!=e},h.prototype._getKeyIndex=function(e){var t,n=-1;return r.isString(e)?(t=this._valuesForString[e])&&(n=t.keyIndex):n=o.inArray(e,this._keys),n},h.prototype._getOriginKey=function(e){var t=e;return e===l?t=void 0:e===c&&(t=NaN),t},h.prototype._getUniqueKey=function(e){var t=e;return r.isUndefined(e)?t=l:this._isNaN(e)&&(t=c),t},h.prototype._getValueObject=function(e,t){return r.isString(e)?this._valuesForString[e]:(r.isUndefined(t)&&(t=this._getKeyIndex(e)),t>=0?this._valuesForIndex[t]:void 0)},h.prototype._getOriginValue=function(e,t){return this._getValueObject(e,t).origin},h.prototype._getKeyValuePair=function(e,t){return[this._getOriginKey(e),this._getOriginValue(e,t)]},h.prototype._createValueObject=function(e,t){return{keyIndex:t,origin:e}},h.prototype.set=function(e,t){var n,i=this._getUniqueKey(e),o=this._getKeyIndex(i);return o<0&&(o=this._keys.push(i)-1,this.size+=1),n=this._createValueObject(t,o),r.isString(e)?this._valuesForString[e]=n:this._valuesForIndex[o]=n,this},h.prototype.get=function(e){var t=this._getUniqueKey(e),n=this._getValueObject(t);return n&&n.origin},h.prototype.keys=function(){return new u(this._keys,a.bind(this._getOriginKey,this))},h.prototype.values=function(){return new u(this._keys,a.bind(this._getOriginValue,this))},h.prototype.entries=function(){return new u(this._keys,a.bind(this._getKeyValuePair,this))},h.prototype.has=function(e){return!!this._getValueObject(e)},h.prototype.delete=function(e){var t;r.isString(e)?this._valuesForString[e]&&(t=this._valuesForString[e].keyIndex,delete this._valuesForString[e]):(t=this._getKeyIndex(e))>=0&&delete this._valuesForIndex[t],t>=0&&(delete this._keys[t],this.size-=1)},h.prototype.forEach=function(e,t){t=t||this,i.forEachArray(this._keys,(function(n){r.isUndefined(n)||e.call(t,this._getValueObject(n).origin,n,this)}),this)},h.prototype.clear=function(){h.call(this)},window.Map&&(s.firefox&&s.version>=37||s.chrome&&s.version>=42)&&(h=window.Map),e.exports=h},function(e,t,n){"use strict";var i=n(4),r=n(2);function o(e){this.length=0,e&&this.setObject(e)}o.prototype.set=function(e,t){2===arguments.length?this.setKeyValue(e,t):this.setObject(e)},o.prototype.setKeyValue=function(e,t){this.has(e)||(this.length+=1),this[this.encodeKey(e)]=t},o.prototype.setObject=function(e){var t=this;i.forEachOwnProperties(e,(function(e,n){t.setKeyValue(n,e)}))},o.prototype.merge=function(e){var t=this;e.each((function(e,n){t.setKeyValue(n,e)}))},o.prototype.encodeKey=function(e){return"Ã¥"+e},o.prototype.decodeKey=function(e){var t=e.split("Ã¥");return t[t.length-1]},o.prototype.get=function(e){return this[this.encodeKey(e)]},o.prototype.has=function(e){return this.hasOwnProperty(this.encodeKey(e))},o.prototype.remove=function(e){return arguments.length>1&&(e=i.toArray(arguments)),r.isArray(e)?this.removeByKeyArray(e):this.removeByKey(e)},o.prototype.removeByKey=function(e){var t=this.has(e)?this.get(e):null;return null!==t&&(delete this[this.encodeKey(e)],this.length-=1),t},o.prototype.removeByKeyArray=function(e){var t=[],n=this;return i.forEach(e,(function(e){t.push(n.removeByKey(e))})),t},o.prototype.removeAll=function(){var e=this;this.each((function(t,n){e.remove(n)}))},o.prototype.each=function(e){var t,n=this;i.forEachOwnProperties(this,(function(i,r){if("Ã¥"===r.charAt(0)&&(t=e(i,n.decodeKey(r))),!1===t)return t}))},o.prototype.keys=function(){var e=[],t=this;return this.each((function(n,i){e.push(t.decodeKey(i))})),e},o.prototype.find=function(e){var t=[];return this.each((function(n,i){e(n,i)&&t.push(n)})),t},o.prototype.toArray=function(){var e=[];return this.each((function(t){e.push(t)})),e},e.exports=o}])},e.exports=t()},51191:e=>{var t;window,t=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
2),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="dist",n(n.s=33)}([function(e,t,n){"use strict";e.exports=function(e,t){var n,i,r,o,s=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;r<o;r+=1)for(i in n=arguments[r])s.call(n,i)&&(e[i]=n[i]);return e}},function(e,t,n){"use strict";e.exports=function(e){return e instanceof Array}},function(e,t,n){"use strict";var i=n(1),r=n(6),o=n(7);e.exports=function(e,t,n){i(e)?r(e,t,n):o(e,t,n)}},function(e,t,n){"use strict";e.exports=function(e){return void 0===e}},function(e,t,n){"use strict";var i=n(22),r=n(2),o=n(6),s=n(7),a=n(37),l=0,c={getLength:function(e){var t=0;return s(e,(function(){t+=1})),t},map:function(e,t,n){var i=[];return r(e,(function(){i.push(t.apply(n||null,arguments))})),i},filter:function(e,t,n){var i=[];return o(e,(function(e){t.apply(n||null,arguments)&&i.push(e)})),i},generateId:function(){return l+=1},isOldBrowser:i.msie&&i.version<9,sendHostName:function(){a("color-picker","UA-129987462-1")}};e.exports=c},function(e,t,n){"use strict";var i=n(1);e.exports=function(e,t,n){var r,o;if(n=n||0,!i(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(o=t.length,r=n;n>=0&&r<o;r+=1)if(t[r]===e)return r;return-1}},function(e,t,n){"use strict";e.exports=function(e,t,n){var i=0,r=e.length;for(n=n||null;i<r&&!1!==t.call(n,e[i],i,e);i+=1);}},function(e,t,n){"use strict";e.exports=function(e,t,n){var i;for(i in n=n||null,e)if(e.hasOwnProperty(i)&&!1===t.call(n,e[i],i,e))break}},function(e,t,n){"use strict";var i=n(39),r=n(13),o=n(41),s=n(3),a=n(9),l=n(19),c=n(4);function u(e,t){var n=c.generateId();e=e||{},s(t)&&(t=a.appendHTMLElement("div")),i(t,"tui-view-"+n),this.id=n,this.container=t,this.childs=new l((function(e){return e.id})),this.parent=null}u.prototype.addChild=function(e,t){t&&t.call(e,this),e.parent=this,this.childs.add(e)},u.prototype.removeChild=function(e,t){var n=o(e)?this.childs.items[e]:e;t&&t.call(n,this),this.childs.remove(n.id)},u.prototype.render=function(){this.childs.each((function(e){e.render()}))},u.prototype.recursive=function(e,t){r(e)&&(t||e(this),this.childs.each((function(t){t.recursive(e)})))},u.prototype.resize=function(){for(var e=Array.prototype.slice.call(arguments),t=this.parent;t;)r(t._onResize)&&t._onResize.apply(t,e),t=t.parent},u.prototype._beforeDestroy=function(){},u.prototype._destroy=function(){this._beforeDestroy(),this.container.innerHTML="",this.id=this.parent=this.childs=this.container=null},u.prototype.destroy=function(e){this.childs&&(this.childs.each((function(e){e.destroy(!0),e._destroy()})),this.childs.clear()),e||this._destroy()},u.prototype.getViewBound=function(){var e=this.container.getBoundingClientRect();return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}},e.exports=u},function(e,t,n){"use strict";var i={appendHTMLElement:function(e,t,n){var i=document.createElement(e);return i.className=n||"",t?t.appendChild(i):document.body.appendChild(i),i}};e.exports=i},function(e,t,n){"use strict";var i=n(0),r=n(20),o=n(11),s=n(21),a=n(1),l=n(13),c=n(2),u=/\s+/g;function h(){this.events=null,this.contexts=null}h.mixin=function(e){i(e.prototype,h.prototype)},h.prototype._getHandlerItem=function(e,t){var n={handler:e};return t&&(n.context=t),n},h.prototype._safeEvent=function(e){var t,n=this.events;return n||(n=this.events={}),e&&((t=n[e])||(t=[],n[e]=t),n=t),n},h.prototype._safeContext=function(){var e=this.contexts;return e||(e=this.contexts=[]),e},h.prototype._indexOfContext=function(e){for(var t=this._safeContext(),n=0;t[n];){if(e===t[n][0])return n;n+=1}return-1},h.prototype._memorizeContext=function(e){var t,n;r(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1?t[n][1]+=1:t.push([e,1]))},h.prototype._forgetContext=function(e){var t,n;r(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1&&(t[n][1]-=1,t[n][1]<=0&&t.splice(n,1)))},h.prototype._bindEvent=function(e,t,n){var i=this._safeEvent(e);this._memorizeContext(n),i.push(this._getHandlerItem(t,n))},h.prototype.on=function(e,t,n){var i=this;o(e)?(e=e.split(u),c(e,(function(e){i._bindEvent(e,t,n)}))):s(e)&&(n=t,c(e,(function(e,t){i.on(t,e,n)}
2)))},h.prototype.once=function(e,t,n){var i=this;if(s(e))return n=t,void c(e,(function(e,t){i.once(t,e,n)}));this.on(e,(function r(){t.apply(n,arguments),i.off(e,r,n)}),n)},h.prototype._spliceMatches=function(e,t){var n,i=0;if(a(e))for(n=e.length;i<n;i+=1)!0===t(e[i])&&(e.splice(i,1),n-=1,i-=1)},h.prototype._matchHandler=function(e){var t=this;return function(n){var i=e===n.handler;return i&&t._forgetContext(n.context),i}},h.prototype._matchContext=function(e){var t=this;return function(n){var i=e===n.context;return i&&t._forgetContext(n.context),i}},h.prototype._matchHandlerAndContext=function(e,t){var n=this;return function(i){var r=e===i.handler,o=t===i.context,s=r&&o;return s&&n._forgetContext(i.context),s}},h.prototype._offByEventName=function(e,t){var n=this,i=l(t),r=n._matchHandler(t);e=e.split(u),c(e,(function(e){var t=n._safeEvent(e);i?n._spliceMatches(t,r):(c(t,(function(e){n._forgetContext(e.context)})),n.events[e]=[])}))},h.prototype._offByHandler=function(e){var t=this,n=this._matchHandler(e);c(this._safeEvent(),(function(e){t._spliceMatches(e,n)}))},h.prototype._offByObject=function(e,t){var n,i=this;this._indexOfContext(e)<0?c(e,(function(e,t){i.off(t,e)})):o(t)?(n=this._matchContext(e),i._spliceMatches(this._safeEvent(t),n)):l(t)?(n=this._matchHandlerAndContext(t,e),c(this._safeEvent(),(function(e){i._spliceMatches(e,n)}))):(n=this._matchContext(e),c(this._safeEvent(),(function(e){i._spliceMatches(e,n)})))},h.prototype.off=function(e,t){o(e)?this._offByEventName(e,t):arguments.length?l(e)?this._offByHandler(e):s(e)&&this._offByObject(e,t):(this.events={},this.contexts=[])},h.prototype.fire=function(e){this.invoke.apply(this,arguments)},h.prototype.invoke=function(e){var t,n,i,r;if(!this.hasListener(e))return!0;for(t=this._safeEvent(e),n=Array.prototype.slice.call(arguments,1),i=0;t[i];){if(!1===(r=t[i]).handler.apply(r.context,n))return!1;i+=1}return!0},h.prototype.hasListener=function(e){return this.getListenerLength(e)>0},h.prototype.getListenerLength=function(e){return this._safeEvent(e).length},e.exports=h},function(e,t,n){"use strict";e.exports=function(e){return"string"==typeof e||e instanceof String}},function(e,t,n){"use strict";var i=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,r={leadingZero:function(e,t){var n="",i=0;if((e+"").length>t)return e+"";for(;i<t-1;i+=1)n+="0";return(n+e).slice(-1*t)},isValidRGB:function(e){return i.test(e)},hexToRGB:function(e){return!!r.isValidRGB(e)&&(e=e.substring(1),[parseInt(e.substr(0,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(4,2),16)])},rgbToHEX:function(e,t,n){var i="#"+r.leadingZero(e.toString(16),2)+r.leadingZero(t.toString(16),2)+r.leadingZero(n.toString(16),2);return!!r.isValidRGB(i)&&i},rgbToHSV:function(e,t,n){var i,r,o,s,a,l;if(e/=255,t/=255,n/=255,a=i=Math.max(e,t,n),l=i-(r=Math.min(e,t,n)),s=0===i?0:l/i,i===r)o=0;else{switch(i){case e:o=(t-n)/l+(t<n?6:0);break;case t:o=(n-e)/l+2;break;case n:o=(e-t)/l+4}o/=6}return[Math.round(360*o),Math.round(100*s),Math.round(100*a)]},hsvToRGB:function(e,t,n){var i,r,o,s,a,l,c,u;if(e=Math.max(0,Math.min(360,e)),t=Math.max(0,Math.min(100,t)),n=Math.max(0,Math.min(100,n)),n/=100,0==(t/=100))return i=r=o=n,[Math.round(255*i),Math.round(255*r),Math.round(255*o)];switch(l=n*(1-t),c=n*(1-t*(a=(e/=60)-(s=Math.floor(e)))),u=n*(1-t*(1-a)),s){case 0:i=n,r=u,o=l;break;case 1:i=c,r=n,o=l;break;case 2:i=l,r=n,o=u;break;case 3:i=l,r=c,o=n;break;case 4:i=u,r=l,o=n;break;default:i=n,r=l,o=c}return[Math.round(255*i),Math.round(255*r),Math.round(255*o)]}};e.exports=r},function(e,t,n){"use strict";e.exports=function(e){return e instanceof Function}},function(e,t,n){"use strict";var i=n(11),r=n(2),o=n(26);function s(e,t,n,i){function s(t){n.call(i||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,s):"attachEvent"in e&&e.attachEvent("on"+t,s),function(e,t,n,i){var s=o(e,t),a=!1;r(s,(function(e){return e.handler!==n||(a=!0,!1)})),a||s.push({handler:n,wrappedHandler:i})}(e,t,n,s)}e.exports=function(e,t,n,o){i(t)?r(t.split(/\s+/g),(function(t){s(e,t,n,o)})):r(t,(function(t,i){s(e,i,t,n)}))}},function(e,t,n){"use strict";e.exports=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},function(e,t,n){"use strict";e.exports=function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))}},function(e,t,n){"use strict";var i=n(11),r=n(2),o=n(26);function s(e,t,n){var i,s=o(e,t);n?(r(s,(function(r,o){return n!==r.handler||(a(e,t,r.wrappedHandler),i=o,!1)})),s.splice(i,1)):(r(s,(function(n){a(e,t,n.wrappedHandler)})),s.splice(0,s.length))}function a(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}
2e.exports=function(e,t,n){i(t)?r(t.split(/\s+/g),(function(t){s(e,t,n)})):r(t,(function(t,n){s(e,n,t)}))}},function(e,t,n){"use strict";var i=n(50);e.exports=function(e,t){var n=i(t.prototype);n.constructor=e,e.prototype=n}},function(e,t,n){"use strict";var i=n(6),r=n(7),o=n(0),s=n(1),a=n(20),l=n(13),c=n(21),u=n(4),h=Array.prototype.slice;function d(e){this.items={},this.length=0,l(e)&&(this.getItemID=e)}d.and=function(e){var t;return e=h.call(arguments),t=e.length,function(n){for(var i=0;i<t;i+=1)if(!e[i].call(null,n))return!1;return!0}},d.or=function(e){var t;return e=h.call(arguments),t=e.length,function(n){for(var i=1,r=e[0].call(null,n);i<t;i+=1)r=r||e[i].call(null,n);return r}},d.merge=function(e){var t={},n=new d(e.getItemID);return i(arguments,(function(e){o(t,e.items)})),n.items=t,n.length=u.getLength(n.items),n},d.prototype.getItemID=function(e){return e._id+""},d.prototype.add=function(e){var t,n;arguments.length>1?i(h.call(arguments),(function(e){this.add(e)}),this):(t=this.getItemID(e),(n=this.items)[t]||(this.length+=1),n[t]=e)},d.prototype.remove=function(e){var t,n,i=[];return this.length?arguments.length>1?(i=u.map(h.call(arguments),(function(e){return this.remove(e)}),this),i):(t=this.items,c(e)&&(e=this.getItemID(e)),t[e]?(this.length-=1,n=t[e],delete t[e],n):i):i},d.prototype.clear=function(){this.items={},this.length=0},d.prototype.has=function(e){var t,n;return!!this.length&&(t=l(e),n=!1,t?this.each((function(t){return!0!==e(t)||(n=!0,!1)})):(e=c(e)?this.getItemID(e):e,n=a(this.items[e])),n)},d.prototype.doWhenHas=function(e,t,n){var i=this.items[e];a(i)&&t.call(n||this,i)},d.prototype.find=function(e){var t=new d;return this.hasOwnProperty("getItemID")&&(t.getItemID=this.getItemID),this.each((function(n){!0===e(n)&&t.add(n)})),t},d.prototype.groupBy=function(e,t){var n,r,o={},a=l(e),c=this.getItemID;if(s(e)){if(i(e,(function(e){o[e+""]=new d(c)})),!t)return o;e=t,a=!0}return this.each((function(t){a?r=e(t):(r=t[e],l(r)&&(r=r.apply(t))),(n=o[r])||(n=o[r]=new d(c)),n.add(t)})),o},d.prototype.single=function(){var e;return this.each((function(t){return e=t,!1}),this),e},d.prototype.sort=function(e){var t=[];return this.each((function(e){t.push(e)})),l(e)&&(t=t.sort(e)),t},d.prototype.each=function(e,t){r(this.items,e,t||this)},d.prototype.toArray=function(){return this.length?u.map(this.items,(function(e){return e})):[]},e.exports=d},function(e,t,n){"use strict";var i=n(3),r=n(36);e.exports=function(e){return!i(e)&&!r(e)}},function(e,t,n){"use strict";e.exports=function(e){return e===Object(e)}},function(e,t,n){"use strict";var i,r,o,s,a,l,c,u,h,d,f={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};"undefined"!=typeof window&&window.navigator&&(o=window.navigator,s=o.appName.replace(/\s/g,"_"),a=o.userAgent,l=/MSIE\s([0-9]+[.0-9]*)/,c=/Trident.*rv:11\./,u=/Edge\/(\d+)\./,h={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},(d={Microsoft_Internet_Explorer:function(){var e=a.match(l);e?(f.msie=!0,f.version=parseFloat(e[1])):f.others=!0},Netscape:function(){var e=!1;if(c.exec(a))f.msie=!0,f.version=11,e=!0;else if(u.exec(a))f.edge=!0,f.version=a.match(u)[1],e=!0;else for(i in h)if(h.hasOwnProperty(i)&&(r=a.match(h[i]))&&r.length>1){f[i]=e=!0,f.version=parseFloat(r[1]||0);break}e||(f.others=!0)}})[s]&&d[s]()),e.exports=f},function(e,t,n){"use strict";var i=n(3);e.exports=function(e){return e&&e.className?i(e.className.baseVal)?e.className:e.className.baseVal:""}},function(e,t,n){"use strict";(function(t){var i=n(10),r=n(42),o=n(44),s=n(47),a=n(28),l=n(17),c=n(14),u=n(15),h=n(0);function d(e,t){c(t,"mousedown",this._onMouseDown,this),this.options=h({distance:10},e),this.container=t,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}d.prototype.destroy=function(){l(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},d.prototype._toggleDragEvent=function(e){var n=this.container;e?(r(n),c(window,"dragstart",u),c(t.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(o(n),l(window,"dragstart",u),l(t.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},d.prototype._getEventData=function(e){return{target:a(e),originEvent:e}},d.prototype._onMouseDown=function(e){0===s(e)&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(e),this._toggleDragEvent(!0))},d.prototype._onMouseMove=function(e){var t=this.options.distance;u(e),this._isMoved=!0,this._distance<t?this._distance+=1:this._dragStartFired||(this._dragStartFired=!0,this.invoke("dragStart",this._dragStartEventData))?this.fire("drag",this._getEventData(e)):this._toggleDragEvent(!1)},d.prototype._onMouseUp=function(e){if(this._toggleDragEvent(!1),this._isMoved)return this._isMoved=!1,void this.fire("dragEnd",this._getEventData(e));this.fire("click",this._getEventData(e))},i.mixin(d),e.exports=d}).call(this,n(25))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var i="_feEventKey";e.exports=function(e,t){var n,r=e[i];return r||(r=e[i]={}),(n=r[t])||(n=r[t]=[]),n}},function(e,t,n){"use strict";e.exports=function(e){var t,n,i=document.documentElement.style;for(t=0,n=e.length;t<n;t+=1)if(e[t]in i)return e[t];return!1}},function(e,t,n){"use strict";e.exports=function(e){return e.target||e.srcElement}},function(e,t,n){"use strict";var i=n(10),r=n(28),o=n(17),s=n(14),a=n(30),l=n(0),c=n(18),u=n(9),h=n(12),d=n(8),f=n(51);function p(e,t){this.options=l({cssPrefix:"tui-colorpicker-",preset:["#181818","#282828","#383838","#585858","#B8B8B8","#D8D8D8","#E8E8E8","#F8F8F8","#AB4642","#DC9656","#F7CA88","#A1B56C","#86C1B9","#7CAFC2","#BA8BAF","#A16946"],detailTxt:"Detail"},e),t=u.appendHTMLElement("div",t,this.options.cssPrefix+"palette-container"),d.call(this,e,t)}c(p,d),p.prototype._onClick=function(e){var t=this.options,n=r(e),i={};if(a(n,t.cssPrefix+"palette-button"))return i.color=n.value,void this.fire("_selectColor",i);a(n,t.cssPrefix+"palette-toggle-slider")&&this.fire("_toggleSlider")},p.prototype._onChange=function(e){var t=this.options,n=r(e),i={};a(n,t.cssPrefix+"palette-hex")&&(i.color=n.value,this.fire("_selectColor",i))},p.prototype._beforeDestroy=function(){this._toggleEvent(!1)},p.prototype._toggleEvent=function(e){var t,n=this.options,i=this.container,r=e?s:o;r(i,"click",this._onClick,this),(t=i.querySelector("."+n.cssPrefix+"palette-hex",i))&&r(t,"change",this._onChange,this)},p.prototype.render=function(e){var t,n=this.options;this._toggleEvent(!1),t=f({cssPrefix:n.cssPrefix,preset:n.preset,detailTxt:n.detailTxt,color:e,isValidRGB:h.isValidRGB,getItemClass:function(e){return e?"":" "+n.cssPrefix+"color-transparent"},isSelected:function(t){return t===e?" "+n.cssPrefix+"selected":""}}),this.container.innerHTML=t,this._toggleEvent(!0)},i.mixin(p),e.exports=p},function(e,t,n){"use strict";var i=n(5),r=n(23);e.exports=function(e,t){var n;return e.classList?e.classList.contains(t):(n=r(e).split(/\s+/),i(t,n)>-1)}},function(e,t,n){"use strict";var i=n(10),r=n(53),o=n(54),s=n(30),a=n(0),l=n(18),c=n(9),u=n(32),h=n(12),d=n(8),f=n(24),p=n(57),g=359.99;function m(e,t){(t=c.appendHTMLElement("div",t,e.cssPrefix+"slider-container")).style.display="none",d.call(this,e,t),this.options=a({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},e),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new f({distance:0},t),this.colorSliderPosLimitRange=[-7,112],this.huebarPosLimitRange=[-3,115],this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}l(m,d),m.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},m.prototype.toggle=function(e){this.container.style.display=e?"block":"none"},m.prototype.isVisible=function(){return"block"===this.container.style.display},m.prototype.render=function(e){var t,n,i=this.container,r=this.options,o=p.layout;h.isValidRGB(e)&&(o=(o=(o=(o=o.replace(/{{slider}}/,p.slider)).replace(/{{huebar}}/,p.huebar)).replace(/{{cssPrefix}}/g,r.cssPrefix)).replace(/{{id}}/g,r.id),this.container.innerHTML=o,this.sliderSvgElement=i.querySelector("."+r.cssPrefix+"svg-slider"),this.huebarSvgElement=i.querySelector("."+r.cssPrefix+"svg-huebar"),this.sliderHandleElement=i.querySelector("."+r.cssPrefix+"slider-handle"),this.huebarHandleElement=i.querySelector("."+r.cssPrefix+"huebar-handle"),this.baseColorElement=i.querySelector("."+r.cssPrefix+"slider-basecolor"),t=h.hexToRGB(e),n=h.rgbToHSV.apply(null,t),this.moveHue(n[0],!0),this.moveSaturationAndValue(n[1],n[2],!0))},m.prototype._setColorSliderPosMax=function(){var e=this.sliderSvgElement.getClientRects()[0];e&&(this.colorSliderPosLimitRange[1]=e.height-10)},m.prototype._moveColorSliderHandle=function(e,t,n){var i,r=this.sliderHandleElement;t=Math.max(this.colorSliderPosLimitRange[0],t),t=Math.min(this.colorSliderPosLimitRange[1],t),e=Math.max(this.colorSliderPosLimitRange[0],e),e=Math.min(this.colorSliderPosLimitRange[1],e),u.setTranslateXY(r,e,t),i=t>50?"white":"black",u.setStrokeColor(r,i),n||this.fire("_selectColor",{color:h.rgbToHEX.apply(null,this.getRGB())})},m.prototype.moveSaturationAndValue=function(e,t,n){var i,r,o,s;e=e||0,t=t||0,i=Math.abs(this.colorSliderPosLimitRange[0]),o=e*(r=this.colorSliderPosLimitRange[1])/100-i,s=r-t*r/100-i,this._moveColorSliderHandle(o,s,n)},m.prototype._moveColorSliderByPosition=function(e,t){var n=this.colorSliderPosLimitRange[0];this._moveColorSliderHandle(e+n,t+n)},m.prototype.getSaturationAndValue=function(){var e=Math.abs(this.colorSliderPosLimitRange[0]),t=e+this.colorSliderPosLimitRange[1],n=u.getTranslateXY(this.sliderHandleElement);return[(n[1]+e)/t*100,100-(n[0]+e)/t*100]},m.prototype._setHueBarPosMax=function(){var e=this.huebarSvgElement.getClientRects()[0];e&&(this.huebarPosLimitRange[1]=e.height-7)},m.prototype._moveHueHandle=function(e,t){var n,i,r=this.huebarHandleElement,o=this.baseColorElement;e=Math.max(this.huebarPosLimitRange[0],e),e=Math.min(this.huebarPosLimitRange[1],e),u.setTranslateY(r,e),n=h.hsvToRGB(this.getHue(),100,100),i=h.rgbToHEX.apply(null,n),u.setGradientColorStop(o,i),t||this.fire("_selectColor",{color:h.rgbToHEX.apply(null,this.getRGB())})},m.prototype.moveHue=function(e,t){var n,i;n=((i=Math.abs(this.huebarPosLimitRange[0]))+this.huebarPosLimitRange[1])*(e=e||0)/g-i,this._moveHueHandle(n,t)},m.prototype._moveHueByPosition=function(e){var t=this.huebarPosLimitRange[0];this._moveHueHandle(e+t)},m.prototype.getHue=function(){var e,t,n=this.huebarHandleElement,i=u.getTranslateXY(n);return t=(e=Math.abs(this.huebarPosLimitRange[0]))+this.huebarPosLimitRange[1],(i[0]+e)*g/t},m.prototype.getHSV=function(){var e=this.getSaturationAndValue();return[this.getHue()].concat(e)},m.prototype.getRGB=function(){return h.hsvToRGB.apply(null,this.getHSV())},m.prototype._prepareColorSliderForMouseEvent=function(e){var t=this.options,n=o(e.target,"."+t.cssPrefix+"slider-part");return this._dragDataCache={isColorSlider:s(n,t.cssPrefix+"slider-left"),parentElement:n}},m.prototype._onClick=function(e){var t=this._prepareColorSliderForMouseEvent(e),n=r(e.originEvent,t.parentElement);t.isColorSlider?this._moveColorSliderByPosition(n[0],n[1]):this._moveHueByPosition(n[1]),this._dragDataCache=null},m.prototype._onDragStart=function(e){this._setColorSliderPosMax(),this._setHueBarPosMax(),this._prepareColorSliderForMouseEvent(e)},m.prototype._onDrag=function(e){var t=this._dragDataCache,n=r(e.originEvent,t.parentElement);t.isColorSlider?this._moveColorSliderByPosition(n[0],n[1]):this._moveHueByPosition(n[1])},m.prototype._onDragEnd=function(){this._dragDataCache=null},i.mixin(m),e.exports=m},function(e,t,n){"use strict";var i=n(4).isOldBrowser,r=/[\.\-0-9]+/g,o={getTranslateXY:function(e){var t;return i?(t=e.style,[parseFloat(t.top),parseFloat(t.left)]):(t=e.getAttribute("transform"))?(t=t.match(r),[parseFloat(t[1]),parseFloat(t[0])]):[0,0]},setTranslateXY:function(e,t,n){i?(e.style.left=t+"px",e.style.top=n+"px"):e.setAttribute("transform","translate("+t+","+n+")")},setTranslateY:function(e,t){i?e.style.top=t+"px":e.setAttribute("transform","translate(-6,"+t+")")},setStrokeColor:function(e,t){i?e.strokecolor=t:e.setAttribute("stroke",t)},setGradientColorStop:function(e,t){i?e.color=t:e.setAttribute("stop-color",t)}};e.exports=o},function(e,t,n){n(34),e.exports=n(35)},function(e,t,n){},function(e,t,n){"use strict";var i={Collection:n(19),View:n(8),Drag:n(24),create:n(48),Palette:n(29),Slider:n(31),colorutil:n(12),svgvml:n(32)};e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return null===e}},function(e,t,n){"use strict";var i=n(3),r=n(38);e.exports=function(e,t){var n=location.hostname,o="TOAST UI "+e+" for "+n+": Statistics",s=window.localStorage.getItem(o);(i(window.tui)||!1!==window.tui.usageStatistics)&&(s&&!function(e){return(new Date).getTime()-e>6048e5}(s)||(window.localStorage.setItem(o,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})}),1e3)))}},function(e,t,n){"use strict";var i=n(7);e.exports=function(e,t){var n=document.createElement("img"),r="";return i(t,(function(e,t){r+="&"+t+"="+e})),r=r.substring(1),n.src=e+"?"+r,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n}},function(e,t,n){"use strict";var i=n(2),r=n(5),o=n(23),s=n(40);e.exports=function(e){var t,n=Array.prototype.slice.call(arguments,1
2),a=e.classList,l=[];a?i(n,(function(t){e.classList.add(t)})):((t=o(e))&&(n=[].concat(t.split(/\s+/),n)),i(n,(function(e){r(e,l)<0&&l.push(e)})),s(e,l))}},function(e,t,n){"use strict";var i=n(1),r=n(3);e.exports=function(e,t){t=(t=i(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),r(e.className.baseVal)?e.className=t:e.className.baseVal=t}},function(e,t,n){"use strict";e.exports=function(e){return"number"==typeof e||e instanceof Number}},function(e,t,n){"use strict";var i=n(14),r=n(15),o=n(43),s=n(27),a="onselectstart"in document,l=s(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);e.exports=function(e){e||(e=document),a?i(e,"selectstart",r):(e=e===document?document.documentElement:e,o(e,"prevUserSelect",e.style[l]),e.style[l]="none")}},function(e,t,n){"use strict";var i=n(16);e.exports=function(e,t,n){e.dataset?e.dataset[t]=n:e.setAttribute("data-"+i(t),n)}},function(e,t,n){"use strict";var i=n(17),r=n(15),o=n(45),s=n(46),a=n(27),l="onselectstart"in document,c="prevUserSelect",u=a(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);e.exports=function(e){e||(e=document),l?i(e,"selectstart",r):((e=e===document?document.documentElement:e).style[u]=o(e,c)||"auto",s(e,c))}},function(e,t,n){"use strict";var i=n(16);e.exports=function(e,t){return e.dataset?e.dataset[t]:e.getAttribute("data-"+i(t))}},function(e,t,n){"use strict";var i=n(16);e.exports=function(e,t){e.dataset?delete e.dataset[t]:e.removeAttribute("data-"+i(t))}},function(e,t,n){"use strict";var i=n(22),r=n(5),o=["0","1","3","5","7"],s=["2","6"],a=["4"];e.exports=function(e){return i.msie&&i.version<=8?function(e){var t=String(e.button);return r(t,o)>-1?0:r(t,s)>-1?2:r(t,a)>-1?1:null}(e):e.button}},function(e,t,n){"use strict";var i=n(10),r=n(0),o=n(4),s=n(12),a=n(49),l=n(29),c=n(31),u=0;function h(e){var t;if(!(this instanceof h))return new h(e);if(!(e=this.options=r({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:u+=1,usageStatistics:!0},e)).container)throw new Error("ColorPicker(): need container option.");t=this.layout=new a(e,e.container),this.palette=new l(e,t.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new c(e,t.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),t.addChild(this.palette),t.addChild(this.slider),this.render(e.color),e.usageStatistics&&o.sendHostName()}h.prototype._onSelectColorInPalette=function(e){var t=e.color,n=this.options;s.isValidRGB(t)||""===t?(this.fire("selectColor",{color:t,origin:"palette"}),n.color!==t&&(n.color=t,this.render(t))):this.render()},h.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},h.prototype._onSelectColorInSlider=function(e){var t=e.color,n=this.options;this.fire("selectColor",{color:t,origin:"slider"}),n.color!==t&&(n.color=t,this.palette.render(t))},h.prototype.setColor=function(e){if(!s.isValidRGB(e))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=e,this.render(e)},h.prototype.getColor=function(){return this.options.color},h.prototype.toggle=function(e){this.layout.container.style.display=e?"block":"none"},h.prototype.render=function(e){this.layout.render(e||this.options.color)},h.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},i.mixin(h),e.exports=h},function(e,t,n){"use strict";var i=n(0),r=n(18),o=n(9),s=n(8);function a(e,t){this.options=i({cssPrefix:"tui-colorpicker-"},e),t=o.appendHTMLElement("div",t,this.options.cssPrefix+"container"),s.call(this,e,t),this.render()}r(a,s),a.prototype.render=function(e){this.recursive((function(t){t.render(e)}),!0)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){function t(){}return t.prototype=e,new t}},function(e,t,n){"use strict";var i=n(52);e.exports=function(e){var t=['<ul class="{{cssPrefix}}clearfix">',"{{each preset}}",['<li>
2<input class="{{cssPrefix}}palette-button{{isSelected @this}}{{getItemClass @this}}" type="button"',"{{if isValidRGB @this}}",' style="background-color:{{@this}};color:{{@this}}"',"{{/if}}",' title="{{@this}}" value="{{@this}}" /></li>'].join(""),"{{/each}}","</ul>",'<div class="{{cssPrefix}}clearfix" style="overflow:hidden">','<input type="button" class="{{cssPrefix}}palette-toggle-slider" value="{{detailTxt}}" />','<input type="text" class="{{cssPrefix}}palette-hex" value="{{color}}" maxlength="7" />','<span class="{{cssPrefix}}palette-preview" style="background-color:{{color}};color:{{color}}">{{color}}</span>',"</div>"].join("\n");return i(t,e)}},function(e,t,n){"use strict";var i=n(5),r=n(2),o=n(1),s=n(11),a=n(0),l=/{{\s?|\s?}}/g,c=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,u=/\[\s?|\s?\]/,h=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,d=/\./,f=/^["']\w+["']$/,p=/"|'/g,g=/^-?\d+\.?\d*$/,m={if:function(e,t,n){var i=function(e,t){var n=[e],i=[],o=0,s=0;return r(t,(function(e,r){0===e.indexOf("if")?o+=1:"/if"===e?o-=1:o||0!==e.indexOf("elseif")&&"else"!==e||(n.push("else"===e?["true"]:e.split(" ").slice(1)),i.push(t.slice(s,r)),s=r+1)})),i.push(t.slice(s)),{exps:n,sourcesInsideIf:i}}(e,t),o=!1,s="";return r(i.exps,(function(e,t){return(o=b(e,n))&&(s=x(i.sourcesInsideIf[t],n)),!o})),s},each:function(e,t,n){var i=b(e,n),s=o(i)?"@index":"@key",l={},c="";return r(i,(function(e,i){l[s]=i,l["@this"]=e,a(n,l),c+=x(t.slice(),n)})),c},with:function(e,t,n){var r=i("as",e),o=e[r+1],s=b(e.slice(0,r),n),l={};return l[o]=s,x(t,a(n,l))||""}},v=3==="a".split(/a/).length?function(e,t){return e.split(t)}:function(e,t){var n,i,r=[],o=0;for(t.global||(t=new RegExp(t,"g")),n=t.exec(e);null!==n;)i=n.index,r.push(e.slice(o,i)),o=i+n[0].length,n=t.exec(e);return r.push(e.slice(o)),r};function y(e,t){var n,i=t[e];return"true"===e?i=!0:"false"===e?i=!1:f.test(e)?i=e.replace(p,""):c.test(e)?i=y((n=e.split(u))[0],t)[y(n[1],t)]:h.test(e)?i=y((n=e.split(d))[0],t)[n[1]]:g.test(e)&&(i=parseFloat(e)),i}function _(e,t,n){for(var i,r,o,a,l=m[e],c=1,u=2,h=t[u];c&&s(h);)0===h.indexOf(e)?c+=1:0===h.indexOf("/"+e)&&(c-=1,i=u),h=t[u+=2];if(c)throw Error(e+" needs {{/"+e+"}} expression.");return t[0]=l(t[0].split(" ").slice(1),(r=0,o=i,(a=t.splice(r+1,o-r)).pop(),a),n),t}function b(e,t){var n=y(e[0],t);return n instanceof Function?function(e,t,n){var i=[];return r(t,(function(e){i.push(y(e,n))})),e.apply(null,i)}(n,e.slice(1),t):n}function x(e,t){for(var n,i,r,o=1,a=e[o];s(a);)i=(n=a.split(" "))[0],m[i]?(r=_(i,e.splice(o,e.length-o),t),e=e.concat(r)):e[o]=b(n,t),a=e[o+=2];return e.join("")}e.exports=function(e,t){return x(v(e,l),t)}},function(e,t,n){"use strict";var i=n(1);e.exports=function(e,t){var n,r=i(e),o=r?e[0]:e.clientX,s=r?e[1]:e.clientY;return t?[o-(n=t.getBoundingClientRect()).left-t.clientLeft,s-n.top-t.clientTop]:[o,s]}},function(e,t,n){"use strict";var i=n(55);e.exports=function(e,t){var n=e.parentNode;if(i(e,t))return e;for(;n&&n!==document;){if(i(n,t))return n;n=n.parentNode}return null}},function(e,t,n){"use strict";var i=n(5),r=n(56),o=Element.prototype,s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return i(this,r(t.querySelectorAll(e)))>-1};e.exports=function(e,t){return s.call(e,t)}},function(e,t,n){"use strict";var i=n(6);e.exports=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],i(e,(function(e){t.push(e)}))}return t}},function(e,t,n){"use strict";(function(t){var i=n(4).isOldBrowser,r=['<div class="{{cssPrefix}}slider-left {{cssPrefix}}slider-part">{{slider}}</div>','<div class="{{cssPrefix}}slider-right {{cssPrefix}}slider-part">{{huebar}}</div>'].join("\n"),o=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-slider">',"<defs>",'<linearGradient id="{{cssPrefix}}svg-fill-color-{{id}}" x1="0%" y1="0%" x2="100%" y2="0%">','<stop offset="0%" stop-color="rgb(255,255,255)" />','<stop class="{{cssPrefix}}slider-basecolor" offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>",'<linearGradient id="{{cssPrefix}}svn-fill-black-{{id}}
2" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" style="stop-color:rgb(0,0,0);stop-opacity:0" />','<stop offset="100%" style="stop-color:rgb(0,0,0);stop-opacity:1" />',"</linearGradient>","</defs>",'<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svg-fill-color-{{id}})"></rect>','<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svn-fill-black-{{id}})"></rect>','<path transform="translate(0,0)" class="{{cssPrefix}}slider-handle" d="M0 7.5 L15 7.5 M7.5 15 L7.5 0 M2 7 a5.5 5.5 0 1 1 0 1 Z" stroke="black" stroke-width="0.75" fill="none" />',"</svg>"].join("\n"),s=['<div class="{{cssPrefix}}vml-slider">','<v:rect strokecolor="none" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill class="{{cssPrefix}}vml {{cssPrefix}}slider-basecolor" type="gradient" method="none" color="#ff0000" color2="#fff" angle="90" />',"</v:rect>",'<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill type="gradient" method="none" color="black" color2="white" o:opacity2="0%" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}slider-handle" coordsize="1 1" style="width:1px;height:1px;"path="m 0,7 l 14,7 m 7,14 l 7,0 ar 12,12 2,2 z" filled="false" stroked="true" />',"</div>"].join("\n"),a=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-huebar">',"<defs>",'<linearGradient id="g-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" stop-color="rgb(255,0,0)" />','<stop offset="16.666%" stop-color="rgb(255,255,0)" />','<stop offset="33.333%" stop-color="rgb(0,255,0)" />','<stop offset="50%" stop-color="rgb(0,255,255)" />','<stop offset="66.666%" stop-color="rgb(0,0,255)" />','<stop offset="83.333%" stop-color="rgb(255,0,255)" />','<stop offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>","</defs>",'<rect width="18px" height="100%" fill="url(#g-{{id}})"></rect>','<path transform="translate(-6,-3)" class="{{cssPrefix}}huebar-handle" d="M0 0 L4 4 L0 8 L0 0 Z" fill="black" stroke="none" />',"</svg>"].join("\n"),l=['<div class="{{cssPrefix}}vml-huebar">','<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-huebar-bg">','<v:fill type="gradient" method="none" colors="0% rgb(255,0,0), 16.666% rgb(255,255,0), 33.333% rgb(0,255,0), 50% rgb(0,255,255), 66.666% rgb(0,0,255), 83.333% rgb(255,0,255), 100% rgb(255,0,0)" angle="180" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}huebar-handle" coordsize="1 1" style="width:1px;height:1px;position:absolute;z-index:1;right:22px;top:-3px;"path="m 0,0 l 4,4 l 0,8 l 0,0 z" filled="true" fillcolor="black" stroked="false" />',"</div>"].join("\n");i&&t.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),e.exports={layout:r,slider:i?s:o,huebar:i?l:a}}).call(this,n(25))}])},e.exports=t()},8618:(e,t,n)=>{var i;window,i=function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s="./src/index.js")}({
vendor: 651 bytes, line 2
2"./node_modules/core-js-pure/es/promise/index.js":function(e,t,n){n("./node_modules/core-js-pure/modules/es.aggregate-error.js"),n("./node_modules/core-js-pure/modules/es.object.to-string.js"),n("./node_modules/core-js-pure/modules/es.promise.js"),n("./node_modules/core-js-pure/modules/es.promise.all-settled.js"),n("./node_modules/core-js-pure/modules/es.promise.any.js"),n("./node_modules/core-js-pure/modules/es.promise.finally.js"),n("./node_modules/core-js-pure/modules/es.string.iterator.js"),n("./node_modules/core-js-pure/modules/web.dom-collections.iterator.js");var i=n("./node_modules/core-js-pure/internals/path.js");e.exports=i.Promise},
vendor: 408 bytes, line 2
2"./node_modules/core-js-pure/features/promise/index.js":function(e,t,n){var i=n("./node_modules/core-js-pure/es/promise/index.js");n("./node_modules/core-js-pure/modules/esnext.aggregate-error.js"),n("./node_modules/core-js-pure/modules/esnext.promise.all-settled.js"),n("./node_modules/core-js-pure/modules/esnext.promise.try.js"),n("./node_modules/core-js-pure/modules/esnext.promise.any.js"),e.exports=i},
vendor: 173 bytes, line 2
2"./node_modules/core-js-pure/internals/a-function.js":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},
vendor: 252 bytes, line 2
2"./node_modules/core-js-pure/internals/a-possible-prototype.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/is-object.js");e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},
vendor: 100 bytes, line 2
2"./node_modules/core-js-pure/internals/add-to-unscopables.js":function(e,t){e.exports=function(){}},
vendor: 183 bytes, line 2
2"./node_modules/core-js-pure/internals/an-instance.js":function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},
vendor: 220 bytes, line 2
2"./node_modules/core-js-pure/internals/an-object.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/is-object.js");e.exports=function(e){if(!i(e))throw TypeError(String(e)+" is not an object");return e}},
vendor: 504 bytes, line 2
2"./node_modules/core-js-pure/internals/array-includes.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/to-indexed-object.js"),r=n("./node_modules/core-js-pure/internals/to-length.js"),o=n("./node_modules/core-js-pure/internals/to-absolute-index.js"),s=function(e){return function(t,n,s){var a,l=i(t),c=r(l.length),u=o(s,c);if(e&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},
vendor: 479 bytes, line 2
2"./node_modules/core-js-pure/internals/check-correctness-of-iteration.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/well-known-symbol.js")("iterator"),r=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){r=!0}};s[i]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var o={};o[i]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(e){}return n}},
vendor: 140 bytes, line 2
2"./node_modules/core-js-pure/internals/classof-raw.js":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},
vendor: 563 bytes, line 2
2"./node_modules/core-js-pure/internals/classof.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/to-string-tag-support.js"),r=n("./node_modules/core-js-pure/internals/classof-raw.js"),o=n("./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag"),s="Arguments"==r(function(){return arguments}());e.exports=i?r:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:s?r(t):"Object"==(i=r(t))&&"function"==typeof t.callee?"Arguments":i}},
vendor: 264 bytes, line 2
2"./node_modules/core-js-pure/internals/correct-prototype-getter.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/fails.js");e.exports=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},
vendor: 580 bytes, line 2
2"./node_modules/core-js-pure/internals/create-iterator-constructor.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/iterators-core.js").IteratorPrototype,r=n("./node_modules/core-js-pure/internals/object-create.js"),o=n("./node_modules/core-js-pure/internals/create-property-descriptor.js"),s=n("./node_modules/core-js-pure/internals/set-to-string-tag.js"),a=n("./node_modules/core-js-pure/internals/iterators.js"),l=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=r(i,{next:o(1,n)}),s(e,c,!1,!0),a[c]=l,e}},
vendor: 386 bytes, line 2
2"./node_modules/core-js-pure/internals/create-non-enumerable-property.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/descriptors.js"),r=n("./node_modules/core-js-pure/internals/object-define-property.js"),o=n("./node_modules/core-js-pure/internals/create-property-descriptor.js");e.exports=i?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},
vendor: 180 bytes, line 2
2"./node_modules/core-js-pure/internals/create-property-descriptor.js":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},
vendor: 1,650 bytes, line 2
2"./node_modules/core-js-pure/internals/define-iterator.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/export.js"),r=n("./node_modules/core-js-pure/internals/create-iterator-constructor.js"),o=n("./node_modules/core-js-pure/internals/object-get-prototype-of.js"),s=n("./node_modules/core-js-pure/internals/object-set-prototype-of.js"),a=n("./node_modules/core-js-pure/internals/set-to-string-tag.js"),l=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),c=n("./node_modules/core-js-pure/internals/redefine.js"),u=n("./node_modules/core-js-pure/internals/well-known-symbol.js"),h=n("./node_modules/core-js-pure/internals/is-pure.js"),d=n("./node_modules/core-js-pure/internals/iterators.js"),f=n("./node_modules/core-js-pure/internals/iterators-core.js"),p=f.IteratorPrototype,g=f.BUGGY_SAFARI_ITERATORS,m=u("iterator"),v="keys",y="values",_="entries",b=function(){return this};e.exports=function(e,t,n,u,f,x,C){r(n,t,u);var j,w,S,k=function(e){if(e===f&&P)return P;if(!g&&e in T)return T[e];switch(e){case v:case y:case _:return function(){return new n(this,e)}}return function(){return new n(this)}},O=t+" Iterator",E=!1,T=e.prototype,M=T[m]||T["@@iterator"]||f&&T[f],P=!g&&M||k(f),A="Array"==t&&T.entries||M;if(A&&(j=o(A.call(new e)),p!==Object.prototype&&j.next&&(h||o(j)===p||(s?s(j,p):"function"!=typeof j[m]&&l(j,m,b)),a(j,O,!0,!0),h&&(d[O]=b))),f==y&&M&&M.name!==y&&(E=!0,P=function(){return M.call(this)}),h&&!C||T[m]===P||l(T,m,P),d[t]=P,f)if(w={values:k(y),keys:x?P:k(v),entries:k(_)},C)for(S in w)(g||E||!(S in T))&&c(T,S,w[S]);else i({target:t,proto:!0,forced:g||E},w);return w}},
vendor: 226 bytes, line 2
2"./node_modules/core-js-pure/internals/descriptors.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/fails.js");e.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},
vendor: 295 bytes, line 2
2"./node_modules/core-js-pure/internals/document-create-element.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/global.js"),r=n("./node_modules/core-js-pure/internals/is-object.js"),o=i.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},
vendor: 584 bytes, line 2
2"./node_modules/core-js-pure/internals/dom-iterables.js":function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},
vendor: 110 bytes, line 2
2"./node_modules/core-js-pure/internals/engine-is-browser.js":function(e,t){e.exports="object"==typeof window},
vendor: 199 bytes, line 2
2"./node_modules/core-js-pure/internals/engine-is-ios.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/engine-user-agent.js");e.exports=/(?:iphone|ipod|ipad).*applewebkit/i.test(i)},
vendor: 228 bytes, line 2
2"./node_modules/core-js-pure/internals/engine-is-node.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/classof-raw.js"),r=n("./node_modules/core-js-pure/internals/global.js");e.exports="process"==i(r.process)},
vendor: 192 bytes, line 2
2"./node_modules/core-js-pure/internals/engine-is-webos-webkit.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/engine-user-agent.js");e.exports=/web0s(?!.*chrome)/i.test(i)},
vendor: 184 bytes, line 2
2"./node_modules/core-js-pure/internals/engine-user-agent.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/get-built-in.js");e.exports=i("navigator","userAgent")||""},
vendor: 382 bytes, line 2
2"./node_modules/core-js-pure/internals/engine-v8-version.js":function(e,t,n){var i,r,o=n("./node_modules/core-js-pure/internals/global.js"),s=n("./node_modules/core-js-pure/internals/engine-user-agent.js"),a=o.process,l=a&&a.versions,c=l&&l.v8;c?r=(i=c.split("."))[0]<4?1:i[0]+i[1]:s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(r=i[1]),e.exports=r&&+r},
vendor: 192 bytes, line 2
2"./node_modules/core-js-pure/internals/enum-bug-keys.js":function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},
vendor: 1,285 bytes, line 2
2"./node_modules/core-js-pure/internals/export.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/global.js"),r=n("./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js").f,o=n("./node_modules/core-js-pure/internals/is-forced.js"),s=n("./node_modules/core-js-pure/internals/path.js"),a=n("./node_modules/core-js-pure/internals/function-bind-context.js"),l=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),c=n("./node_modules/core-js-pure/internals/has.js"),u=function(e){var t=function(t,n,i){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,h,d,f,p,g,m,v,y=e.target,_=e.global,b=e.stat,x=e.proto,C=_?i:b?i[y]:(i[y]||{}).prototype,j=_?s:s[y]||(s[y]={}),w=j.prototype;for(d in t)n=!o(_?d:y+(b?".":"#")+d,e.forced)&&C&&c(C,d),p=j[d],n&&(g=e.noTargetGet?(v=r(C,d))&&v.value:C[d]),f=n&&g?g:t[d],n&&typeof p==typeof f||(m=e.bind&&n?a(f,i):e.wrap&&n?u(f):x&&"function"==typeof f?a(Function.call,f):f,(e.sham||f&&f.sham||p&&p.sham)&&l(m,"sham",!0),j[d]=m,x&&(c(s,h=y+"Prototype")||l(s,h,{}),s[h][d]=f,e.real&&w&&!w[d]&&l(w,d,f)))}},
vendor: 122 bytes, line 2
2"./node_modules/core-js-pure/internals/fails.js":function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},
vendor: 450 bytes, line 2
2"./node_modules/core-js-pure/internals/function-bind-context.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/a-function.js");e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},
vendor: 333 bytes, line 2
2"./node_modules/core-js-pure/internals/get-built-in.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/path.js"),r=n("./node_modules/core-js-pure/internals/global.js"),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(i[e])||o(r[e]):i[e]&&i[e][t]||r[e]&&r[e][t]}},
vendor: 348 bytes, line 2
2"./node_modules/core-js-pure/internals/get-iterator-method.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/classof.js"),r=n("./node_modules/core-js-pure/internals/iterators.js"),o=n("./node_modules/core-js-pure/internals/well-known-symbol.js")("iterator");e.exports=function(e){if(null!=e)return e[o]||e["@@iterator"]||r[i(e)]}},
vendor: 385 bytes, line 2
2"./node_modules/core-js-pure/internals/global.js":function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n("./node_modules/webpack/buildin/global.js"))},
vendor: 193 bytes, line 2
2"./node_modules/core-js-pure/internals/has.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/to-object.js"),r={}.hasOwnProperty;e.exports=function(e,t){return r.call(i(e),t)}},
vendor: 83 bytes, line 2
2"./node_modules/core-js-pure/internals/hidden-keys.js":function(e,t){e.exports={}},
vendor: 238 bytes, line 2
2"./node_modules/core-js-pure/internals/host-report-errors.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/global.js");e.exports=function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},
vendor: 172 bytes, line 2
2"./node_modules/core-js-pure/internals/html.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/get-built-in.js");e.exports=i("document","documentElement")},
vendor: 372 bytes, line 2
2"./node_modules/core-js-pure/internals/ie8-dom-define.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/descriptors.js"),r=n("./node_modules/core-js-pure/internals/fails.js"),o=n("./node_modules/core-js-pure/internals/document-create-element.js");e.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},
vendor: 338 bytes, line 2
2"./node_modules/core-js-pure/internals/indexed-object.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/fails.js"),r=n("./node_modules/core-js-pure/internals/classof-raw.js"),o="".split;e.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?o.call(e,""):Object(e)}:Object},
vendor: 270 bytes, line 2
2"./node_modules/core-js-pure/internals/inspect-source.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/shared-store.js"),r=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(e){return r.call(e)}),e.exports=i.inspectSource},
vendor: 1,241 bytes, line 2
2"./node_modules/core-js-pure/internals/internal-state.js":function(e,t,n){var i,r,o,s=n("./node_modules/core-js-pure/internals/native-weak-map.js"),a=n("./node_modules/core-js-pure/internals/global.js"),l=n("./node_modules/core-js-pure/internals/is-object.js"),c=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),u=n("./node_modules/core-js-pure/internals/has.js"),h=n("./node_modules/core-js-pure/internals/shared-store.js"),d=n("./node_modules/core-js-pure/internals/shared-key.js"),f=n("./node_modules/core-js-pure/internals/hidden-keys.js"),p="Object already initialized",g=a.WeakMap;if(s||h.state){var m=h.state||(h.state=new g),v=m.get,y=m.has,_=m.set;i=function(e,t){if(y.call(m,e))throw new TypeError(p);return t.facade=e,_.call(m,e,t),t},r=function(e){return v.call(m,e)||{}},o=function(e){return y.call(m,e)}}else{var b=d("state");f[b]=!0,i=function(e,t){if(u(e,b))throw new TypeError(p);return t.facade=e,c(e,b,t),t},r=function(e){return u(e,b)?e[b]:{}},o=function(e){return u(e,b)}}e.exports={set:i,get:r,has:o,enforce:function(e){return o(e)?r(e):i(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=r(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},
vendor: 313 bytes, line 2
2"./node_modules/core-js-pure/internals/is-array-iterator-method.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/well-known-symbol.js"),r=n("./node_modules/core-js-pure/internals/iterators.js"),o=i("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||s[o]===e)}},
vendor: 359 bytes, line 2
2"./node_modules/core-js-pure/internals/is-forced.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/fails.js"),r=/#|\.prototype\./,o=function(e,t){var n=a[s(e)];return n==c||n!=l&&("function"==typeof t?i(t):!!t)},s=o.normalize=function(e){return String(e).replace(r,".").toLowerCase()},a=o.data={},l=o.NATIVE="N",c=o.POLYFILL="P";e.exports=o},
vendor: 146 bytes, line 2
2"./node_modules/core-js-pure/internals/is-object.js":function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},
vendor: 79 bytes, line 2
2"./node_modules/core-js-pure/internals/is-pure.js":function(e,t){e.exports=!0},
vendor: 1,103 bytes, line 2
2"./node_modules/core-js-pure/internals/iterate.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/an-object.js"),r=n("./node_modules/core-js-pure/internals/is-array-iterator-method.js"),o=n("./node_modules/core-js-pure/internals/to-length.js"),s=n("./node_modules/core-js-pure/internals/function-bind-context.js"),a=n("./node_modules/core-js-pure/internals/get-iterator-method.js"),l=n("./node_modules/core-js-pure/internals/iterator-close.js"),c=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var u,h,d,f,p,g,m,v=n&&n.that,y=!(!n||!n.AS_ENTRIES),_=!(!n||!n.IS_ITERATOR),b=!(!n||!n.INTERRUPTED),x=s(t,v,1+y+b),C=function(e){return u&&l(u),new c(!0,e)},j=function(e){return y?(i(e),b?x(e[0],e[1],C):x(e[0],e[1])):b?x(e,C):x(e)};if(_)u=e;else{if("function"!=typeof(h=a(e)))throw TypeError("Target is not iterable");if(r(h)){for(d=0,f=o(e.length);f>d;d++)if((p=j(e[d]))&&p instanceof c)return p;return new c(!1)}u=h.call(e)}for(g=u.next;!(m=g.call(u)).done;){try{p=j(m.value)}catch(e){throw l(u),e}if("object"==typeof p&&p&&p instanceof c)return p}return new c(!1)}},
vendor: 215 bytes, line 2
2"./node_modules/core-js-pure/internals/iterator-close.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/an-object.js");e.exports=function(e){var t=e.return;if(void 0!==t)return i(t.call(e)).value}},
vendor: 754 bytes, line 2
2"./node_modules/core-js-pure/internals/iterators-core.js":function(e,t,n){"use strict";var i,r,o,s=n("./node_modules/core-js-pure/internals/fails.js"),a=n("./node_modules/core-js-pure/internals/object-get-prototype-of.js"),l=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),c=n("./node_modules/core-js-pure/internals/has.js"),u=n("./node_modules/core-js-pure/internals/well-known-symbol.js"),h=n("./node_modules/core-js-pure/internals/is-pure.js"),d=u("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(r=a(a(o)))!==Object.prototype&&(i=r):f=!0);var p=null==i||s((function(){var e={};return i[d].call(e)!==e}));p&&(i={}),h&&!p||c(i,d)||l(i,d,(function(){return this})),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:f}},
vendor: 81 bytes, line 2
2"./node_modules/core-js-pure/internals/iterators.js":function(e,t){e.exports={}},
vendor: 1,077 bytes, line 2
2"./node_modules/core-js-pure/internals/microtask.js":function(e,t,n){var i,r,o,s,a,l,c,u,h=n("./node_modules/core-js-pure/internals/global.js"),d=n("./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js").f,f=n("./node_modules/core-js-pure/internals/task.js").set,p=n("./node_modules/core-js-pure/internals/engine-is-ios.js"),g=n("./node_modules/core-js-pure/internals/engine-is-webos-webkit.js"),m=n("./node_modules/core-js-pure/internals/engine-is-node.js"),v=h.MutationObserver||h.WebKitMutationObserver,y=h.document,_=h.process,b=h.Promise,x=d(h,"queueMicrotask"),C=x&&x.value;C||(i=function(){var e,t;for(m&&(e=_.domain)&&e.exit();r;){t=r.fn,r=r.next;try{t()}catch(e){throw r?s():o=void 0,e}}o=void 0,e&&e.enter()},p||m||g||!v||!y?b&&b.resolve?((c=b.resolve(void 0)).constructor=b,u=c.then,s=function(){u.call(c,i)}):s=m?function(){_.nextTick(i)}:function(){f.call(h,i)}:(a=!0,l=y.createTextNode(""),new v(i).observe(l,{characterData:!0}),s=function(){l.data=a=!a})),e.exports=C||function(e){var t={fn:e,next:void 0};o&&(o.next=t),r||(r=t,s()),o=t}},
vendor: 166 bytes, line 2
2"./node_modules/core-js-pure/internals/native-promise-constructor.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/global.js");e.exports=i.Promise},
vendor: 305 bytes, line 2
2"./node_modules/core-js-pure/internals/native-symbol.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/engine-v8-version.js"),r=n("./node_modules/core-js-pure/internals/fails.js");e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())||!Symbol.sham&&i&&i<41}))},
vendor: 267 bytes, line 2
2"./node_modules/core-js-pure/internals/native-weak-map.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/global.js"),r=n("./node_modules/core-js-pure/internals/inspect-source.js"),o=i.WeakMap;e.exports="function"==typeof o&&/native code/.test(r(o))},
vendor: 372 bytes, line 2
2"./node_modules/core-js-pure/internals/new-promise-capability.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/a-function.js"),r=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=i(t),this.reject=i(n)};e.exports.f=function(e){return new r(e)}},
vendor: 1,142 bytes, line 2
2"./node_modules/core-js-pure/internals/object-create.js":function(e,t,n){var i,r=n("./node_modules/core-js-pure/internals/an-object.js"),o=n("./node_modules/core-js-pure/internals/object-define-properties.js"),s=n("./node_modules/core-js-pure/internals/enum-bug-keys.js"),a=n("./node_modules/core-js-pure/internals/hidden-keys.js"),l=n("./node_modules/core-js-pure/internals/html.js"),c=n("./node_modules/core-js-pure/internals/document-create-element.js"),u=n("./node_modules/core-js-pure/internals/shared-key.js"),h=u("IE_PROTO"),d=function(){},f=function(e){return"<script>"+e+"<\/script>"},p=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;p=i?function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t}(i):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F);for(var n=s.length;n--;)delete p.prototype[s[n]];return p()};a[h]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(d.prototype=r(e),n=new d,d.prototype=null,n[h]=e):n=p(),void 0===t?n:o(n,t)}},
vendor: 461 bytes, line 2
2"./node_modules/core-js-pure/internals/object-define-properties.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/descriptors.js"),r=n("./node_modules/core-js-pure/internals/object-define-property.js"),o=n("./node_modules/core-js-pure/internals/an-object.js"),s=n("./node_modules/core-js-pure/internals/object-keys.js");e.exports=i?Object.defineProperties:function(e,t){o(e);for(var n,i=s(t),a=i.length,l=0;a>l;)r.f(e,n=i[l++],t[n]);return e}},
vendor: 536 bytes, line 2
2"./node_modules/core-js-pure/internals/object-define-property.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/descriptors.js"),r=n("./node_modules/core-js-pure/internals/ie8-dom-define.js"),o=n("./node_modules/core-js-pure/internals/an-object.js"),s=n("./node_modules/core-js-pure/internals/to-primitive.js"),a=Object.defineProperty;t.f=i?a:function(e,t,n){if(o(e),t=s(t,!0),o(n),r)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},
vendor: 701 bytes, line 2
2"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/descriptors.js"),r=n("./node_modules/core-js-pure/internals/object-property-is-enumerable.js"),o=n("./node_modules/core-js-pure/internals/create-property-descriptor.js"),s=n("./node_modules/core-js-pure/internals/to-indexed-object.js"),a=n("./node_modules/core-js-pure/internals/to-primitive.js"),l=n("./node_modules/core-js-pure/internals/has.js"),c=n("./node_modules/core-js-pure/internals/ie8-dom-define.js"),u=Object.getOwnPropertyDescriptor;t.f=i?u:function(e,t){if(e=s(e),t=a(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return o(!r.f.call(e,t),e[t])}},
vendor: 550 bytes, line 2
2"./node_modules/core-js-pure/internals/object-get-prototype-of.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/has.js"),r=n("./node_modules/core-js-pure/internals/to-object.js"),o=n("./node_modules/core-js-pure/internals/shared-key.js"),s=n("./node_modules/core-js-pure/internals/correct-prototype-getter.js"),a=o("IE_PROTO"),l=Object.prototype;e.exports=s?Object.getPrototypeOf:function(e){return e=r(e),i(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},
vendor: 481 bytes, line 2
2"./node_modules/core-js-pure/internals/object-keys-internal.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/has.js"),r=n("./node_modules/core-js-pure/internals/to-indexed-object.js"),o=n("./node_modules/core-js-pure/internals/array-includes.js").indexOf,s=n("./node_modules/core-js-pure/internals/hidden-keys.js");e.exports=function(e,t){var n,a=r(e),l=0,c=[];for(n in a)!i(s,n)&&i(a,n)&&c.push(n);for(;t.length>l;)i(a,n=t[l++])&&(~o(c,n)||c.push(n));return c}},
vendor: 257 bytes, line 2
2"./node_modules/core-js-pure/internals/object-keys.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/object-keys-internal.js"),r=n("./node_modules/core-js-pure/internals/enum-bug-keys.js");e.exports=Object.keys||function(e){return i(e,r)}},
vendor: 250 bytes, line 2
2"./node_modules/core-js-pure/internals/object-property-is-enumerable.js":function(e,t,n){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!i.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:i},
vendor: 488 bytes, line 2
2"./node_modules/core-js-pure/internals/object-set-prototype-of.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/an-object.js"),r=n("./node_modules/core-js-pure/internals/a-possible-prototype.js");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,o){return i(n),r(o),t?e.call(n,o):n.__proto__=o,n}}():void 0)},
vendor: 285 bytes, line 2
2"./node_modules/core-js-pure/internals/object-to-string.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/to-string-tag-support.js"),r=n("./node_modules/core-js-pure/internals/classof.js");e.exports=i?{}.toString:function(){return"[object "+r(this)+"]"}},
vendor: 76 bytes, line 2
2"./node_modules/core-js-pure/internals/path.js":function(e,t){e.exports={}},
vendor: 155 bytes, line 2
2"./node_modules/core-js-pure/internals/perform.js":function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},
vendor: 379 bytes, line 2
2"./node_modules/core-js-pure/internals/promise-resolve.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/an-object.js"),r=n("./node_modules/core-js-pure/internals/is-object.js"),o=n("./node_modules/core-js-pure/internals/new-promise-capability.js");e.exports=function(e,t){if(i(e),r(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},
vendor: 227 bytes, line 2
2"./node_modules/core-js-pure/internals/redefine-all.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/redefine.js");e.exports=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:i(e,r,t[r],n);return e}},
vendor: 213 bytes, line 2
2"./node_modules/core-js-pure/internals/redefine.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js");e.exports=function(e,t,n,r){r&&r.enumerable?e[t]=n:i(e,t,n)}},
vendor: 169 bytes, line 2
2"./node_modules/core-js-pure/internals/require-object-coercible.js":function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},
vendor: 272 bytes, line 2
2"./node_modules/core-js-pure/internals/set-global.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/global.js"),r=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js");e.exports=function(e,t){try{r(i,e,t)}catch(n){i[e]=t}return t}},
vendor: 468 bytes, line 2
2"./node_modules/core-js-pure/internals/set-species.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/get-built-in.js"),r=n("./node_modules/core-js-pure/internals/object-define-property.js"),o=n("./node_modules/core-js-pure/internals/well-known-symbol.js"),s=n("./node_modules/core-js-pure/internals/descriptors.js"),a=o("species");e.exports=function(e){var t=i(e),n=r.f;s&&t&&!t[a]&&n(t,a,{configurable:!0,get:function(){return this}})}},
vendor: 626 bytes, line 2
2"./node_modules/core-js-pure/internals/set-to-string-tag.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/to-string-tag-support.js"),r=n("./node_modules/core-js-pure/internals/object-define-property.js").f,o=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),s=n("./node_modules/core-js-pure/internals/has.js"),a=n("./node_modules/core-js-pure/internals/object-to-string.js"),l=n("./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag");e.exports=function(e,t,n,c){if(e){var u=n?e:e.prototype;s(u,l)||r(u,l,{configurable:!0,value:t}),c&&!i&&o(u,"toString",a)}}},
vendor: 242 bytes, line 2
2"./node_modules/core-js-pure/internals/shared-key.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/shared.js"),r=n("./node_modules/core-js-pure/internals/uid.js"),o=i("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},
vendor: 242 bytes, line 2
2"./node_modules/core-js-pure/internals/shared-store.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/global.js"),r=n("./node_modules/core-js-pure/internals/set-global.js"),o="__core-js_shared__",s=i[o]||r(o,{});e.exports=s},
vendor: 364 bytes, line 2
2"./node_modules/core-js-pure/internals/shared.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/is-pure.js"),r=n("./node_modules/core-js-pure/internals/shared-store.js");(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.13.0",mode:i?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},
vendor: 372 bytes, line 2
2"./node_modules/core-js-pure/internals/species-constructor.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/an-object.js"),r=n("./node_modules/core-js-pure/internals/a-function.js"),o=n("./node_modules/core-js-pure/internals/well-known-symbol.js")("species");e.exports=function(e,t){var n,s=i(e).constructor;return void 0===s||null==(n=i(s)[o])?t:r(n)}},
vendor: 501 bytes, line 2
2"./node_modules/core-js-pure/internals/string-multibyte.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/to-integer.js"),r=n("./node_modules/core-js-pure/internals/require-object-coercible.js"),o=function(e){return function(t,n){var o,s,a=String(r(t)),l=i(n),c=a.length;return l<0||l>=c?e?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?e?a.charAt(l):o:e?a.slice(l,l+2):s-56320+(o-55296<<10)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},
vendor: 1,468 bytes, line 2
2"./node_modules/core-js-pure/internals/task.js":function(e,t,n){var i,r,o,s=n("./node_modules/core-js-pure/internals/global.js"),a=n("./node_modules/core-js-pure/internals/fails.js"),l=n("./node_modules/core-js-pure/internals/function-bind-context.js"),c=n("./node_modules/core-js-pure/internals/html.js"),u=n("./node_modules/core-js-pure/internals/document-create-element.js"),h=n("./node_modules/core-js-pure/internals/engine-is-ios.js"),d=n("./node_modules/core-js-pure/internals/engine-is-node.js"),f=s.location,p=s.setImmediate,g=s.clearImmediate,m=s.process,v=s.MessageChannel,y=s.Dispatch,_=0,b={},x="onreadystatechange",C=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},j=function(e){return function(){C(e)}},w=function(e){C(e.data)},S=function(e){s.postMessage(e+"",f.protocol+"//"+f.host)};p&&g||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return b[++_]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(_),_},g=function(e){delete b[e]},d?i=function(e){m.nextTick(j(e))}:y&&y.now?i=function(e){y.now(j(e))}:v&&!h?(o=(r=new v).port2,r.port1.onmessage=w,i=l(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&f&&"file:"!==f.protocol&&!a(S)?(i=S,s.addEventListener("message",w,!1)):i=x in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),C(e)}}:function(e){setTimeout(j(e),0)}),e.exports={set:p,clear:g}},
vendor: 226 bytes, line 2
2"./node_modules/core-js-pure/internals/to-absolute-index.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/to-integer.js"),r=Math.max,o=Math.min;e.exports=function(e,t){var n=i(e);return n<0?r(n+t,0):o(n,t)}},
vendor: 256 bytes, line 2
2"./node_modules/core-js-pure/internals/to-indexed-object.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/indexed-object.js"),r=n("./node_modules/core-js-pure/internals/require-object-coercible.js");e.exports=function(e){return i(r(e))}},
vendor: 155 bytes, line 2
2"./node_modules/core-js-pure/internals/to-integer.js":function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},
vendor: 205 bytes, line 2
2"./node_modules/core-js-pure/internals/to-length.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/to-integer.js"),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},
vendor: 190 bytes, line 2
2"./node_modules/core-js-pure/internals/to-object.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/require-object-coercible.js");e.exports=function(e){return Object(i(e))}},
vendor: 437 bytes, line 2
2"./node_modules/core-js-pure/internals/to-primitive.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/is-object.js");e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},
vendor: 212 bytes, line 2
2"./node_modules/core-js-pure/internals/to-string-tag-support.js":function(e,t,n){var i={};i[n("./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag")]="z",e.exports="[object z]"===String(i)},
vendor: 175 bytes, line 2
2"./node_modules/core-js-pure/internals/uid.js":function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+i).toString(36)}},
vendor: 204 bytes, line 2
2"./node_modules/core-js-pure/internals/use-symbol-as-uid.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/native-symbol.js");e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},
vendor: 587 bytes, line 2
2"./node_modules/core-js-pure/internals/well-known-symbol.js":function(e,t,n){var i=n("./node_modules/core-js-pure/internals/global.js"),r=n("./node_modules/core-js-pure/internals/shared.js"),o=n("./node_modules/core-js-pure/internals/has.js"),s=n("./node_modules/core-js-pure/internals/uid.js"),a=n("./node_modules/core-js-pure/internals/native-symbol.js"),l=n("./node_modules/core-js-pure/internals/use-symbol-as-uid.js"),c=r("wks"),u=i.Symbol,h=l?u:u&&u.withoutSetter||s;e.exports=function(e){return o(c,e)&&(a||"string"==typeof c[e])||(a&&o(u,e)?c[e]=u[e]:c[e]=h("Symbol."+e)),c[e]}},
vendor: 886 bytes, line 2
2"./node_modules/core-js-pure/modules/es.aggregate-error.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/export.js"),r=n("./node_modules/core-js-pure/internals/object-get-prototype-of.js"),o=n("./node_modules/core-js-pure/internals/object-set-prototype-of.js"),s=n("./node_modules/core-js-pure/internals/object-create.js"),a=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),l=n("./node_modules/core-js-pure/internals/create-property-descriptor.js"),c=n("./node_modules/core-js-pure/internals/iterate.js"),u=function(e,t){var n=this;if(!(n instanceof u))return new u(e,t);o&&(n=o(new Error(void 0),r(n))),void 0!==t&&a(n,"message",String(t));var i=[];return c(e,i.push,{that:i}),a(n,"errors",i),n};u.prototype=s(Error.prototype,{constructor:l(5,u),message:l(5,""),name:l(5,"AggregateError")}),i({global:!0},{AggregateError:u})},
vendor: 816 bytes, line 2
2"./node_modules/core-js-pure/modules/es.array.iterator.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/to-indexed-object.js"),r=n("./node_modules/core-js-pure/internals/add-to-unscopables.js"),o=n("./node_modules/core-js-pure/internals/iterators.js"),s=n("./node_modules/core-js-pure/internals/internal-state.js"),a=n("./node_modules/core-js-pure/internals/define-iterator.js"),l="Array Iterator",c=s.set,u=s.getterFor(l);e.exports=a(Array,"Array",(function(e,t){c(this,{type:l,target:i(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},
vendor: 77 bytes, line 2
2"./node_modules/core-js-pure/modules/es.object.to-string.js":function(e,t){},
vendor: 802 bytes, line 2
2"./node_modules/core-js-pure/modules/es.promise.all-settled.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/export.js"),r=n("./node_modules/core-js-pure/internals/a-function.js"),o=n("./node_modules/core-js-pure/internals/new-promise-capability.js"),s=n("./node_modules/core-js-pure/internals/perform.js"),a=n("./node_modules/core-js-pure/internals/iterate.js");i({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=o.f(t),i=n.resolve,l=n.reject,c=s((function(){var n=r(t.resolve),o=[],s=0,l=1;a(e,(function(e){var r=s++,a=!1;o.push(void 0),l++,n.call(t,e).then((function(e){a||(a=!0,o[r]={status:"fulfilled",value:e},--l||i(o))}),(function(e){a||(a=!0,o[r]={status:"rejected",reason:e},--l||i(o))}))})),--l||i(o)}));return c.error&&l(c.value),n.promise}})},
vendor: 877 bytes, line 2
2"./node_modules/core-js-pure/modules/es.promise.any.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/export.js"),r=n("./node_modules/core-js-pure/internals/a-function.js"),o=n("./node_modules/core-js-pure/internals/get-built-in.js"),s=n("./node_modules/core-js-pure/internals/new-promise-capability.js"),a=n("./node_modules/core-js-pure/internals/perform.js"),l=n("./node_modules/core-js-pure/internals/iterate.js"),c="No one promise resolved";i({target:"Promise",stat:!0},{any:function(e){var t=this,n=s.f(t),i=n.resolve,u=n.reject,h=a((function(){var n=r(t.resolve),s=[],a=0,h=1,d=!1;l(e,(function(e){var r=a++,l=!1;s.push(void 0),h++,n.call(t,e).then((function(e){l||d||(d=!0,i(e))}),(function(e){l||d||(l=!0,s[r]=e,--h||u(new(o("AggregateError"))(s,c)))}))})),--h||u(new(o("AggregateError"))(s,c))}));return h.error&&u(h.value),n.promise}})},
vendor: 1,058 bytes, line 2
2"./node_modules/core-js-pure/modules/es.promise.finally.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/export.js"),r=n("./node_modules/core-js-pure/internals/is-pure.js"),o=n("./node_modules/core-js-pure/internals/native-promise-constructor.js"),s=n("./node_modules/core-js-pure/internals/fails.js"),a=n("./node_modules/core-js-pure/internals/get-built-in.js"),l=n("./node_modules/core-js-pure/internals/species-constructor.js"),c=n("./node_modules/core-js-pure/internals/promise-resolve.js"),u=n("./node_modules/core-js-pure/internals/redefine.js");if(i({target:"Promise",proto:!0,real:!0,forced:!!o&&s((function(){o.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=l(this,a("Promise")),n="function"==typeof e;return this.then(n?function(n){return c(t,e()).then((function(){return n}))}:e,n?function(n){return c(t,e()).then((function(){throw n}))}:e)}}),!r&&"function"==typeof o){var h=a("Promise").prototype.finally;o.prototype.finally!==h&&u(o.prototype,"finally",h,{unsafe:!0})}},
vendor: 5,649 bytes, line 2
2"./node_modules/core-js-pure/modules/es.promise.js":function(e,t,n){"use strict";var i,r,o,s,a=n("./node_modules/core-js-pure/internals/export.js"),l=n("./node_modules/core-js-pure/internals/is-pure.js"),c=n("./node_modules/core-js-pure/internals/global.js"),u=n("./node_modules/core-js-pure/internals/get-built-in.js"),h=n("./node_modules/core-js-pure/internals/native-promise-constructor.js"),d=n("./node_modules/core-js-pure/internals/redefine.js"),f=n("./node_modules/core-js-pure/internals/redefine-all.js"),p=n("./node_modules/core-js-pure/internals/object-set-prototype-of.js"),g=n("./node_modules/core-js-pure/internals/set-to-string-tag.js"),m=n("./node_modules/core-js-pure/internals/set-species.js"),v=n("./node_modules/core-js-pure/internals/is-object.js"),y=n("./node_modules/core-js-pure/internals/a-function.js"),_=n("./node_modules/core-js-pure/internals/an-instance.js"),b=n("./node_modules/core-js-pure/internals/inspect-source.js"),x=n("./node_modules/core-js-pure/internals/iterate.js"),C=n("./node_modules/core-js-pure/internals/check-correctness-of-iteration.js"),j=n("./node_modules/core-js-pure/internals/species-constructor.js"),w=n("./node_modules/core-js-pure/internals/task.js").set,S=n("./node_modules/core-js-pure/internals/microtask.js"),k=n("./node_modules/core-js-pure/internals/promise-resolve.js"),O=n("./node_modules/core-js-pure/internals/host-report-errors.js"),E=n("./node_modules/core-js-pure/internals/new-promise-capability.js"),T=n("./node_modules/core-js-pure/internals/perform.js"),M=n("./node_modules/core-js-pure/internals/internal-state.js"),P=n("./node_modules/core-js-pure/internals/is-forced.js"),A=n("./node_modules/core-js-pure/internals/well-known-symbol.js"),I=n("./node_modules/core-js-pure/internals/engine-is-browser.js"),D=n("./node_modules/core-js-pure/internals/engine-is-node.js"),L=n("./node_modules/core-js-pure/internals/engine-v8-version.js"),R=A("species"),F="Promise",B=M.get,H=M.set,z=M.getterFor(F),N=h&&h.prototype,U=h,V=N,W=c.TypeError,X=c.document,Y=c.process,G=E.f,q=G,Z=!!(X&&X.createEvent&&c.dispatchEvent),K="function"==typeof PromiseRejectionEvent,J="unhandledrejection",$=!1,Q=P(F,(function(){var e=b(U)!==String(U);if(!e&&66===L)return!0;if(l&&!V.finally)return!0;if(L>=51&&/native code/.test(U))return!1;var t=new U((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(t.constructor={})[R]=n,!($=t.then((function(){}))instanceof n)||!e&&I&&!K})),ee=Q||!C((function(e){U.all(e).catch((function(){}))})),te=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},ne=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;S((function(){for(var i=e.value,r=1==e.state,o=0;n.length>o;){var s,a,l,c=n[o++],u=r?c.ok:c.fail,h=c.resolve,d=c.reject,f=c.domain;try{u?(r||(2===e.rejection&&se(e),e.rejection=1),!0===u?s=i:(f&&f.enter(),s=u(i),f&&(f.exit(),l=!0)),s===c.promise?d(W("Promise-chain cycle")):(a=te(s))?a.call(s,h,d):h(s)):d(i)}catch(e){f&&!l&&f.exit(),d(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&re(e)}))}},ie=function(e,t,n){var i,r;Z?((i=X.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),c.dispatchEvent(i)):i={promise:t,reason:n},!K&&(r=c["on"+e])?r(i):e===J&&O("Unhandled promise rejection",n)},re=function(e){w.call(c,(function(){var t,n=e.facade,i=e.value;if(oe(e)&&(t=T((function(){D?Y.emit("unhandledRejection",i,n):ie(J,n,i)})),e.rejection=D||oe(e)?2:1,t.error))throw t.value}))},oe=function(e){return 1!==e.rejection&&!e.parent},se=function(e){w.call(c,(function(){var t=e.facade;D?Y.emit("rejectionHandled",t):ie("rejectionhandled",t,e.value)}))},ae=function(e,t,n){return function(i){e(t,i,n)}},le=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,ne(e,!0))},ce=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw W("Promise can't be resolved itself");var i=te(t);i?S((function(){var n={done:!1};try{i.call(t,ae(ce,n,e),ae(le,n,e))}catch(t){le(n,t,e)}})):(e.value=t,e.state=1,ne(e,!1))}catch(t){le({done:!1},t,e)}}};if(Q&&(V=(U=function(e){_(this,U,F),y(e),i.call(this);var t=B(this);try{e(ae(ce,t),ae(le,t))}catch(e){le(t,e)}}).prototype,(i=function(e){H(this,{type:F,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(V,{then:function(e,t){var n=z(this),i=G(j(this,U));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=D?Y.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&ne(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new i,t=B(e);this.promise=e,this.resolve=ae(ce,t),this.reject=ae(le,t)},E.f=G=function(e){return e===U||e===o?new r(e):q(e)},!l&&"function"==typeof h&&N!==Object.prototype)){s=N.then,$||(d(N,"then",(function(e,t){var n=this;return new U((function(e,t){s.call(n,e,t)})).then(e,t)}),{unsafe:!0}),d(N,"catch",V.catch,{unsafe:!0}));try{delete N.constructor}catch(e){}p&&p(N,V)}a({global:!0,wrap:!0,forced:Q},{Promise:U}),g(U,F,!1,!0),m(F),o=u(F),a({target:F,stat:!0,forced:Q},{reject:function(e){var t=G(this);return t.reject.call(void 0,e),t.promise}}),a({target:F,stat:!0,forced:l||Q},{resolve:function(e){return k(l&&this===o?U:this,e)}}),a({target:F,stat:!0,forced:ee},{all:function(e){var t=this,n=G(t),i=n.resolve,r=n.reject,o=T((function(){var n=y(t.resolve),o=[],s=0,a=1;x(e,(function(e){var l=s++,c=!1;o.push(void 0),a++,n.call(t,e).then((function(e){c||(c=!0,o[l]=e,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise},race:function(e){var t=this,n=G(t),i=n.reject,r=T((function(){var r=y(t.resolve);x(e,(function(e){r.call(t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}})},
vendor: 554 bytes, line 2
2"./node_modules/core-js-pure/modules/es.string.iterator.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/string-multibyte.js").charAt,r=n("./node_modules/core-js-pure/internals/internal-state.js"),o=n("./node_modules/core-js-pure/internals/define-iterator.js"),s="String Iterator",a=r.set,l=r.getterFor(s);o(String,"String",(function(e){a(this,{type:s,string:String(e),index:0})}),(function(){var e,t=l(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=i(n,r),t.index+=e.length,{value:e,done:!1})}))},
vendor: 144 bytes, line 2
2"./node_modules/core-js-pure/modules/esnext.aggregate-error.js":function(e,t,n){n("./node_modules/core-js-pure/modules/es.aggregate-error.js")},
vendor: 152 bytes, line 2
2"./node_modules/core-js-pure/modules/esnext.promise.all-settled.js":function(e,t,n){n("./node_modules/core-js-pure/modules/es.promise.all-settled.js")},
vendor: 136 bytes, line 2
2"./node_modules/core-js-pure/modules/esnext.promise.any.js":function(e,t,n){n("./node_modules/core-js-pure/modules/es.promise.any.js")},
vendor: 402 bytes, line 2
2"./node_modules/core-js-pure/modules/esnext.promise.try.js":function(e,t,n){"use strict";var i=n("./node_modules/core-js-pure/internals/export.js"),r=n("./node_modules/core-js-pure/internals/new-promise-capability.js"),o=n("./node_modules/core-js-pure/internals/perform.js");i({target:"Promise",stat:!0},{try:function(e){var t=r.f(this),n=o(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},
vendor: 624 bytes, line 2
2"./node_modules/core-js-pure/modules/web.dom-collections.iterator.js":function(e,t,n){n("./node_modules/core-js-pure/modules/es.array.iterator.js");var i=n("./node_modules/core-js-pure/internals/dom-iterables.js"),r=n("./node_modules/core-js-pure/internals/global.js"),o=n("./node_modules/core-js-pure/internals/classof.js"),s=n("./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),a=n("./node_modules/core-js-pure/internals/iterators.js"),l=n("./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag");for(var c in i){var u=r[c],h=u&&u.prototype;h&&o(h)!==l&&s(h,l,c),a[c]=a.Array}},
vendor: 229 bytes, line 2
2"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./src/css/index.styl":function(e,t,n){},
2"./src/index.js":function(e,t,n){"use strict";n("./src/js/polyfill.js");var i,r=n("./src/js/imageEditor.js"),o=(i=r)&&i.__esModule?i:{default:i};n("./src/css/index.styl"),n("./src/js/command/addIcon.js"),n("./src/js/command/addImageObject.js"),n("./src/js/command/addObject.js"),n("./src/js/command/addShape.js"),n("./src/js/command/addText.js"),n("./src/js/command/applyFilter.js"),n("./src/js/command/changeIconColor.js"),n("./src/js/command/changeShape.js"),n("./src/js/command/changeText.js"),n("./src/js/command/changeTextStyle.js"),n("./src/js/command/clearObjects.js"),n("./src/js/command/flip.js"),n("./src/js/command/loadImage.js"),n("./src/js/command/removeFilter.js"),n("./src/js/command/removeObject.js"),n("./src/js/command/resizeCanvasDimension.js"),n("./src/js/command/rotate.js"),n("./src/js/command/setObjectProperties.js"),n("./src/js/command/setObjectPosition.js"),n("./src/js/command/changeSelection.js"),n("./src/js/command/resize.js"),e.exports=o.default},
2"./src/js/action.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("tui-code-snippet"),o=n("./src/js/helper/imagetracer.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/util.js"),l=n("./src/js/consts.js");t.default={getActions:function(){return{main:this._mainAction(),shape:this._shapeAction(),crop:this._cropAction(),resize:this._resizeAction(),flip:this._flipAction(),rotate:this._rotateAction(),text:this._textAction(),mask:this._maskAction(),draw:this._drawAction(),icon:this._iconAction(),filter:this._filterAction(),history:this._historyAction()}},_mainAction:function(){var e=this,t=function(){"crop"===e.ui.submenu&&(e.stopDrawingMode(),e.ui.changeMenu("crop"))},n=function(t){var n,i;return n=t,"rotate"===e.ui.submenu&&e.ui.rotate.setRangeBarAngle("setAngle",n),i=t,"filter"===e.ui.submenu&&e.ui.filter.setFilterState(i),t},i=function(){e.ui.filter&&e.ui.filter.initFilterCheckBoxState()};return(0,r.extend)({initLoadImage:function(n,i){return e.loadImageFromURL(n,i).then((function(i){t(),e.ui.initializeImgUrl=n,e.ui.resizeEditor({imageSize:i}),e.clearUndoStack(),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.LOAD_IMAGE)}))},undo:function(){e.isEmptyUndoStack()||(t(),e.deactivateAll(),e.undo().then(n))},redo:function(){e.isEmptyRedoStack()||(t(),e.deactivateAll(),e.redo().then(n))},reset:function(){t(),e.loadImageFromURL(e.ui.initializeImgUrl,"resetImage").then((function(n){t(),i(),e.ui.resizeEditor({imageSize:n}),e.clearUndoStack(),e._initHistory()}))},delete:function(){e.ui.changeHelpButtonEnabled("delete",!1),t(),e.removeActiveObject(),e.activeObjectId=null},deleteAll:function(){t(),e.clearObjects(),e.ui.changeHelpButtonEnabled("delete",!1),e.ui.changeHelpButtonEnabled("deleteAll",!1)},load:function(n){(0,a.isSupportFileApi)()||alert("This browser does not support file-api"),e.ui.initializeImgUrl=URL.createObjectURL(n),e.loadImageFromFile(n).then((function(n){t(),i(),e.clearUndoStack(),e.ui.activeMenuEvent(),e.ui.resizeEditor({imageSize:n}),e._clearHistory(),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.LOAD_IMAGE)})).catch((function(e){return Promise.reject(e)}))},download:function(){var t=e.toDataURL(),n=e.getImageName(),i=void 0,r=void 0;(0,a.isSupportFileApi)()&&window.saveAs?(r=(i=(0,a.base64ToBlob)(t)).type.split("/")[1],n.split(".").pop()!==r&&(n+="."+r),saveAs(i,n)):window.open().document.body.innerHTML="<img src='"+t+"'>"},history:function(t){e.ui.toggleHistoryMenu(t)},zoomIn:function(){var t;e.ui.toggleZoomButtonStatus("zoomIn"),e.deactivateAll(),t=e._graphics.getZoomMode(),e.stopDrawingMode(),t!==l.zoomModes.ZOOM?(e.startDrawingMode(l.drawingModes.ZOOM),e._graphics.startZoomInMode()):e._graphics.endZoomInMode()},zoomOut:function(){e._graphics.zoomOut()},hand:function(){var t;e.ui.offZoomInButtonStatus(),e.ui.toggleZoomButtonStatus("hand"),e.deactivateAll(),t=e._graphics.getZoomMode(),e.stopDrawingMode(),t!==l.zoomModes.HAND?(e.startDrawingMode(l.drawingModes.ZOOM),e._graphics.startHandMode()):e._graphics.endHandMode()}},this._commonAction())},_iconAction:function(){var e=this;return(0,r.extend)({changeColor:function(t){e.activeObjectId&&e.changeIconColor(e.activeObjectId,t)},addIcon:function(t,n){e.startDrawingMode("ICON"),e.setDrawingIcon(t,n)},cancelAddIcon:function(){e.ui.icon.clearIconType(),e.changeSelectableAll(!0),e.changeCursor("default"),e.stopDrawingMode()},registerDefaultIcons:function(t,n){var i={};i[t]=n,e.registerIcons(i)},registerCustomIcon:function(t,n){(new s.default).imageToSVG(t,(function(t){var i=t.match(/path[^>]*d="([^"]*)"/)[1],r={};r[n.name]=i,e.registerIcons(r),e.addIcon(n.name,{left:100,top:100})}),s.default.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var e=this;return(0,r.extend)({setDrawMode:function(t,n){e.stopDrawingMode(),"free"===t?e.startDrawingMode("FREE_DRAWING",n):e.startDrawingMode("LINE_DRAWING",n)},setColor:function(t){e.setBrush({color:t})}},this._commonAction())},_maskAction:function(){var e=this;return(0,r.extend)({loadImageFromURL:function(t,n){return e.loadImageFromURL(e.toDataURL(),"FilterImage").then((function(){e.addImageObject(t).then((function(){URL.revokeObjectURL(n)})),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.LOAD_MASK_IMAGE)}))},applyFilter:function(){e.applyFilter("mask",{maskObjId:e.activeObjectId})}},this._commonAction())},_textAction:function(){var e=this;return(0,r.extend)({changeTextStyle:function(t,n){e.activeObjectId&&e.changeTextStyle(e.activeObjectId,t,n)}},this._commonAction())},_rotateAction:function(){var e=this;return(0,r.extend)({rotate:function(t,n){e.rotate(t,n),e.ui.resizeEditor(),e.ui.rotate.setRangeBarAngle("rotate",t)},setAngle:function(t,n){e.setAngle(t,n),e.ui.resizeEditor(),e.ui.rotate.setRangeBarAngle("setAngle",t)}},this._commonAction())},_shapeAction:function(){var e=this;return(0,r.extend)({changeShape:function(t,n){e.activeObjectId&&e.changeShape(e.activeObjectId,t,n)},setDrawingShape:function(t){e.setDrawingShape(t)}},this._commonAction())},_cropAction:function(){var e=this;return(0,r.extend)({crop:function(){var t=e.getCropzoneRect();t&&!(0,a.isEmptyCropzone)(t)&&e.crop(t).then((function(){e.stopDrawingMode(),e.ui.resizeEditor(),e.ui.changeMenu("crop"),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.CROP)})).catch((function(e){return Promise.reject(e)}))},cancel:function(){e.stopDrawingMode(),e.ui.changeMenu("crop")},preset:function(t){switch(t){case"preset-square":e.setCropzoneRect(1);break;case"preset-3-2":e.setCropzoneRect(1.5);break;case"preset-4-3":e.setCropzoneRect(4/3);break;case"preset-5-4":e.setCropzoneRect(5/4);break;case"preset-7-5":e.setCropzoneRect(1.4);break;case"preset-16-9":e.setCropzoneRect(16/9);break;default:e.setCropzoneRect(),e.ui.crop.changeApplyButtonStatus(!1)}}},this._commonAction())},_resizeAction:function(){var e=this;return(0,r.extend)({getCurrentDimensions:function(){return e._graphics.getCurrentDimensions()},preview:function(t,n,i){var r=e._graphics.getCurrentDimensions(),o=function(){return r.width/r.height},s={};switch(t){case"width":s.width=n,s.height=i?n/o():r.height;break;case"height":s.height=n,s.width=i?n*o():r.width;break;default:s=r}e._graphics.resize(s).then((function(){e.ui.resizeEditor()})),i&&(e.ui.resize.setWidthValue(s.width),e.ui.resize.setHeightValue(s.height))},lockAspectRatio:function(t,n,i){var r=e._graphics.getCurrentDimensions(),o=r.width,s=r.height,a=o/s;if(t)if(o>s){var l=i/a,c=n*a;e.ui.resize.setLimit({minWidth:c>n?c:n,minHeight:n,maxWidth:i,maxHeight:l<i?l:i})}else{var u=i*a,h=n/a;e.ui.resize.setLimit({minWidth:n,minHeight:h>n?h:n,maxWidth:u<i?u:i,maxHeight:i})}else e.ui.resize.setLimit({minWidth:n,minHeight:n,maxWidth:i,maxHeight:i})},resize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t||(t=e._graphics.getCurrentDimensions()),e.resize(t).then((function(){e._graphics.setOriginalDimensions(t),e.stopDrawingMode(),e.ui.resizeEditor(),e.ui.changeMenu("resize")})).catch((function(e){return Promise.reject(e)}))},reset:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e._graphics.getOriginalDimensions();e.ui.resize.setWidthValue(n.width,!0),e.ui.resize.setHeightValue(n.height,!0),e._graphics.resize(n).then((function(){t||(e.stopDrawingMode(),e.ui.resizeEditor(),e.ui.changeMenu("resize"))}))}},this._commonAction())},_flipAction:function(){var e=this;return(0,r.extend)({flip:function(t){return e[t]()}},this._commonAction())},_filterAction:function(){var e=this;return(0,r.extend)({applyFilter:function(t,n,i,r){t?e.applyFilter(n,i,r):e.hasFilter(n)&&e.removeFilter(n)}},this._commonAction())},setReAction:function(){var e=this;this.on({undoStackChanged:function(t){t?(e.ui.changeHelpButtonEnabled("undo",!0),e.ui.changeHelpButtonEnabled("reset",!0)):(e.ui.changeHelpButtonEnabled("undo",!1),e.ui.changeHelpButtonEnabled("reset",!1)),e.ui.resizeEditor()},redoStackChanged:function(t){t?e.ui.changeHelpButtonEnabled("redo",!0):e.ui.changeHelpButtonEnabled("redo",!1),e.ui.resizeEditor()},objectActivated:function(t){e.activeObjectId=t.id,e.ui.changeHelpButtonEnabled("delete",!0),e.ui.changeHelpButtonEnabled("deleteAll",!0),"cropzone"===t.type?e.ui.crop.changeApplyButtonStatus(!0):["rect","circle","triangle"].indexOf(t.type)>-1?(e.stopDrawingMode(),"shape"!==e.ui.submenu&&e.ui.changeMenu("shape",!1,!1),e.ui.shape.setShapeStatus({strokeColor:t.stroke,strokeWidth:t.strokeWidth,fillColor:t.fill}),e.ui.shape.setMaxStrokeValue(Math.min(t.width,t.height))):"path"===t.type||"line"===t.type?"draw"!==e.ui.submenu&&(e.ui.changeMenu("draw",!1,!1),e.ui.draw.changeStandbyMode()):["i-text","text"].indexOf(t.type)>-1?("text"!==e.ui.submenu&&e.ui.changeMenu("text",!1,!1),e.ui.text.setTextStyleStateOnAction(t)):"icon"===t.type&&(e.stopDrawingMode(),"icon"!==e.ui.submenu&&e.ui.changeMenu("icon",!1,!1),e.ui.icon.setIconPickerColor(t.fill))},addText:function(t){var n=e.ui.text,i=n.textColor,r=n.fontSize,o=n.fontStyle,s=n.fontWeight,a=n.underline;e.addText("Double Click",{position:t.originPosition,styles:{fill:i,fontSize:r,fontFamily:"Noto Sans",fontStyle:o,fontWeight:s,underline:a}}).then((function(){e.changeCursor("default")}))},addObjectAfter:function(t){"icon"===t.type?e.ui.icon.changeStandbyMode():["rect","circle","triangle"].indexOf(t.type)>-1&&(e.ui.shape.setMaxStrokeValue(Math.min(t.width,t.height)),e.ui.shape.changeStandbyMode())},objectScaled:function(t){if(["i-text","text"].indexOf(t.type)>-1)e.ui.text.fontSize=(0,a.toInteger)(t.fontSize);else if(["rect","circle","triangle"].indexOf(t.type)>
2=0){var n=t.width,i=t.height,r=e.ui.shape.getStrokeValue();n<r&&e.ui.shape.setStrokeValue(n),i<r&&e.ui.shape.setStrokeValue(i)}},selectionCleared:function(){e.activeObjectId=null,"text"===e.ui.submenu?e.changeCursor("text"):(0,a.includes)(["draw","crop","resize"],e.ui.submenu)||e.stopDrawingMode()}})},_historyAction:function(){var e=this;return{undo:function(t){return e.undo(t)},redo:function(t){return e.redo(t)}}},_commonAction:function(){var e=this,t=l.drawingModes.TEXT,n=l.drawingModes.CROPPER,i=l.drawingModes.SHAPE,r=l.drawingModes.ZOOM,o=l.drawingModes.RESIZE;return{modeChange:function(s){switch(s){case l.drawingMenuNames.TEXT:e._changeActivateMode(t);break;case l.drawingMenuNames.CROP:e.startDrawingMode(n);break;case l.drawingMenuNames.SHAPE:e._changeActivateMode(i),e.setDrawingShape(e.ui.shape.type,e.ui.shape.options);break;case l.drawingMenuNames.ZOOM:e.startDrawingMode(r);break;case l.drawingMenuNames.RESIZE:e.startDrawingMode(o)}},deactivateAll:this.deactivateAll.bind(this),changeSelectableAll:this.changeSelectableAll.bind(this),discardSelection:this.discardSelection.bind(this),stopDrawingMode:this.stopDrawingMode.bind(this)}},mixin:function(e){(0,r.extend)(e.prototype,this)}}},
2"./src/js/command/addIcon.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l=a.componentNames.ICON,c={name:a.commandNames.ADD_ICON,execute:function(e,t,n){var i=this;return e.getComponent(l).add(t,n).then((function(t){return i.undoData.object=e.getObject(t.id),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};o.default.register(c),t.default=c},
2"./src/js/command/addImageObject.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a={name:n("./src/js/consts.js").commandNames.ADD_IMAGE_OBJECT,execute:function(e,t){var n=this;return e.addImageObject(t).then((function(t){return n.undoData.object=e.getObject(t.id),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};o.default.register(a),t.default=a},
2"./src/js/command/addObject.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l={name:a.commandNames.ADD_OBJECT,execute:function(e,t){return new s.Promise((function(n,i){e.contains(t)?i(a.rejectMessages.addedObject):(e.add(t),n(t))}))},undo:function(e,t){return new s.Promise((function(n,i){e.contains(t)?(e.remove(t),n(t)):i(a.rejectMessages.noObject)}))}};o.default.register(l),t.default=l},
2"./src/js/command/addShape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l=a.componentNames.SHAPE,c={name:a.commandNames.ADD_SHAPE,execute:function(e,t,n){var i=this;return e.getComponent(l).add(t,n).then((function(t){var n=t.id;return i.undoData.object=e.getObject(n),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};o.default.register(c),t.default=c},
2"./src/js/command/addText.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l=n("./src/js/helper/selectionModifyHelper.js"),c=a.componentNames.TEXT,u={name:a.commandNames.ADD_TEXT,execute:function(e,t,n){var i=this,r=e.getComponent(c);if(this.undoData.object){var o=this.undoData.object;return new s.Promise((function(t,n){e.contains(o)?n(a.rejectMessages.redo):(e.add(o),t(o))}))}return r.add(t,n).then((function(t){var n=t.id,r=e.getObject(n);return i.undoData.object=r,(0,l.setCachedUndoDataForDimension)((0,l.makeSelectionUndoData)(r,(function(){return(0,l.makeSelectionUndoDatum)(n,r,!1)}))),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};o.default.register(u),t.default=u},
2"./src/js/command/applyFilter.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=s(n("tui-code-snippet")),r=s(n("./src/js/factory/command.js")),o=n("./src/js/consts.js");function s(e){return e&&e.__esModule?e:{default:e}}var a=o.componentNames.FILTER,l=null,c={name:o.commandNames.APPLY_FILTER,execute:function(e,t,n,r){var s=e.getComponent(a);if("mask"===t){var c=e.getObject(n.maskObjId);if(!c||!c.isType("image"))return Promise.reject(o.rejectMessages.invalidParameters);i.default.extend(n,{mask:c}),e.remove(n.mask)}if(!this.isRedo){var u=function(e,t,n){var i={};return"mask"===e&&(i.object=n.mask),i.options=t,i}(t,s.getOptions(t),n);l=this.setUndoData(u,l,r)}return s.add(t,n)},undo:function(e,t){var n=e.getComponent(a);if("mask"===t){var i=this.undoData.object;return e.add(i),e.setActiveObject(i),n.remove(t)}return this.undoData.options?n.add(t,this.undoData.options):n.remove(t)}};r.default.register(c),t.default=c},
2"./src/js/command/changeIconColor.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l=a.componentNames.ICON,c={name:a.commandNames.CHANGE_ICON_COLOR,execute:function(e,t,n){var i=this;return new s.Promise((function(r,o){var s=e.getComponent(l),c=e.getObject(t);c||o(a.rejectMessages.noObject),i.undoData.object=c,i.undoData.color=s.getColor(c),s.setColor(n,c),r()}))},undo:function(e){var t=e.getComponent(l),n=this.undoData,i=n.object,r=n.color;return t.setColor(r,i),s.Promise.resolve()}};o.default.register(c),t.default=c},
2"./src/js/command/changeSelection.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l=n("./src/js/helper/selectionModifyHelper.js"),c={name:a.commandNames.CHANGE_SELECTION,execute:function(e,t){return this.isRedo?t.forEach((function(t){e.setObjectProperties(t.id,t)})):this.undoData=(0,l.getCachedUndoDataForDimension)(),s.Promise.resolve()},undo:function(e){return this.undoData.forEach((function(t){e.setObjectProperties(t.id,t)})),s.Promise.resolve()}};o.default.register(c),t.default=c},
2"./src/js/command/changeShape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a(n("tui-code-snippet")),r=a(n("./src/js/factory/command.js")),o=n("./src/js/util.js"),s=n("./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=s.componentNames.SHAPE,c=null,u={name:s.commandNames.CHANGE_SHAPE,execute:function(e,t,n,r){var a=e.getComponent(l),u=e.getObject(t);if(!u)return o.Promise.reject(s.rejectMessages.noObject);if(!this.isRedo){var h=function(e,t){var n={object:t,options:{}};return i.default.forEachOwnProperties(e,(function(e,i){n.options[i]=t[i]})),n}(n,u);c=this.setUndoData(h,c,r)}return a.change(u,n)},undo:function(e){var t=e.getComponent(l),n=this.undoData,i=n.object,r=n.options;return t.change(i,r)}};r.default.register(u),t.default=u},
2"./src/js/command/changeText.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l=a.componentNames.TEXT,c={name:a.commandNames.CHANGE_TEXT,execute:function(e,t,n){var i=e.getComponent(l),r=e.getObject(t);return r?(this.undoData.object=r,this.undoData.text=i.getText(r),i.change(r,n)):s.Promise.reject(a.rejectMessages.noObject)},undo:function(e){var t=e.getComponent(l),n=this.undoData,i=n.object,r=n.text;return t.change(i,r)}};o.default.register(c),t.default=c},
2"./src/js/command/changeTextStyle.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a(n("tui-code-snippet")),r=a(n("./src/js/factory/command.js")),o=n("./src/js/util.js"),s=n("./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=s.componentNames.TEXT,c=null,u={name:s.commandNames.CHANGE_TEXT_STYLE,execute:function(e,t,n,r){var a=e.getComponent(l),u=e.getObject(t);if(!u)return o.Promise.reject(s.rejectMessages.noObject);if(!this.isRedo){var h=function(e,t){var n={object:t,styles:{}};return i.default.forEachOwnProperties(e,(function(e,i){var r=t[i];n.styles[i]=r})),n}(n,u);c=this.setUndoData(h,c,r)}return a.setStyle(u,n)},undo:function(e){var t=e.getComponent(l),n=this.undoData,i=n.object,r=n.styles;return t.setStyle(i,r)}};r.default.register(u),t.default=u},
2"./src/js/command/clearObjects.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a={name:n("./src/js/consts.js").commandNames.CLEAR_OBJECTS,execute:function(e){var t=this;return new s.Promise((function(n){t.undoData.objects=e.removeAll(),n()}))},undo:function(e){return e.add(this.undoData.objects),s.Promise.resolve()}};o.default.register(a),t.default=a},
2"./src/js/command/flip.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/consts.js"),a=s.componentNames.FLIP,l={name:s.commandNames.FLIP_IMAGE,execute:function(e,t){var n=e.getComponent(a);return this.undoData.setting=n.getCurrentSetting(),n[t]()},undo:function(e){return e.getComponent(a).set(this.undoData.setting)}};o.default.register(l),t.default=l},
2"./src/js/command/loadImage.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/consts.js"),a=s.componentNames.IMAGE_LOADER,l={name:s.commandNames.LOAD_IMAGE,execute:function(e,t,n){var i=e.getComponent(a),r=i.getCanvasImage(),o=r?r.width:0,s=r?r.height:0,l=e.removeAll(!0).filter((function(e){return"cropzone"!==e.type}));return l.forEach((function(e){e.evented=!0})),this.undoData={name:i.getImageName(),image:r,objects:l},i.load(t,n).then((function(e){return{oldWidth:o,oldHeight:s,newWidth:e.width,newHeight:e.height}}))},undo:function(e){var t=e.getComponent(a),n=this.undoData,i=n.objects,r=n.name,o=n.image;return e.removeAll(!0),e.add(i),t.load(r,o)}};o.default.register(l),t.default=l},
2"./src/js/command/removeFilter.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/consts.js"),a=s.componentNames.FILTER,l={name:s.commandNames.REMOVE_FILTER,execute:function(e,t){var n=e.getComponent(a);return this.undoData.options=n.getOptions(t),n.remove(t)},undo:function(e,t){var n=e.getComponent(a),i=this.undoData.options;return n.add(t,i)}};o.default.register(l),t.default=l},
2"./src/js/command/removeObject.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l={name:a.commandNames.REMOVE_OBJECT,execute:function(e,t){var n=this;return new s.Promise((function(i,r){n.undoData.objects=e.removeObjectById(t),n.undoData.objects.length?i():r(a.rejectMessages.noObject)}))},undo:function(e){return e.add(this.undoData.objects),s.Promise.resolve()}};o.default.register(l),t.default=l},
2"./src/js/command/resize.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/consts.js"),a=s.componentNames.RESIZE,l={name:s.commandNames.RESIZE_IMAGE,execute:function(e,t){var n=e.getComponent(a),i=n.getOriginalDimensions();return i||(i=n.getCurrentDimensions()),this.undoData.dimensions=i,n.resize(t)},undo:function(e){return e.getComponent(a).resize(this.undoData.dimensions)}};o.default.register(l),t.default=l},
2"./src/js/command/resizeCanvasDimension.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a={name:n("./src/js/consts.js").commandNames.RESIZE_CANVAS_DIMENSION,execute:function(e,t){var n=this;return new s.Promise((function(i){n.undoData.size={width:e.cssMaxWidth,height:e.cssMaxHeight},e.setCssMaxDimension(t),e.adjustCanvasDimension(),i()}))},undo:function(e){return e.setCssMaxDimension(this.undoData.size),e.adjustCanvasDimension(),s.Promise.resolve()}};o.default.register(a),t.default=a},
2"./src/js/command/rotate.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/consts.js"),a=s.componentNames.ROTATION,l=null,c={name:s.commandNames.ROTATE_IMAGE,execute:function(e,t,n,i){var r=e.getComponent(a);if(!this.isRedo){var o=function(e){return{angle:e.getCurrentAngle()}}(r);l=this.setUndoData(o,l,i)}return r[t](n)},undo:function(e){var t=e.getComponent(a),n=this.args,i=n[1],r=n[2];return"setAngle"===i?t[i](this.undoData.angle):t.rotate(-r)}};o.default.register(c),t.default=c},
2"./src/js/command/setObjectPosition.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/factory/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s=n("./src/js/util.js"),a=n("./src/js/consts.js"),l={name:a.commandNames.SET_OBJECT_POSITION,execute:function(e,t,n){return e.getObject(t)?(this.undoData.objectId=t,this.undoData.props=e.getObjectProperties(t,["left","top"]),e.setObjectPosition(t,n),e.renderAll(),s.Promise.resolve()):s.Promise.reject(a.rejectMessages.noObject)},undo:function(e){var t=this.undoData,n=t.objectId,i=t.props;return e.setObjectProperties(n,i),e.renderAll(),s.Promise.resolve()}};o.default.register(l),t.default=l},
2"./src/js/command/setObjectProperties.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a(n("tui-code-snippet")),r=a(n("./src/js/factory/command.js")),o=n("./src/js/util.js"),s=n("./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l={name:s.commandNames.SET_OBJECT_PROPERTIES,execute:function(e,t,n){var r=this,a=e.getObject(t);return a?(this.undoData.props={},i.default.forEachOwnProperties(n,(function(e,t){r.undoData.props[t]=a[t]})),e.setObjectProperties(t,n),o.Promise.resolve()):o.Promise.reject(s.rejectMessages.noObject)},undo:function(e,t){var n=this.undoData.props;return e.setObjectProperties(t,n),o.Promise.resolve()}};r.default.register(l),t.default=l},
2"./src/js/component/cropper.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=u(n("tui-code-snippet")),o=u(n("fabric")),s=u(n("./src/js/interface/component.js")),a=u(n("./src/js/extension/cropzone.js")),l=n("./src/js/consts.js"),c=n("./src/js/util.js");function u(e){return e&&e.__esModule?e:{default:e}}var h={presetRatio:null,top:-10,left:-10,height:1,width:1},d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.CROPPER,e));return n._cropzone=null,n._startX=null,n._startY=null,n._withShiftKey=!1,n._listeners={keydown:n._onKeyDown.bind(n),keyup:n._onKeyUp.bind(n),mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(){if(!this._cropzone){var e=this.getCanvas();e.forEachObject((function(e){e.evented=!1})),this._cropzone=new a.default(e,r.default.extend({left:0,top:0,width:.5,height:.5,strokeWidth:0,cornerSize:10,cornerColor:"black",fill:"transparent"},l.CROPZONE_DEFAULT_OPTIONS,this.graphics.cropSelectionStyle)),e.discardActiveObject(),e.add(this._cropzone),e.on("mouse:down",this._listeners.mousedown),e.selection=!1,e.defaultCursor="crosshair",o.default.util.addListener(document,"keydown",this._listeners.keydown),o.default.util.addListener(document,"keyup",this._listeners.keyup)}}},{key:"end",value:function(){var e=this.getCanvas(),t=this._cropzone;t&&(e.remove(t),e.selection=!0,e.defaultCursor="default",e.off("mouse:down",this._listeners.mousedown),e.forEachObject((function(e){e.evented=!0})),this._cropzone=null,o.default.util.removeListener(document,"keydown",this._listeners.keydown),o.default.util.removeListener(document,"keyup",this._listeners.keyup))}},{key:"changeVisibility",value:function(e){this._cropzone&&this._cropzone.set({visible:e})}},{key:"_onFabricMouseDown",value:function(e){var t=this.getCanvas();if(!e.target){t.selection=!1;var n=t.getPointer(e.e);this._startX=n.x,this._startY=n.y,t.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}}},{key:"_onFabricMouseMove",value:function(e){var t=this.getCanvas(),n=t.getPointer(e.e),i=n.x,r=n.y,o=this._cropzone;Math.abs(i-this._startX)+Math.abs(r-this._startY)>10&&(t.remove(o),o.set(this._calcRectDimensionFromPoint(i,r)),t.add(o),t.setActiveObject(o))}},{key:"_calcRectDimensionFromPoint",value:function(e,t){var n=this.getCanvas(),i=n.getWidth(),r=n.getHeight(),o=this._startX,s=this._startY,a=(0,c.clamp)(e,0,o),l=(0,c.clamp)(t,0,s),u=(0,c.clamp)(e,o,i)-a,h=(0,c.clamp)(t,s,r)-l;return this._withShiftKey&&(u>h?h=u:h>u&&(u=h),o>=e&&(a=o-u),s>=t&&(l=s-h)),{left:a,top:l,width:u,height:h}}},{key:"_onFabricMouseUp",value:function(){var e=this._cropzone,t=this._listeners,n=this.getCanvas();n.setActiveObject(e),n.off({"mouse:move":t.mousemove,"mouse:up":t.mouseup})}},{key:"getCroppedImageData",value:function(e){var t=this.getCanvas(),n=t.contains(this._cropzone);if(!e)return null;n&&t.remove(this._cropzone);var i={imageName:this.getImageName(),url:t.toDataURL(e)};return n&&t.add(this._cropzone),i}},{key:"getCropzoneRect",value:function(){var e=this._cropzone;return e.isValid()?{left:e.left,top:e.top,width:e.width,height:e.height}:null}},{key:"setCropzoneRect",value:function(e){var t=this.getCanvas(),n=this._cropzone;t.discardActiveObject(),t.selection=!1,t.remove(n),n.set(e?this._getPresetPropertiesForCropSize(e):h),t.add(n),t.selection=!0,e&&t.setActiveObject(n)}},{key:"_getPresetPropertiesForCropSize",value:function(e){var t=this.getCanvas(),n=t.getWidth(),i=t.getHeight(),o=n>=i?n:i,s=function(e,t){return e>t?t/e:1},a=o*e,l=o,u=s(a,n),h=r.default.map([a,l],(function(e){return e*u}));a=h[0];var d=s(l=h[1],i),f=r.default.map([a,l],(function(e){return(0,c.fixFloatingPoint)(e*d)}));return a=f[0],{presetRatio:e,top:(i-(l=f[1]))/2,left:(n-a)/2,width:a,height:l}}},{key:"_onKeyDown",value:function(e){e.keyCode===l.keyCodes.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(e){e.keyCode===l.keyCodes.SHIFT&&(this._withShiftKey=!1)}}]),t}(s.default);t.default=d},
2"./src/js/component/filter.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n("tui-code-snippet"),o=f(n("fabric")),s=f(n("./src/js/interface/component.js")),a=n("./src/js/util.js"),l=n("./src/js/consts.js"),c=f(n("./src/js/extension/mask.js")),u=f(n("./src/js/extension/sharpen.js")),h=f(n("./src/js/extension/emboss.js")),d=f(n("./src/js/extension/colorFilter.js"));function f(e){return e&&e.__esModule?e:{default:e}}var p=o.default.Image.filters;p.Mask=c.default,p.Sharpen=u.default,p.Emboss=h.default,p.ColorFilter=d.default;var g=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.FILTER,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"add",value:function(e,t){var n=this;return new a.Promise((function(i,r){var o=n._getSourceImage(),s=n.getCanvas(),a=n._getFilter(o,e);a||(a=n._createFilter(o,e,t)),a||r(l.rejectMessages.invalidParameters),n._changeFilterValues(a,t),n._apply(o,(function(){s.renderAll(),i({type:e,action:"add",options:t})}))}))}},{key:"remove",value:function(e){var t=this;return new a.Promise((function(n,i){var r=t._getSourceImage(),o=t.getCanvas(),s=t.getOptions(e);r.filters.length||i(l.rejectMessages.unsupportedOperation),t._removeFilter(r,e),t._apply(r,(function(){o.renderAll(),n({type:e,action:"remove",options:s})}))}))}},{key:"hasFilter",value:function(e){return!!this._getFilter(this._getSourceImage(),e)}},{key:"getOptions",value:function(e){var t=this._getSourceImage(),n=this._getFilter(t,e);return n?(0,r.extend)({},n.options):null}},{key:"_changeFilterValues",value:function(e,t){(0,r.forEach)(t,(function(t,n){(0,r.isUndefined)(e[n])||(e[n]=t)})),(0,r.forEach)(e.options,(function(n,i){(0,r.isUndefined)(t[i])||(e.options[i]=t[i])}))}},{key:"_apply",value:function(e,t){e.filters.push(),e.applyFilters()&&t()}},{key:"_getSourceImage",value:function(){return this.getCanvasImage()}},{key:"_createFilter",value:function(e,t,n){var i=void 0,r=this._getFabricFilterType(t),s=o.default.Image.filters[r];return s&&((i=new s(n)).options=n,e.filters.push(i)),i}},{key:"_getFilter",value:function(e,t){var n=null;if(e){var i=this._getFabricFilterType(t),r=e.filters.length,o=void 0,s=void 0;for(s=0;s<r;s+=1)if((o=e.filters[s]).type===i){n=o;break}}return n}},{key:"_removeFilter",value:function(e,t){var n=this._getFabricFilterType(t);e.filters=(0,r.filter)(e.filters,(function(e){return e.type!==n}))}},{key:"_getFabricFilterType",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}}]),t}(s.default);t.default=g},
2"./src/js/component/flip.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n("tui-code-snippet")),o=l(n("./src/js/interface/component.js")),s=n("./src/js/util.js"),a=n("./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.componentNames.FLIP,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"getCurrentSetting",value:function(){var e=this.getCanvasImage();return{flipX:e.flipX,flipY:e.flipY}}},{key:"set",value:function(e){var t=this.getCurrentSetting(),n=t.flipX!==e.flipX,i=t.flipY!==e.flipY;return n||i?(r.default.extend(t,e),this.setImageProperties(t,!0),this._invertAngle(n,i),this._flipObjects(n,i),s.Promise.resolve({flipX:t.flipX,flipY:t.flipY,angle:this.getCanvasImage().angle})):s.Promise.reject(a.rejectMessages.flip)}},{key:"_invertAngle",value:function(e,t){var n=this.getCanvasImage(),i=n.angle;e&&(i*=-1),t&&(i*=-1),n.rotate(parseFloat(i)).setCoords()}},{key:"_flipObjects",value:function(e,t){var n=this.getCanvas();e&&n.forEachObject((function(e){e.set({angle:parseFloat(-1*e.angle),flipX:!e.flipX,left:n.width-e.left}).setCoords()}
2)),t&&n.forEachObject((function(e){e.set({angle:parseFloat(-1*e.angle),flipY:!e.flipY,top:n.height-e.top}).setCoords()})),n.renderAll()}},{key:"reset",value:function(){return this.set({flipX:!1,flipY:!1})}},{key:"flipX",value:function(){var e=this.getCurrentSetting();return this.set({flipX:!e.flipX,flipY:e.flipY})}},{key:"flipY",value:function(){var e=this.getCurrentSetting();return this.set({flipX:e.flipX,flipY:!e.flipY})}}]),t}(o.default);t.default=c},
2"./src/js/component/freeDrawing.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=a(n("fabric")),o=a(n("./src/js/interface/component.js")),s=n("./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,s.componentNames.FREE_DRAWING,e));return n.width=12,n.oColor=new r.default.Color("rgba(0, 0, 0, 0.5)"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e){this.getCanvas().isDrawingMode=!0,this.setBrush(e)}},{key:"setBrush",value:function(e){var t=this.getCanvas().freeDrawingBrush;e=e||{},this.width=e.width||this.width,e.color&&(this.oColor=new r.default.Color(e.color)),t.width=this.width,t.color=this.oColor.toRgba()}},{key:"end",value:function(){this.getCanvas().isDrawingMode=!1}}]),t}(o.default);t.default=l},
2"./src/js/component/icon.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=c(n("tui-code-snippet")),o=c(n("fabric")),s=c(n("./src/js/interface/component.js")),a=n("./src/js/util.js"),l=n("./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u={arrow:"M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z",cancel:"M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z"},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.ICON,e));return n._oColor="#000000",n._pathMap=u,n._type=null,n._iconColor=null,n._handlers={mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"setStates",value:function(e,t){this._type=e,this._iconColor=t}},{key:"start",value:function(){var e=this.getCanvas();e.selection=!1,e.on("mouse:down",this._handlers.mousedown)}},{key:"end",value:function(){var e=this.getCanvas();e.selection=!0,e.off({"mouse:down":this._handlers.mousedown})}},{key:"add",value:function(e,t){var n=this;return new a.Promise((function(i,o){var s=n.getCanvas(),a=n._pathMap[e],c=l.fObjectOptions.SELECTION_STYLE,u=a?n._createIcon(a):null;n._icon=u,u||o(l.rejectMessages.invalidParameters),u.set(r.default.extend({type:"icon",fill:n._oColor},c,t,n.graphics.controlStyle)),s.add(u).setActiveObject(u),i(n.graphics.createObjectProperties(u))}))}},{key:"registerPaths",value:function(e){var t=this;r.default.forEach(e,(function(e,n){t._pathMap[n]=e}),this)}},{key:"setColor",value:function(e,t){this._oColor=e,t&&"icon"===t.get("type")&&(t.set({fill:this._oColor}),this.getCanvas().renderAll())}},{key:"getColor",value:function(e){return e.fill}},{key:"_createIcon",value:function(e){return new o.default.Path(e)}},{key:"_onFabricMouseDown",value:function(e){var t=this,n=this.getCanvas();this._startPoint=n.getPointer(e.e);var i=this._startPoint,r=i.x,o=i.y;this.add(this._type,{left:r,top:o,fill:this._iconColor}).then((function(){t.fire(l.eventNames.ADD_OBJECT,t.graphics.createObjectProperties(t._icon)),n.on("mouse:move",t._handlers.mousemove),n.on("mouse:up",t._handlers.mouseup)}))}},{key:"_onFabricMouseMove",value:function(e){var t=this.getCanvas();if(this._icon){var n=t.getPointer(e.e),i=(n.x-this._startPoint.x)/this._icon.width,r=(n.y-this._startPoint.y)/this._icon.height;this._icon.set({scaleX:Math.abs(2*i),scaleY:Math.abs(2*r)}),this._icon.setCoords(),t.renderAll()}}},{key:"_onFabricMouseUp",value:function(){var e=this.getCanvas();this.fire(l.eventNames.OBJECT_ADDED,this.graphics.createObjectProperties(this._icon)),this._icon=null,e.off("mouse:down",this._handlers.mousedown),e.off("mouse:move",this._handlers.mousemove),e.off("mouse:up",this._handlers.mouseup)}}]),t}(s.default);t.default=h},
2"./src/js/component/imageLoader.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/component.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/util.js"),l=n("./src/js/consts.js"),c={padding:0,crossOrigin:"Anonymous"},u=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.IMAGE_LOADER,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"load",value:function(e,t){var n=this,i=void 0;if(e||t)i=this._setBackgroundImage(t).then((function(t){return n.setCanvasImage(e,t),n.adjustCanvasDimension(),t}));else{var r=this.getCanvas();r.backgroundImage=null,r.renderAll(),i=new a.Promise((function(e){n.setCanvasImage("",null),e()}))}return i}},{key:"_setBackgroundImage",value:function(e){var t=this;return e?new a.Promise((function(n,i){var r=t.getCanvas();r.setBackgroundImage(e,(function(){var e=r.backgroundImage;e&&e.getElement()?n(e):i(l.rejectMessages.loadingImageFailed)}),c)})):a.Promise.reject(l.rejectMessages.loadImage)}}]),t}(s.default);t.default=u},
2"./src/js/component/line.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=c(n("tui-code-snippet")),o=c(n("fabric")),s=c(n("./src/js/interface/component.js")),a=c(n("./src/js/extension/arrowLine.js")),l=n("./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.LINE,e));return n._width=12,n._oColor=new o.default.Color("rgba(0, 0, 0, 0.5)"),n._listeners={mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"setHeadOption",value:function(e){var t=e.arrowType,n=void 0===t?{head:null,tail:null}:t;this._arrowType=n}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getCanvas();t.defaultCursor="crosshair",t.selection=!1,this.setHeadOption(e),this.setBrush(e),t.forEachObject((function(e){e.set({evented:!1})})),t.on({"mouse:down":this._listeners.mousedown})}},{key:"setBrush",value:function(e){var t=this.getCanvas().freeDrawingBrush;e=e||{},this._width=e.width||this._width,e.color&&(this._oColor=new o.default.Color(e.color)),t.width=this._width,t.color=this._oColor.toRgba()}},{key:"end",value:function(){var e=this.getCanvas();e.defaultCursor="default",e.selection=!0,e.forEachObject((function(e){e.set({evented:!0})})),e.off("mouse:down",this._listeners.mousedown)}},{key:"_onFabricMouseDown",value:function(e){var t=this.getCanvas(),n=t.getPointer(e.e),i=n.x,r=n.y,o=[i,r,i,r];this._line=new a.default(o,{stroke:this._oColor.toRgba(),strokeWidth:this._width,arrowType:this._arrowType,evented:!1}),this._line.set(l.fObjectOptions.SELECTION_STYLE),t.add(this._line),t.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup}),this.fire(l.eventNames.ADD_OBJECT,this._createLineEventObjectProperties())}},{key:"_onFabricMouseMove",value:function(e){var t=this.getCanvas(),n=t.getPointer(e.e);this._line.set({x2:n.x,y2:n.y}),this._line.setCoords(),t.renderAll()}},{key:"_onFabricMouseUp",value:function(){var e=this.getCanvas();this.fire(l.eventNames.OBJECT_ADDED,this._createLineEventObjectProperties()),this._line=null,e.off({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}},{key:"_createLineEventObjectProperties",value:function(){var e=this.graphics.createObjectProperties(this._line),t=this._line,n=t.x1,i=t.x2,o=t.y1,s=t.y2;return r.default.extend({},e,{startPosition:{x:n,y:o},endPosition:{x:i,y:s}})}}]),t}(s.default);t.default=u},
2"./src/js/component/resize.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/util.js"),s=n("./src/js/interface/component.js"),a=(i=s)&&i.__esModule?i:{default:i},l=n("./src/js/consts.js"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.RESIZE,e));return n._dimensions=null,n._originalDimensions=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"getCurrentDimensions",value:function(){var e=this.getCanvasImage();if(!this._dimensions&&e){var t=e.width,n=e.height;this._dimensions={width:t,height:n}}return this._dimensions}},{key:"getOriginalDimensions",value:function(){return this._originalDimensions}},{key:"setOriginalDimensions",value:function(e){this._originalDimensions=e}},{key:"resize",value:function(e){var t=this.getCanvasImage(),n=t.width,i=t.height,r=t.scaleX,s=t.scaleY,a=e.width,l=e.height,c={scaleX:a?a/n:r,scaleY:l?l/i:s};return r===c.scaleX&&s===c.scaleY||(t.set(c).setCoords(),this._dimensions={width:t.width*t.scaleX,height:t.height*t.scaleY}),this.adjustCanvasDimensionBase(),o.Promise.resolve()}},{key:"start",value:function(){var e=this.getCurrentDimensions();this.setOriginalDimensions(e)}},{key:"end",value:function(){}}]),t}(a.default);t.default=c},
2"./src/js/component/rotation.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n("fabric")),o=l(n("./src/js/interface/component.js")),s=n("./src/js/util.js"),a=n("./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.componentNames.ROTATION,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"getCurrentAngle",value:function(){return this.getCanvasImage().angle}},{key:"setAngle",value:function(e){var t=this.getCurrentAngle()%360;e%=360;var n=this.getCanvasImage(),i=n.getCenterPoint();n.set({angle:e}).setCoords(),this.adjustCanvasDimension();var r=n.getCenterPoint();return this._rotateForEachObject(i,r,e-t),s.Promise.resolve(e)}},{key:"_rotateForEachObject",value:function(e,t,n){var i=this.getCanvas(),o=e.x-t.x,s=e.y-t.y;i.forEachObject((function(t){var i=t.getCenterPoint(),a=r.default.util.degreesToRadians(n),l=r.default.util.rotatePoint(i,e,a);t.set({left:l.x-o,top:l.y-s,angle:(t.angle+n)%360}),t.setCoords()})),i.renderAll()}},{key:"rotate",value:function(e){var t=this.getCurrentAngle();return this.setAngle(t+e)}}]),t}(o.default);t.default=c},
2"./src/js/component/shape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n("tui-code-snippet"),o=h(n("fabric")),s=h(n("./src/js/interface/component.js")),a=h(n("./src/js/helper/shapeResizeHelper.js")),l=n("./src/js/helper/shapeFilterFillHelper.js"),c=n("./src/js/util.js"),u=n("./src/js/consts.js");function h(e){return e&&e.__esModule?e:{default:e}}var d=(0,r.extend)({strokeWidth:1,stroke:"#000000",fill:"#ffffff",width:1,height:1,rx:0,ry:0},u.SHAPE_DEFAULT_OPTIONS);function f(e,t,n){var i=e.fill,o=(0,c.getFillTypeFromOption)(e.fill),s=i;i.color&&(s=i.color);var a=null;if("filter"===o){var u=n();a=(0,l.makeFillPatternForFilter)(t,i.filter,u)}else a={fill:s};return(0,r.extend)({},e,a)}var p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.componentNames.SHAPE,e));return n._shapeObj=null,n._type="rect",n._options=(0,r.extend)({},d),n._isSelected=!1,n._startPoint={},n._withShiftKey=!1,n._handlers={mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n),keydown:n._onKeyDown.bind(n),keyup:n._onKeyUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(){var e=this.getCanvas();this._isSelected=!1,e.defaultCursor="crosshair",e.selection=!1,e.uniformScaling=!0,e.on({"mouse:down":this._handlers.mousedown}),o.default.util.addListener(document,"keydown",this._handlers.keydown),o.default.util.addListener(document,"keyup",this._handlers.keyup)}},{key:"end",value:function(){var e=this.getCanvas();this._isSelected=!1,e.defaultCursor="default",e.selection=!0,e.uniformScaling=!1,e.off({"mouse:down":this._handlers.mousedown}),o.default.util.removeListener(document,"keydown",this._handlers.keydown),o.default.util.removeListener(document,"keyup",this._handlers.keyup)}},{key:"setStates",value:function(e,t){this._type=e,t&&(this._options=(0,r.extend)(this._options,t))}},{key:"add",value:function(e,t){var n=this;return new c.Promise((function(i){var r=n.getCanvas(),o=n._extendOptions(t),s=n._createInstance(e,o),a=n.graphics.createObjectProperties(s);n._bindEventOnShape(s),r.add(s).setActiveObject(s),n._resetPositionFillFilter(s),i(a)}))}},{key:"change",value:function(e,t){var n=this;return new c.Promise((function(i,r){(0,c.isShape)(e)||r(u.rejectMessages.unsupportedType);var o="filter"===(0,c.getFillTypeFromOption)(t.fill),s=n.graphics,a=s.canvasImage,l=s.createStaticCanvas;e.set(o?f(t,a,l):t),o&&n._resetPositionFillFilter(e),n.getCanvas().renderAll(),i()}))}},{key:"makeFillPropertyForUserEvent",value:function(e){var t=(0,c.getFillTypeFromObject)(e),n={};if(t===u.SHAPE_FILL_TYPE.FILTER){var i=(0,l.getFillImageFromShape)(e),r=(0,l.makeFilterOptionFromFabricImage)(i);n.type=t,n.filter=r}else n.type=u.SHAPE_FILL_TYPE.COLOR,n.color=e.fill||"transparent";return n}},{key:"processForCopiedObject",value:function(e,t){if(this._bindEventOnShape(e),"filter"===(0,c.getFillTypeFromObject)(e)){var n=(0,l.getFillImageFromShape)(t),i=(0,l.makeFilterOptionFromFabricImage)(n),r=this.graphics.createStaticCanvas();e.set((0,l.makeFillPatternForFilter)(this.graphics.canvasImage,i,r)),this._resetPositionFillFilter(e)}}},{key:"_createInstance",value:function(e,t){var n=void 0;switch(e){case"rect":n=new o.default.Rect(t);break;case"circle":n=new o.default.Ellipse((0,r.extend)({type:"circle"},t));break;case"triangle":n=new o.default.Triangle(t);break;default:n={}}return n}},{key:"_extendOptions",value:function(e){var t=u.fObjectOptions.SELECTION_STYLE,n=this.graphics,i=n.canvasImage,o=n.createStaticCanvas;return f(e=(0,r.extend)({},d,this._options,t,e),i,o)}},{key:"_bindEventOnShape",value:function(e){var t=this,n=this.getCanvas();e.on({added:function(){t._shapeObj=this,a.default.setOrigins(t._shapeObj)},selected:function(){t._isSelected=!0,t._shapeObj=this,n.uniformScaling=!0,n.defaultCursor="default",a.default.setOrigins(t._shapeObj)},deselected:function(){t._isSelected=!1,t._shapeObj=null,n.defaultCursor="crosshair",n.uniformScaling=!1},modified:function(){var e=t._shapeObj;a.default.adjustOriginToCenter(e),a.default.setOrigins(e)},modifiedInGroup:function(n){t._fillFilterRePositionInGroupSelection(e,n)},moving:function(){t._resetPositionFillFilter(this)},rotating:function(){t._resetPositionFillFilter(this)},scaling:function(e){var i=n.getPointer(e.e),r=t._shapeObj;n.setCursor("crosshair"),a.default.resize(r,i,!0),t._resetPositionFillFilter(this)}})}},{key:"_onFabricMouseDown",value:function(e){if(e.target||(this._isSelected=!1,this._shapeObj=!1),!this._isSelected&&!this._shapeObj){var t=this.getCanvas();this._startPoint=t.getPointer(e.e),t.on({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}}},{key:"_onFabricMouseMove",value:function(e){var t=this,n=this.getCanvas(),i=n.getPointer(e.e),r=this._startPoint.x,o=this._startPoint.y,s=r-i.x,l=o-i.y,c=this._shapeObj;c?(this._shapeObj.set({isRegular:this._withShiftKey}),a.default.resize(c,i),n.renderAll(),this._resetPositionFillFilter(c)):this.add(this._type,{left
2:r,top:o,width:s,height:l}).then((function(e){t.fire(u.eventNames.ADD_OBJECT,e)}))}},{key:"_onFabricMouseUp",value:function(){var e=this,t=this.getCanvas(),n=this._startPoint.x,i=this._startPoint.y,r=this._shapeObj;r?r&&(a.default.adjustOriginToCenter(r),this.fire(u.eventNames.OBJECT_ADDED,this.graphics.createObjectProperties(r))):this.add(this._type,{left:n,top:i,width:20,height:20}).then((function(t){e.fire(u.eventNames.ADD_OBJECT,t)})),t.off({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}},{key:"_onKeyDown",value:function(e){e.keyCode===u.keyCodes.SHIFT&&(this._withShiftKey=!0,this._shapeObj&&(this._shapeObj.isRegular=!0))}},{key:"_onKeyUp",value:function(e){e.keyCode===u.keyCodes.SHIFT&&(this._withShiftKey=!1,this._shapeObj&&(this._shapeObj.isRegular=!1))}},{key:"_resetPositionFillFilter",value:function(e){if("filter"===(0,c.getFillTypeFromObject)(e)){var t=(0,c.getCustomProperty)(e,"patternSourceCanvas").patternSourceCanvas,n=(0,l.getFillImageFromShape)(e),i=(0,c.getCustomProperty)(n,"originalAngle").originalAngle;this.graphics.canvasImage.angle!==i&&(0,l.reMakePatternImageSource)(e,this.graphics.canvasImage);var r=e.originX,o=e.originY;a.default.adjustOriginToCenter(e),e.width*=e.scaleX,e.height*=e.scaleY,e.rx*=e.scaleX,e.ry*=e.scaleY,e.scaleX=1,e.scaleY=1,(0,l.rePositionFilterTypeFillImage)(e),(0,c.changeOrigin)(e,{originX:r,originY:o}),(0,l.resetFillPatternCanvas)(t)}}},{key:"_fillFilterRePositionInGroupSelection",value:function(e,t){1===t.scaleX&&1===t.scaleY||t.addWithUpdate();var n=e.angle,i=e.left,r=e.top;o.default.util.addTransformToObject(e,t.calcTransformMatrix()),this._resetPositionFillFilter(e),e.set({angle:n,left:i,top:r})}}]),t}(s.default);t.default=p},
2"./src/js/component/text.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=c(n("tui-code-snippet")),o=c(n("fabric")),s=c(n("./src/js/interface/component.js")),a=n("./src/js/util.js"),l=n("./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u={fill:"#000000",left:0,top:0},h={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"tie-text-align-left",underline:!1},d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.TEXT,e));return n._defaultStyles=u,n._isSelected=!1,n._selectedObj={},n._editingObj={},n._listeners={mousedown:n._onFabricMouseDown.bind(n),select:n._onFabricSelect.bind(n),selectClear:n._onFabricSelectClear.bind(n),scaling:n._onFabricScaling.bind(n),textChanged:n._onFabricTextChanged.bind(n)},n._textarea=null,n._ratio=1,n._lastClickTime=(new Date).getTime(),n._editingObjInfos={},n.isPrevEditing=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(){var e=this,t=this.getCanvas();t.selection=!1,t.defaultCursor="text",t.on({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged}),t.forEachObject((function(t){"i-text"===t.type&&e.adjustOriginPosition(t,"start")})),this.setCanvasRatio()}},{key:"end",value:function(){var e=this,t=this.getCanvas();t.selection=!0,t.defaultCursor="default",t.forEachObject((function(n){"i-text"===n.type&&(""===n.text?t.remove(n):e.adjustOriginPosition(n,"end"))})),t.off({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:selected":this._listeners.select,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged})}},{key:"adjustOriginPosition",value:function(e,t){var n="center",i="center";"start"===t&&(n="left",i="top");var r=e.getPointByOrigin(n,i),o=r.x,s=r.y;e.set({left:o,top:s,originX:n,originY:i}),e.setCoords()}},{key:"add",value:function(e,t){var n=this;return new a.Promise((function(i){var s=n.getCanvas(),a=null,c=l.fObjectOptions.SELECTION_STYLE,u=n._defaultStyles;n._setInitPos(t.position),t.styles&&(u=r.default.extend(u,t.styles)),r.default.isExisty(t.autofocus)||(t.autofocus=!0),a=new o.default.IText(e,u),c=r.default.extend({},c,{originX:"left",originY:"top"}),a.set(c),a.on({mouseup:n._onFabricMouseUp.bind(n)}),s.add(a),t.autofocus&&(a.enterEditing(),a.selectAll()),s.getActiveObject()||s.setActiveObject(a),n.isPrevEditing=!0,i(n.graphics.createObjectProperties(a))}))}},{key:"change",value:function(e,t){var n=this;return new a.Promise((function(i){e.set("text",t),n.getCanvas().renderAll(),i()}))}},{key:"setStyle",value:function(e,t){var n=this;return new a.Promise((function(i){r.default.forEach(t,(function(n,i){e[i]===n&&"fontSize"!==i&&(t[i]=h[i]||"")}),n),"textDecoration"in t&&r.default.extend(t,n._getTextDecorationAdaptObject(t.textDecoration)),e.set(t),n.getCanvas().renderAll(),i()}))}},{key:"getText",value:function(e){return e.text}},{key:"setSelectedInfo",value:function(e,t){this._selectedObj=e,this._isSelected=t}},{key:"isSelected",value:function(){return this._isSelected}},{key:"getSelectedObj",value:function(){return this._selectedObj}},{key:"setCanvasRatio",value:function(){var e=this.getCanvasElement(),t=parseInt(e.style.maxWidth,10),n=e.width;this._ratio=n/t}},{key:"getCanvasRatio",value:function(){return this._ratio}},{key:"_getTextDecorationAdaptObject",value:function(e){return{underline:"underline"===e,linethrough:"line-through"===e,overline:"overline"===e}}},{key:"_setInitPos",value:function(e){e=e||this.getCanvasImage().getCenterPoint(),this._defaultStyles.left=e.x,this._defaultStyles.top=e.y}},{key:"_onInput",value:function(){var e=this.getCanvasRatio(),t=this._editingObj,n=this._textarea.style;n.width=Math.ceil(t.width/e)+"px",n.height=Math.ceil(t.height/e)+"px"}},{key:"_onKeyDown",value:function(){var e=this,t=this.getCanvasRatio(),n=this._editingObj,i=this._textarea.style;setTimeout((function(){n.text(e._textarea.value),i.width=Math.ceil(n.width/t)+"px",i.height=Math.ceil(n.height/t)+"px"}),0)}},{key:"_onBlur",value:function(){var e=this.getCanvasRatio(),t=this._editingObj,n=this._editingObjInfos,i=this._textarea.value,o=t.width/e-n.width/e,s=t.height/e-n.height/e;if(1===e&&(o/=2,s/=2),this._textarea.style.display="none",t.set({left:n.left+o,top:n.top+s}),i.length){this.getCanvas().add(t);var a={id:r.default.stamp(t),type:t.type,text:i};this.fire(l.eventNames.TEXT_CHANGED,a)}}},{key:"_onScroll",value:function(){this._textarea.scrollLeft=0,this._textarea.scrollTop=0}},{key:"_onFabricScaling",value:function(e){var t=e.target;t.fontSize=t.fontSize*t.scaleY,t.scaleX=1,t.scaleY=1}},{key:"_onFabricTextChanged",value:function(e){this.fire(l.eventNames.TEXT_CHANGED,e.target)}},{key:"_onFabricSelectClear",value:function(e){var t=this.getSelectedObj();this.isPrevEditing=!0,this.setSelectedInfo(e.target,!1),t&&""===t.text&&this.getCanvas().remove(t)}},{key:"_onFabricSelect",value:function(e){this.isPrevEditing=!0,this.setSelectedInfo(e.target,!0)}},{key:"_onFabricMouseDown",value:function(e){var t=e.target;t&&!t.isType("text")||(this.isPrevEditing?this.isPrevEditing=!1:this._fireAddText(e))}},{key:"_fireAddText",value:function(e){var t=e.target,n=e.e||{},i=this.getCanvas().getPointer(n);t||this.fire(l.eventNames.ADD_TEXT,{originPosition:{x:i.x,y:i.y},clientPosition:{x:n.clientX||0,y:n.clientY||0}})}},{key:"_onFabricMouseUp",value:function(e){var t=e.target,n=(new Date).getTime();this._isDoubleClick(n)&&!t.isEditing&&t.enterEditing(),t.isEditing&&this.fire(l.eventNames.TEXT_EDITING),this._lastClickTime=n}},{key:"_isDoubleClick",value:function(e){return e-this._lastClickTime<500}}]),t}(s.default);t.default=d},
2"./src/js/component/zoom.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n("fabric")),o=l(n("./src/js/interface/component.js")),s=n("./src/js/util.js"),a=n("./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c={left:0,top:0,width:0,height:0,stroke:"#000000",strokeWidth:0,fill:"#000000",opacity:.4,evented:!1,selectable:!1,hoverCursor:"auto"},u=.0045,h=.003,d=.003,f=.0066,p=.0044,g=.003,m=a.eventNames.ZOOM_CHANGED,v=a.eventNames.ADD_TEXT,y=a.eventNames.TEXT_EDITING,_=a.eventNames.OBJECT_MODIFIED,b=a.eventNames.KEY_DOWN,x=a.eventNames.KEY_UP,C=a.eventNames.HAND_STARTED,j=a.eventNames.HAND_STOPPED,w=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.componentNames.ZOOM,e));n.zoomArea=null,n._startPoint=null,n._centerPoints=[],n.zoomLevel=1,n.zoomMode=a.zoomModes.DEFAULT,n._listeners={startZoom:n._onMouseDownWithZoomMode.bind(n),moveZoom:n._onMouseMoveWithZoomMode.bind(n),stopZoom:n._onMouseUpWithZoomMode.bind(n),startHand:n._onMouseDownWithHandMode.bind(n),moveHand:n._onMouseMoveWithHandMode.bind(n),stopHand:n._onMouseUpWithHandMode.bind(n),zoomChanged:n._changeScrollState.bind(n),keydown:n._startHandModeWithSpaceBar.bind(n),keyup:n._endHandModeWithSpaceBar.bind(n)};var i=n.getCanvas();return n.aspectRatio=i.width/i.height,n._verticalScroll=new r.default.Rect(c),n._horizontalScroll=new r.default.Rect(c),i.on(m,n._listeners.zoomChanged),n.graphics.on(v,n._startTextEditingHandler.bind(n)),n.graphics.on(y,n._startTextEditingHandler.bind(n)),n.graphics.on(_,n._stopTextEditingHandler.bind(n)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"attachKeyboardZoomEvents",value:function(){r.default.util.addListener(document,b,this._listeners.keydown),r.default.util.addListener(document,x,this._listeners.keyup)}},{key:"detachKeyboardZoomEvents",value:function(){r.default.util.removeListener(document,b,this._listeners.keydown),r.default.util.removeListener(document,x,this._listeners.keyup)}},{key:"_startTextEditingHandler",value:function(){this.isTextEditing=!0}},{key:"_stopTextEditingHandler",value:function(){this.isTextEditing=!1}},{key:"_startHandModeWithSpaceBar",value:function(e){this.withSpace||this.isTextEditing||e.keyCode===a.keyCodes.SPACE&&(this.withSpace=!0,this.startHandMode())}},{key:"_endHandModeWithSpaceBar",value:function(e){e.keyCode===a.keyCodes.SPACE&&(this.withSpace=!1,this.endHandMode())}},{key:"startZoomInMode",value:function(){if(!this.zoomArea){this.endHandMode(),this.zoomMode=a.zoomModes.ZOOM;var e=this.getCanvas();this._changeObjectsEventedState(!1),this.zoomArea=new r.default.Rect({left:0,top:0,width:.5,height:.5,stroke:"black",strokeWidth:1,fill:"transparent",hoverCursor:"zoom-in"}),e.discardActiveObject(),e.add(this.zoomArea),e.on("mouse:down",this._listeners.startZoom),e.selection=!1,e.defaultCursor="zoom-in"}}},{key:"endZoomInMode",value:function(){this.zoomMode=a.zoomModes.DEFAULT;var e=this.getCanvas(),t=this._listeners,n=t.startZoom,i=t.moveZoom,r=t.stopZoom;e.selection=!0,e.defaultCursor="auto",e.off({"mouse:down":n,"mouse:move":i,"mouse:up":r}),this._changeObjectsEventedState(!0),e.remove(this.zoomArea),this.zoomArea=null}},{key:"start",value:function(){this.zoomArea=null,this._startPoint=null,this._startHandPoint=null}},{key:"end",value:function(){this.endZoomInMode(),this.endHandMode()}},{key:"startHandMode",value:function(){this.endZoomInMode(),this.zoomMode=a.zoomModes.HAND;var e=this.getCanvas();
vendor: 5,096 bytes, line 2
2this._changeObjectsEventedState(!1),e.discardActiveObject(),e.off("mouse:down",this._listeners.startHand),e.on("mouse:down",this._listeners.startHand),e.selection=!1,e.defaultCursor="grab",e.fire(C)}},{key:"endHandMode",value:function(){this.zoomMode=a.zoomModes.DEFAULT;var e=this.getCanvas();this._changeObjectsEventedState(!0),e.off("mouse:down",this._listeners.startHand),e.selection=!0,e.defaultCursor="auto",this._startHandPoint=null,e.fire(j)}},{key:"_onMouseDownWithZoomMode",value:function(e){var t=e.target,n=e.e;if(!t){var i=this.getCanvas();i.selection=!1,this._startPoint=i.getPointer(n),this.zoomArea.set({width:0,height:0});var r=this._listeners,o=r.moveZoom,s=r.stopZoom;i.on({"mouse:move":o,"mouse:up":s})}}},{key:"_onMouseMoveWithZoomMode",value:function(e){var t=e.e,n=this.getCanvas(),i=n.getPointer(t),r=i.x,o=i.y,s=this.zoomArea,a=this._startPoint;Math.abs(r-a.x)+Math.abs(o-a.y)>10&&(n.remove(s),s.set(this._calcRectDimensionFromPoint(r,o)),n.add(s))}},{key:"_calcRectDimensionFromPoint",value:function(e,t){var n=this.getCanvas(),i=n.getWidth(),r=n.getHeight(),o=this._startPoint,a=o.x,l=o.y,c=Math.min,u=c(a,e),h=c(l,t);return{left:u,top:h,width:(0,s.clamp)(e,a,i)-u,height:(0,s.clamp)(t,l,r)-h}}},{key:"_onMouseUpWithZoomMode",value:function(){var e=this.zoomLevel,t=this.zoomArea,n=this._listeners,i=n.moveZoom,r=n.stopZoom,o=this.getCanvas(),s=this._getCenterPoint(),a=s.x,l=s.y;this._isMaxZoomLevel()||(this._centerPoints.push({x:a,y:l,prevZoomLevel:e,zoomLevel:e+1}),e+=1,o.zoomToPoint({x:a,y:l},e),this._fireZoomChanged(o,e),this.zoomLevel=e),o.off({"mouse:move":i,"mouse:up":r}),o.remove(t),this._startPoint=null}},{key:"_getCenterPoint",value:function(){var e=this.zoomArea,t=e.left,n=e.top,i=e.width,r=e.height,o=this._startPoint,s=o.x,a=o.y,l=this.aspectRatio;return i<10&&r<10?{x:s,y:a}:i>r?{x:t+l*r/2,y:n+r/2}:{x:t+i/2,y:n+i/l/2}}},{key:"zoom",value:function(e){for(var t=e.x,n=e.y,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.zoomLevel,r=this.getCanvas(),o=this._centerPoints,s=o.length-1;s>=0&&!(o[s].zoomLevel<i);s-=1){var a=o.pop(),l=a.x,c=a.y,u=a.prevZoomLevel;r.zoomToPoint({x:l,y:c},u),this.zoomLevel=u}r.zoomToPoint({x:t,y:n},i),this._isDefaultZoomLevel(i)||this._centerPoints.push({x:t,y:n,zoomLevel:i,prevZoomLevel:this.zoomLevel}),this.zoomLevel=i,this._fireZoomChanged(r,i)}},{key:"zoomOut",value:function(){var e=this._centerPoints;if(e.length){var t=this.getCanvas(),n=e.pop(),i=n.x,r=n.y,o=n.prevZoomLevel;this._isDefaultZoomLevel(o)?t.setViewportTransform([1,0,0,1,0,0]):t.zoomToPoint({x:i,y:r},o),this.zoomLevel=o,this._fireZoomChanged(t,this.zoomLevel)}}},{key:"resetZoom",value:function(){var e=this.getCanvas();e.setViewportTransform([1,0,0,1,0,0]),this.zoomLevel=1,this._centerPoints=[],this._fireZoomChanged(e,this.zoomLevel)}},{key:"_isMaxZoomLevel",value:function(){return this.zoomLevel>=5}},{key:"_movePointOfZoom",value:function(e){var t=e.x,n=e.y,i=this._centerPoints;if(i.length){var r=this.getCanvas(),o=this.zoomLevel,s=i.pop(),a=s.x,l=s.y,c=s.prevZoomLevel,u=a-t,h=l-n;r.zoomToPoint({x:a,y:l},c),r.zoomToPoint({x:u,y:h},o),i.push({x:u,y:h,prevZoomLevel:c,zoomLevel:o}),this._fireZoomChanged(r,o)}}},{key:"_onMouseDownWithHandMode",value:function(e){var t=e.target,n=e.e;if(!t){var i=this.getCanvas();if(!(this.zoomLevel<=1)){i.selection=!1,this._startHandPoint=i.getPointer(n);var r=this._listeners,o=r.moveHand,s=r.stopHand;i.on({"mouse:move":o,"mouse:up":s})}}}},{key:"_onMouseMoveWithHandMode",value:function(e){var t=e.e,n=this.getCanvas().getPointer(t),i=n.x,r=n.y,o=i-this._startHandPoint.x,s=r-this._startHandPoint.y;this._movePointOfZoom({x:o,y:s})}},{key:"_onMouseUpWithHandMode",value:function(){var e=this.getCanvas(),t=this._listeners,n=t.moveHand,i=t.stopHand;e.off({"mouse:move":n,"mouse:up":i}),this._startHandPoint=null}},{key:"_changeScrollState",value:function(e){var t=e.viewport,n=e.zoomLevel,i=this.getCanvas();if(i.remove(this._verticalScroll),i.remove(this._horizontalScroll),!this._isDefaultZoomLevel(n)){var r=i.width,o=i.height,a=t.tl,l=t.tr,c=t.bl,m=l.x-a.x,v=c.y-a.y,y=m*m/r,_=v*f,b=(0,s.clamp)(a.x+a.x/r*m,a.x,l.x-y),x=v*p,C=v*g;this._horizontalScroll.set({left:b,top:c.y-_-x,width:y,height:_,rx:C,ry:C});var j=m*u,w=v*v/o,S=(0,s.clamp)(a.y+a.y/o*v,l.y,c.y-w),k=m*h,O=m*d;this._verticalScroll.set({left:l.x-j-k,top:S,width:j,height:w,rx:O,ry:O}),this._addScrollBar()}}},{key:"_changeObjectsEventedState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getCanvas();t.forEachObject((function(t){t.evented=e}))}},{key:"_addScrollBar",value:function(){var e=this,t=this.getCanvas();t.add(this._horizontalScroll),t.add(this._verticalScroll),this.scrollBarTid&&clearTimeout(this.scrollBarTid),this.scrollBarTid=setTimeout((function(){t.remove(e._horizontalScroll),t.remove(e._verticalScroll)}),3e3)}},{key:"_isDefaultZoomLevel",value:function(e){return 1===e}},{key:"_fireZoomChanged",value:function(e,t){e.fire(m,{viewport:e.calcViewportBoundaries(),zoomLevel:t})}},{key:"mode",get:function(){return this.zoomMode}}]),t}(o.default);t.default=w},
2"./src/js/consts.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultResizePixelValues=t.emptyCropRectValues=t.defaultFilterRangeValues=t.defaultTextRangeValues=t.defaultShapeStrokeValues=t.defaultDrawRangeValues=t.defaultRotateRangeValues=t.defaultIconPath=t.rejectMessages=t.fObjectOptions=t.keyCodes=t.zoomModes=t.drawingMenuNames=t.drawingModes=t.historyNames=t.selectorNames=t.eventNames=t.commandNames=t.CROPZONE_DEFAULT_OPTIONS=t.SHAPE_DEFAULT_OPTIONS=t.componentNames=t.filterType=t.OBJ_TYPE=t.SHAPE_TYPE=t.SHAPE_FILL_TYPE=t.HELP_MENUS=t.DELETE_HELP_MENUS=t.COMMAND_HELP_MENUS=t.ZOOM_HELP_MENUS=void 0;var i=n("./src/js/util.js"),r=t.ZOOM_HELP_MENUS=["zoomIn","zoomOut","hand"],o=t.COMMAND_HELP_MENUS=["history","undo","redo","reset"],s=t.DELETE_HELP_MENUS=["delete","deleteAll"];t.HELP_MENUS=[].concat(r,o,s),t.SHAPE_FILL_TYPE={FILTER:"filter",COLOR:"color"},t.SHAPE_TYPE=["rect","circle","triangle"],t.OBJ_TYPE={CROPZONE:"cropzone"},t.filterType={VINTAGE:"vintage",SEPIA2:"sepia2",REMOVE_COLOR:"removeColor",COLOR_FILTER:"colorFilter",REMOVE_WHITE:"removeWhite",BLEND_COLOR:"blendColor",BLEND:"blend"},t.componentNames=(0,i.keyMirror)("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE","ZOOM","RESIZE"),t.SHAPE_DEFAULT_OPTIONS={lockSkewingX:!0,lockSkewingY:!0,bringForward:!0,isRegular:!1},t.CROPZONE_DEFAULT_OPTIONS={hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0,lockSkewingX:!0,lockSkewingY:!0},t.commandNames={CLEAR_OBJECTS:"clearObjects",LOAD_IMAGE:"loadImage",FLIP_IMAGE:"flip",ROTATE_IMAGE:"rotate",ADD_OBJECT:"addObject",REMOVE_OBJECT:"removeObject",APPLY_FILTER:"applyFilter",REMOVE_FILTER:"removeFilter",ADD_ICON:"addIcon",CHANGE_ICON_COLOR:"changeIconColor",ADD_SHAPE:"addShape",CHANGE_SHAPE:"changeShape",ADD_TEXT:"addText",CHANGE_TEXT:"changeText",CHANGE_TEXT_STYLE:"changeTextStyle",ADD_IMAGE_OBJECT:"addImageObject",RESIZE_CANVAS_DIMENSION:"resizeCanvasDimension",SET_OBJECT_PROPERTIES:"setObjectProperties",SET_OBJECT_POSITION:"setObjectPosition",CHANGE_SELECTION:"changeSelection",RESIZE_IMAGE:"resize"},t.eventNames={OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",OBJECT_CREATED:"objectCreated",OBJECT_ROTATED:"objectRotated",OBJECT_ADDED:"objectAdded",OBJECT_MODIFIED:"objectModified",TEXT_EDITING:"textEditing",TEXT_CHANGED:"textChanged",ICON_CREATE_RESIZE:"iconCreateResize",ICON_CREATE_END:"iconCreateEnd",ADD_TEXT:"addText",ADD_OBJECT:"addObject",ADD_OBJECT_AFTER:"addObjectAfter",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_MOVE:"mousemove",REDO_STACK_CHANGED:"redoStackChanged",UNDO_STACK_CHANGED:"undoStackChanged",SELECTION_CLEARED:"selectionCleared",SELECTION_CREATED:"selectionCreated",EXECUTE_COMMAND:"executeCommand",AFTER_UNDO:"afterUndo",AFTER_REDO:"afterRedo",ZOOM_CHANGED:"zoomChanged",HAND_STARTED:"handStarted",HAND_STOPPED:"handStopped",KEY_DOWN:"keydown",KEY_UP:"keyup",INPUT_BOX_EDITING_STARTED:"inputBoxEditingStarted",INPUT_BOX_EDITING_STOPPED:"inputBoxEditingStopped",FOCUS:"focus",BLUR:"blur",IMAGE_RESIZED:"imageResized"},t.selectorNames={COLOR_PICKER_INPUT_BOX:".tui-colorpicker-palette-hex"},t.historyNames={LOAD_IMAGE:"Load",LOAD_MASK_IMAGE:"Mask",ADD_MASK_IMAGE:"Mask",ADD_IMAGE_OBJECT:"Mask",CROP:"Crop",RESIZE:"Resize",APPLY_FILTER:"Filter",REMOVE_FILTER:"Filter",CHANGE_SHAPE:"Shape",CHANGE_ICON_COLOR:"Icon",ADD_TEXT:"Text",CHANGE_TEXT_STYLE:"Text",REMOVE_OBJECT:"Delete",CLEAR_OBJECTS:"Delete"},t.drawingModes=(0,i.keyMirror)("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON","ZOOM","RESIZE"),t.drawingMenuNames={TEXT:"text",CROP:"crop",RESIZE:"resize",SHAPE:"shape",ZOOM:"zoom"},t.zoomModes={DEFAULT:"normal",ZOOM:"zoom",HAND:"hand"},t.keyCodes={Z:90,Y:89,C:67,V:86,SHIFT:16,BACKSPACE:8,DEL:46,ARROW_DOWN:40,ARROW_UP:38,SPACE:32},t.fObjectOptions={SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},t.rejectMessages={addedObject:"The object is already added.",flip:"The flipX and flipY setting values are not changed.",invalidDrawingMode:"This operation is not supported in the drawing mode.",invalidParameters:"Invalid parameters.",isLock:"The executing command state is locked.",loadImage:"The background image is empty.",loadingImageFailed:"Invalid image loaded.",noActiveObject:"There is no active object.",noObject:"The object is not in canvas.",redo:"The promise of redo command is reject.",rotation:"The current angle is same the old angle.",undo:"The promise of undo command is reject.",unsupportedOperation:"Unsupported operation.",unsupportedType:"Unsupported object type."},t.defaultIconPath={"icon-arrow":"M40 12V0l24 24-24 24V36H0V12h40z","icon-arrow-2":"M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18  z ","icon-arrow-3":"M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27  z ","icon-star":"M35,54.557999 l-19.912001,
210.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001  z ","icon-star-2":"M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83  z ","icon-polygon":"M3,31 L19,3 h32 l16,28 l-16,28 H19  z ","icon-location":"M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z","icon-heart":"M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285  z ","icon-bubble":"M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z"},t.defaultRotateRangeValues={realTimeEvent:!0,min:-360,max:360,value:0},t.defaultDrawRangeValues={min:5,max:30,value:12},t.defaultShapeStrokeValues={realTimeEvent:!0,min:2,max:300,value:3},t.defaultTextRangeValues={realTimeEvent:!0,min:10,max:100,value:50},t.defaultFilterRangeValues={tintOpacityRange:{realTimeEvent:!0,min:0,max:1,value:.7,useDecimal:!0},removewhiteDistanceRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},brightnessRange:{realTimeEvent:!0,min:-1,max:1,value:0,useDecimal:!0},noiseRange:{realTimeEvent:!0,min:0,max:1e3,value:100},pixelateRange:{realTimeEvent:!0,min:2,max:20,value:4},colorfilterThresholdRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},blurFilterRange:{value:.1}},t.emptyCropRectValues={LEFT:0,TOP:0,WIDTH:.5,HEIGHT:.5},t.defaultResizePixelValues={realTimeEvent:!0,min:32,max:4088,value:800}},
2"./src/js/drawingMode/cropper.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.CROPPER))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.CROPPER).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.CROPPER).end()}}]),t}(s.default);t.default=l},
2"./src/js/drawingMode/freeDrawing.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.FREE_DRAWING))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e,t){e.getComponent(a.componentNames.FREE_DRAWING).start(t)}},{key:"end",value:function(e){e.getComponent(a.componentNames.FREE_DRAWING).end()}}]),t}(s.default);t.default=l},
2"./src/js/drawingMode/icon.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.ICON))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.ICON).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.ICON).end()}}]),t}(s.default);t.default=l},
2"./src/js/drawingMode/lineDrawing.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.LINE_DRAWING))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e,t){e.getComponent(a.componentNames.LINE).start(t)}},{key:"end",value:function(e){e.getComponent(a.componentNames.LINE).end()}}]),t}(s.default);t.default=l},
2"./src/js/drawingMode/resize.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.RESIZE))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.RESIZE).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.RESIZE).end()}}]),t}(s.default);t.default=l},
2"./src/js/drawingMode/shape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.SHAPE))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.SHAPE).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.SHAPE).end()}}]),t}(s.default);t.default=l},
2"./src/js/drawingMode/text.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.TEXT))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.TEXT).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.TEXT).end()}}]),t}(s.default);t.default=l},
2"./src/js/drawingMode/zoom.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/interface/drawingMode.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.ZOOM))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.ZOOM).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.ZOOM).end()}}]),t}(s.default);t.default=l},
2"./src/js/extension/arrowLine.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("fabric"),o=(i=r)&&i.__esModule?i:{default:i},s=o.default.util.createClass(o.default.Line,{type:"line",initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.callSuper("initialize",e,t),this.arrowType=t.arrowType},_render:function(e){var t=this.calcLinePoints(),n={fromX:t.x1,fromY:t.y1,toX:t.x2,toY:t.y2};this.ctx=e,e.lineWidth=this.strokeWidth,this._renderBasicLinePath(n),this._drawDecoratorPath(n),this._renderStroke(e)},_renderBasicLinePath:function(e){var t=e.fromX,n=e.fromY,i=e.toX,r=e.toY;this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(i,r)},_drawDecoratorPath:function(e){this._drawDecoratorPathType("head",e),this._drawDecoratorPathType("tail",e)},_drawDecoratorPathType:function(e,t){switch(this.arrowType[e]){case"triangle":this._drawTrianglePath(e,t);break;case"chevron":this._drawChevronPath(e,t)}},_drawTrianglePath:function(e,t){var n=1.7*this.ctx.lineWidth;this._drawChevronPath(e,t,n),this.ctx.closePath()},_drawChevronPath:function(e,t,n){var i=this,r=t.fromX,o=t.fromY,s=t.toX,a=t.toY,l=this.ctx;n||(n=2.7*this.ctx.lineWidth);var c="head"===e?[r,o]:[s,a],u=c[0],h=c[1],d="head"===e?[s,a]:[r,o],f=d[0],p=d[1],g=180*Math.atan2(p-h,f-u)/Math.PI,m=function(e){return i.getRotatePosition(n,e,{x:u,y:h})};l.moveTo.apply(l,m(g+30)),l.lineTo(u,h),l.lineTo.apply(l,m(g-30))},getRotatePosition:function(e,t,n){var i=t*Math.PI/180,r=n.x,o=n.y;return[e*Math.cos(i)+r,e*Math.sin(i)+o]}});t.default=s},
2"./src/js/extension/colorFilter.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("fabric"),o=(i=r)&&i.__esModule?i:{default:i},s=o.default.util.createClass(o.default.Image.filters.BaseFilter,{type:"ColorFilter",initialize:function(e){e||(e={}),this.color=e.color||"#FFFFFF",this.threshold=e.threshold||45,this.x=e.x||null,this.y=e.y||null},applyTo:function(e){var t,n=e.canvasEl,i=n.getContext("2d"),r=i.getImageData(0,0,n.width,n.height),s=r.data,a=this.threshold,l=o.default.Color.sourceFromHex(this.color),c=void 0;for(this.x&&this.y&&(l=this._getColor(r,this.x,this.y)),c=0,t=s.length;c<t;c+=4)this._isOutsideThreshold(s[c],l[0],a)||this._isOutsideThreshold(s[c+1],l[1],a)||this._isOutsideThreshold(s[c+2],l[2],a)||(s[c]=s[c+1]=s[c+2]=s[c+3]=0);i.putImageData(r,0,0)},_isOutsideThreshold:function(e,t,n){var i=e-t;return Math.abs(i)>n},_getColor:function(e,t,n){var i=[0,0,0,0],r=e.data,o=4*(e.width*n+t);return i[0]=r[o],i[1]=r[o+1],i[2]=r[o+2],i[3]=r[o+3],i}});t.default=s},
2"./src/js/extension/cropzone.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a(n("tui-code-snippet")),r=a(n("fabric")),o=n("./src/js/util.js"),s=n("./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=["tl","tr","mt","ml","mr","mb","bl","br"],u=function(){};function h(e,t){return e>t?"width":"height"}var d=r.default.util.createClass(r.default.Rect,{initialize:function(e,t,n){(t=i.default.extend(t,n)).type="cropzone",this.callSuper("initialize",t),this._addEventHandler(),this.canvas=e,this.options=t},canvasEventDelegation:function(e){var t="unregistered";return this.canvasEventTrigger[e]!==u?t="registered":[s.eventNames.OBJECT_MOVED,s.eventNames.OBJECT_SCALED].indexOf(e)<0&&(t="none"),t},canvasEventRegister:function(e,t){this.canvasEventTrigger[e]=t},_addEventHandler:function(){var e;this.canvasEventTrigger=(l(e={},s.eventNames.OBJECT_MOVED,u),l(e,s.eventNames.OBJECT_SCALED,u),e),this.on({moving:this._onMoving.bind(this),scaling:this._onScaling.bind(this)}),r.default.util.addListener(document,"keydown",this._onKeyDown.bind(this)),r.default.util.addListener(document,"keyup",this._onKeyUp.bind(this))},_renderCropzone:function(e){var t=this.flipX?-1:1,n=this.flipY?-1:1,i=t/this.scaleX,r=n/this.scaleY;e.scale(i,r),this._fillOuterRect(e,"rgba(0, 0, 0, 0.5)"),this.options.lineWidth?(this._fillInnerRect(e),this._strokeBorder(e,"rgb(255, 255, 255)",{lineWidth:this.options.lineWidth})):(this._strokeBorder(e,"rgb(0, 0, 0)",{lineDashWidth:7}),this._strokeBorder(e,"rgb(255, 255, 255)",{lineDashWidth:7,lineDashOffset:7})),e.scale(1/i,1/r)},_render:function(e){this.callSuper("_render",e),this._renderCropzone(e)},_fillOuterRect:function(e,t){var n=this._getCoordinates(),i=n.x,r=n.y;e.save(),e.fillStyle=t,e.beginPath(),e.moveTo(i[0]-1,r[0]-1),e.lineTo(i[3]+1,r[0]-1),e.lineTo(i[3]+1,r[3]+1),e.lineTo(i[0]-1,r[3]+1),e.lineTo(i[0]-1,r[0]-1),e.closePath(),e.moveTo(i[1],r[1]),e.lineTo(i[1],r[2]),e.lineTo(i[2],r[2]),e.lineTo(i[2],r[1]),e.lineTo(i[1],r[1]),e.closePath(),e.fill(),e.restore()},_fillInnerRect:function(e){var t=this._getCoordinates(),n=t.x,i=t.y,r=this._caculateInnerPosition(n,(n[2]-n[1])/3),o=this._caculateInnerPosition(i,(i[2]-i[1])/3);e.save(),e.strokeStyle="rgba(255, 255, 255, 0.7)",e.lineWidth=this.options.lineWidth,e.beginPath(),e.moveTo(r[0],o[1]),e.lineTo(r[3],o[1]),e.moveTo(r[0],o[2]),e.lineTo(r[3],o[2]),e.moveTo(r[1],o[0]),e.lineTo(r[1],o[3]),e.moveTo(r[2],o[0]),e.lineTo(r[2],o[3]),e.stroke(),e.closePath(),e.restore()},_caculateInnerPosition:function(e,t){var n=[];return n[0]=e[1],n[1]=e[1]+t,n[2]=e[1]+2*t,n[3]=e[2],n},_getCoordinates:function(){var e=this.canvas,t=this.width,n=this.height,r=this.left,o=this.top,s=t/2,a=n/2,l=e.getHeight(),c=e.getWidth();return{x:i.default.map([-(s+r),-s,s,s+(c-r-t)],Math.ceil),y:i.default.map([-(a+o),-a,a,a+(l-o-n)],Math.ceil)}},_strokeBorder:function(e,t,n){var i=n.lineDashWidth,r=n.lineDashOffset,o=n.lineWidth,s=this.width/2,a=this.height/2;
2e.save(),e.strokeStyle=t,e.setLineDash&&e.setLineDash([i,i]),r&&(e.lineDashOffset=r),o&&(e.lineWidth=o),e.beginPath(),e.moveTo(-s,-a),e.lineTo(s,-a),e.lineTo(s,a),e.lineTo(-s,a),e.lineTo(-s,-a),e.stroke(),e.restore()},_onMoving:function(){var e=this.height,t=this.width,n=this.left,i=this.top,r=this.canvas.getWidth()-t,a=this.canvas.getHeight()-e;this.left=(0,o.clamp)(n,0,r),this.top=(0,o.clamp)(i,0,a),this.canvasEventTrigger[s.eventNames.OBJECT_MOVED](this)},_onScaling:function(e){var t=e.transform.corner,n=this.canvas.getPointer(e.e),i=this._calcScalingSizeFromPointer(n,t);this.scale(1).set(i),this.canvasEventTrigger[s.eventNames.OBJECT_SCALED](this)},_calcScalingSizeFromPointer:function(e,t){var n=function(e){return c.indexOf(e)>=0}(t);return n&&this._resizeCropZone(e,t)},adjustRatioCropzoneSize:function(e){var t=e.width,n=e.height,i=e.leftMaker,r=e.topMaker,s=e.maxWidth,a=e.maxHeight,l=e.scaleTo;if(t=s?(0,o.clamp)(t,1,s):t,n=a?(0,o.clamp)(n,1,a):n,!this.presetRatio)return this._withShiftKey&&(t>n?n=t:n>t&&(t=n)),{width:t,height:n,left:i(t),top:r(n)};"width"===l?n=t/this.presetRatio:t=n*this.presetRatio;var c=Math.min(s/t,a/n);if(c<=1){var u=[t,n].map((function(e){return e*c}));t=u[0],n=u[1]}return{width:t,height:n,left:i(t),top:r(n)}},_getCropzoneRectInfo:function(){var e=this.canvas,t=e.width,n=e.height,i=this.getBoundingRect(!1,!0),r=i.top,o=i.left,s=i.width,a=i.height;return{rectTop:r,rectLeft:o,rectWidth:s,rectHeight:a,rectRight:o+s,rectBottom:r+a,canvasWidth:t,canvasHeight:n}},_resizeCropZone:function(e,t){var n=e.x,i=e.y,r=this._getCropzoneRectInfo(),o=r.rectWidth,s=r.rectHeight,a=r.rectTop,l=r.rectLeft,c=r.rectBottom,u=r.rectRight,d=r.canvasWidth,f=r.canvasHeight,p={tl:{width:u-n,height:c-i,leftMaker:function(e){return u-e},topMaker:function(e){return c-e},maxWidth:u,maxHeight:c,scaleTo:h(l-n,a-i)},tr:{width:n-l,height:c-i,leftMaker:function(){return l},topMaker:function(e){return c-e},maxWidth:d-l,maxHeight:c,scaleTo:h(n-u,a-i)},mt:{width:o,height:c-i,leftMaker:function(){return l},topMaker:function(e){return c-e},maxWidth:d-l,maxHeight:c,scaleTo:"height"},ml:{width:u-n,height:s,leftMaker:function(e){return u-e},topMaker:function(){return a},maxWidth:u,maxHeight:f-a,scaleTo:"width"},mr:{width:n-l,height:s,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:d-l,maxHeight:f-a,scaleTo:"width"},mb:{width:o,height:i-a,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:d-l,maxHeight:f-a,scaleTo:"height"},bl:{width:u-n,height:i-a,leftMaker:function(e){return u-e},topMaker:function(){return a},maxWidth:u,maxHeight:f-a,scaleTo:h(l-n,i-c)},br:{width:n-l,height:i-a,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:d-l,maxHeight:f-a,scaleTo:h(n-u,i-c)}};return this.adjustRatioCropzoneSize(p[t])},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0},_onKeyDown:function(e){e.keyCode===s.keyCodes.SHIFT&&(this._withShiftKey=!0)},_onKeyUp:function(e){e.keyCode===s.keyCodes.SHIFT&&(this._withShiftKey=!1)}});t.default=d},
2"./src/js/extension/emboss.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("fabric"),o=(i=r)&&i.__esModule?i:{default:i},s=o.default.util.createClass(o.default.Image.filters.Convolute,{type:"Emboss",initialize:function(){this.matrix=[1,1,1,1,.7,-1,-1,-1,-1]}});t.default=s},
2"./src/js/extension/mask.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("fabric"),o=(i=r)&&i.__esModule?i:{default:i},s=o.default.util.createClass(o.default.Image.filters.BlendImage,{applyTo:function(e){if(this.mask){var t=e.canvasEl,n=t.width,i=t.height,r=this._createCanvasOfMask(n,i),o=t.getContext("2d"),s=r.getContext("2d"),a=o.getImageData(0,0,n,i);this._drawMask(s,t,o),this._mapData(s,a,n,i),e.imageData=a}},_createCanvasOfMask:function(e,t){var n=o.default.util.createCanvasElement();return n.width=e,n.height=t,n},_drawMask:function(e){var t=this.mask,n=t.getElement(),i=t.angle,r=t.left,o=t.scaleX,s=t.scaleY,a=t.top;e.save(),e.translate(r,a),e.rotate(i*Math.PI/180),e.scale(o,s),e.drawImage(n,-n.width/2,-n.height/2),e.restore()},_mapData:function(e,t,n,i){for(var r=t.data,o=t.height,s=r,a=t.width*o*4,l=e.getImageData(0,0,n,i).data,c=0;c<a;c+=4)s[c+3]=l[c]}});t.default=s},
2"./src/js/extension/sharpen.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("fabric"),o=(i=r)&&i.__esModule?i:{default:i},s=o.default.util.createClass(o.default.Image.filters.Convolute,{type:"Sharpen",initialize:function(){this.matrix=[0,-1,0,-1,5,-1,0,-1,0]}});t.default=s},
2"./src/js/factory/command.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("./src/js/interface/command.js"),o=(i=r)&&i.__esModule?i:{default:i},s={};t.default={create:function(e){var t=s[e];if(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o.default(t,i)}return null},register:function(e){s[e.name]=e}}},
2"./src/js/factory/errorMessage.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n("tui-code-snippet"),o=(i=r)&&i.__esModule?i:{default:i},s=(0,n("./src/js/util.js").keyMirror)("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),a="Should implement a method: ",l="Should set a component name",c={UN_IMPLEMENTATION:function(e){return a+e},NO_COMPONENT_NAME:function(){return l}};t.default={types:o.default.extend({},s),create:function(e){e=e.toLowerCase();for(var t=c[e],n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.apply(void 0,i)}}},
2"./src/js/graphics.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=T(n("tui-code-snippet")),o=T(n("fabric")),s=T(n("./src/js/component/imageLoader.js")),a=T(n("./src/js/component/cropper.js")),l=T(n("./src/js/component/flip.js")),c=T(n("./src/js/component/rotation.js")),u=T(n("./src/js/component/freeDrawing.js")),h=T(n("./src/js/component/line.js")),d=T(n("./src/js/component/text.js")),f=T(n("./src/js/component/icon.js")),p=T(n("./src/js/component/filter.js")),g=T(n("./src/js/component/shape.js")),m=T(n("./src/js/component/zoom.js")),v=T(n("./src/js/drawingMode/cropper.js")),y=T(n("./src/js/drawingMode/freeDrawing.js")),_=T(n("./src/js/drawingMode/lineDrawing.js")),b=T(n("./src/js/drawingMode/shape.js")),x=T(n("./src/js/drawingMode/text.js")),C=T(n("./src/js/drawingMode/icon.js")),j=T(n("./src/js/drawingMode/zoom.js")),w=n("./src/js/helper/selectionModifyHelper.js"),S=n("./src/js/util.js"),k=n("./src/js/consts.js"),O=T(n("./src/js/component/resize.js")),E=T(n("./src/js/drawingMode/resize.js"));function T(e){return e&&e.__esModule?e:{default:e}}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var P=r.default.extend,A=r.default.stamp,I=r.default.isArray,D=r.default.isString,L=r.default.forEachArray,R=r.default.forEachOwnProperties,F=r.default.CustomEvents,B={cssOnly:!0},H={backstoreOnly:!0},z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.cssMaxWidth,r=n.cssMaxHeight;M(this,e),this.canvasImage=null,this.cssMaxWidth=i||1e3,this.cssMaxHeight=r||800,this.cropSelectionStyle={},this.targetObjectForCopyPaste=null,this.imageName="",this._objects={},this._canvas=null,this._drawingMode=k.drawingModes.NORMAL,this._drawingModeMap={},this._componentMap={},this._handler={onMouseDown:this._onMouseDown.bind(this),onObjectAdded:this._onObjectAdded.bind(this),onObjectRemoved:this._onObjectRemoved.bind(this),onObjectMoved:this._onObjectMoved.bind(this),onObjectScaled:this._onObjectScaled.bind(this),onObjectModified:this._onObjectModified.bind(this),onObjectRotated:this._onObjectRotated.bind(this),onObjectSelected:this._onObjectSelected.bind(this),onPathCreated:this._onPathCreated.bind(this),onSelectionCleared:this._onSelectionCleared.bind(this),onSelectionCreated:this._onSelectionCreated.bind(this)},this._setObjectCachingToFalse(),this._setCanvasElement(t),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents(),this._attachZoomEvents()}return i(e,[{key:"destroy",value:function(){var e=this._canvas.wrapperEl;this._canvas.clear(),e.parentNode.removeChild(e),this._detachZoomEvents()}},{key:"_attachZoomEvents",value:function(){this.getComponent(k.componentNames.ZOOM).attachKeyboardZoomEvents()}},{key:"_detachZoomEvents",value:function(){this.getComponent(k.componentNames.ZOOM).detachKeyboardZoomEvents()}},{key:"deactivateAll",value:function(){return this._canvas.discardActiveObject(),this}},{key:"renderAll",value:function(){return this._canvas.renderAll(),this}},{key:"add",value:function(e){var t,n=[];I(e)?n=e:n.push(e),(t=this._canvas).add.apply(t,n)}},{key:"contains",value:function(e){return this._canvas.contains(e)}},{key:"getObjects",value:function(){return this._canvas.getObjects().slice()}},{key:"getObject",value:function(e){return this._objects[e]}},{key:"remove",value:function(e){this._canvas.remove(e)}},{key:"removeAll",value:function(e){var t=this._canvas,n=t.getObjects().slice();return t.remove.apply(t,this._canvas.getObjects()),e&&t.clear(),n}},{key:"removeObjectById",value:function(e){var t=[],n=this._canvas,i=this.getObject(e);return i&&i.isType("group")&&!i.isEmpty()?(n.discardActiveObject(),i.forEachObject((function(e){t.push(e),n.remove(e)}))):n.contains(i)&&(t.push(i),n.remove(i)),t}},{key:"getObjectId",value:function(e){var t=null;for(t in this._objects)if(this._objects.hasOwnProperty(t)&&e===this._objects[t])return t;return null}},{key:"getActiveObject",value:function(){return this._canvas._activeObject}},{key:"getActiveObjectIdForRemove",value:function(){var e=this.getActiveObject(),t=e.type,n=e.left,i=e.top;if("activeSelection"===t){var r=new o.default.Group([].concat(e.getObjects()),{left:n,top:i});return this._addFabricObject(r)}return this.getObjectId(e)}},{key:"isReadyRemoveObject",value:function(){var e=this.getActiveObject();return e&&!e.isEditing}},{key:"getActiveObjects",value:function(){var e=this._canvas._activeObject;return e&&"activeSelection"===e.type?e:null}},{key:"getActiveSelectionFromObjects",value:function(e){var t=this.getCanvas();return new o.default.ActiveSelection(e,{canvas:t})}},{key:"setActiveObject",value:function(e){this._canvas.setActiveObject(e)}},{key:"setCropSelectionStyle",value:function(e){this.cropSelectionStyle=e}},{key:"getComponent",value:function(e){return this._componentMap[e]}},{key:"getDrawingMode",value:function(){return this._drawingMode}},{key:"startDrawingMode",value:function(e,t){if(this._isSameDrawingMode(e))return!0;this.stopDrawingMode();var n=this._getDrawingModeInstance(e);return n&&n.start&&(n.start(this,t),this._drawingMode=e),!!n}},{key:"stopDrawingMode",value:function(){if(!this._isSameDrawingMode(k.drawingModes.NORMAL)){var e=this._getDrawingModeInstance(this.getDrawingMode());e&&e.end&&e.end(this),this._drawingMode=k.drawingModes.NORMAL}}},{key:"zoom",value:function(e,t){var n=e.x,i=e.y,r=this.getComponent(k.
2componentNames.ZOOM);r.zoom({x:n,y:i},t)}},{key:"getZoomMode",value:function(){return this.getComponent(k.componentNames.ZOOM).mode}},{key:"startZoomInMode",value:function(){this.getComponent(k.componentNames.ZOOM).startZoomInMode()}},{key:"endZoomInMode",value:function(){this.getComponent(k.componentNames.ZOOM).endZoomInMode()}},{key:"zoomOut",value:function(){this.getComponent(k.componentNames.ZOOM).zoomOut()}},{key:"startHandMode",value:function(){this.getComponent(k.componentNames.ZOOM).startHandMode()}},{key:"endHandMode",value:function(){this.getComponent(k.componentNames.ZOOM).endHandMode()}},{key:"resetZoom",value:function(){this.getComponent(k.componentNames.ZOOM).resetZoom()}},{key:"toDataURL",value:function(e){var t=this.getComponent(k.componentNames.CROPPER);t.changeVisibility(!1);var n=this._canvas&&this._canvas.toDataURL(e);return t.changeVisibility(!0),n}},{key:"setCanvasImage",value:function(e,t){t&&A(t),this.imageName=e,this.canvasImage=t}},{key:"setCssMaxDimension",value:function(e){this.cssMaxWidth=e.width||this.cssMaxWidth,this.cssMaxHeight=e.height||this.cssMaxHeight}},{key:"adjustCanvasDimension",value:function(){this.adjustCanvasDimensionBase(this.canvasImage.scale(1))}},{key:"adjustCanvasDimensionBase",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e||(e=this.canvasImage);var t=e.getBoundingRect(),n=t.width,i=t.height,r=this._calcMaxDimension(n,i);this.setCanvasCssDimension({width:"100%",height:"100%","max-width":r.width+"px","max-height":r.height+"px"}),this.setCanvasBackstoreDimension({width:n,height:i}),this._canvas.centerObject(e)}},{key:"setCanvasCssDimension",value:function(e){this._canvas.setDimensions(e,B)}},{key:"setCanvasBackstoreDimension",value:function(e){this._canvas.setDimensions(e,H)}},{key:"setImageProperties",value:function(e,t){var n=this.canvasImage;n&&(n.set(e).setCoords(),t&&this._canvas.renderAll())}},{key:"getCanvasElement",value:function(){return this._canvas.getElement()}},{key:"getCanvas",value:function(){return this._canvas}},{key:"getCanvasImage",value:function(){return this.canvasImage}},{key:"getImageName",value:function(){return this.imageName}},{key:"addImageObject",value:function(e){var t=this,n=this._callbackAfterLoadingImageObject.bind(this);return new S.Promise((function(i){o.default.Image.fromURL(e,(function(e){n(e),i(t.createObjectProperties(e))}),{crossOrigin:"Anonymous"})}))}},{key:"getCenter",value:function(){return this._canvas.getCenter()}},{key:"getCropzoneRect",value:function(){return this.getComponent(k.componentNames.CROPPER).getCropzoneRect()}},{key:"setCropzoneRect",value:function(e){this.getComponent(k.componentNames.CROPPER).setCropzoneRect(e)}},{key:"getCroppedImageData",value:function(e){return this.getComponent(k.componentNames.CROPPER).getCroppedImageData(e)}},{key:"setBrush",value:function(e){var t=this._drawingMode,n=k.componentNames.FREE_DRAWING;t===k.drawingModes.LINE_DRAWING&&(n=k.componentNames.LINE),this.getComponent(n).setBrush(e)}},{key:"setDrawingShape",value:function(e,t){this.getComponent(k.componentNames.SHAPE).setStates(e,t)}},{key:"setIconStyle",value:function(e,t){this.getComponent(k.componentNames.ICON).setStates(e,t)}},{key:"registerPaths",value:function(e){this.getComponent(k.componentNames.ICON).registerPaths(e)}},{key:"changeCursor",value:function(e){var t=this.getCanvas();t.defaultCursor=e,t.renderAll()}},{key:"hasFilter",value:function(e){return this.getComponent(k.componentNames.FILTER).hasFilter(e)}},{key:"setSelectionStyle",value:function(e){P(k.fObjectOptions.SELECTION_STYLE,e)}},{key:"setObjectProperties",value:function(e,t){var n=this.getObject(e),i=P({},t);return n.set(i),n.setCoords(),this.getCanvas().renderAll(),i}},{key:"getObjectProperties",value:function(e,t){var n=this.getObject(e),i={};return D(t)?i[t]=n[t]:I(t)?L(t,(function(e){i[e]=n[e]})):R(t,(function(e,t){i[t]=n[t]})),i}},{key:"getObjectPosition",value:function(e,t,n){var i=this.getObject(e);return i?i.getPointByOrigin(t,n):null}},{key:"setObjectPosition",value:function(e,t){var n=this.getObject(e),i=t.x,r=t.y,o=t.originX,s=t.originY;if(!n)return!1;var a=n.getPointByOrigin(o,s),l=n.getPointByOrigin("center","center"),c=l.x-a.x,u=l.y-a.y;return n.set({left:i+c,top:r+u}),n.setCoords(),!0}},{key:"getCanvasSize",value:function(){var e=this.getCanvasImage();return{width:e?e.width:0,height:e?e.height:0}}},{key:"createStaticCanvas",value:function(){var e=new o.default.StaticCanvas;return e.set({enableRetinaScaling:!1}),e}},{key:"_getDrawingModeInstance",value:function(e){return this._drawingModeMap[e]}},{key:"_setObjectCachingToFalse",value:function(){o.default.Object.prototype.objectCaching=!1}},{key:"_setCanvasElement",value:function(e){var t=void 0,n=void 0;
2"CANVAS"!==(t=e.nodeType?e:document.querySelector(e)).nodeName.toUpperCase()&&(n=document.createElement("canvas"),t.appendChild(n)),this._canvas=new o.default.Canvas(n,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})}},{key:"_createDrawingModeInstances",value:function(){this._register(this._drawingModeMap,new v.default),this._register(this._drawingModeMap,new y.default),this._register(this._drawingModeMap,new _.default),this._register(this._drawingModeMap,new b.default),this._register(this._drawingModeMap,new x.default),this._register(this._drawingModeMap,new C.default),this._register(this._drawingModeMap,new j.default),this._register(this._drawingModeMap,new E.default)}},{key:"_createComponents",value:function(){this._register(this._componentMap,new s.default(this)),this._register(this._componentMap,new a.default(this)),this._register(this._componentMap,new l.default(this)),this._register(this._componentMap,new c.default(this)),this._register(this._componentMap,new u.default(this)),this._register(this._componentMap,new h.default(this)),this._register(this._componentMap,new d.default(this)),this._register(this._componentMap,new f.default(this)),this._register(this._componentMap,new p.default(this)),this._register(this._componentMap,new g.default(this)),this._register(this._componentMap,new m.default(this)),this._register(this._componentMap,new O.default(this))}},{key:"_register",value:function(e,t){e[t.getName()]=t}},{key:"_isSameDrawingMode",value:function(e){return this.getDrawingMode()===e}},{key:"_calcMaxDimension",value:function(e,t){var n=this.cssMaxWidth/e,i=this.cssMaxHeight/t,r=Math.min(e,this.cssMaxWidth),o=Math.min(t,this.cssMaxHeight);return n<1&&n<i?(r=e*n,o=t*n):i<1&&i<n&&(r=e*i,o=t*i),{width:Math.floor(r),height:Math.floor(o)}}},{key:"_callbackAfterLoadingImageObject",value:function(e){var t=this.getCanvasImage().getCenterPoint();e.set(k.fObjectOptions.SELECTION_STYLE),e.set({left:t.x,top:t.y,crossOrigin:"Anonymous"}),this.getCanvas().add(e).setActiveObject(e)}},{key:"_attachCanvasEvents",value:function(){var e=this._canvas,t=this._handler;e.on({"mouse:down":t.onMouseDown,"object:added":t.onObjectAdded,"object:removed":t.onObjectRemoved,"object:moving":t.onObjectMoved,"object:scaling":t.onObjectScaled,"object:modified":t.onObjectModified,"object:rotating":t.onObjectRotated,"path:created":t.onPathCreated,"selection:cleared":t.onSelectionCleared,"selection:created":t.onSelectionCreated,"selection:updated":t.onObjectSelected})}},{key:"_onMouseDown",value:function(e){var t=this,n=e.e,i=e.target,r=this._canvas.getPointer(n);if(i){var o=i.type,s=(0,w.makeSelectionUndoData)(i,(function(e){return(0,w.makeSelectionUndoDatum)(t.getObjectId(e),e,"activeSelection"===o)}));(0,w.setCachedUndoDataForDimension)(s)}this.fire(k.eventNames.MOUSE_DOWN,n,r)}},{key:"_onObjectAdded",value:function(e){var t=e.target;t.isType("cropzone")||this._addFabricObject(t)}},{key:"_onObjectRemoved",value:function(e){var t=e.target;this._removeFabricObject(A(t))}},{key:"_onObjectMoved",value:function(e){var t=this;this._lazyFire(k.eventNames.OBJECT_MOVED,(function(e){return t.createObjectProperties(e)}),e.target)}},{key:"_onObjectScaled",value:function(e){var t=this;this._lazyFire(k.eventNames.OBJECT_SCALED,(function(e){return t.createObjectProperties(e)}),e.target)}},{key:"_onObjectModified",value:function(e){var t=e.target;"activeSelection"===t.type&&t.getObjects().forEach((function(e){return e.fire("modifiedInGroup",t)})),this.fire(k.eventNames.OBJECT_MODIFIED,t,this.getObjectId(t))}},{key:"_onObjectRotated",value:function(e){var t=this;this._lazyFire(k.eventNames.OBJECT_ROTATED,(function(e){return t.createObjectProperties(e)}),e.target)}},{key:"_lazyFire",value:function(e,t,n){var i=this,r=n&&n.canvasEventDelegation?n.canvasEventDelegation(e):"none";"unregistered"===r&&n.canvasEventRegister(e,(function(n){i.fire(e,t(n))})),"none"===r&&this.fire(e,t(n))}},{key:"_onObjectSelected",value:function(e){var t=e.target,n=this.createObjectProperties(t);this.fire(k.eventNames.OBJECT_ACTIVATED,n)}},{key:"_onPathCreated",value:function(e){var t=e.path.getCenterPoint(),n=t.x,i=t.y;e.path.set(P({left:n,top:i},k.fObjectOptions.SELECTION_STYLE));var r=this.createObjectProperties(e.path);this.fire(k.eventNames.ADD_OBJECT,r)}},{key:"_onSelectionCleared",value:function(){this.fire(k.eventNames.SELECTION_CLEARED)}},{key:"_onSelectionCreated",value:function(e){var t=e.target,n=this.createObjectProperties(t);this.fire(k.eventNames.OBJECT_ACTIVATED,n),this.fire(k.eventNames.SELECTION_CREATED,e.target)}},{key:"discardSelection",value:function(){this._canvas.discardActiveObject(),this._canvas.renderAll()}},{key:"changeSelectableAll",value:function(e){this._canvas.forEachObject((function(t){t.selectable=e,t.hoverCurs
2or=e?"move":"crosshair"}))}},{key:"createObjectProperties",value:function(e){var t={id:A(e),type:e.type};if(P(t,(0,S.getProperties)(e,["left","top","width","height","fill","stroke","strokeWidth","opacity","angle"])),(0,S.includes)(["i-text","text"],e.type))P(t,this._createTextProperties(e,t));else if((0,S.includes)(["rect","triangle","circle"],e.type)){var n=this.getComponent(k.componentNames.SHAPE);P(t,{fill:n.makeFillPropertyForUserEvent(e)})}return t}},{key:"_createTextProperties",value:function(e){var t={};return P(t,(0,S.getProperties)(e,["text","fontFamily","fontSize","fontStyle","textAlign","textDecoration","fontWeight"])),t}},{key:"_addFabricObject",value:function(e){var t=A(e);return this._objects[t]=e,t}},{key:"_removeFabricObject",value:function(e){delete this._objects[e]}},{key:"resetTargetObjectForCopyPaste",value:function(){var e=this.getActiveObject();e&&(this.targetObjectForCopyPaste=e)}},{key:"pasteObject",value:function(){var e=this;if(!this.targetObjectForCopyPaste)return S.Promise.resolve([]);var t=this.targetObjectForCopyPaste,n="activeSelection"===t.type?t.getObjects():[t],i=null;return this.discardSelection(),this._cloneObject(n).then((function(t){i=t.length>1?e.getActiveSelectionFromObjects(t):t[0],e.targetObjectForCopyPaste=i,e.setActiveObject(i)}))}},{key:"_cloneObject",value:function(e){var t=this,n=r.default.map(e,(function(e){return t._cloneObjectItem(e)}));return S.Promise.all(n)}},{key:"_cloneObjectItem",value:function(e){var t=this;return this._copyFabricObjectForPaste(e).then((function(e){var n=t.createObjectProperties(e);return t.add(e),t.fire(k.eventNames.ADD_OBJECT,n),e}))}},{key:"_copyFabricObjectForPaste",value:function(e){var t=this,n=function(e,t){return t?e-10:e+10};return this._copyFabricObject(e).then((function(e){var i=e.left,o=e.top,s=e.width,a=e.height,l=t.getCanvasSize(),c=l.width,u=l.height,h=i+s/2,d=o+a/2;return e.set(r.default.extend({left:n(i,h+10>c),top:n(o,d+10>u)},k.fObjectOptions.SELECTION_STYLE)),e}))}},{key:"_copyFabricObject",value:function(e){var t=this;return new S.Promise((function(n){e.clone((function(i){var r=t.getComponent(k.componentNames.SHAPE);(0,S.isShape)(i)&&r.processForCopiedObject(i,e),n(i)}))}))}},{key:"getCurrentDimensions",value:function(){return this.getComponent(k.componentNames.RESIZE).getCurrentDimensions()}},{key:"getOriginalDimensions",value:function(){return this.getComponent(k.componentNames.RESIZE).getOriginalDimensions()}},{key:"setOriginalDimensions",value:function(e){this.getComponent(k.componentNames.RESIZE).setOriginalDimensions(e)}},{key:"resize",value:function(e){var t=this.getComponent(k.componentNames.RESIZE);return t.resize(e)}}]),e}();F.mixin(z),t.default=z},
2"./src/js/helper/imagetracer.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.versionnumber="1.2.4",this.optionpresets={default:{corsenabled:!1,ltres:1,qtres:1,pathomit:8,rightangleenhance:!0,colorsampling:2,numberofcolors:16,mincolorratio:0,colorquantcycles:3,layering:0,strokewidth:1,linefilter:!1,scale:1,roundcoords:1,viewbox:!1,desc:!1,lcpr:0,qcpr:0,blurradius:0,blurdelta:20},posterized1:{colorsampling:0,numberofcolors:2},posterized2:{numberofcolors:4,blurradius:5},curvy:{ltres:.01,linefilter:!0,rightangleenhance:!1},sharp:{qtres:.01,linefilter:!1},detailed:{pathomit:0,roundcoords:2,ltres:.5,qtres:.5,numberofcolors:64},smoothed:{blurradius:5,blurdelta:64},grayscale:{colorsampling:0,colorquantcycles:1,numberofcolors:7},fixedpalette:{colorsampling:0,colorquantcycles:1,numberofcolors:27},randomsampling1:{colorsampling:1,numberofcolors:8},randomsampling2:{colorsampling:1,numberofcolors:64},artistic1:{colorsampling:0,colorquantcycles:1,pathomit:0,blurradius:5,blurdelta:64,ltres:.01,linefilter:!0,numberofcolors:16,strokewidth:2},artistic2:{qtres:.01,colorsampling:0,colorquantcycles:1,numberofcolors:4,strokewidth:0},artistic3:{qtres:10,ltres:10,numberofcolors:8},artistic4:{qtres:10,ltres:10,numberofcolors:64,blurradius:5,blurdelta:256,strokewidth:2},posterized3:{ltres:1,qtres:1,pathomit:20,rightangleenhance:!0,colorsampling:0,numberofcolors:3,mincolorratio:0,colorquantcycles:3,blurradius:3,blurdelta:20,strokewidth:0,linefilter:!1,roundcoords:1,pal:[{r:0,g:0,b:100,a:255},{r:255,g:255,b:255,a:255}]}},this.pathscan_combined_lookup=[[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[13,3,0,1],[13,2,-1,0],[7,1,0,-1],[7,0,1,0]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[11,1,0,-1],[14,0,1,0],[14,3,0,1],[11,2,-1,0]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]]],this.gks=[[.27901,.44198,.27901],[.135336,.228569,.272192,.228569,.135336],[.086776,.136394,.178908,.195843,.178908,.136394,.086776],[.063327,.093095,.122589,.144599,.152781,.144599,.122589,.093095,.063327],[.049692,.069304,.089767,.107988,.120651,.125194,.120651,.107988,.089767,.069304,.049692]],this.specpalette=[{r:0,g:0,b:0,a:255},{r:128,g:128,b:128,a:255},{r:0,g:0,b:128,a:255},{r:64,g:64,b:128,a:255},{r:192,g:192,b:192,a:255},{r:255,g:255,b:255,a:255},{r:128,g:128,b:192,a:255},{r:0,g:0,b:192,a:255},{r:128,g:0,b:0,a:255},{r:128,g:64,b:64,a:255},{r:128,g:0,b:128,a:255},{r:168,g:168,b:168,a:255},{r:192,g:128,b:128,a:255},{r:192,g:0,b:0,a:255},{r:255,g:255,b:255,a:255},{r:0,g:128,b:0,a:255}]}return i(e,null,[{key:"tracerDefaultOption",value:function(){return{pathomit:100,ltres:.1,qtres:1,scale:1,strokewidth:5,viewbox:!1,linefilter:!0,desc:!1,rightangleenhance:!1,pal:[{r:0,g:0,b:0,a:255},{r:255,g:255,b:255,a:255}]}}}]),i(e,[{key:"imageToSVG",value:function(e,t,n){var i=this;n=this.checkoptions(n),this.loadImage(e,(function(e){t(i.imagedataToSVG(i.getImgdata(e),n))}),n)}},{key:"imagedataToSVG",value:function(e,t){t=this.checkoptions(t);var n=this.imagedataToTracedata(e,t);return this.getsvgstring(n,t)}},{key:"imageToTracedata",value:function(e,t,n){var i=this;n=this.checkoptions(n),this.loadImage(e,(function(e){t(i.imagedataToTracedata(i.getImgdata(e),n))}),n)}},{key:"imagedataToTracedata",value:function(e,t){t=this.checkoptions(t);var n=this.colorquantization(e,t),i=void 0;if(0===t.layering){i={layers:[],palette:n.palette,width:n.array[0].length-2,height:n.array.length-2};for(var r=0;r<n.palette.length;
vendor: 5,178 bytes, line 2
2r+=1){var o=this.batchtracepaths(this.internodes(this.pathscan(this.layeringstep(n,r),t.pathomit),t),t.ltres,t.qtres);i.layers.push(o)}}else{var s=this.layering(n);t.layercontainerid&&this.drawLayers(s,this.specpalette,t.scale,t.layercontainerid);var a=this.batchpathscan(s,t.pathomit),l=this.batchinternodes(a,t);i={layers:this.batchtracelayers(l,t.ltres,t.qtres),palette:n.palette,width:e.width,height:e.height}}return i}},{key:"checkoptions",value:function(e){"string"==typeof(e=e||{})&&(e=e.toLowerCase(),e=this.optionpresets[e]?this.optionpresets[e]:{});for(var t=Object.keys(this.optionpresets.default),n=0;n<t.length;n+=1)e.hasOwnProperty(t[n])||(e[t[n]]=this.optionpresets.default[t[n]]);return e}},{key:"colorquantization",value:function(e,t){var n=[],i=0,r=void 0,o=void 0,s=void 0,a=[],l=e.width*e.height,c=void 0,u=void 0,h=void 0,d=void 0,f=void 0;for(u=0;u<e.height+2;u+=1)for(n[u]=[],c=0;c<e.width+2;c+=1)n[u][c]=-1;for(f=t.pal?t.pal:0===t.colorsampling?this.generatepalette(t.numberofcolors):1===t.colorsampling?this.samplepalette(t.numberofcolors,e):this.samplepalette2(t.numberofcolors,e),t.blurradius>0&&(e=this.blur(e,t.blurradius,t.blurdelta)),d=0;d<t.colorquantcycles;d+=1){if(d>0)for(h=0;h<f.length;h+=1)a[h].n>0&&(f[h]={r:Math.floor(a[h].r/a[h].n),g:Math.floor(a[h].g/a[h].n),b:Math.floor(a[h].b/a[h].n),a:Math.floor(a[h].a/a[h].n)}),a[h].n/l<t.mincolorratio&&d<t.colorquantcycles-1&&(f[h]={r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())});for(c=0;c<f.length;c+=1)a[c]={r:0,g:0,b:0,a:0,n:0};for(u=0;u<e.height;u+=1)for(c=0;c<e.width;c+=1){for(i=4*(u*e.width+c),s=0,o=1024,h=0;h<f.length;h+=1)(r=Math.abs(f[h].r-e.data[i])+Math.abs(f[h].g-e.data[i+1])+Math.abs(f[h].b-e.data[i+2])+Math.abs(f[h].a-e.data[i+3]))<o&&(o=r,s=h);a[s].r+=e.data[i],a[s].g+=e.data[i+1],a[s].b+=e.data[i+2],a[s].a+=e.data[i+3],a[s].n+=1,n[u+1][c+1]=s}}return{array:n,palette:f}}},{key:"samplepalette",value:function(e,t){for(var n=void 0,i=[],r=0;r<e;r+=1)n=4*Math.floor(Math.random()*t.data.length/4),i.push({r:t.data[n],g:t.data[n+1],b:t.data[n+2],a:t.data[n+3]});return i}},{key:"samplepalette2",value:function(e,t){for(var n=void 0,i=[],r=Math.ceil(Math.sqrt(e)),o=Math.ceil(e/r),s=t.width/(r+1),a=t.height/(o+1),l=0;l<o;l+=1)for(var c=0;c<r&&i.length!==e;c+=1)n=4*Math.floor((l+1)*a*t.width+(c+1)*s),i.push({r:t.data[n],g:t.data[n+1],b:t.data[n+2],a:t.data[n+3]});return i}},{key:"generatepalette",value:function(e){var t=[],n=void 0,i=void 0,r=void 0;if(e<8)for(var o=Math.floor(255/(e-1)),s=0;s<e;s+=1)t.push({r:s*o,g:s*o,b:s*o,a:255});else{var a=Math.floor(Math.pow(e,1/3)),l=Math.floor(255/(a-1)),c=e-a*a*a;for(n=0;n<a;n+=1)for(i=0;i<a;i+=1)for(r=0;r<a;r+=1)t.push({r:n*l,g:i*l,b:r*l,a:255});for(n=0;n<c;n+=1)t.push({r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())})}return t}},{key:"layering",value:function(e){var t=[],n=0,i=e.array.length,r=e.array[0].length,o=void 0,s=void 0,a=void 0,l=void 0,c=void 0,u=void 0,h=void 0,d=void 0,f=void 0,p=void 0,g=void 0;for(g=0;g<e.palette.length;g+=1)for(t[g]=[],p=0;p<i;p+=1)for(t[g][p]=[],f=0;f<r;f+=1)t[g][p][f]=0;for(p=1;p<i-1;p+=1)for(f=1;f<r-1;f+=1)n=e.array[p][f],o=e.array[p-1][f-1]===n?1:0,s=e.array[p-1][f]===n?1:0,a=e.array[p-1][f+1]===n?1:0,l=e.array[p][f-1]===n?1:0,c=e.array[p][f+1]===n?1:0,u=e.array[p+1][f-1]===n?1:0,h=e.array[p+1][f]===n?1:0,d=e.array[p+1][f+1]===n?1:0,t[n][p+1][f+1]=1+2*c+4*d+8*h,l||(t[n][p+1][f]=2+4*h+8*u),s||(t[n][p][f+1]=0+2*a+4*c+8),o||(t[n][p][f]=0+2*s+4+8*l);return t}},{key:"layeringstep",value:function(e,t){var n=[],i=e.array.length,r=e.array[0].length,o=void 0,s=void 0;for(s=0;s<i;s+=1)for(n[s]=[],o=0;o<r;o+=1)n[s][o]=0;for(s=1;s<i;s+=1)for(o=1;o<r;o+=1)n[s][o]=(e.array[s-1][o-1]===t?1:0)+(e.array[s-1][o]===t?2:0)+(e.array[s][o-1]===t?8:0)+(e.array[s][o]===t?4:0);return n}},{key:"pathscan",value:function(e,t){for(var n=[],i=0,r=0,o=0,s=0,a=e[0].length,l=e.length,c=0,u=!0,h=!1,d=void 0,f=0;f<l;f+=1)for(var p=0;p<a;p+=1)if(4===e[f][p]||11===e[f][p])for(o=p,s=f,n[i]={},n[i].points=[],n[i].boundingbox=[o,s,o,s],n[i].holechildren=[],u=!1,r=0,h=11===e[f][p],c=1;!u;){if(n[i].points[r]={},n[i].points[r].x=o-1,n[i].points[r].y=s-1,n[i].points[r].t=e[s][o],o-1<n[i].boundingbox[0]&&(n[i].boundingbox[0]=o-1),o-1>n[i].boundingbox[2]&&(n[i].boundingbox[2]=o-1),s-1<n[i].boundingbox[1]&&(n[i].boundingbox[1]=s-1),s-1>n[i].boundingbox[3]&&(n[i].boundingbox[3]=s-1),d=this.pathscan_combined_lookup[e[s][o]][c],e[s][o]=d[0],c=d[1],o+=d[2],s+=d[3],o-1===n[i].points[0].x&&s-1===n[i].points[0].y)if(u=!0,n[i].points.length<t)n.pop();else{if(n[i].isholepath=!!h,h){for(var g=0,m=[-1,-1,a+1,l+1],v=0;v<i;v++)!n[v].isholepath&&this.boundingboxincludes(n[v].boundingbox,n[i].boundingbox)&&this.boundingboxincludes(m,n[v].boundingbox)&&(g=v,m=n[v].boundingbox);n[g].holechildren.push(i)}i+=1}r+=1}return n}},{key:"boundingboxincludes",value:function(e,t){return e[0]<t[0]&&e[1]<t[1]&&e[2]>t[2]&&e[3]>t[3]}},{key:"batchpathscan",value:function(e,t){var n=[];for(var i in e)e.hasOwnProperty(i)&&(n[i]=this.pathscan(e[i],t));return n}}
2,{key:"internodes",value:function(e,t){var n=[],i=0,r=0,o=0,s=0,a=0,l=void 0,c=void 0;for(l=0;l<e.length;l+=1)for(n[l]={},n[l].points=[],n[l].boundingbox=e[l].boundingbox,n[l].holechildren=e[l].holechildren,n[l].isholepath=e[l].isholepath,i=e[l].points.length,c=0;c<i;c+=1)r=(c+1)%i,o=(c+2)%i,s=(c-1+i)%i,a=(c-2+i)%i,t.rightangleenhance&&this.testrightangle(e[l],a,s,c,r,o)&&(n[l].points.length>0&&(n[l].points[n[l].points.length-1].linesegment=this.getdirection(n[l].points[n[l].points.length-1].x,n[l].points[n[l].points.length-1].y,e[l].points[c].x,e[l].points[c].y)),n[l].points.push({x:e[l].points[c].x,y:e[l].points[c].y,linesegment:this.getdirection(e[l].points[c].x,e[l].points[c].y,(e[l].points[c].x+e[l].points[r].x)/2,(e[l].points[c].y+e[l].points[r].y)/2)})),n[l].points.push({x:(e[l].points[c].x+e[l].points[r].x)/2,y:(e[l].points[c].y+e[l].points[r].y)/2,linesegment:this.getdirection((e[l].points[c].x+e[l].points[r].x)/2,(e[l].points[c].y+e[l].points[r].y)/2,(e[l].points[r].x+e[l].points[o].x)/2,(e[l].points[r].y+e[l].points[o].y)/2)});return n}},{key:"testrightangle",value:function(e,t,n,i,r,o){return e.points[i].x===e.points[t].x&&e.points[i].x===e.points[n].x&&e.points[i].y===e.points[r].y&&e.points[i].y===e.points[o].y||e.points[i].y===e.points[t].y&&e.points[i].y===e.points[n].y&&e.points[i].x===e.points[r].x&&e.points[i].x===e.points[o].x}},{key:"getdirection",value:function(e,t,n,i){return e<n?t<i?1:t>i?7:0:e>n?t<i?3:t>i?5:4:t<i?2:t>i?6:8}},{key:"batchinternodes",value:function(e,t){var n=[];for(var i in e)e.hasOwnProperty(i)&&(n[i]=this.internodes(e[i],t));return n}},{key:"tracepath",value:function(e,t,n){var i=0,r=void 0,o=void 0,s=void 0,a={segments:[]};for(a.boundingbox=e.boundingbox,a.holechildren=e.holechildren,a.isholepath=e.isholepath;i<e.points.length;){for(r=e.points[i].linesegment,o=-1,s=i+1;(e.points[s].linesegment===r||e.points[s].linesegment===o||-1===o)&&s<e.points.length-1;)e.points[s].linesegment!==r&&-1===o&&(o=e.points[s].linesegment),s+=1;s===e.points.length-1&&(s=0),a.segments=a.segments.concat(this.fitseq(e,t,n,i,s)),i=s>0?s:e.points.length}return a}},{key:"fitseq",value:function(e,t,n,i,r){if(r>e.points.length||r<0)return[];var o=i,s=0,a=!0,l=void 0,c=void 0,u=void 0,h=r-i;h<0&&(h+=e.points.length);for(var d=(e.points[r].x-e.points[i].x)/h,f=(e.points[r].y-e.points[i].y)/h,p=(i+1)%e.points.length,g=void 0;p!=r;)(g=p-i)<0&&(g+=e.points.length),l=e.points[i].x+d*g,c=e.points[i].y+f*g,(u=(e.points[p].x-l)*(e.points[p].x-l)+(e.points[p].y-c)*(e.points[p].y-c))>t&&(a=!1),u>s&&(o=p,s=u),p=(p+1)%e.points.length;if(a)return[{type:"L",x1:e.points[i].x,y1:e.points[i].y,x2:e.points[r].x,y2:e.points[r].y}];var m=o;a=!0,s=0;var v=(m-i)/h,y=(1-v)*(1-v),_=2*(1-v)*v,b=v*v,x=(y*e.points[i].x+b*e.points[r].x-e.points[m].x)/-_,C=(y*e.points[i].y+b*e.points[r].y-e.points[m].y)/-_;for(p=i+1;p!=r;)_=2*(1-(v=(p-i)/h))*v,b=v*v,l=(y=(1-v)*(1-v))*e.points[i].x+_*x+b*e.points[r].x,c=y*e.points[i].y+_*C+b*e.points[r].y,(u=(e.points[p].x-l)*(e.points[p].x-l)+(e.points[p].y-c)*(e.points[p].y-c))>n&&(a=!1),u>s&&(o=p,s=u),p=(p+1)%e.points.length;if(a)return[{type:"Q",x1:e.points[i].x,y1:e.points[i].y,x2:x,y2:C,x3:e.points[r].x,y3:e.points[r].y}];var j=m;return this.fitseq(e,t,n,i,j).concat(this.fitseq(e,t,n,j,r))}},{key:"batchtracepaths",value:function(e,t,n){var i=[];for(var r in e)e.hasOwnProperty(r)&&i.push(this.tracepath(e[r],t,n));return i}},{key:"batchtracelayers",value:function(e,t,n){var i=[];for(var r in e)e.hasOwnProperty(r)&&(i[r]=this.batchtracepaths(e[r],t,n));return i}},{key:"roundtodec",value:function(e,t){return Number(e.toFixed(t))}},{key:"svgpathstring",value:function(e,t,n,i){var r=e.layers[t],o=r[n],s="",a=void 0;if(i.linefilter&&o.segments.length<3)return s;if(s="<path "+(i.desc?'desc="l '+t+" p "+n+'" ':"")+this.tosvgcolorstr(e.palette[t],i)+'d="',-1===i.roundcoords){for(s+="M "+o.segments[0].x1*i.scale+" "+o.segments[0].y1*i.scale+" ",a=0;a<o.segments.length;a++)s+=o.segments[a].type+" "+o.segments[a].x2*i.scale+" "+o.segments[a].y2*i.scale+" ",o.segments[a].hasOwnProperty("x3")&&(s+=o.segments[a].x3*i.scale+" "+o.segments[a].y3*i.scale+" ");s+="Z "}else{for(s+="M "+this.roundtodec(o.segments[0].x1*i.scale,i.roundcoords)+" "+this.roundtodec(o.segments[0].y1*i.scale,i.roundcoords)+" ",a=0;a<o.segments.length;a++)s+=o.segments[a].type+" "+this.roundtodec(o.segments[a].x2*i.scale,i.roundcoords)+" "+this.roundtodec(o.segments[a].y2*i.scale,i.roundcoords)+" ",o.segments[a].hasOwnProperty("x3")&&(s+=this.roundtodec(o.segments[a].x3*i.scale,i.roundcoords)+" "+this.roundtodec(o.segments[a].y3*i.scale,i.roundcoords)+" ");s+="Z "}for(var l=0;l<o.holechildren.length;l++){var c=r[o.holechildren[l]];if(-1===i.roundcoords)for(c.segments[c.segments.length-1].hasOwnProperty("x3")?s+="M "+c.segments[c.segments.length-1].x3*i.scale+" "+c.segments[c.segments.length-1].y3*i.scale+" ":s+="M "+c.segments[c.segments.length-1].x2*i.scale+" "+c.segments[c.segments.length-1].y2*i.scale+" ",a=c.segments.length-1;a>=0;a--)s+=c.segments[a].type+" ",c.segments[a].hasOwnProperty("x3")&&(s+=c.segments[a].x2*i.scale+" "+c.segments[a].y2*i.scale+" "),s+=c.segments[a].x1*i.scale+" "+c.segments[a].y1*i.scale+" ";else for(c.segments[c.segments.length-1].hasOwnProperty("x3")?s+="M "+this.roundtodec(c.segments[c.segments.length-1].x3*i.scale)+" "+this.roundtodec(c.segments[c.segments.length-1].y3*i.scale)+" ":s+="M "+this.roundtodec(c.segments[c.segments.length-1].x2*i.scale)+" "+this.roundtodec(c.segments[c.segments.length-1].y2*i.scale)+" ",a=c.segments.length-1;a>=0;a--)s+=c.segments[a].type+" ",c.segments[a].hasOwnProperty("x3")&&(s+=this.roundtodec(c.segments[a].x2*i.scale)+" "+this.roundtodec(c.segments[a].y2*i.scale)+" "),s+=this.roundtodec(c.segments[a].x1*i.scale)+" "+this.roundtodec(c.segments[a].y1*i.scale)+" ";s+="Z "}if(s+='" />',i.lcpr||i.qcpr){for(a=0;a<o.segments.length;a++)o.segments[a].hasOwnProperty("x3")&&i.qcpr&&(s+='<circle cx="'+o.segments[a].x2*i.scale+'" cy="'+o.segments[a].y2*i.scale+'" r="'+i.qcpr+'" fill="cyan" stroke-width="'+.2*i.qcpr+'" stroke="black" />',s+='<circle cx="'+o.segments[a].x3*i.scale+'" cy="'+o.segments[a].y3*i.scale+'" r="'+i.qcpr+'" fill="white" stroke-width="'+.2*i.qcpr+'" stroke="black" />',s+='<line x1="'+o.segments[a].x1*i.scale+'" y1="'+o.segments[a].y1*i.scale+'" x2="'+o.segments[a].x2*i.scale+'" y2="'+o.segments[a].y2*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />',s+='<line x1="'+o.segments[a].x2*i.scale+'" y1="'+o.segments[a].y2*i.scale+'" x2="'+o.segments[a].x3*i.scale+'" y2="'+o.segments[a].y3*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />'),!o.segments[a].hasOwnProperty("x3")&&i.lcpr&&(s+='<circle cx="'+o.segments[a].x2*i.scale+'" cy="'+o.segments[a].y2*i.scale+'" r="'+i.lcpr+'" fill="white" stroke-width="'+.2*i.lcpr+'" stroke="black" />');for(l=0;l<o.holechildren.length;l++)for(c=r[o.holechildren[l]],a=0;a<c.segments.length;a++)c.segments[a].hasOwnProperty("x3")&&i.qcpr&&(s+='<circle cx="'+c.segments[a].x2*i.scale+'" cy="'+c.segments[a].y2*i.scale+'" r="'+i.qcpr+'" fill="cyan" stroke-width="'+.2*i.qcpr+'" stroke="black" />',s+='<circle cx="'+c.segments[a].x3*i.scale+'" cy="'+c.segments[a].y3*i.scale+'" r="'+i.qcpr+'" fill="white" stroke-width="'+.2*i.qcpr+'" stroke="black" />',s+='<line x1="'+c.segments[a].x1*i.scale+'" y1="'+c.segments[a].y1*i.scale+'" x2="'+c.segments[a].x2*i.scale+'" y2="'+c.segments[a].y2*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />',s+='<line x1="'+c.segments[a].x2*i.scale+'" y1="'+c.segments[a].y2*i.scale+'" x2="'+c.segments[a].x3*i.scale+'" y2="'+c.segments[a].y3*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />'),!c.segments[a].hasOwnProperty("x3")&&i.lcpr&&(s+='<circle cx="'+c.segments[a].x2*i.scale+'" cy="'+c.segments[a].y2*i.scale+'" r="'+i.lcpr+'" fill="white" stroke-width="'+.2*i.lcpr+'" stroke="black" />')}return s}},{key:"getsvgstring",value:function(e,t){t=this.checkoptions(t);for(var n=e.width*t.scale,i=e.height*t.scale,r="<svg "+(t.viewbox?'viewBox="0 0 '+n+" "+i+'" ':'width="'+n+'" height="'+i+'" ')+'version="1.1" xmlns="http://www.w3.org/2000/svg" desc="Created with imagetracer.js version '+this.versionnumber+'" >',o=0;o<e.layers.length;o+=1)for(var s=0;s<e.layers[o].length;
2s+=1)e.layers[o][s].isholepath||(r+=this.svgpathstring(e,o,s,t));return r+="</svg>"}},{key:"compareNumbers",value:function(e,t){return e-t}},{key:"torgbastr",value:function(e){return"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"}},{key:"tosvgcolorstr",value:function(e,t){return'fill="rgb('+e.r+","+e.g+","+e.b+')" stroke="rgb('+e.r+","+e.g+","+e.b+')" stroke-width="'+t.strokewidth+'" opacity="'+e.a/255+'" '}},{key:"appendSVGString",value:function(e,t){var n=void 0;t?(n=document.getElementById(t))||((n=document.createElement("div")).id=t,document.body.appendChild(n)):(n=document.createElement("div"),document.body.appendChild(n)),n.innerHTML+=e}},{key:"blur",value:function(e,t,n){var i=void 0,r=void 0,o=void 0,s=void 0,a=void 0,l=void 0,c=void 0,u=void 0,h=void 0,d={width:e.width,height:e.height,data:[]};if((t=Math.floor(t))<1)return e;t>5&&(t=5),(n=Math.abs(n))>1024&&(n=1024);var f=this.gks[t-1];for(r=0;r<e.height;r++)for(i=0;i<e.width;i++){for(a=0,l=0,c=0,u=0,h=0,o=-t;o<t+1;o++)i+o>0&&i+o<e.width&&(s=4*(r*e.width+i+o),a+=e.data[s]*f[o+t],l+=e.data[s+1]*f[o+t],c+=e.data[s+2]*f[o+t],u+=e.data[s+3]*f[o+t],h+=f[o+t]);s=4*(r*e.width+i),d.data[s]=Math.floor(a/h),d.data[s+1]=Math.floor(l/h),d.data[s+2]=Math.floor(c/h),d.data[s+3]=Math.floor(u/h)}var p=new Uint8ClampedArray(d.data);for(r=0;r<e.height;r++)for(i=0;i<e.width;i++){for(a=0,l=0,c=0,u=0,h=0,o=-t;o<t+1;o++)r+o>0&&r+o<e.height&&(a+=p[s=4*((r+o)*e.width+i)]*f[o+t],l+=p[s+1]*f[o+t],c+=p[s+2]*f[o+t],u+=p[s+3]*f[o+t],h+=f[o+t]);s=4*(r*e.width+i),d.data[s]=Math.floor(a/h),d.data[s+1]=Math.floor(l/h),d.data[s+2]=Math.floor(c/h),d.data[s+3]=Math.floor(u/h)}for(r=0;r<e.height;r++)for(i=0;i<e.width;i++)s=4*(r*e.width+i),Math.abs(d.data[s]-e.data[s])+Math.abs(d.data[s+1]-e.data[s+1])+Math.abs(d.data[s+2]-e.data[s+2])+Math.abs(d.data[s+3]-e.data[s+3])>n&&(d.data[s]=e.data[s],d.data[s+1]=e.data[s+1],d.data[s+2]=e.data[s+2],d.data[s+3]=e.data[s+3]);return d}},{key:"loadImage",value:function(e,t,n){var i=new Image;n&&n.corsenabled&&(i.crossOrigin="Anonymous"),i.src=e,i.onload=function(){var e=document.createElement("canvas");e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0),t(e)}}},{key:"getImgdata",value:function(e){return e.getContext("2d").getImageData(0,0,e.width,e.height)}},{key:"drawLayers",value:function(e,t,n,i){n=n||1;var r=void 0,o=void 0,s=void 0,a=void 0,l=void 0,c=void 0;for(l in i?(c=document.getElementById(i))||((c=document.createElement("div")).id=i,document.body.appendChild(c)):(c=document.createElement("div"),document.body.appendChild(c)),e)if(e.hasOwnProperty(l)){r=e[l][0].length,o=e[l].length;var u=document.createElement("canvas");u.width=r*n,u.height=o*n;var h=u.getContext("2d");for(a=0;a<o;a+=1)for(s=0;s<r;s+=1)h.fillStyle=this.torgbastr(t[e[l][a][s]%t.length]),h.fillRect(s*n,a*n,n,n);c.appendChild(u)}}}]),e}();t.default=r},
2"./src/js/helper/selectionModifyHelper.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCachedUndoDataForDimension=function(e){a=e},t.getCachedUndoDataForDimension=function(){return a},t.makeSelectionUndoData=function(e,t){return"activeSelection"===e.type?e.getObjects().map((function(n){var i=n.angle,r=n.left,o=n.top,a=n.scaleX,l=n.scaleY,c=n.width,u=n.height;s.default.util.addTransformToObject(n,e.calcTransformMatrix());var h=t(n);return n.set({angle:i,left:r,top:o,width:c,height:u,scaleX:a,scaleY:l}),h})):[t(e)]},t.makeSelectionUndoDatum=function(e,t,n){return n?{id:e,width:t.width,height:t.height,top:t.top,left:t.left,angle:t.angle,scaleX:t.scaleX,scaleY:t.scaleY}:(0,r.extend)({id:e},t)};var i,r=n("tui-code-snippet"),o=n("fabric"),s=(i=o)&&i.__esModule?i:{default:i},a=null},
2"./src/js/helper/shapeFilterFillHelper.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFillImageFromShape=f,t.rePositionFilterTypeFillImage=function(e){var t=e.angle,n=e.flipX,i=e.flipY,o=f(e),s=function(e){var t=m(e),n=t[0],i=n.x,r=n.y,o=t[1],s=o.x,a=o.y,l=t[2],c=l.x,u=l.y,h=t[3],d=h.x,f=h.y,p=Math.min(i,s,c,d),g=Math.min(r,a,u,f),v=Math.max(i,s,c,d),y=Math.max(r,a,u,f);return{left:p,top:g,right:v,bottom:y,width:v-p,height:y-g}}(e),l=s.right,c=s.bottom,h=s.width,p=s.height,g=(h-e.width)/2,v=(p-e.height)/2,y=e.left-e.width/2-g,_=e.top-e.height/2-v,b=h/2-g,x=p/2-v,C=Math.max(h,p)+Math.max(g,v),j=function(e){var t=e.shapeObj,n=e.left,i=e.top,o=e.width,s=e.height,a=e.cropX,l=e.cropY,c=e.flipX,h=e.flipY,f=e.right,p=e.bottom,g=function(e,n,i,o){return function(e){var t=e.type,n=e.shapeObj,i=e.outDistance,o=e.left,s=e.top,a=e.flipX,l=e.flipY,c=m(n),u=function(e,t,n){var i=0,o=0;(0,r.forEach)(t,(function(t,n){t[e]<i&&(i=t[e],o=n)}));var s=n[o],a=s[0],l=s[1];return{startPointIndex:o,endPointIndex1:a,endPointIndex2:l}}(t,c,[[1,2],[0,3],[0,3],[1,2]]),h=function(e,t,n){var i=n.startPointIndex,o=n.endPointIndex1,s=n.endPointIndex2,a="x"===e?180:270;return(0,r.map)([o,s],(function(e){var n=t[i],r=t[e],o=n.y-r.y,s=n.x-r.x;return 180*Math.atan2(o,s)/Math.PI-a}))}(t,c,u),d=u.startPointIndex,f=function(e){var t=e.outDistance,n=e.startPointIndex,i=e.flipX,r=e.flipY,o=e.reatAngles,s=t*Math.cos(o[0]*Math.PI/180),a=t*Math.cos(o[1]*Math.PI/180),l=2===n||3===n,c={top:l?s:a,left:l?a:s};return function(e,t,n){return(!t&&n||!t&&!n)&&0===e||(t&&n||t&&!n)&&1===e||(!t&&!n||!t&&n)&&2===e||(t&&!n||t&&n)&&3===e}(n,i,r)&&(c.left=-1*c.left),function(e,t,n){return(t&&!n||!t&&!n)&&0===e||(!t&&!n||t&&!n)&&1===e||(t&&n||!t&&n)&&2===e||(!t&&n||t&&n)&&3===e}(n,i,r)&&(c.top=-1*c.top),c}({outDistance:i,startPointIndex:d,flipX:a,flipY:l,reatAngles:h});return[o+f.left,s+f.top]}({type:e,outDistance:n,shapeObj:t,flipX:c,flipY:h,left:i,top:o})},v=o,y=s,_=function(e,t){var n=t.left,i=t.top,o=t.width,s=t.height,a=t.cropX,l=t.cropY,c={width:o,height:s};return(0,r.forEach)(["x","y"],(function(t){var r="x"===t?a:l,o=c[u[t]],s=d[u[t]];if(o>s){var h=(o-s)/2;c[u[t]]=s;var f=e(t,h,n,i);n=f[0],i=f[1]}if(r<0){var p=e(t,r,n,i);n=p[0],i=p[1]}})),[n,i,c.width,c.height]}(g,{left:n,top:i,width:o,height:s,cropX:a,cropY:l});n=_[0],i=_[1],o=_[2],s=_[3];var b=function(e,t){var n=t.left,i=t.top,o=t.insideCanvasRealImageWidth,s=t.insideCanvasRealImageHeight,a=t.right,l=t.bottom,c=t.cropX,u=t.cropY,h=t.originalWidth,f=t.originalHeight,p=o,g=s,m=d,v=m.width,y=m.height;a>v&&c>0&&(p=h-Math.abs(a-v)),l>y&&u>0&&(g=f-Math.abs(l-y));var _={x:(o-p)/2,y:(s-g)/2};return(0,r.forEach)(["x","y"],(function(t){var r=_[t];if(r>0){var o=e(t,r,n,i);n=o[0],i=o[1]}})),[n,i,p,g]}(g,{left:n,top:i,insideCanvasRealImageWidth:o,insideCanvasRealImageHeight:s,right:f,bottom:p,cropX:a,cropY:l,originalWidth:v,originalHeight:y});return n=b[0],i=b[1],o=b[2],s=b[3],[n,i,o,s]}({shapeObj:e,left:b,top:x,width:h,height:p,cropX:y,cropY:_,flipX:n,flipY:i,right:l,bottom:c});b=j[0],x=j[1],h=j[2],p=j[3],o.set({angle:n===i?-t:t,left:b,top:x,width:h,height:p,cropX:y,cropY:_,flipX:n,flipY:i}),(0,a.setCustomProperty)(o,{fillImageMaxSize:C})},t.makeFilterOptionFromFabricImage=p,t.makeFillPatternForFilter=function(e,t,n){var i=v(g(e),e.angle,t);n.add(i);var r={fill:new fabric.Pattern({source:n.getElement(),repeat:"no-repeat"})};return(0,a.setCustomProperty)(r,{patternSourceCanvas:n}),r},t.resetFillPatternCanvas=function(e){var t=e.getObjects()[0],n=(0,a.getCustomProperty)(t,"fillImageMaxSize").fillImageMaxSize;n=Math.max(1,n),e.setDimensions({width:n,height:n}),e.renderAll()},t.reMakePatternImageSource=function(e,t){var n=(0,a.getCustomProperty)(e,"patternSourceCanvas").patternSourceCanvas,i=n.getObjects()[0],r=p(i);n.remove(i);var o=v(g(t,!0),t.angle,r);n.add(o)},t.getCachedCanvasImageElement=g;var i,r=n("tui-code-snippet"),o=n("./src/js/helper/shapeResizeHelper.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/util.js");function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c={pixelate:"blocksize",blur:"blur"},u={x:"width",y:"height"},h=(0,a.flipObject)(c),d=null;function f(e){return(0,a.getCustomProperty)(e,"patternSourceCanvas").patternSourceCanvas.getObjects()[0]}function p(e){return(0,r.map)(e.filters,(function(e){var t=Object.keys(e)[0];return l({},h[t],e[t])}))}function g(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return d&&!t||(d=e.toCanvasElement()),d}function m(e){return[e.getPointByOrigin("left","top"),e.getPointByOrigin("right","top"),e.getPointByOrigin("left","bottom"),e.getPointByOrigin("right","bottom")]}function v(e,t,n){var i=new fabric.Image(e);return(0,r.forEach)(r.extend.apply(void 0,[{}].concat(n)),(function(e,t){var n=(0,a.capitalizeString)(t),r=new fabric.Image.filters[n](l({},c[t],e));i.filters.push(r)})),i.applyFilters(),(0,a.setCustomProperty)(i,{originalAngle:t,fillImageMaxSize:Math.max(i.width,i.height)}),s.default.adjustOriginToCenter(i),i}},
vendor: 1,906 bytes, line 2
2"./src/js/helper/shapeResizeHelper.js":function(e,t,n){"use strict";var i={rect:1,circle:2,triangle:1},r={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};function o(e,t,n){var i=e.x,r=e.y,o=t.x,s=t.y,a=n*Math.PI/180;return{originX:i>(o-i)*Math.cos(a)-(s-r)*Math.sin(a)+i?"right":"left",originY:r>(o-i)*Math.sin(a)+(s-r)*Math.cos(a)+r?"bottom":"top"}}e.exports={setOrigins:function(e){var t=e.getPointByOrigin("left","top"),n=e.getPointByOrigin("right","top"),i=e.getPointByOrigin("right","bottom"),r=e.getPointByOrigin("left","bottom");e.origins={lt:t,rt:n,rb:i,lb:r}},resize:function(e,t,n){(function(e){return"center"===e.originX&&"center"===e.originY})(e)&&(function(e,t){var n=t.getPointByOrigin("center","center"),i=o(n,e,-t.angle),r=i.originX,s=i.originY,a=t.getPointByOrigin(r,s),l=t.left-(n.x-a.x),c=t.top-(n.y-a.y);t.set({originX:r,originY:s,left:l,top:c}),t.setCoords()}(t,e),function(e){var t=e.originX,n=e.originY,i=t.substring(0,1)+n.substring(0,1);e.startPoint=e.origins[i]}(e)),n?function(e){var t=e.type,n=e.scaleX,i=e.scaleY,o=r[t],s=e[o.w]*n,a=e[o.h]*i;if(e.isRegular){var l=Math.max(n,i);s=e[o.w]*l,a=e[o.h]*l}var c={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};c[o.w]=s,c[o.h]=a,e.set(c)}(e):function(e,t){var n=t.type,o=t.strokeWidth,s=t.startPoint,a=i[n],l=r[n],c=!("triangle"!==t.type),u={},h=Math.abs(s.x-e.x)/a,d=Math.abs(s.y-e.y)/a;h>o&&(h-=o/a),d>o&&(d-=o/a),t.isRegular&&(h=d=Math.max(h,d),c&&(d=Math.sqrt(3)/2*h)),u[l.w]=h,u[l.h]=d,t.set(u)}(t,e),function(e,t){var n=t.startPoint,i=o(n,e,-t.angle),r=i.originX,s=i.originY;t.setPositionByOrigin(n,r,s),t.setCoords()}(t,e)},adjustOriginToCenter:function(e){var t=e.getPointByOrigin("center","center"),n=e.originX,i=e.originY,r=e.getPointByOrigin(n,i),o=e.left+(t.x-r.x),s=e.top+(t.y-r.y);e.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:o,top:s}),e.setCoords()}}},
2"./src/js/imageEditor.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=f(n("tui-code-snippet")),o=f(n("./src/js/invoker.js")),s=f(n("./src/js/ui.js")),a=f(n("./src/js/action.js")),l=f(n("./src/js/factory/command.js")),c=f(n("./src/js/graphics.js")),u=n("./src/js/helper/selectionModifyHelper.js"),h=n("./src/js/util.js"),d=n("./src/js/consts.js");function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=r.default.isUndefined,m=r.default.forEach,v=r.default.CustomEvents,y=d.eventNames.MOUSE_DOWN,_=d.eventNames.OBJECT_MOVED,b=d.eventNames.OBJECT_SCALED,x=d.eventNames.OBJECT_ACTIVATED,C=d.eventNames.OBJECT_ROTATED,j=d.eventNames.OBJECT_ADDED,w=d.eventNames.OBJECT_MODIFIED,S=d.eventNames.ADD_TEXT,k=d.eventNames.ADD_OBJECT,O=d.eventNames.TEXT_EDITING,E=d.eventNames.TEXT_CHANGED,T=d.eventNames.ICON_CREATE_RESIZE,M=d.eventNames.ICON_CREATE_END,P=d.eventNames.SELECTION_CLEARED,A=d.eventNames.SELECTION_CREATED,I=d.eventNames.ADD_OBJECT_AFTER,D=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=r.default.extend({includeUI:!1,usageStatistics:!0},n),this.mode=null,this.activeObjectId=null,n.includeUI){var i=n.includeUI;i.usageStatistics=n.usageStatistics,this.ui=new s.default(t,i,this.getActions()),n=this.ui.setUiDefaultSelectionStyle(n)}this._invoker=new o.default,this._graphics=new c.default(this.ui?this.ui.getEditorArea():t,{cssMaxWidth:n.cssMaxWidth,cssMaxHeight:n.cssMaxHeight}),this._handlers={keydown:this._onKeyDown.bind(this),mousedown:this._onMouseDown.bind(this),objectActivated:this._onObjectActivated.bind(this),objectMoved:this._onObjectMoved.bind(this),objectScaled:this._onObjectScaled.bind(this),objectRotated:this._onObjectRotated.bind(this),objectAdded:this._onObjectAdded.bind(this),objectModified:this._onObjectModified.bind(this),createdPath:this._onCreatedPath,addText:this._onAddText.bind(this),addObject:this._onAddObject.bind(this),textEditing:this._onTextEditing.bind(this),textChanged:this._onTextChanged.bind(this),iconCreateResize:this._onIconCreateResize.bind(this),iconCreateEnd:this._onIconCreateEnd.bind(this),selectionCleared:this._selectionCleared.bind(this),selectionCreated:this._selectionCreated.bind(this)},this._attachInvokerEvents(),this._attachGraphicsEvents(),this._attachDomEvents(),this._setSelectionStyle(n.selectionStyle,{applyCropSelectionStyle:n.applyCropSelectionStyle,applyGroupSelectionStyle:n.applyGroupSelectionStyle}),n.usageStatistics&&(0,h.sendHostName)(),this.ui&&(this.ui.initCanvas(),this.setReAction(),this._attachColorPickerInputBoxEvents()),fabric.enableGLFiltering=!1}return i(e,[{key:"_attachColorPickerInputBoxEvents",value:function(){var e=this;this.ui.on(d.eventNames.INPUT_BOX_EDITING_STARTED,(function(){e.isColorPickerInputBoxEditing=!0})),this.ui.on(d.eventNames.INPUT_BOX_EDITING_STOPPED,(function(){e.isColorPickerInputBoxEditing=!1}))}},{key:"_detachColorPickerInputBoxEvents",value:function(){this.ui.off(d.eventNames.INPUT_BOX_EDITING_STARTED),this.ui.off(d.eventNames.INPUT_BOX_EDITING_STOPPED)}},{key:"_setSelectionStyle",value:function(e,t){var n=t.applyCropSelectionStyle,i=t.applyGroupSelectionStyle;e&&this._graphics.setSelectionStyle(e),n&&this._graphics.setCropSelectionStyle(e),i&&this.on("selectionCreated",(function(t){"activeSelection"===t.type&&t.set(e)}))}},{key:"_attachInvokerEvents",value:function(){var e=this,t=d.eventNames.UNDO_STACK_CHANGED,n=d.eventNames.REDO_STACK_CHANGED,i=d.eventNames.EXECUTE_COMMAND,r=d.eventNames.AFTER_UNDO,o=d.eventNames.AFTER_REDO,s=d.eventNames.HAND_STARTED,a=d.eventNames.HAND_STOPPED;if(this._invoker.on(t,this.fire.bind(this,t)),this._invoker.on(n,this.fire.bind(this,n)),this.ui){var l=this._graphics.getCanvas();this._invoker.on(i,(function(t){return e.ui.fire(i,t)})),this._invoker.on(r,(function(t){return e.ui.fire(r,t)})),this._invoker.on(o,(function(t){return e.ui.fire(o,t)})),l.on(s,(function(){return e.ui.fire(s)})),l.on(a,(function(){return e.ui.fire(a)}))}}},{key:"_attachGraphicsEvents",value:function(){var e;this._graphics.on((p(e={},y,this._handlers.mousedown),p(e,_,this._handlers.objectMoved),p(e,b,this._handlers.objectScaled),p(e,C,this._handlers.objectRotated),p(e,x,this._handlers.objectActivated),p(e,j,this._handlers.objectAdded),p(e,w,this._handlers.objectModified),p(e,S,this._handlers.addText),p(e,k,this._handlers.addObject),p(e,O,this._handlers.textEditing),p(e,E,this._handlers.textChanged),p(e,T,this._handlers.iconCreateResize),p(e,M,this._handlers.iconCreateEnd),p(e,P,this._handlers.selectionCleared),p(e,A,this._handlers.selectionCreated),e))}},{key:"_attachDomEvents",value:function(){document.addEventListener("keydown",this._handlers.keydown)}},{key:"_detachDomEvents",value:function(){document.removeEventListener("keydown",this._handlers.keydown)}},{key:"_onKeyDown",value:function(e){var t=e.ctrlKey,n=e.keyCode,i=e.metaKey;(t||i)&&(n===d.keyCodes.C?this._graphics.resetTargetObjectForCopyPaste():n===d.keyCodes.V?(this._graphics.pasteObject(),this.clearRedoStack()):n===d.keyCodes.Z?this.undo().catch((function(){})):n===d.keyCodes.Y&&this.redo().catch((function(){})));var r=n===d.keyCodes.BACKSPACE||n===d.keyCodes.DEL,o=this._graphics.isReadyRemoveObject();!this.isColorPickerInputBoxEditing&&o&&r&&(e.preventDefault(),this.removeActiveObject())}},{key:"removeActiveObject",value:function(){var e=this._graphics.getActiveObjectIdForRemove();this.removeObject(e)}},{key:"_onMouseDown",value:function(e,t){this.fire(d.eventNames.MOUSE_DOWN,e,t)}}
2,{key:"_pushAddObjectCommand",value:function(e){var t=l.default.create(d.commandNames.ADD_OBJECT,this._graphics,e);this._invoker.pushUndoStack(t)}},{key:"_pushModifyObjectCommand",value:function(e){var t=this,n=e.type,i=(0,u.makeSelectionUndoData)(e,(function(e){return(0,u.makeSelectionUndoDatum)(t._graphics.getObjectId(e),e,"activeSelection"===n)})),r=l.default.create(d.commandNames.CHANGE_SELECTION,this._graphics,i);r.execute(this._graphics,i),this._invoker.pushUndoStack(r)}},{key:"_onObjectActivated",value:function(e){this.fire(d.eventNames.OBJECT_ACTIVATED,e)}},{key:"_onObjectMoved",value:function(e){this.fire(d.eventNames.OBJECT_MOVED,e)}},{key:"_onObjectScaled",value:function(e){this.fire(d.eventNames.OBJECT_SCALED,e)}},{key:"_onObjectRotated",value:function(e){this.fire(d.eventNames.OBJECT_ROTATED,e)}},{key:"getDrawingMode",value:function(){return this._graphics.getDrawingMode()}},{key:"clearObjects",value:function(){return this.execute(d.commandNames.CLEAR_OBJECTS)}},{key:"deactivateAll",value:function(){this._graphics.deactivateAll(),this._graphics.renderAll()}},{key:"discardSelection",value:function(){this._graphics.discardSelection()}},{key:"changeSelectableAll",value:function(e){this._graphics.changeSelectableAll(e)}},{key:"_initHistory",value:function(){this.ui&&this.ui.initHistory()}},{key:"_clearHistory",value:function(){this.ui&&this.ui.clearHistory()}},{key:"execute",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=[this._graphics].concat(i);return(t=this._invoker).execute.apply(t,[e].concat(o))}},{key:"executeSilent",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=[this._graphics].concat(i);return(t=this._invoker).executeSilent.apply(t,[e].concat(o))}},{key:"undo",value:function(){for(var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=h.Promise.resolve(),i=0;i<t;i+=1)n=n.then((function(){return e._invoker.undo()}));return n}},{key:"redo",value:function(){for(var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=h.Promise.resolve(),i=0;i<t;i+=1)n=n.then((function(){return e._invoker.redo()}));return n}},{key:"zoom",value:function(e){var t=e.x,n=e.y,i=e.zoomLevel;this._graphics.zoom({x:t,y:n},i)}},{key:"resetZoom",value:function(){this._graphics.resetZoom()}},{key:"loadImageFromFile",value:function(e,t){if(!e)return h.Promise.reject(d.rejectMessages.invalidParameters);var n=URL.createObjectURL(e);return t=t||e.name,this.loadImageFromURL(n,t).then((function(t){return URL.revokeObjectURL(e),t}))}},{key:"loadImageFromURL",value:function(e,t){return t&&e?this.execute(d.commandNames.LOAD_IMAGE,t,e):h.Promise.reject(d.rejectMessages.invalidParameters)}},{key:"addImageObject",value:function(e){return e?this.execute(d.commandNames.ADD_IMAGE_OBJECT,e):h.Promise.reject(d.rejectMessages.invalidParameters)}},{key:"startDrawingMode",value:function(e,t){return this._graphics.startDrawingMode(e,t)}},{key:"stopDrawingMode",value:function(){this._graphics.stopDrawingMode()}},{key:"crop",value:function(e){var t=this._graphics.getCroppedImageData(e);return t?this.loadImageFromURL(t.url,t.imageName):h.Promise.reject(d.rejectMessages.invalidParameters)}},{key:"getCropzoneRect",value:function(){return this._graphics.getCropzoneRect()}},{key:"setCropzoneRect",value:function(e){this._graphics.setCropzoneRect(e)}},{key:"_flip",value:function(e){return this.execute(d.commandNames.FLIP_IMAGE,e)}},{key:"flipX",value:function(){return this._flip("flipX")}},{key:"flipY",value:function(){return this._flip("flipY")}},{key:"resetFlip",value:function(){return this._flip("reset")}},{key:"_rotate",value:function(e,t,n){return n?this.executeSilent(d.commandNames.ROTATE_IMAGE,e,t):this.execute(d.commandNames.ROTATE_IMAGE,e,t)}},{key:"rotate",value:function(e,t){return this._rotate("rotate",e,t)}},{key:"setAngle",value:function(e,t){return this._rotate("setAngle",e,t)}},{key:"setBrush",value:function(e){this._graphics.setBrush(e)}},{key:"setDrawingShape",value:function(e,t){this._graphics.setDrawingShape(e,t)}},{key:"setDrawingIcon",value:function(e,t){this._graphics.setIconStyle(e,t)}},{key:"addShape",value:function(e,t){return t=t||{},this._setPositions(t),this.execute(d.commandNames.ADD_SHAPE,e,t)}},{key:"changeShape",value:function(e,t,n){return this[n?"executeSilent":"execute"](d.commandNames.CHANGE_SHAPE,e,t)}},{key:"addText",value:function(e,t){return e=e||"",t=t||{},this.execute(d.commandNames.ADD_TEXT,e,t)}},{key:"changeText",value:function(e,t){return t=t||"",this.execute(d.commandNames.CHANGE_TEXT,e,t)}},{key:"changeTextStyle",value:function(e,t,n){return this[n?"executeSilent":"execute"](d.commandNames.CHANGE_TEXT_STYLE,e,t)}},{key:"_changeActivateMode",value:function(e){"ICON"!==e&&this.getDrawingMode()!==e&&this.startDrawingMode(e)}},{key:"_onTextChanged",value:function(e){this.fire(d.eventNames.TEXT_CHANGED,e)}},{key:"_onIconCreateResize",value:function(e){this.fire(d.eventNames.ICON_CREATE_RESIZE,e)}},{key:"_onIconCreateEnd",value:function(e){this.fire(d.eventNames.ICON_CREATE_END,e)}},{key:"_onTextEditing",value:function(){this.fire(d.eventNames.TEXT_EDITING)}},{key:"_onAddText",value:function(e){this.fire(d.eventNames.ADD_TEXT,{originPosition:e.originPosition,clientPosition:e.clientPosition})}},{key:"_onAddObject",value:function(e){var t=this._graphics.getObject(e.id);this._invoker.fire(d.eventNames.EXECUTE_COMMAND,(0,h.getObjectType)(t.type)),this._pushAddObjectC
2ommand(t)}},{key:"_onObjectAdded",value:function(e){this.fire(j,e),this.fire(I,e)}},{key:"_onObjectModified",value:function(e){e.type!==d.OBJ_TYPE.CROPZONE&&(this._invoker.fire(d.eventNames.EXECUTE_COMMAND,(0,h.getObjectType)(e.type)),this._pushModifyObjectCommand(e))}},{key:"_selectionCleared",value:function(){this.fire(P)}},{key:"_selectionCreated",value:function(e){this.fire(A,e)}},{key:"registerIcons",value:function(e){this._graphics.registerPaths(e)}},{key:"changeCursor",value:function(e){this._graphics.changeCursor(e)}},{key:"addIcon",value:function(e,t){return t=t||{},this._setPositions(t),this.execute(d.commandNames.ADD_ICON,e,t)}},{key:"changeIconColor",value:function(e,t){return this.execute(d.commandNames.CHANGE_ICON_COLOR,e,t)}},{key:"removeObject",value:function(e){var t=this._graphics.getObject(e).type;return this.execute(d.commandNames.REMOVE_OBJECT,e,(0,h.getObjectType)(t))}},{key:"hasFilter",value:function(e){return this._graphics.hasFilter(e)}},{key:"removeFilter",value:function(e){return this.execute(d.commandNames.REMOVE_FILTER,e)}},{key:"applyFilter",value:function(e,t,n){return this[n?"executeSilent":"execute"](d.commandNames.APPLY_FILTER,e,t)}},{key:"toDataURL",value:function(e){return this._graphics.toDataURL(e)}},{key:"getImageName",value:function(){return this._graphics.getImageName()}},{key:"clearUndoStack",value:function(){this._invoker.clearUndoStack()}},{key:"clearRedoStack",value:function(){this._invoker.clearRedoStack()}},{key:"isEmptyUndoStack",value:function(){return this._invoker.isEmptyUndoStack()}},{key:"isEmptyRedoStack",value:function(){return this._invoker.isEmptyRedoStack()}},{key:"resizeCanvasDimension",value:function(e){return e?this.execute(d.commandNames.RESIZE_CANVAS_DIMENSION,e):h.Promise.reject(d.rejectMessages.invalidParameters)}},{key:"destroy",value:function(){var e=this;this.stopDrawingMode(),this._detachDomEvents(),this._graphics.destroy(),this._graphics=null,this.ui&&(this._detachColorPickerInputBoxEvents(),this.ui.destroy()),m(this,(function(t,n){e[n]=null}),this)}},{key:"_setPositions",value:function(e){var t=this._graphics.getCenter();g(e.left)&&(e.left=t.left),g(e.top)&&(e.top=t.top)}},{key:"setObjectProperties",value:function(e,t){return this.execute(d.commandNames.SET_OBJECT_PROPERTIES,e,t)}},{key:"setObjectPropertiesQuietly",value:function(e,t){this._graphics.setObjectProperties(e,t)}},{key:"getObjectProperties",value:function(e,t){return this._graphics.getObject(e)?this._graphics.getObjectProperties(e,t):null}},{key:"getCanvasSize",value:function(){return this._graphics.getCanvasSize()}},{key:"getObjectPosition",value:function(e,t,n){return this._graphics.getObjectPosition(e,t,n)}},{key:"setObjectPosition",value:function(e,t){return this.execute(d.commandNames.SET_OBJECT_POSITION,e,t)}},{key:"resize",value:function(e){return this.execute(d.commandNames.RESIZE_IMAGE,e)}}]),e}();a.default.mixin(D),v.mixin(D),t.default=D},
2"./src/js/interface/command.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n("tui-code-snippet")),o=s(n("./src/js/factory/errorMessage.js"));function s(e){return e&&e.__esModule?e:{default:e}}var a=o.default.create,l=o.default.types,c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t.name,this.args=n,this.execute=t.execute,this.undo=t.undo,this.executeCallback=t.executeCallback||null,this.undoCallback=t.undoCallback||null,this.undoData={}}return i(e,[{key:"execute",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"execute"))}},{key:"undo",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"undo"))}},{key:"setUndoData",value:function(e,t,n){return t&&(e=t),n?t||(t=e):(r.default.extend(this.undoData,e),t=null),t}},{key:"setExecuteCallback",value:function(e){return this.executeCallback=e,this}},{key:"setUndoCallback",value:function(e){return this.undoCallback=e,this}},{key:"isRedo",get:function(){return Object.keys(this.undoData).length>0}}]),e}();t.default=c},
2"./src/js/interface/component.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.graphics=n}return i(e,[{key:"fire",value:function(){for(var e=this.graphics,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.graphics.fire.apply(e,n)}},{key:"setCanvasImage",value:function(e,t){this.graphics.setCanvasImage(e,t)}},{key:"getCanvasElement",value:function(){return this.graphics.getCanvasElement()}},{key:"getCanvas",value:function(){return this.graphics.getCanvas()}},{key:"getCanvasImage",value:function(){return this.graphics.getCanvasImage()}},{key:"getImageName",value:function(){return this.graphics.getImageName()}},{key:"getEditor",value:function(){return this.graphics.getEditor()}},{key:"getName",value:function(){return this.name}},{key:"setImageProperties",value:function(e,t){this.graphics.setImageProperties(e,t)}},{key:"setCanvasCssDimension",value:function(e){this.graphics.setCanvasCssDimension(e)}},{key:"setCanvasBackstoreDimension",value:function(e){this.graphics.setCanvasBackstoreDimension(e)}},{key:"adjustCanvasDimension",value:function(){this.graphics.adjustCanvasDimension()}},{key:"adjustCanvasDimensionBase",value:function(){this.graphics.adjustCanvasDimensionBase()}}]),e}();t.default=r},
2"./src/js/interface/drawingMode.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("./src/js/factory/errorMessage.js"),s=(i=o)&&i.__esModule?i:{default:i},a=s.default.create,l=s.default.types,c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t}return r(e,[{key:"getName",value:function(){return this.name}},{key:"start",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"start"))}},{key:"end",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"stop"))}}]),e}();t.default=c},
2"./src/js/invoker.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n("tui-code-snippet")),o=l(n("./src/js/factory/command.js")),s=n("./src/js/util.js"),a=n("./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=r.default.isFunction,u=r.default.isString,h=r.default.CustomEvents,d=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._undoStack=[],this._redoStack=[],this._isLocked=!1,this._isSilent=!1}return i(e,[{key:"_invokeExecution",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lock();var i=e.args;return i||(i=[]),e.execute.apply(e,i).then((function(i){return t._isSilent||(t.pushUndoStack(e),t.fire(n?a.eventNames.AFTER_REDO:a.eventNames.EXECUTE_COMMAND,e)),t.unlock(),c(e.executeCallback)&&e.executeCallback(i),i})).catch((function(e){return t.unlock(),s.Promise.reject(e)}))}},{key:"_invokeUndo",value:function(e){var t=this;this.lock();var n=e.args;return n||(n=[]),e.undo.apply(e,n).then((function(n){return t.pushRedoStack(e),t.fire(a.eventNames.AFTER_UNDO,e),t.unlock(),c(e.undoCallback)&&e.undoCallback(n),n})).catch((function(e){return t.unlock(),s.Promise.reject(e)}))}},{key:"_fireRedoStackChanged",value:function(){this.fire(a.eventNames.REDO_STACK_CHANGED,this._redoStack.length)}},{key:"_fireUndoStackChanged",value:function(){this.fire(a.eventNames.UNDO_STACK_CHANGED,this._undoStack.length)}},{key:"lock",value:function(){this._isLocked=!0}},{key:"unlock",value:function(){this._isLocked=!1}},{key:"executeSilent",value:function(){var e=this;this._isSilent=!0;for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.execute.apply(this,n.concat([this._isSilent])).then((function(){e._isSilent=!1}))}},{key:"execute",value:function(){var e=this;if(this._isLocked)return s.Promise.reject(a.rejectMessages.isLock);for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=n[0];return u(r)&&(r=o.default.create.apply(o.default,n)),this._invokeExecution(r).then((function(t){return e.clearRedoStack(),t}))}},{key:"undo",value:function(){var e=this._undoStack.pop(),t=void 0,n="";return e&&this._isLocked&&(this.pushUndoStack(e,!0),e=null),e?(this.isEmptyUndoStack()&&this._fireUndoStackChanged(),t=this._invokeUndo(e)):(n=a.rejectMessages.undo,this._isLocked&&(n=n+" Because "+a.rejectMessages.isLock),t=s.Promise.reject(n)),t}},{key:"redo",value:function(){var e=this._redoStack.pop(),t=void 0,n="";return e&&this._isLocked&&(this.pushRedoStack(e,!0),e=null),e?(this.isEmptyRedoStack()&&this._fireRedoStackChanged(),t=this._invokeExecution(e,!0)):(n=a.rejectMessages.redo,this._isLocked&&(n=n+" Because "+a.rejectMessages.isLock),t=s.Promise.reject(n)),t}},{key:"pushUndoStack",value:function(e,t){this._undoStack.push(e),t||this._fireUndoStackChanged()}},{key:"pushRedoStack",value:function(e,t){this._redoStack.push(e),t||this._fireRedoStackChanged()}},{key:"isEmptyRedoStack",value:function(){return 0===this._redoStack.length}},{key:"isEmptyUndoStack",value:function(){return 0===this._undoStack.length}},{key:"clearUndoStack",value:function(){this.isEmptyUndoStack()||(this._undoStack=[],this._fireUndoStackChanged())}},{key:"clearRedoStack",value:function(){this.isEmptyRedoStack()||(this._redoStack=[],this._fireRedoStackChanged())}}]),e}();h.mixin(d),t.default=d},
2"./src/js/polyfill.js":function(e,t,n){"use strict";Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),"document"in window.self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(e){if("Element"in e){var t="classList",n=e.Element.prototype,i=Object,r=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array.prototype.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},s=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},a=function(e,t){if(""===t)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(e,t)},l=function(e){for(var t=r.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],i=0,o=n.length;i<o;i++)this.push(n[i]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=l.prototype=[],u=function(){return new l(this)};if(s.prototype=Error.prototype,c.item=function(e){return this[e]||null},c.contains=function(e){return-1!==a(this,e+="")},c.add=function(){var e,t=arguments,n=0,i=t.length,r=!1;do{e=t[n]+"",-1===a(this,e)&&(this.push(e),r=!0)}while(++n<i);r&&this._updateClassName()},c.remove=function(){var e,t,n=arguments,i=0,r=n.length,o=!1;do{for(e=n[i]+"",t=a(this,e);-1!==t;)this.splice(t,1),o=!0,t=a(this,e)}while(++i<r);o&&this._updateClassName()},c.toggle=function(e,t){e+="";var n=this.contains(e),i=n?!0!==t&&"remove":!1!==t&&"add";return i&&this[i](e),!0===t||!1===t?t:!n},c.toString=function(){return this.join(" ")},i.defineProperty){var h={get:u,enumerable:!0,configurable:!0};try{i.defineProperty(n,t,h)}catch(e){void 0!==e.number&&-2146823252!==e.number||(h.enumerable=!1,i.defineProperty(n,t,h))}}else i.prototype.__defineGetter__&&n.__defineGetter__(t,u)}}(window.self),function(){var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var n,i=arguments.length;for(n=0;n<i;n++)e=arguments[n],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.call(this,e)}}e=null}()),function(){if("undefined"!=typeof window&&window.addEventListener){var e,t,n,i=Object.create(null),r=function(){clearTimeout(t),t=setTimeout(e,100)},o=function(){},s=function(e){function t(e){var t;return void 0!==e.protocol?t=e:(t=document.createElement("a")).href=e,t.protocol.replace(/:/g,"")+t.host}var n,i,r;return window.XMLHttpRequest&&(n=new XMLHttpRequest,i=t(location),r=t(e),n=void 0===n.withCredentials&&""!==r&&r!==i?XDomainRequest||void 0:XMLHttpRequest),n},a="http://www.w3.org/1999/xlink";e=function(){var e,t,n,l,c,u,h,d,f,p,g=0;function m(){var e;0==(g-=1)&&(o(),window.addEventListener("resize",r,!1),window.addEventListener("orientationchange",r,!1),window.MutationObserver?((e=new MutationObserver(r)).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),o=function(){try{e.disconnect(),window.removeEventListener("resize",r,!1),window.removeEventListener("orientationchange",r,!1)}catch(e){}}):(document.documentElement.addEventListener("DOMSubtreeModified",r,!1),o=function(){document.documentElement.removeEventListener("DOMSubtreeModified",r,!1),window.removeEventListener("resize",r,!1),window.removeEventListener("orientationchange",r,!1)}))}function v(e){return function(){!0!==i[e.base]&&(e.useEl.setAttributeNS(a,"xlink:href","#"+e.hash),e.useEl.hasAttribute("href")&&e.useEl.setAttribute("href","#"+e.hash))}}function y(e){return function(){var t,n=document.body,i=document.createElement("x");e.onload=null,i.innerHTML=e.responseText,(t=i.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",n.insertBefore(t,n.firstChild)),m()}}function _(e){return function(){e.onerror=null,e.ontimeout=null,m()}}for(o(),f=document.getElementsByTagName("use"),c=0;c<f.length;c+=1){try{t=f[c].getBoundingClientRect()}catch(e){t=!1}e=(d=(l=f[c].getAttribute("href")||f[c].getAttributeNS(a,"href")||f[c].getAttribute("xlink:href"))&&l.split?l.split("#"):["",""])[0],n=d[1],u=t&&0===t.left&&0===t.right&&0===t.top&&0===t.bottom,t&&0===t.width&&0===t.height&&!u?(f[c].hasAttribute("href")&&f[c].setAttributeNS(a,"xlink:href",l),e.length&&(!0!==(p=i[e])&&setTimeout(v({useEl:f[c],base:e,hash:n}),0),void 0===p&&void 0!==(h=s(e))&&(p=new h,i[e]=p,p.onload=y(p),p.onerror=_(p),p.ontimeout=_(p),p.open("GET",e),p.send(),g+=1))):u?e.length&&i[e]&&setTimeout(v({useEl:f[c],base:e,hash:n}),0):void 0===i[e]?i[e]=!0:i[e].onload&&(i[e].abort(),delete i[e].onload,i[e]=!0)}f="",g+=1,m()},n=function(){window.removeEventListener("load",n,!1),t=setTimeout(e,0)},"complete"!==document.readyState?window.addEventListener("load",n,!1):n()}}()},
2"./src/js/ui.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=C(n("tui-code-snippet")),o=n("./src/js/util.js"),s=n("./src/js/consts.js"),a=C(n("./src/js/ui/template/mainContainer.js")),l=C(n("./src/js/ui/template/controls.js")),c=C(n("./src/js/ui/theme/theme.js")),u=C(n("./src/js/ui/shape.js")),h=C(n("./src/js/ui/crop.js")),d=C(n("./src/js/ui/resize.js")),f=C(n("./src/js/ui/flip.js")),p=C(n("./src/js/ui/rotate.js")),g=C(n("./src/js/ui/text.js")),m=C(n("./src/js/ui/mask.js")),v=C(n("./src/js/ui/icon.js")),y=C(n("./src/js/ui/draw.js")),_=C(n("./src/js/ui/filter.js")),b=C(n("./src/js/ui/history.js")),x=C(n("./src/js/ui/locale/locale.js"));function C(e){return e&&e.__esModule?e:{default:e}}var j={Shape:u.default,Crop:h.default,Resize:d.default,Flip:f.default,Rotate:p.default,Text:g.default,Mask:m.default,Icon:v.default,Draw:y.default,Filter:_.default},w=r.default.CustomEvents,S="1300",k="on",O="zoomIn",E="hand",T=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=this._initializeOption(n),this._actions=i,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new x.default(this.options.locale),this.theme=new c.default(this.options.theme),this.eventHandler={},this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuBarElement=null,this._subMenuElement=null,this._makeUiElement(t),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}return i(e,[{key:"destroy",value:function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",(0,o.assignmentForDestroy)(this)}},{key:"setUiDefaultSelectionStyle",value:function(e){return r.default.extend({applyCropSelectionStyle:!0,applyGroupSelectionStyle:!0,selectionStyle:{cornerStyle:"circle",cornerSize:16,cornerColor:"#fff",cornerStrokeColor:"#fff",transparentCorners:!1,lineWidth:2,borderColor:"#fff"}},e)}},{key:"resizeEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.uiSize,n=e.imageSize,i=void 0===n?this.imageSize:n;i!==this.imageSize&&(this.imageSize=i),t&&this._setUiSize(t);var r=this._getCanvasMaxDimension(),o=r.width,s=r.height,a=this._editorElement.style,l=this.options.menuBarPosition;a.height=s+"px",a.width=o+"px",this._setEditorPosition(l),this._editorElementWrap.style.bottom="0px",this._editorElementWrap.style.top="0px",this._editorElementWrap.style.left="0px",this._editorElementWrap.style.width="100%";var c=this._selectedElement.classList;"top"===l&&this._selectedElement.offsetWidth<S?c.add("tui-image-editor-top-optimization"):c.remove("tui-image-editor-top-optimization")}},{key:"toggleZoomButtonStatus",value:function(e){this._buttonElements[e].classList.toggle(k),e===O?this._buttonElements[E].classList.remove(k):this._buttonElements[O].classList.remove(k)}},{key:"offZoomInButtonStatus",value:function(){this._buttonElements[O].classList.remove(k)}},{key:"changeHandButtonStatus",value:function(e){this._buttonElements[E].classList[e?"add":"remove"](k)}},{key:"changeHelpButtonEnabled",value:function(e,t){this._buttonElements[e].classList[t?"add":"remove"]("enabled")}},{key:"_initializeOption",value:function(e){return r.default.extend({loadImage:{path:"",name:""},locale:{},menuIconPath:"",menu:["resize","crop","flip","rotate","draw","shape","icon","text","mask","filter"],initMenu:"",uiSize:{width:"100%",height:"100%"},menuBarPosition:"bottom"},e)}},{key:"_setUiSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.uiSize,t=this._selectedElement.style;t.width=e.width,t.height=e.height}},{key:"_makeSubMenu",value:function(){var e=this;r.default.forEach(this.options.menu,(function(t){var n=j[t.replace(/^[a-z]/,(function(e){return e.toUpperCase()}))];e._makeMenuElement(t),e._buttonElements[t]=e._menuBarElement.querySelector(".tie-btn-"+t),e[t]=new n(e._subMenuElement,{locale:e._locale,makeSvgIcon:e.theme.makeMenSvgIconSet.bind(e.theme),menuBarPosition:e.options.menuBarPosition,usageStatistics:e.options.usageStatistics})}))}},{key:"_attachHistoryEvent",value:function(){this.on(s.eventNames.EXECUTE_COMMAND,this._addHistory.bind(this)),this.on(s.eventNames.AFTER_UNDO,this._selectPrevHistory.bind(this)),this.on(s.eventNames.AFTER_REDO,this._selectNextHistory.bind(this))}},{key:"_attachZoomEvent",value:function(){var e=this;this.on(s.eventNames.HAND_STARTED,(function(){e.offZoomInButtonStatus(),e.changeHandButtonStatus(!0)})),this.on(s.eventNames.HAND_STOPPED,(function(){return e.changeHandButtonStatus(!1)}))}},{key:"_makeUiElement",value:function(e){var t=void 0;
2window.snippet=r.default,t=e.nodeType?e:document.querySelector(e);var n=(0,o.getSelector)(t);t.classList.add("tui-image-editor-container"),t.innerHTML=(0,l.default)({locale:this._locale,biImage:this.theme.getStyle("common.bi"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),menuBarPosition:this.options.menuBarPosition})+(0,a.default)({locale:this._locale,biImage:this.theme.getStyle("common.bi"),commonStyle:this.theme.getStyle("common"),headerStyle:this.theme.getStyle("header"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),submenuStyle:this.theme.getStyle("submenu")}),this._selectedElement=t,this._selectedElement.classList.add(this.options.menuBarPosition),this._mainElement=n(".tui-image-editor-main"),this._editorElementWrap=n(".tui-image-editor-wrap"),this._editorElement=n(".tui-image-editor"),this._helpMenuBarElement=n(".tui-image-editor-help-menu"),this._menuBarElement=n(".tui-image-editor-menu"),this._subMenuElement=n(".tui-image-editor-submenu"),this._buttonElements={download:this._selectedElement.querySelectorAll(".tui-image-editor-download-btn"),load:this._selectedElement.querySelectorAll(".tui-image-editor-load-btn")},this._addHelpMenus(),this._historyMenu=new b.default(this._buttonElements.history,{locale:this._locale,makeSvgIcon:this.theme.makeMenSvgIconSet.bind(this.theme)}),this._activateZoomMenus()}},{key:"_activateZoomMenus",value:function(){var e=this;r.default.forEach(s.ZOOM_HELP_MENUS,(function(t){e.changeHelpButtonEnabled(t,!0)}))}},{key:"_makeHelpMenuWithPartition",value:function(){return[].concat(s.ZOOM_HELP_MENUS,[""],s.COMMAND_HELP_MENUS,[""],s.DELETE_HELP_MENUS)}},{key:"_addHelpMenus",value:function(){var e=this,t=this._makeHelpMenuWithPartition();r.default.forEach(t,(function(t){t?(e._makeMenuElement(t,["normal","disabled","hover"],"help"),e._buttonElements[t]=e._helpMenuBarElement.querySelector(".tie-btn-"+t)):e._makeMenuPartitionElement()}))}},{key:"_makeMenuPartitionElement",value:function(){var e=document.createElement("li"),t=document.createElement("div");e.className=(0,o.cls)("item"),t.className=(0,o.cls)("icpartition"),e.appendChild(t),this._helpMenuBarElement.appendChild(e)}},{key:"_makeMenuElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["normal","active","hover"],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",i=document.createElement("li"),r=this.theme.makeMenSvgIconSet(t,e);this._addTooltipAttribute(i,e),i.className="tie-btn-"+e+" "+(0,o.cls)("item")+" "+n,i.innerHTML=r,"normal"===n?this._menuBarElement.appendChild(i):this._helpMenuBarElement.appendChild(i)}},{key:"_addHelpActionEvent",value:function(){var e=this;r.default.forEach(s.HELP_MENUS,(function(t){e.eventHandler[t]=function(n){return e._actions.main[t](n)},e._buttonElements[t].addEventListener("click",e.eventHandler[t])}))}},{key:"_removeHelpActionEvent",value:function(){var e=this;r.default.forEach(s.HELP_MENUS,(function(t){e._buttonElements[t].removeEventListener("click",e.eventHandler[t])}))}},{key:"_addHistory",value:function(e){if(!(0,o.isSilentCommand)(e)){var t="string"==typeof e?{name:e}:(0,o.getHistoryTitle)(e);this._historyMenu.add(t)}}},{key:"initHistory",value:function(){this._historyMenu.init()}},{key:"clearHistory",value:function(){this._historyMenu.clear()}},{key:"_selectPrevHistory",value:function(){this._historyMenu.prev()}},{key:"_selectNextHistory",value:function(){this._historyMenu.next()}},{key:"toggleHistoryMenu",value:function(e){e.target.closest(".tie-panel-history")||this._buttonElements.history.classList.toggle("opened")}},{key:"_addTooltipAttribute",value:function(e,t){e.setAttribute("tooltip-content",this._locale.localize(t.replace(/^[a-z]/g,(function(e){return e.toUpperCase()}))))}},{key:"_addDownloadEvent",value:function(){var e=this;this.eventHandler.download=function(){return e._actions.main.download()},r.default.forEach(this._buttonElements.download,(function(t){t.addEventListener("click",e.eventHandler.download)}))}},{key:"_removeDownloadEvent",value:function(){var e=this;r.default.forEach(this._buttonElements.download,(function(t){t.removeEventListener("click",e.eventHandler.download)}))}},{key:"_addLoadEvent",value:function(){var e=this;this.eventHandler.loadImage=function(t){return e._actions.main.load(t.target.files[0])},r.default.forEach(this._buttonElements.load,(function(t){t.addEventListener("change",e.eventHandler.loadImage)}))}},{key:"_removeLoadEvent",value:function(){var e=this;r.default.forEach(this._buttonElements.load,(function(t){t.removeEventListener("change",e.eventHandler.loadImage)}))}},{key:"_addMainMenuEvent",value:function(e){var t=this;this.eventHandler[e]=function(){return t.changeMenu(e)},this._buttonElements[e].addEventListener("click",this.eventHandler[e])}},{key:"_addSubMenuEvent",value:function(e){var t=this;this[e].addEvent(this._actions[e]),this[e].on(s.eventNames.INPUT_BOX_EDITING_STARTED,(function(){return t.fire(s.eventNames.INPUT_BOX_EDITING_STARTED)})),this[e].on(s.eventNames.INPUT_BOX_EDITING_STOPPED,(function(){return t.fire(s.eventNames.INPUT_BOX_EDITING_STOPPED)}))}},{key:"_addMenuEvent",value:function(){var e=this;r.default.forEach(this.options.menu,(function(t){e._addMainMenuEvent(t),e._addSubMenuEvent(t)}))}},{key:"_removeMainMenuEvent",value:function(){var e=this;r.default.forEach(this.options.menu,(function(t){e._buttonElements[t].removeEventListener("click",e.eventHandler[t]),e[t].off(s.eventNames.INPUT_BOX_EDITING_STARTED),e[t].off(s.eventNames.INPUT_BOX_EDITING_STOPPED)}))}},{key:"getEditorArea",value:function(){return this._editorElement}},{key:"activeMenuEvent",value:function(){this._initMenuEvent||(this._addHelpActionEvent(),this._addDownloadEvent(),this._addMenuEvent(),this._initMenu(),this._historyMenu.addEvent(this._actions.history),this._initMenuEvent=!0)}},{key:"_removeUiEvent",value:function(){this._removeHelpActionEvent(),this._removeDownloadEvent(),this._removeLoadEvent(),this._removeMainMenuEvent(),this._historyMenu.removeEvent()}},{key:"_destroyAllMenu",value:function(){var e=this;r.default.forEach(this.options.menu,(function(t){e[t].destroy()})),this._historyMenu.destroy()}},{key:"initCanvas",value:function(){var e=this,t=this._getLoadImage();t.path&&this._actions.main.initLoadImage(t.path,t.name).then((function(){e.activeMenuEvent()})),this._addLoadEvent();var n=document.createElement("div");n.className=(0,o.cls)("grid-visual"),n.innerHTML='<table>\n           <tr><td class="dot left-top"></td><td></td><td class="dot right-top"></td></tr>\n           <tr><td></td><td></td><td></td></tr>\n           <tr><td class="dot left-bottom"></td><td></td><td class="dot right-bottom"></td></tr>\n         </table>',this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(n)}},{key:"_getLoadImage",value:function(){return this.options.loadImage}},{key:"changeMenu",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._submenuChangeTransection||(this._submenuChangeTransection=!0,this._changeMenu(e,t,n),this._submenuChangeTransection=!1)}},{key:"_changeMenu",value:function(e,t,n){this.submenu&&(this._buttonElements[this.submenu].classList.remove("active"),this._mainElement.classList.remove("tui-image-editor-menu-"+this.submenu),n&&this._actions.main.discardSelection(),this._actions.main.changeSelectableAll(!0),this[this.submenu].changeStandbyMode()),this.submenu===e&&t?this.submenu=null:(this._buttonElements[e].classList.add("active"),this._mainElement.classList.add("tui-image-editor-menu-"+e),this.submenu=e,this[this.submenu].changeStartMode()),this.resizeEditor()}},{key:"_initMenu",value:function(){if(this.options.initMenu){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!1),this._buttonElements[this.options.initMenu].dispatchEvent(e)}this.icon&&this.icon.registerDefaultIcon()}},{key:"_getCanvasMaxDimension",value:function(){var e=this._editorContainerElement.style,t=e.maxWidth,n=e.maxHeight;return{width:parseFloat(t),height:parseFloat(n)}}},{key:"_setEditorPosition",value:function(e){var t=this._getCanvasMaxDimension(),n=t.width,i=t.height,r=this._editorElement.style,o=0,s=0;this.submenu&&("bottom"===e?o=i>this._editorElementWrap.scrollHeight-150?(i-this._editorElementWrap.scrollHeight)/2:-75:"top"===e?o=i>this._editorElementWrap.offsetHeight-150?75-(i-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===e?s=n>this._editorElementWrap.offsetWidth-248?124-(n-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===e&&(s=n>this._editorElementWrap.scrollWidth-248?(n-this._editorElementWrap.scrollWidth)/2:-124)),r.top=o+"px",r.left=s+"px"}}]),e}();w.mixin(T),t.default=T},
2"./src/js/ui/crop.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n("tui-code-snippet")),o=l(n("./src/js/ui/submenuBase.js")),s=l(n("./src/js/ui/template/submenu/crop.js")),a=n("./src/js/util.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,n){var i=n.locale,r=n.makeSvgIcon,o=n.menuBarPosition,a=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"crop",makeSvgIcon:r,menuBarPosition:o,templateHtml:s.default,usageStatistics:a}));return l.status="active",l._els={apply:l.selector(".tie-crop-button .apply"),cancel:l.selector(".tie-crop-button .cancel"),preset:l.selector(".tie-crop-preset-button")},l.defaultPresetButton=l._els.preset.querySelector(".preset-none"),l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),(0,a.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._applyEventHandler.bind(this),n=this._cancelEventHandler.bind(this),i=this._cropzonePresetEventHandler.bind(this);this.eventHandler={apply:t,cancel:n,cropzonePreset:i},this.actions=e,this._els.apply.addEventListener("click",t),this._els.cancel.addEventListener("click",n),this._els.preset.addEventListener("click",i)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel),this._els.preset.removeEventListener("click",this.eventHandler.cropzonePreset)}},{key:"_applyEventHandler",value:function(){this.actions.crop(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.cancel(),this._els.apply.classList.remove("active")}},{key:"_cropzonePresetEventHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button.preset");if(t){var n=t.className.match(/preset-[^\s]+/)[0];this._setPresetButtonActive(t),this.actions.preset(n)}}},{key:"changeStartMode",value:function(){this.actions.modeChange("crop")}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this._setPresetButtonActive()}},{key:"changeApplyButtonStatus",value:function(e){e?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}},{key:"_setPresetButtonActive",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultPresetButton;r.default.forEach([].slice.call(this._els.preset.querySelectorAll(".preset")),(function(e){e.classList.remove("active")})),e&&e.classList.add("active")}}]),t}(o.default);t.default=c},
2"./src/js/ui/draw.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=u(n("./src/js/ui/tools/colorpicker.js")),o=u(n("./src/js/ui/tools/range.js")),s=u(n("./src/js/ui/submenuBase.js")),a=u(n("./src/js/ui/template/submenu/draw.js")),l=n("./src/js/util.js"),c=n("./src/js/consts.js");function u(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(e,n){var i=n.locale,s=n.makeSvgIcon,l=n.menuBarPosition,u=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var h=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"draw",makeSvgIcon:s,menuBarPosition:l,templateHtml:a.default,usageStatistics:u}));return h._els={lineSelectButton:h.selector(".tie-draw-line-select-button"),drawColorPicker:new r.default(h.selector(".tie-draw-color"),"#00a9ff",h.toggleDirection,h.usageStatistics),drawRange:new o.default({slider:h.selector(".tie-draw-range"),input:h.selector(".tie-draw-range-value")},c.defaultDrawRangeValues)},h.type=null,h.color=h._els.drawColorPicker.color,h.width=h._els.drawRange.value,h.colorPickerInputBox=h._els.drawColorPicker.colorpickerElement.querySelector(c.selectorNames.COLOR_PICKER_INPUT_BOX),h}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),(0,l.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){this.eventHandler.changeDrawType=this._changeDrawType.bind(this),this.actions=e,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",this._changeDrawColor.bind(this)),this._els.drawRange.on("change",this._changeDrawRange.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"_removeEvent",value:function(){this._els.lineSelectButton.removeEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.off(),this._els.drawRange.off(),this.colorPickerInputBox.removeEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.removeEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:(0,l.getRgb)(this.color,.7)})}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.stopDrawingMode(),this.actions.changeSelectableAll(!0),this._els.lineSelectButton.classList.remove("free"),this._els.lineSelectButton.classList.remove("line")}},{key:"changeStartMode",value:function(){this.type="free",this._els.lineSelectButton.classList.add("free"),this.setDrawMode()}},{key:"_changeDrawType",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=this.getButtonType(t,["free","line"]);if(this.actions.discardSelection(),this.type===n)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=n,this._els.lineSelectButton.classList.add(n),this.setDrawMode()}}},{key:"_changeDrawColor",value:function(e){this.color=e||"transparent",this.type?this.setDrawMode():this.changeStartMode()}},{key:"_changeDrawRange",value:function(e){this.width=e,this.type?this.setDrawMode():this.changeStartMode()}}]),t}(s.default);t.default=h},
2"./src/js/ui/filter.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=h(n("tui-code-snippet")),o=h(n("./src/js/ui/tools/colorpicker.js")),s=h(n("./src/js/ui/tools/range.js")),a=h(n("./src/js/ui/submenuBase.js")),l=h(n("./src/js/ui/template/submenu/filter.js")),c=n("./src/js/util.js"),u=n("./src/js/consts.js");function h(e){return e&&e.__esModule?e:{default:e}}var d="130px",f=["add","diff","subtract","multiply","screen","lighten","darken"],p=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],g={grayscale:"grayscale",invert:"invert",sepia:"sepia",blur:"blur",sharpen:"sharpen",emboss:"emboss",removeWhite:"removeColor",brightness:"brightness",contrast:"contrast",saturation:"saturation",vintage:"vintage",polaroid:"polaroid",noise:"noise",pixelate:"pixelate",colorFilter:"removeColor",tint:"blendColor",multiply:"blendColor",blend:"blendColor",hue:"hue",gamma:"gamma"},m=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],v=["filterBlendColor","filterMultiplyColor","filterTintColor"],y=function(e){function t(e,n){var i=n.locale,r=n.menuBarPosition,o=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"filter",menuBarPosition:r,templateHtml:l.default,usageStatistics:o}));return s.selectBoxShow=!1,s.checkedMap={},s._makeControlElement(),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),this._destroyToolInstance(),(0,c.assignmentForDestroy)(this)}},{key:"_removeEvent",value:function(){var e=this;r.default.forEach(p,(function(t){var n=e.selector(".tie-"+t),i=(0,c.toCamelCase)(t);n.removeEventListener("change",e.eventHandler[i])})),r.default.forEach([].concat(m,v),(function(t){e._els[t].off()})),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),r.default.forEachArray(this.colorPickerInputBoxes,(function(t){t.removeEventListener(u.eventNames.FOCUS,e._onStartEditingInputBox.bind(e)),t.removeEventListener(u.eventNames.BLUR,e._onStopEditingInputBox.bind(e))}),this)}},{key:"_destroyToolInstance",value:function(){var e=this;r.default.forEach([].concat(m,v),(function(t){e._els[t].destroy()}))}},{key:"addEvent",value:function(e){var t=this,n=e.applyFilter,i=function(e){return t._changeFilterState.bind(t,n,e)},o=function(e){return function(i,r){return t._changeFilterState(n,e,r)}};this.eventHandler={changeBlendFilter:i("blend"),blandTypeClick:function(e){return e.stopPropagation()}},r.default.forEach(p,(function(e){var n=t.selector(".tie-"+e),r=(0,c.toCamelCase)(e);t.checkedMap[r]=n,t.eventHandler[r]=i(r),n.addEventListener("change",t.eventHandler[r])})),this._els.removewhiteDistanceRange.on("change",o("removeWhite")),this._els.colorfilterThresholdRange.on("change",o("colorFilter")),this._els.pixelateRange.on("change",o("pixelate")),this._els.noiseRange.on("change",o("noise")),this._els.brightnessRange.on("change",o("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",i("multiply")),this._els.filterTintColor.on("change",i("tint")),this._els.tintOpacity.on("change",o("tint")),this._els.filterMultiplyColor.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.filterTintColor.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.filterBlendColor.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),r.default.forEachArray(this.colorPickerInputBoxes,(function(e){e.addEventListener(u.eventNames.FOCUS,t._onStartEditingInputBox.bind(t)),e.addEventListener(u.eventNames.BLUR,t._onStopEditingInputBox.bind(t))}),this)}},{key:"setFilterState",value:function(e){var t=e.type,n=e.options,i=e.action,r=this._getFilterNameFromOptions(t,n),o="remove"===i;o||this._setFilterState(r,n),this.checkedMap[r].checked=!o}},{key:"initFilterCheckBoxState",value:function(){r.default.forEach(this.checkedMap,(function(e){e.checked=!1}
2),this)}},{key:"_setFilterState",value:function(e,t){"colorFilter"===e?this._els.colorfilterThresholdRange.value=t.distance:"removeWhite"===e?this._els.removewhiteDistanceRange.value=t.distance:"pixelate"===e?this._els.pixelateRange.value=t.blocksize:"brightness"===e?this._els.brightnessRange.value=t.brightness:"noise"===e?this._els.noiseRange.value=t.noise:"tint"===e?(this._els.tintOpacity.value=t.alpha,this._els.filterTintColor.color=t.color):"blend"===e?this._els.filterBlendColor.color=t.color:"multiply"===e&&(this._els.filterMultiplyColor.color=t.color)}},{key:"_getFilterNameFromOptions",value:function(e,t){var n=e;return"removeColor"===e?n=r.default.isExisty(t.useAlpha)?"removeWhite":"colorFilter":"blendColor"===e&&(n={add:"blend",multiply:"multiply",tint:"tint"}[t.mode]),n}},{key:"_changeFilterState",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this.checkedMap[t].checked,r=g[t],o=this.checkedMap[t].closest(".tui-image-editor-checkbox-group");o&&(i?o.classList.remove("tui-image-editor-disabled"):o.classList.add("tui-image-editor-disabled")),e(i,r,this._getFilterOption(t),!n)}},{key:"_getFilterOption",value:function(e){var t={};switch(e){case"removeWhite":t.color="#FFFFFF",t.useAlpha=!1,t.distance=parseFloat(this._els.removewhiteDistanceRange.value);break;case"colorFilter":t.color="#FFFFFF",t.distance=parseFloat(this._els.colorfilterThresholdRange.value);break;case"pixelate":t.blocksize=(0,c.toInteger)(this._els.pixelateRange.value);break;case"noise":t.noise=(0,c.toInteger)(this._els.noiseRange.value);break;case"brightness":t.brightness=parseFloat(this._els.brightnessRange.value);break;case"blend":t.mode="add",t.color=this._els.filterBlendColor.color,t.mode=this._els.blendType.value;break;case"multiply":t.mode="multiply",t.color=this._els.filterMultiplyColor.color;break;case"tint":t.mode="tint",t.color=this._els.filterTintColor.color,t.alpha=this._els.tintOpacity.value;break;case"blur":t.blur=this._els.blurRange.value}return t}},{key:"_makeControlElement",value:function(){this._els={removewhiteDistanceRange:new s.default({slider:this.selector(".tie-removewhite-distance-range")},u.defaultFilterRangeValues.removewhiteDistanceRange),brightnessRange:new s.default({slider:this.selector(".tie-brightness-range")},u.defaultFilterRangeValues.brightnessRange),noiseRange:new s.default({slider:this.selector(".tie-noise-range")},u.defaultFilterRangeValues.noiseRange),pixelateRange:new s.default({slider:this.selector(".tie-pixelate-range")},u.defaultFilterRangeValues.pixelateRange),colorfilterThresholdRange:new s.default({slider:this.selector(".tie-colorfilter-threshold-range")},u.defaultFilterRangeValues.colorfilterThresholdRange),filterTintColor:new o.default(this.selector(".tie-filter-tint-color"),"#03bd9e",this.toggleDirection,this.usageStatistics),filterMultiplyColor:new o.default(this.selector(".tie-filter-multiply-color"),"#515ce6",this.toggleDirection,this.usageStatistics),filterBlendColor:new o.default(this.selector(".tie-filter-blend-color"),"#ffbb3b",this.toggleDirection,this.usageStatistics),blurRange:u.defaultFilterRangeValues.blurFilterRange},this._els.tintOpacity=this._pickerWithRange(this._els.filterTintColor.pickerControl),this._els.blendType=this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl),this.colorPickerControls.push(this._els.filterTintColor),this.colorPickerControls.push(this._els.filterMultiplyColor),this.colorPickerControls.push(this._els.filterBlendColor),this.colorPickerInputBoxes=[],this.colorPickerInputBoxes.push(this._els.filterTintColor.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterMultiplyColor.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterBlendColor.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX))}},{key:"_pickerWithRange",value:function(e){var t=document.createElement("div"),n=document.createElement("label"),i=document.createElement("div");return i.id="tie-filter-tint-opacity",n.innerHTML="Opacity",t.appendChild(n),t.appendChild(i),e.appendChild(t),e.style.height=d,new s.default({slider:i},u.defaultFilterRangeValues.tintOpacityRange)}},{key:"_pickerWithSelectbox",value:function(e){var t=document.createElement("div"),n=document.createElement("select"),i=document.createElement("ul");return t.className="tui-image-editor-selectlist-wrap",i.className="tui-image-editor-selectlist",t.appendChild(n),t.appendChild(i),this._makeSelectOptionList(n),e.appendChild(t),e.style.height=d,this._drawSelectOptionList(n,i),this._pickerWithSelectboxForAddEvent(n,i),n}},{key:"_drawSelectOptionList",value:function(e,t){var n=e.querySelectorAll("option");r.default.forEach(n,(function(e){var n=document.createElement("li");n.innerHTML=e.innerHTML,n.setAttribute("data-item",e.value),t.appendChild(n)}))}},{key:"_pickerWithSelectboxForAddEvent",value:function(e,t){var n=this;t.addEventListener("click",(function(i){var r=i.target.getAttribute("data-item"),o=document.createEvent("HTMLEvents");e.querySelector('[value="'+r+'"]').selected=!0,o.initEvent("change",!0,!0),e.dispatchEvent(o),n.selectBoxShow=!1,t.style.display="none"})),e.addEventListener("mousedown",(function(i){i.preventDefault(),n.selectBoxShow=!n.selectBoxShow,t.style.display=n.selectBoxShow?"block":"none",t.setAttribute("data-selectitem",e.value),t.querySelector("[data-item='"+e.value+"']").classList.add("active")}))}},{key:"_makeSelectOptionList",value:function(e){r.default.forEach(f,(function(t){var n=document.createElement("option");n.setAttribute("value",t),n.innerHTML=t.replace(/^[a-z]/,(function(e){return e.toUpperCase()})),e.appendChild(n)}))}}]),t}(a.default);t.default=y},
2"./src/js/ui/flip.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n("tui-code-snippet")),o=l(n("./src/js/ui/submenuBase.js")),s=l(n("./src/js/ui/template/submenu/flip.js")),a=n("./src/js/util.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,n){var i=n.locale,r=n.makeSvgIcon,o=n.menuBarPosition,a=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"flip",makeSvgIcon:r,menuBarPosition:o,templateHtml:s.default,usageStatistics:a}));return l.flipStatus=!1,l._els={flipButton:l.selector(".tie-flip-button")},l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),(0,a.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){this.eventHandler.changeFlip=this._changeFlip.bind(this),this._actions=e,this._els.flipButton.addEventListener("click",this.eventHandler.changeFlip)}},{key:"_removeEvent",value:function(){this._els.flipButton.removeEventListener("click",this.eventHandler.changeFlip)}},{key:"_changeFlip",value:function(e){var t=this,n=e.target.closest(".tui-image-editor-button");if(n){var i=this.getButtonType(n,["flipX","flipY","resetFlip"]);if(!this.flipStatus&&"resetFlip"===i)return;this._actions.flip(i).then((function(e){var n=t._els.flipButton.classList;t.flipStatus=!1,n.remove("resetFlip"),r.default.forEach(["flipX","flipY"],(function(i){n.remove(i),e[i]&&(n.add(i),n.add("resetFlip"),t.flipStatus=!0)}))}))}}}]),t}(o.default);t.default=c},
2"./src/js/ui/history.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=a(n("./src/js/ui/panelMenu.js")),o=a(n("./src/js/ui/template/submenu/history.js")),s=n("./src/js/util.js");function a(e){return e&&e.__esModule?e:{default:e}}var l="selected-item",c="disabled-item",u=function(e){function t(e,n){var i=n.locale,r=n.makeSvgIcon;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{name:"history"}));return e.classList.add("enabled"),o.locale=i,o.makeSvgIcon=r,o._eventHandler={},o._historyIndex=o.getListLength(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"add",value:function(e){var t=e.name,n=e.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var i=(0,o.default)({locale:this.locale,makeSvgIcon:this.makeSvgIcon,name:t,detail
2:n}),r=this.makeListItemElement(i);this.pushListItemElement(r),this._historyIndex=this.getListLength()-1,this._selectItem(this._historyIndex)}},{key:"init",value:function(){this.deleteListItemElement(1,this.getListLength()),this._historyIndex=0,this._selectItem(this._historyIndex)}},{key:"clear",value:function(){this.deleteListItemElement(0,this.getListLength()),this._historyIndex=-1}},{key:"prev",value:function(){this._historyIndex-=1,this._selectItem(this._historyIndex)}},{key:"next",value:function(){this._historyIndex+=1,this._selectItem(this._historyIndex)}},{key:"_hasDisabledItem",value:function(){return this.getListLength()-1>this._historyIndex}},{key:"_addHistoryEventListener",value:function(){var e=this;this._eventHandler.history=function(t){return e._clickHistoryItem(t)},this.listElement.addEventListener("click",this._eventHandler.history)}},{key:"_removeHistoryEventListener",value:function(){this.listElement.removeEventListener("click",this._eventHandler.history)}},{key:"_clickHistoryItem",value:function(e){var t=e.target.closest(".history-item");if(t){var n=Number.parseInt(t.getAttribute("data-index"),10);if(n!==this._historyIndex){var i=Math.abs(n-this._historyIndex);n<this._historyIndex?this._actions.undo(i):this._actions.redo(i)}}}},{key:"_selectItem",value:function(e){for(var t=0;t<this.getListLength();t+=1)this.removeClass(t,l),this.removeClass(t,c),t>e&&this.addClass(t,c);this.addClass(e,l)}},{key:"destroy",value:function(){this.removeEvent(),(0,s.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){this._actions=e,this._addHistoryEventListener()}},{key:"removeEvent",value:function(){this._removeHistoryEventListener()}}]),t}(r.default);t.default=u},
2"./src/js/ui/icon.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=u(n("tui-code-snippet")),o=u(n("./src/js/ui/tools/colorpicker.js")),s=u(n("./src/js/ui/submenuBase.js")),a=u(n("./src/js/ui/template/submenu/icon.js")),l=n("./src/js/util.js"),c=n("./src/js/consts.js");function u(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(e,n){var i=n.locale,r=n.makeSvgIcon,s=n.menuBarPosition,l=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"icon",makeSvgIcon:r,menuBarPosition:s,templateHtml:a.default,usageStatistics:l}));return u.iconType=null,u._iconMap={},u._els={registerIconButton:u.selector(".tie-icon-image-file"),addIconButton:u.selector(".tie-icon-add-button"),iconColorpicker:new o.default(u.selector(".tie-icon-color"),"#ffbb3b",u.toggleDirection,u.usageStatistics)},u.colorPickerInputBox=u._els.iconColorpicker.colorpickerElement.querySelector(c.selectorNames.COLOR_PICKER_INPUT_BOX),u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.iconColorpicker.destroy(),(0,l.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._registerIconHandler.bind(this),n=this._addIconHandler.bind(this);this.eventHandler={registerIcon:t,addIcon:n},this.actions=e,this._els.iconColorpicker.on("change",this._changeColorHandler.bind(this)),this._els.registerIconButton.addEventListener("change",t),this._els.addIconButton.addEventListener("click",n),this.colorPickerInputBox.addEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"_removeEvent",value:function(){this._els.iconColorpicker.off(),this._els.registerIconButton.removeEventListener("change",this.eventHandler.registerIcon),this._els.addIconButton.removeEventListener("click",this.eventHandler.addIcon),this.colorPickerInputBox.removeEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.removeEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"clearIconType",value:function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null}},{key:"registerDefaultIcon",value:function(){var e=this;r.default.forEach(c.defaultIconPath,(function(t,n){e.actions.registerDefaultIcons(n,t)}))}},{key:"setIconPickerColor",value:function(e){this._els.iconColorpicker.color=e}},{key:"changeStandbyMode",value:function(){this.clearIconType(),this.actions.cancelAddIcon()}},{key:"_changeColorHandler",value:function(e){e=e||"transparent",this.actions.changeColor(e)}},{key:"_addIconHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=t.getAttribute("data-icontype"),i=this._els.iconColorpicker.color;this.actions.discardSelection(),this.actions.changeSelectableAll(!1),this._els.addIconButton.classList.remove(this.iconType),this._els.addIconButton.classList.add(n),this.iconType===n?this.changeStandbyMode():(this.actions.addIcon(n,i),this.iconType=n)}}},{key:"_registerIconHandler",value:function(e){var t=void 0;l.isSupportFileApi||alert("This browser does not support file-api");var n=e.target.files[0];n&&(t=URL.createObjectURL(n),this.actions.registerCustomIcon(t,n))}}]),t}(s.default);t.default=h},
2"./src/js/ui/locale/locale.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._locale=t}return i(e,[{key:"localize",value:function(e){return this._locale[e]||e}}]),e}();t.default=r},
2"./src/js/ui/mask.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=a(n("./src/js/ui/submenuBase.js")),o=a(n("./src/js/ui/template/submenu/mask.js")),s=n("./src/js/util.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,n){var i=n.locale,r=n.makeSvgIcon,s=n.menuBarPosition,a=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"mask",makeSvgIcon:r,menuBarPosition:s,templateHtml:o.default,usageStatistics:a}));return l._els={applyButton:l.selector(".tie-mask-apply"),maskImageButton:l.selector(".tie-mask-image-file")},l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),(0,s.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._loadMaskFile.bind(this),n=this._applyMask.bind(this);this.eventHandler={loadMaskFile:t,applyMask:n},this.actions=e,this._els.maskImageButton.addEventListener("change",t),this._els.applyButton.addEventListener("click",n)}},{key:"_removeEvent",value:function(){this._els.maskImageButton.removeEventListener("change",this.eventHandler.loadMaskFile),this._els.applyButton.removeEventListener("click",this.eventHandler.applyMask)}},{key:"_applyMask",value:function(){this.actions.applyFilter(),this._els.applyButton.classList.remove("active")}},{key:"_loadMaskFile",value:function(e){var t=void 0;(0,s.isSupportFileApi)()||alert("This browser does not support file-api");var n=e.target.files[0];n&&(t=URL.createObjectURL(n),this.actions.loadImageFromURL(t,n),this._els.applyButton.classList.add("active"))}}]),t}(r.default);t.default=l},
2"./src/js/ui/panelMenu.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(t,n){var i=n.name;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=i,this.items=[],this.panelElement=this._makePanelElement(),this.listElement=this._makeListElement(),this.panelElement.appendChild(this.listElement),t.appendChild(this.panelElement)}return i(e,[{key:"_makePanelElement",value:function(){var e=document.createElement("div");return e.className="tie-panel-"+this.name,e}},{key:"_makeListElement",value:function(){var e=document.createElement("ol");return e.className=this.name+"-list",e}},{key:"makeListItemElement",value:function(e){var t=document.createElement("li");return t.innerHTML=e,t.className=this.name+"-item",t.setAttribute("data-index",this.items.length),t}},{key:"pushListItemElement",value:function(e){this.listElement.appendChild(e),this.listElement.scrollTop+=e.offsetHeight,this.items.push(e)}},{key:"deleteListItemElement",value:function(e,t){for(var n=this.items,i=e;i<t;i+=1)this.listElement.removeChild(n[i]);n.splice(e,t-e+1)}},{key:"getListLength",value:function(){return this.items.length}},{key:"addClass",value:function(e,t){this.items[e]&&this.items[e].classList.add(t)}},{key:"removeClass",value:function(e,t){this.items[e]&&this.items[e].classList.remove(t)}},{key:"toggleClass",value:function(e,t){this.items[e]&&this.items[e].classList.toggle(t)}}]),e}();t.default=r},
2"./src/js/ui/resize.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=c(n("./src/js/ui/submenuBase.js")),o=c(n("./src/js/ui/template/submenu/resize.js")),s=n("./src/js/util.js"),a=c(n("./src/js/ui/tools/range.js")),l=n("./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e,n){var i=n.locale,r=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"resize",makeSvgIcon:r,menuBarPosition:s,templateHtml:o.default,usageStatistics:c}));return u.status="active",u._lockState=!1,u._originalDimensions=null,u._els={widthRange:new a.default({slider:u.selector(".tie-width-range"),input:u.selector(".tie-width-range-value")},l.defaultResizePixelValues),heightRange:new a.default({slider:u.selector(".tie-height-range"),input:u.selector(".tie-height-range-value")},l.defaultResizePixelValues),lockAspectRatio:u.selector(".tie-lock-aspect-ratio"),apply:u.selector(".tie-resize-button .apply"),cancel:u.selector(".tie-resize-button .cancel")},u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"changeStartMode",value:function(){this.actions.modeChange("resize");var e=this.actions.getCurrentDimensions();this._originalDimensions=e,this.setWidthValue(e.width),this.setHeightValue(e.height)}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this.actions.reset(!0)}},{key:"setLimit",value:function(e){this._els.widthRange.min=this.calcMinValue(e.minWidth),this._els.heightRange.min=this.calcMinValue(e.minHeight),this._els.widthRange.max=this.calcMaxValue(e.maxWidth),this._els.heightRange.max=this.calcMaxValue(e.maxHeight)}},{key:"calcMaxValue",value:function(e){return e<=0&&(e=l.defaultResizePixelValues.max),e}},{key:"calcMinValue",value:function(e){return e<=0&&(e=l.defaultResizePixelValues.min),e}},{key:"setWidthValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._els.widthRange.value=e,t&&this._els.widthRange.trigger("change")}},{key:"setHeightValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._els.heightRange.value=e,t&&this._els.heightRange.trigger("change")}},{key:"destroy",value:function(){this._removeEvent(),(0,s.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){this._els.widthRange.on("change",this._changeWidthRangeHandler.bind(this)),this._els.heightRange.on("change",this._changeHeightRangeHandler.bind(this)),this._els.lockAspectRatio.addEventListener("change",this._changeLockAspectRatio.bind(this));var t=this._applyEventHandler.bind(this),n=this._cancelEventHandler.bind(this);this.eventHandler={apply:t,cancel:n},this.actions=e,this._els.apply.addEventListener("click",t),this._els.cancel.addEventListener("click",n)}},{key:"_changeWidthRangeHandler",value:function(e){this.actions.preview("width",(0,s.toInteger)(e),this._lockState)}},{key:"_changeHeightRangeHandler",value:function(e){this.actions.preview("height",(0,s.toInteger)(e),this._lockState)}},{key:"_changeLockAspectRatio",value:function(e){this._lockState=e.target.checked,this.actions.lockAspectRatio(this._lockState,l.defaultResizePixelValues.min,l.defaultResizePixelValues.max)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel)}},{key:"_applyEventHandler",value:function(){this.actions.resize(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.reset(),this._els.cancel.classList.remove("active")}},{key:"changeApplyButtonStatus",value:function(e){e?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}}]),t}(r.default);t.default=u},
2"./src/js/ui/rotate.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=c(n("./src/js/ui/tools/range.js")),o=c(n("./src/js/ui/submenuBase.js")),s=c(n("./src/js/ui/template/submenu/rotate.js")),a=n("./src/js/util.js"),l=n("./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e,n){var i=n.locale,o=n.makeSvgIcon,a=n.menuBarPosition,c=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"rotate",makeSvgIcon:o,menuBarPosition:a,templateHtml:s.default,usageStatistics:c}));return u._value=0,u._els={rotateButton:u.selector(".tie-rotate-button"),rotateRange:new r.default({slider:u.selector(".tie-rotate-range"),input:u.selector(".tie-rotate-range-value")},l.defaultRotateRangeValues)},u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.rotateRange.destroy(),(0,a.assignmentForDestroy)(this)}},{key:"setRangeBarAngle",value:function(e,t){var n=t;"rotate"===e&&(n=parseInt(this._els.rotateRange.value,10)+t),this._setRangeBarRatio(n)}},{key:"_setRangeBarRatio",value:function(e){this._els.rotateRange.value=e}},{key:"addEvent",value:function(e){this.eventHandler.rotationAngleChanged=this._changeRotateForButton.bind(this),this.actions=e,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",this._changeRotateForRange.bind(this))}},{key:"_removeEvent",value:function(){this._els.rotateButton.removeEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.off()}},{key:"_changeRotateForRange",value:function(e,t){var n=(0,a.toInteger)(e);this.actions.setAngle(n,!t),this._value=n}},{key:"_changeRotateForButton",value:function(e){var t=e.target.closest(".tui-image-editor-button"),n=this._els.rotateRange.value;if(t){var i={clockwise:30,counterclockwise:-30}[this.getButtonType(t,["counterclockwise","clockwise"])],r=parseInt(n,10)+i;r>=-360&&r<=360&&this.actions.rotate(i)}}}]),t}(o.default);t.default=u},
2"./src/js/ui/shape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=h(n("tui-code-snippet")),o=h(n("./src/js/ui/tools/colorpicker.js")),s=h(n("./src/js/ui/tools/range.js")),a=h(n("./src/js/ui/submenuBase.js")),l=h(n("./src/js/ui/template/submenu/shape.js")),c=n("./src/js/util.js"),u=n("./src/js/consts.js");function h(e){return e&&e.__esModule?e:{default:e}}var d={stroke:"#ffbb3b",fill:"",strokeWidth:3},f=function(e){function t(e,n){var i=n.locale,r=n.makeSvgIcon,a=n.menuBarPosition,c=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var h=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"shape",makeSvgIcon:r,menuBarPosition:a,templateHtml:l.default,usageStatistics:c}));return h.type=null,h.options=d,h._els={shapeSelectButton:h.selector(".tie-shape-button"),shapeColorButton:h.selector(".tie-shape-color-button"),strokeRange:new s.default({slider:h.selector(".tie-stroke-range"),input:h.selector(".tie-stroke-range-value")},u.defaultShapeStrokeValues),fillColorpicker:new o.default(h.selector(".tie-color-fill"),"",h.toggleDirection,h.usageStatistics),strokeColorpicker:new o.default(h.selector(".tie-color-stroke"),"#ffbb3b",h.toggleDirection,h.usageStatistics)},h.colorPickerControls.push(h._els.fillColorpicker),h.colorPickerControls.push(h._els.strokeColorpicker),h.colorPickerInputBoxes=[],h.colorPickerInputBoxes.push(h._els.fillColorpicker.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),h.colorPickerInputBoxes.push(h._els.strokeColorpicker.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),h}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),(0,c.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this;this.eventHandler.shapeTypeSelected=this._changeShapeHandler.bind(this),this.actions=e,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",this._changeStrokeRangeHandler.bind(this)),this._els.fillColorpicker.on("change",this._changeFillColorHandler.bind(this)),this._els.strokeColorpicker.on("change",this._changeStrokeColorHandler.bind(this)),this._els.fillColorpicker.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.strokeColorpicker.on("changeShow",this.colorPickerChangeShow.bind(this)),r.default.forEachArray(this.colorPickerInputBoxes,(function(e){e.addEventListener(u.eventNames.FOCUS,t._onStartEditingInputBox.bind(t)),e.addEventListener(u.eventNames.BLUR,t._onStopEditingInputBox.bind(t))}),this)}},{key:"_removeEvent",value:function(){var e=this;this._els.shapeSelectButton.removeEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.off(),this._els.fillColorpicker.off(),this._els.strokeColorpicker.off(),r.default.forEachArray(this.colorPickerInputBoxes,(function(t){t.removeEventListener(u.eventNames.FOCUS,e._onStartEditingInputBox.bind(e)),t.removeEventListener(u.eventNames.BLUR,e._onStopEditingInputBox.bind(e))}),this)}},{key:"setShapeStatus",value:function(e){var t=e.strokeWidth,n=e.strokeColor,i=e.fillColor;this._els.strokeRange.value=t,this._els.strokeColorpicker.color=n,this._els.fillColorpicker.color=i,this.options.stroke=n,this.options.fill=i,this.options.strokeWidth=t,this.actions.setDrawingShape(this.type,{strokeWidth:t})}},{key:"changeStartMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.changeSelectableAll(!0),this._els.shapeSelectButton.classList.remove("circle"),this._els.shapeSelectButton.classList.remove("tri
2angle"),this._els.shapeSelectButton.classList.remove("rect")}},{key:"setMaxStrokeValue",value:function(e){var t=e;t<=0&&(t=u.defaultShapeStrokeValues.max),this._els.strokeRange.max=t}},{key:"setStrokeValue",value:function(e){this._els.strokeRange.value=e,this._els.strokeRange.trigger("change")}},{key:"getStrokeValue",value:function(){return this._els.strokeRange.value}},{key:"_changeShapeHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){this.actions.stopDrawingMode(),this.actions.discardSelection();var n=this.getButtonType(t,["circle","triangle","rect"]);if(this.type===n)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=n,e.currentTarget.classList.add(n),this.actions.changeSelectableAll(!1),this.actions.modeChange("shape")}}},{key:"_changeStrokeRangeHandler",value:function(e,t){this.options.strokeWidth=(0,c.toInteger)(e),this.actions.changeShape({strokeWidth:e},!t),this.actions.setDrawingShape(this.type,this.options)}},{key:"_changeFillColorHandler",value:function(e){e=e||"transparent",this.options.fill=e,this.actions.changeShape({fill:e})}},{key:"_changeStrokeColorHandler",value:function(e){e=e||"transparent",this.options.stroke=e,this.actions.changeShape({stroke:e})}}]),t}(a.default);t.default=f},
2"./src/js/ui/submenuBase.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n("tui-code-snippet"),o=n("./src/js/consts.js"),s=function(){function e(t,n){var i=n.locale,r=n.name,o=n.makeSvgIcon,s=n.menuBarPosition,a=n.templateHtml,l=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.subMenuElement=t,this.menuBarPosition=s,this.toggleDirection="top"===s?"down":"up",this.colorPickerControls=[],this.usageStatistics=l,this.eventHandler={},this._makeSubMenuElement({locale:i,name:r,makeSvgIcon:o,templateHtml:a})}return i(e,[{key:"selector",value:function(e){return this.subMenuElement.querySelector(e)}},{key:"colorPickerChangeShow",value:function(e){this.colorPickerControls.forEach((function(t){e!==t&&t.hide()}))}},{key:"getButtonType",value:function(e,t){return e.className.match(RegExp("("+t.join("|")+")"))[0]}},{key:"changeClass",value:function(e,t,n){e.classList.remove(t),e.classList.add(n)}},{key:"changeStandbyMode",value:function(){}},{key:"changeStartMode",value:function(){}},{key:"_makeSubMenuElement",value:function(e){var t=e.locale,n=e.name,i=e.iconStyle,r=e.makeSvgIcon,o=e.templateHtml,s=document.createElement("div");s.className="tui-image-editor-menu-"+n,s.innerHTML=o({locale:t,iconStyle:i,makeSvgIcon:r}),this.subMenuElement.appendChild(s)}},{key:"_onStartEditingInputBox",value:function(){this.fire(o.eventNames.INPUT_BOX_EDITING_STARTED)}},{key:"_onStopEditingInputBox",value:function(){this.fire(o.eventNames.INPUT_BOX_EDITING_STOPPED)}}]),e}();r.CustomEvents.mixin(s),t.default=s},
2"./src/js/ui/template/controls.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("./src/js/util.js");t.default=function(e){var t=e.locale,n=e.biImage,r=e.loadButtonStyle,o=e.downloadButtonStyle,s=e.menuBarPosition;return'\n    <ul class="tui-image-editor-help-menu '+(0,i.getHelpMenuBarPosition)(s)+'"></ul>\n    <div class="tui-image-editor-controls">\n        <div class="tui-image-editor-controls-logo">\n            <img src="'+n+'" />\n        </div>\n        <ul class="tui-image-editor-menu"></ul>\n\n        <div class="tui-image-editor-controls-buttons">\n            <div style="'+r+'">\n                '+t.localize("Load")+'\n                <input type="file" class="tui-image-editor-load-btn" />\n            </div>\n            <button class="tui-image-editor-download-btn" style="'+o+'">\n                '+t.localize("Download")+"\n            </button>\n        </div>\n    </div>\n"}},
2"./src/js/ui/template/mainContainer.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.biImage,i=e.commonStyle,r=e.headerStyle,o=e.loadButtonStyle,s=e.downloadButtonStyle,a=e.submenuStyle;return'\n    <div class="tui-image-editor-main-container" style="'+i+'">\n        <div class="tui-image-editor-header" style="'+r+'">\n            <div class="tui-image-editor-header-logo">\n                <img src="'+n+'" />\n            </div>\n            <div class="tui-image-editor-header-buttons">\n                <div style="'+o+'">\n                    '+t.localize("Load")+'\n                    <input type="file" class="tui-image-editor-load-btn" />\n                </div>\n                <button class="tui-image-editor-download-btn" style="'+s+'">\n                    '+t.localize("Download")+'\n                </button>\n            </div>\n        </div>\n        <div class="tui-image-editor-main">\n            <div class="tui-image-editor-submenu">\n                <div class="tui-image-editor-submenu-style" style="'+a+'"></div>\n            </div>\n            <div class="tui-image-editor-wrap">\n                <div class="tui-image-editor-size-wrap">\n                    <div class="tui-image-editor-align-wrap">\n                        <div class="tui-image-editor"></div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n'}},
2"./src/js/ui/template/style.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.subMenuLabelActive,n=e.subMenuLabelNormal,i=e.subMenuRangeTitle,r=e.submenuPartitionVertical,o=e.submenuPartitionHorizontal,s=e.submenuCheckbox,a=e.submenuRangePointer,l=e.submenuRangeValue,c=e.submenuColorpickerTitle,u=e.submenuColorpickerButton,h=e.submenuRangeBar,d=e.submenuRangeSubbar,f=e.submenuDisabledRangePointer,p=e.submenuDisabledRangeBar,g=e.submenuDisabledRangeSubbar,m=e.submenuIconSize,v=e.menuIconSize,y=e.biSize,_=e.menuIconStyle,b=e.submenuIconStyle;return'\n    .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n    .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label,\n    .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label,\n    .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label,\n    .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label,\n    .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label,\n    .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label,\n    .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label,\n    .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label,\n    .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n    .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n    .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n    .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n    .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n    .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n    .tie-crop-button .tui-image-editor-button.apply.active label,\n    .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n    .tie-resize-button .tui-image-editor-button.apply.active label,\n    .tie-resize-preset-button .tui-image-editor-button.preset.active label,\n    .tie-shape-button.rect .tui-image-editor-button.rect label,\n    .tie-shape-button.circle .tui-image-editor-button.circle label,\n    .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n    .tie-text-effect-button .tui-image-editor-button.active label,\n    .tie-text-align-button.tie-text-align-left .tui-image-editor-button.left label,\n    .tie-text-align-button.tie-text-align-center .tui-image-editor-button.center label,\n    .tie-text-align-button.tie-text-align-right .tui-image-editor-button.right label,\n    .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n    .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n    .tui-image-editor-container .tui-image-editor-checkbox label > span {\n        '+t+"\n    }\n    .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n    .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n    .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label >
2 span {\n        "+n+"\n    }\n    .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n        "+i+"\n    }\n    .tui-image-editor-container .tui-image-editor-partition > div {\n        "+r+"\n    }\n    .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n    .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n        "+o+"\n    }\n    .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n        "+s+"\n    }\n    .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n        border: 0;\n    }\n    .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n        "+a+"\n    }\n    .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n        "+h+"\n    }\n    .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n        "+d+"\n    }\n    .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n        "+f+"\n    }\n    .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n        "+g+"\n    }\n    .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n        "+p+"\n    }\n    .tui-image-editor-container .tui-image-editor-range-value {\n        "+l+"\n    }\n    .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n        "+c+"\n    }\n    .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n        "+u+"\n    }\n    .tui-image-editor-container .svg_ic-menu {\n        "+v+"\n    }\n    .tui-image-editor-container .svg_ic-submenu {\n        "+m+"\n    }\n    .tui-image-editor-container .tui-image-editor-controls-logo > img,\n    .tui-image-editor-container .tui-image-editor-header-logo > img {\n        "+y+"\n    }\n    .tui-image-editor-menu use.normal.use-default,\n    .tui-image-editor-help-menu use.normal.use-default {\n        fill-rule: evenodd;\n        fill: "+_.normal.color+";\n        stroke: "+_.normal.color+";\n    }\n    .tui-image-editor-menu use.active.use-default,\n    .tui-image-editor-help-menu use.active.use-default {\n        fill-rule: evenodd;\n        fill: "+_.active.color+";\n        stroke: "+_.active.color+";\n    }\n    .tui-image-editor-menu use.hover.use-default,\n    .tui-image-editor-help-menu use.hover.use-default {\n        fill-rule: evenodd;\n        fill: "+_.hover.color+";\n        stroke: "+_.hover.color+";\n    }\n    .tui-image-editor-menu use.disabled.use-default,\n    .tui-image-editor-help-menu use.disabled.use-default {\n        fill-rule: evenodd;\n        fill: "+_.disabled.color+";\n        stroke: "+_.disabled.color+";\n    }\n    .tui-image-editor-submenu use.normal.use-default {\n        fill-rule: evenodd;\n        fill: "+b.normal.color+";\n        stroke: "+b.normal.color+";\n    }\n    .tui-image-editor-submenu use.active.use-default {\n        fill-rule: evenodd;\n        fill: "+b.active.color+";\n        stroke: "+b.active.color+";\n    }\n"}},
2"./src/js/ui/template/submenu/crop.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tie-crop-preset-button">\n            <div class="tui-image-editor-button preset preset-none active">\n                <div>\n                    '+n(["normal","active"],"shape-rectangle",!0)+"\n                </div>\n                <label> "+t.localize("Custom")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-square">\n                <div>\n                    '+n(["normal","active"],"crop",!0)+"\n                </div>\n                <label> "+t.localize("Square")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-3-2">\n                <div>\n                    '+n(["normal","active"],"crop",!0)+"\n                </div>\n                <label> "+t.localize("3:2")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-4-3">\n                <div>\n                    '+n(["normal","active"],"crop",!0)+"\n                </div>\n                <label> "+t.localize("4:3")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-5-4">\n                <div>\n                    '+n(["normal","active"],"crop",!0)+"\n                </div>\n                <label> "+t.localize("5:4")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-7-5">\n                <div>\n                    '+n(["normal","active"],"crop",!0)+"\n                </div>\n                <label> "+t.localize("7:5")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-16-9">\n                <div>\n                    '+n(["normal","active"],"crop",!0)+"\n                </div>\n                <label> "+t.localize("16:9")+' </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition tui-image-editor-newline">\n        </li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tie-crop-button action">\n            <div class="tui-image-editor-button apply">\n                '+n(["normal","active"],"apply")+"\n                <label>\n                    "+t.localize("Apply")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button cancel">\n                '+n(["normal","active"],"cancel")+"\n                <label>\n                    "+t.localize("Cancel")+"\n                </label>\n            </div>\n        </li>\n    </ul>\n"}},
2"./src/js/ui/template/submenu/draw.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tie-draw-line-select-button">\n            <div class="tui-image-editor-button free">\n                <div>\n                    '+n(["normal","active"],"draw-free",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Free")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button line">\n                <div>\n                    '+n(["normal","active"],"draw-line",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Straight")+'\n                </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li>\n            <div class="tie-draw-color" title="'+t.localize("Color")+'"></div>\n        </li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n            <label class="range">'+t.localize("Range")+'</label>\n            <div class="tie-draw-range"></div>\n            <input class="tie-draw-range-value tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},
2"./src/js/ui/template/submenu/filter.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tui-image-editor-submenu-align">\n            <div class="tui-image-editor-checkbox-wrap fixed-width">\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-grayscale">\n                        <span>'+t.localize("Grayscale")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-invert">\n                        <span>'+t.localize("Invert")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-sepia">\n                        <span>'+t.localize("Sepia")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-vintage">\n                        <span>'+t.localize("Sepia2")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-blur">\n                        <span>'+t.localize("Blur")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-sharpen">\n                        <span>'+t.localize("Sharpen")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-emboss">\n                        <span>'+t.localize("Emboss")+'</span>\n                    </label>\n                </div>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-submenu-align">\n            <div class="tui-image-editor-checkbox-group tui-image-editor-disabled" style="margin-bottom: 7px;">\n                <div class="tui-image-editor-checkbox-wrap">\n                    <div class="tui-image-editor-checkbox">\n                        <label>\n                            <input type="checkbox" class="tie-remove-white">\n                            <span>'+t.localize("Remove White")+'</span>\n                        </label>\n                    </div>\n                </div>\n                <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n                    <label>'+t.localize("Distance")+'</label>\n                    <div class="tie-removewhite-distance-range"></div>\n                </div>\n            </div>\n            <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-brightness">\n                        <span>'+t.localize("Brightness")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-range-wrap short">\n                    <div class="tie-brightness-range"></div>\n                </div>\n            </div>\n            <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-noise">\n                        <span>'+t.localize("Noise")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-range-wrap short">\n                    <div class="tie-noise-range"></div>\n                </div>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-submenu-align">\n            <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-pixelate">
2\n                        <span>'+t.localize("Pixelate")+'</span>\n                    </label>\n                </div>\n                <div class="tui-image-editor-range-wrap short">\n                    <div class="tie-pixelate-range"></div>\n                </div>\n            </div>\n            <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n                <div class="tui-image-editor-newline tui-image-editor-checkbox-wrap">\n                    <div class="tui-image-editor-checkbox">\n                        <label>\n                            <input type="checkbox" class="tie-color-filter">\n                            <span>'+t.localize("Color Filter")+'</span>\n                        </label>\n                    </div>\n                </div>\n                <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n                    <label>'+t.localize("Threshold")+'</label>\n                    <div class="tie-colorfilter-threshold-range"></div>\n                </div>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li>\n            <div class="filter-color-item">\n                <div class="tie-filter-tint-color" title="'+t.localize("Tint")+'"></div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-tint">\n                        <span></span>\n                    </label>\n                </div>\n            </div>\n            <div class="filter-color-item">\n                <div class="tie-filter-multiply-color" title="'+t.localize("Multiply")+'"></div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-multiply">\n                        <span></span>\n                    </label>\n                </div>\n            </div>\n            <div class="filter-color-item">\n                <div class="tie-filter-blend-color" title="'+t.localize("Blend")+'"></div>\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-blend">\n                        <span></span>\n                    </label>\n                </div>\n            </div>\n        </li>\n    </ul>\n'}},
2"./src/js/ui/template/submenu/flip.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tie-flip-button tui-image-editor-submenu-item">\n        <li>\n            <div class="tui-image-editor-button flipX">\n                <div>\n                    '+n(["normal","active"],"flip-x",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Flip X")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button flipY">\n                <div>\n                    '+n(["normal","active"],"flip-y",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Flip Y")+'\n                </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li>\n            <div class="tui-image-editor-button resetFlip">\n                <div>\n                    '+n(["normal","active"],"flip-reset",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Reset")+"\n                </label>\n            </div>\n        </li>\n    </ul>\n"}},
2"./src/js/ui/template/submenu/history.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon,i=e.name,r=e.detail;return'\n    <div class="tui-image-editor-history-item history">\n        <div class="history-item-icon">\n            '+n(["normal","active"],"history-"+i.toLowerCase(),!0)+"\n        </div>\n        <span>\n            "+t.localize(i)+"\n            "+(r?"("+t.localize(r)+")":"")+'\n        </span>\n        <div class="history-item-checkbox">\n            '+n(["normal"],"history-check",!0)+"\n        </div>\n    </div>\n"}},
2"./src/js/ui/template/submenu/icon.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tie-icon-add-button">\n            <div class="tui-image-editor-button" data-icontype="icon-arrow">\n                <div>\n                    '+n(["normal","active"],"icon-arrow",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Arrow")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button" data-icontype="icon-arrow-2">\n                <div>\n                    '+n(["normal","active"],"icon-arrow-2",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Arrow-2")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button" data-icontype="icon-arrow-3">\n                <div>\n                    '+n(["normal","active"],"icon-arrow-3",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Arrow-3")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button" data-icontype="icon-star">\n                <div>\n                    '+n(["normal","active"],"icon-star",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Star-1")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button" data-icontype="icon-star-2">\n                <div>\n                    '+n(["normal","active"],"icon-star-2",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Star-2")+'\n                </label>\n            </div>\n\n            <div class="tui-image-editor-button" data-icontype="icon-polygon">\n                <div>\n                    '+n(["normal","active"],"icon-polygon",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Polygon")+'\n                </label>\n            </div>\n\n            <div class="tui-image-editor-button" data-icontype="icon-location">\n                <div>\n                    '+n(["normal","active"],"icon-location",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Location")+'\n                </label>\n            </div>\n\n            <div class="tui-image-editor-button" data-icontype="icon-heart">\n                <div>\n                    '+n(["normal","active"],"icon-heart",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Heart")+'\n                </label>\n            </div>\n\n            <div class="tui-image-editor-button" data-icontype="icon-bubble">\n                <div>\n                    '+n(["normal","active"],"icon-bubble",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Bubble")+'\n                </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li class="tie-icon-add-button">\n            <div class="tui-image-editor-button" style="margin:0">\n                <div>\n                    <input type="file" accept="image/*" class="tie-icon-image-file">\n                    '+n(["normal","active"],"icon-load",!0)+"\n                </div>\n                <label>\n                    "+t.localize("Custom icon")+'\n                </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li>\n            <div class="tie-icon-color" title="'+t.localize("Color")+'"></div>\n        </li>\n    </ul>\n'}},
2"./src/js/ui/template/submenu/mask.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li>\n            <div class="tui-image-editor-button">\n                <div>\n                    <input type="file" accept="image/*" class="tie-mask-image-file">\n                    '+n(["normal","active"],"mask-load",!0)+"\n                </div>\n                <label> "+t.localize("Load Mask Image")+' </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tie-mask-apply tui-image-editor-newline apply" style="margin-top: 22px;margin-bottom: 5px">\n            <div class="tui-image-editor-button apply">\n                '+n(["normal","active"],"apply")+"\n                <label>\n                    "+t.localize("Apply")+"\n                </label>\n            </div>\n        </li>\n    </ul>\n"}},
2"./src/js/ui/template/submenu/resize.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tui-image-editor-submenu-align">\n            <div class="tui-image-editor-range-wrap tui-image-editor-newline">\n                <label class="range">'+t.localize("Width")+'&nbsp;</label>\n                <div class="tie-width-range"></div>\n                <input class="tie-width-range-value tui-image-editor-range-value" value="0" /> <label class="range">px</label>\n                <div class="tui-image-editor-partition tui-image-editor-newline"></div>\n                <label class="range">'+t.localize("Height")+'</label>\n                <div class="tie-height-range"></div>\n                <input class="tie-height-range-value tui-image-editor-range-value" value="0" /> <label class="range">px</label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-submenu-align">\n            <div class="tui-image-editor-checkbox-wrap">\n                <div class="tui-image-editor-checkbox">\n                    <label>\n                        <input type="checkbox" class="tie-lock-aspect-ratio">\n                        <span>'+t.localize("Lock Aspect Ratio")+'</span>\n                    </label>\n                </div>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n        <li class="tie-resize-button action">\n            <div class="tui-image-editor-button apply">\n                '+n(["normal","active"],"apply")+"\n                <label>\n                    "+t.localize("Apply")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button cancel">\n                '+n(["normal","active"],"cancel")+"\n                <label>\n                    "+t.localize("Cancel")+"\n                </label>\n            </div>\n        </li>\n    </ul>\n"}},
2"./src/js/ui/template/submenu/rotate.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tie-rotate-button">\n            <div class="tui-image-editor-button clockwise">\n                <div>\n                    '+n(["normal","active"],"rotate-clockwise",!0)+'\n                </div>\n                <label> 30 </label>\n            </div>\n            <div class="tui-image-editor-button counterclockwise">\n                <div>\n                    '+n(["normal","active"],"rotate-counterclockwise",!0)+'\n                </div>\n                <label> -30 </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n            <label class="range">'+t.localize("Range")+'</label>\n            <div class="tie-rotate-range"></div>\n            <input class="tie-rotate-range-value tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},
2"./src/js/ui/template/submenu/shape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tie-shape-button">\n            <div class="tui-image-editor-button rect">\n                <div>\n                    '+n(["normal","active"],"shape-rectangle",!0)+"\n                </div>\n                <label> "+t.localize("Rectangle")+' </label>\n            </div>\n            <div class="tui-image-editor-button circle">\n                <div>\n                    '+n(["normal","active"],"shape-circle",!0)+"\n                </div>\n                <label> "+t.localize("Circle")+' </label>\n            </div>\n            <div class="tui-image-editor-button triangle">\n                <div>\n                    '+n(["normal","active"],"shape-triangle",!0)+"\n                </div>\n                <label> "+t.localize("Triangle")+' </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li class="tie-shape-color-button">\n            <div class="tie-color-fill" title="'+t.localize("Fill")+'"></div>\n            <div class="tie-color-stroke" title="'+t.localize("Stroke")+'"></div>\n        </li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n            <label class="range">'+t.localize("Stroke")+'</label>\n            <div class="tie-stroke-range"></div>\n            <input class="tie-stroke-range-value tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},
2"./src/js/ui/template/submenu/text.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li class="tie-text-effect-button">\n            <div class="tui-image-editor-button bold">\n                <div>\n                    '+n(["normal","active"],"text-bold",!0)+"\n                </div>\n                <label> "+t.localize("Bold")+' </label>\n            </div>\n            <div class="tui-image-editor-button italic">\n                <div>\n                    '+n(["normal","active"],"text-italic",!0)+"\n                </div>\n                <label> "+t.localize("Italic")+' </label>\n            </div>\n            <div class="tui-image-editor-button underline">\n                <div>\n                    '+n(["normal","active"],"text-underline",!0)+"\n                </div>\n                <label> "+t.localize("Underline")+' </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li class="tie-text-align-button">\n            <div class="tui-image-editor-button left">\n                <div>\n                    '+n(["normal","active"],"text-align-left",!0)+"\n                </div>\n                <label> "+t.localize("Left")+' </label>\n            </div>\n            <div class="tui-image-editor-button center">\n                <div>\n                    '+n(["normal","active"],"text-align-center",!0)+"\n                </div>\n                <label> "+t.localize("Center")+' </label>\n            </div>\n            <div class="tui-image-editor-button right">\n                <div>\n                    '+n(["normal","active"],"text-align-right",!0)+"\n                </div>\n                <label> "+t.localize("Right")+' </label>\n            </div>\n        </li>\n        <li class="tui-image-editor-partition">\n            <div></div>\n        </li>\n        <li>\n            <div class="tie-text-color" title="'+t.localize("Color")+'"></div>\n        </li>\n        <li class="tui-image-editor-partition only-left-right">\n            <div></div>\n        </li>\n        <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n            <label class="range">'+t.localize("Text size")+'</label>\n            <div class="tie-text-range"></div>\n            <input class="tie-text-range-value tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},
2"./src/js/ui/text.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=u(n("./src/js/ui/tools/range.js")),o=u(n("./src/js/ui/tools/colorpicker.js")),s=u(n("./src/js/ui/submenuBase.js")),a=u(n("./src/js/ui/template/submenu/text.js")),l=n("./src/js/util.js"),c=n("./src/js/consts.js");function u(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(e,n){var i=n.locale,s=n.makeSvgIcon,l=n.menuBarPosition,u=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var h=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"text",makeSvgIcon:s,menuBarPosition:l,templateHtml:a.default,usageStatistics:u}));return h.effect={bold:!1,italic:!1,underline:!1},h.align="tie-text-align-left",h._els={textEffectButton:h.selector(".tie-text-effect-button"),textAlignButton:h.selector(".tie-text-align-button"),textColorpicker:new o.default(h.selector(".tie-text-color"),"#ffbb3b",h.toggleDirection,h.usageStatistics),textRange:new r.default({slider:h.selector(".tie-text-range"),input:h.selector(".tie-text-range-value")},c.defaultTextRangeValues)},h.colorPickerInputBox=h._els.textColorpicker.colorpickerElement.querySelector(c.selectorNames.COLOR_PICKER_INPUT_BOX),h}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),(0,l.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._setTextEffectHandler.bind(this),n=this._setTextAlignHandler.bind(this);this.eventHandler={setTextEffect:t,setTextAlign:n},this.actions=e,this._els.textEffectButton.addEventListener("click",t),this._els.textAlignButton.addEventListener("click",n),this._els.textRange.on("change",this._changeTextRnageHandler.bind(this)),this._els.textColorpicker.on("change",this._changeColorHandler.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"_removeEvent",value:function(){var e=this.eventHandler,t=e.setTextEffect,n=e.setTextAlign;this._els.textEffectButton.removeEventListener("click",t),this._els.textAlignButton.removeEventListener("click",n),this._els.textRange.off(),this._els.textColorpicker.off(),this.colorPickerInputBox.removeEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.removeEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStartMode",value:function(){this.actions.modeChange("text")}},{key:"setTextStyleStateOnAction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fill,n=e.fontSize,i=e.fontStyle,r=e.fontWeight,o=e.textDecoration,s=e.textAlign;this.textColor=t,this.fontSize=n,this.setEffectState("italic",i),this.setEffectState("bold",r),this.setEffectState("underline",o),this.setAlignState("tie-text-align-"+s)}},{key:"setEffectState",value:function(e,t){var n="italic"===t||"bold"===t||"underline"===t,i=this._els.textEffectButton.querySelector(".tui-image-editor-button."+e);this.effect[e]=n,i.classList[n?"add":"remove"]("active")}},{key:"setAlignState",value:function(e){var t=this._els.textAlignButton;t.classList.remove(this.align),t.classList.add(e),this.align=e}},{key:"_setTextEffectHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=t.className.match(/(bold|italic|underline)/)[0],i={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[n];this.effect[n]=!this.effect[n],t.classList.toggle("active"),this.actions.changeTextStyle(i)}}},{key:"_setTextAlignHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=this.getButtonType(t,["left","center","right"]),i="tie-text-align-"+n;e.currentTarget.classList.remove(this.align),this.align!==i&&e.currentTarget.classList.add(i),this.actions.changeTextStyle({textAlign:n}),this.align=i}}},{key:"_changeTextRnageHandler",value:function(e,t){this.actions.changeTextStyle({fontSize:e},!t)}},{key:"_changeColorHandler",value:function(e){e=e||"transparent",this.actions.changeTextStyle({fill:e})}},{key:"textColor",set:function(e){this._els.textColorpicker.color=e},get:function(){return this._els.textColorpicker.color}},{key:"fontSize",get:function(){return this._els.textRange.value},set:function(e){this._els.textRange.value=e}},{key:"fontStyle",get:function(){return this.effect.italic?"italic":"normal"}},{key:"fontWeight",get:function(){return this.effect.bold?"bold":"normal"}},{key:"underline",get:function(){return this.effect.underline}}]),t}(s.default);t.default=h},
2"./src/js/ui/theme/standard.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"common.bi.image":"https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png","common.bisize.width":"251px","common.bisize.height":"21px","common.backgroundImage":"none","common.backgroundColor":"#1e1e1e","common.border":"0px","header.backgroundImage":"none","header.backgroundColor":"transparent","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"'Noto Sans', sans-serif","loadButton.fontSize":"12px","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"'Noto Sans', sans-serif","downloadButton.fontSize":"12px","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#434343","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalLabel.color":"#8a8a8a","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"0px","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"}},
2"./src/js/ui/theme/theme.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n("tui-code-snippet"),o=c(n("./src/js/ui/template/style.js")),s=c(n("./src/js/ui/theme/standard.js")),a=c(n("./src/svg/default.svg")),l=n("./src/js/util.js");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.styles=this._changeToObject((0,r.extend)({},s.default,t)),(0,l.styleLoad)(this._styleMaker()),this._loadDefaultSvgIcon()}return i(e,[{key:"getStyle",value:function(e){var t=null,n=e.replace(/\..+$/,""),i=this.styles[e];switch(e){case"common.bi":t=this.styles[e].image;break;case"menu.icon":t={active:this.styles[n+".activeIcon"],normal:this.styles[n+".normalIcon"],hover:this.styles[n+".hoverIcon"],disabled:this.styles[n+".disabledIcon"]};break;case"submenu.icon":t={active:this.styles[n+".activeIcon"],normal:this.styles[n+".normalIcon"]};break;case"submenu.label":t={active:this._makeCssText(this.styles[n+".activeLabel"]),normal:this._makeCssText(this.styles[n+".normalLabel"])};break;case"submenu.partition":t={vertical:this._makeCssText((0,r.extend)({},i,{borderLeft:"1px solid "+i.color})),horizontal:this._makeCssText((0,r.extend)({},i,{borderBottom:"1px solid "+i.color}))};break;case"range.disabledPointer":case"range.disabledBar":case"range.disabledSubbar":case"range.pointer":case"range.bar":case"range.subbar":i.backgroundColor=i.color,t=this._makeCssText(i);break;default:t=this._makeCssText(i)}return t}},{key:"_styleMaker",value:function(){var e=this.getStyle("submenu.label"),t=this.getStyle("submenu.partition");return(0,o.default)({subMenuLabelActive:e.active,subMenuLabelNormal:e.normal,submenuPartitionVertical:t.vertical,submenuPartitionHorizontal:t.horizontal,biSize:this.getStyle("common.bisize"),subMenuRangeTitle:this.getStyle("range.title"),submenuRangePointer:this.getStyle("range.pointer"),submenuRangeBar:this.getStyle("range.bar"),submenuRangeSubbar:this.getStyle("range.subbar"),submenuDisabledRangePointer:this.getStyle("range.disabledPointer"),submenuDisabledRangeBar:this.getStyle("range.disabledBar"),submenuDisabledRangeSubbar:this.getStyle("range.disabledSubbar"),submenuRangeValue:this.getStyle("range.value"),submenuColorpickerTitle:this.getStyle("colorpicker.title"),submenuColorpickerButton:this.getStyle("colorpicker.button"),submenuCheckbox:this.getStyle("checkbox"),menuIconSize:this.getStyle("menu.iconSize"),submenuIconSize:this.getStyle("submenu.iconSize"),menuIconStyle:this.getStyle("menu.icon"),submenuIconStyle:this.getStyle("submenu.icon")})}},{key:"_changeToObject",value:function(e){var t={};return(0,r.forEach)(e,(function(e,n){var i=n.match(/^(.+)\.([a-z]+)$/i),r=i[1],o=i[2];t[r]||(t[r]={}),t[r][o]=e})),t}},{key:"_makeCssText",value:function(e){var t=this,n=[];return(0,r.forEach)(e,(function(e,i){["backgroundImage"].indexOf(i)>-1&&"none"!==e&&(e="url("+e+")"),n.push(t._toUnderScore(i)+": "+e)})),n.join(";")}},{key:"_toUnderScore",value:function(e){return e.replace(/([A-Z])/g,(function(e,t){return"-"+t.toLowerCase()}))}},{key:"_loadDefaultSvgIcon",value:function(){if(!document.getElementById("tui-image-editor-svg-default-icons")){var e=(new DOMParser).parseFromString(a.default,"text/xml");document.body.appendChild(e.documentElement)}}},{key:"_makeIconClassName",value:function(e,t){var n=(t?this.get
2Style("submenu.icon"):this.getStyle("menu.icon"))[e],i=n.path,r=n.name;return i&&r?e:e+" use-default"}},{key:"_makeSvgIconPrefix",value:function(e,t){var n=(t?this.getStyle("submenu.icon"):this.getStyle("menu.icon"))[e],i=n.path,r=n.name;return i&&r?i+"#"+r+"-":"#"}},{key:"_makeSvgItem",value:function(e,t,n){var i=this;return(0,r.map)(e,(function(e){return'<use xlink:href="'+i._makeSvgIconPrefix(e,n)+"ic-"+i._toUnderScore(t)+'" class="'+i._makeIconClassName(e,n)+'"/>'})).join("")}},{key:"makeMenSvgIconSet",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return'<svg class="svg_ic-'+(n?"submenu":"menu")+'">'+this._makeSvgItem(e,t,n)+"</svg>"}}]),e}();t.default=u},
2"./src/js/ui/tools/colorpicker.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n("tui-code-snippet")),o=s(n("tui-color-picker"));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#7e7e7e",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up",r=arguments[3];a(this,e),this.colorpickerElement=t,this.usageStatistics=r,this._show=!1,this._colorpickerElement=t,this._toggleDirection=i,this._makePickerButtonElement(n),this._makePickerLayerElement(t,t.getAttribute("title")),this._color=n,this.picker=o.default.create({container:this.pickerElement,preset:l,color:n,usageStatistics:this.usageStatistics}),this._addEvent()}return i(e,[{key:"destroy",value:function(){var e=this;this._removeEvent(),this.picker.destroy(),this.colorpickerElement.innerHTML="",r.default.forEach(this,(function(t,n){e[n]=null}))}},{key:"_changeColorElement",value:function(e){e?(this.colorElement.classList.remove("transparent"),this.colorElement.style.backgroundColor=e):(this.colorElement.style.backgroundColor="#fff",this.colorElement.classList.add("transparent"))}},{key:"_makePickerButtonElement",value:function(e){this.colorpickerElement.classList.add("tui-image-editor-button"),this.colorElement=document.createElement("div"),this.colorElement.className="color-picker-value",e?this.colorElement.style.backgroundColor=e:this.colorElement.classList.add("transparent")}},{key:"_makePickerLayerElement",value:function(e,t){var n=document.createElement("label"),i=document.createElement("div");this.pickerControl=document.createElement("div"),this.pickerControl.className="color-picker-control",this.pickerElement=document.createElement("div"),this.pickerElement.className="color-picker",n.innerHTML=t,i.className="triangle",this.pickerControl.appendChild(this.pickerElement),this.pickerControl.appendChild(i),e.appendChild(this.pickerControl),e.appendChild(this.colorElement),e.appendChild(n)}},{key:"_addEvent",value:function(){var e=this;this.picker.on("selectColor",(function(t){e._changeColorElement(t.color),e._color=t.color,e.fire("change",t.color)})),this.eventHandler={pickerToggle:this._pickerToggleEventHandler.bind(this),pickerHide:function(){return e.hide()}},this.colorpickerElement.addEventListener("click",this.eventHandler.pickerToggle),document.body.addEventListener("click",this.eventHandler.pickerHide)}},{key:"_removeEvent",value:function(){this.colorpickerElement.removeEventListener("click",this.eventHandler.pickerToggle),document.body.removeEventListener("click",this.eventHandler.pickerHide),this.picker.off()}},{key:"_pickerToggleEventHandler",value:function(e){var t=e.target,n=t&&this._isElementInColorPickerControl(t);(!n||n&&this._isPaletteButton(t))&&(this._show=!this._show,this.pickerControl.style.display=this._show?"block":"none",this._setPickerControlPosition(),this.fire("changeShow",this)),e.stopPropagation()}},{key:"_isPaletteButton",value:function(e){return"tui-colorpicker-palette-button"===e.className}},{key:"_isElementInColorPickerControl",value:function(e){for(var t=e;t!==document.body&&t;){if(t===this.pickerControl)return!0;t=t.parentNode}return!1}},{key:"hide",value:function(){this._show=!1,this.pickerControl.style.display="none"}},{key:"_setPickerControlPosition",value:function(){var e=this.pickerControl.style,t=this._colorpickerElement.clientWidth/2+2,n=this.pickerControl.offsetWidth/2-t,i=-1*(this.pickerControl.offsetHeight+10);"down"===this._toggleDirection&&(i=30),e.top=i+"px",e.left="-"+n+"px"}},{key:"color",get:function(){return this._color},set:function(e){this._color=e,this._changeColorElement(e)}}]),e}();r.default.CustomEvents.mixin(c),t.default=c},
2"./src/js/ui/tools/range.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n("tui-code-snippet"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/util.js"),l=n("./src/js/consts.js");function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var u=/(-?)([0-9]*)[^0-9]*([0-9]*)/g,h=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(this,e),this._value=n.value||0,this.rangeElement=t.slider,this.rangeInputElement=t.input,this._drawRangeElement(),this.rangeWidth=this._getRangeWidth(),this._min=n.min||0,this._max=n.max||100,this._useDecimal=n.useDecimal,this._absMax=-1*this._min+this._max,this.realTimeEvent=n.realTimeEvent||!1,this.eventHandler={startChangingSlide:this._startChangingSlide.bind(this),stopChangingSlide:this._stopChangingSlide.bind(this),changeSlide:this._changeSlide.bind(this),changeSlideFinally:this._changeSlideFinally.bind(this),changeInput:this._changeValueWithInput.bind(this,!1),changeInputFinally:this._changeValueWithInput.bind(this,!0),changeInputWithArrow:this._changeValueWithInputKeyEvent.bind(this)},this._addClickEvent(),this._addDragEvent(),this._addInputEvent(),this.value=n.value,this.trigger("change")}return r(e,[{key:"destroy",value:function(){var e=this;this._removeClickEvent(),this._removeDragEvent(),this._removeInputEvent(),this.rangeElement.innerHTML="",s.default.forEach(this,(function(t,n){e[n]=null}))}},{key:"trigger",value:function(e){this.fire(e,this._value)}},{key:"_getRangeWidth",value:function(){var e=function(e){return(0,a.toInteger)(window.getComputedStyle(e,null).width)};return e(this.rangeElement)-e(this.pointer)}},{key:"_drawRangeElement",value:function(){this.rangeElement.classList.add("tui-image-editor-range"),this.bar=document.createElement("div"),this.bar.className="tui-image-editor-virtual-range-bar",this.subbar=document.createElement("div"),this.subbar.className="tui-image-editor-virtual-range-subbar",this.pointer=document.createElement("div"),this.pointer.className="tui-image-editor-virtual-range-pointer",this.bar.appendChild(this.subbar),this.bar.appendChild(this.pointer),this.rangeElement.appendChild(this.bar)}},{key:"_addInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.addEventListener("keyup",this.eventHandler.changeInput),this.rangeInputElement.addEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_removeInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.removeEventListener("keyup",this.eventHandler.changeInput),this.rangeInputElement.removeEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_changeValueWithInputKeyEvent",value:function(e){var t=e.keyCode,n=e.target;if(!([l.keyCodes.ARROW_UP,l.keyCodes.ARROW_DOWN].indexOf(t)<0)){var i=Number(n.value);if(!((i=this._valueUpDownForKeyEvent(i,t))<this._min||i>this._max)){var r=(0,a.clamp)(i,this._min,this.max);this.value=r,this.fire("change",r,!1)}}}},{key:"_valueUpDownForKeyEvent",value:function(e,t){var n=this._useDecimal?.1:1;return t===l.keyCodes.ARROW_UP?e+=n:t===l.keyCodes.ARROW_DOWN&&(e-=n),e}},{key:"_changeValueWithInput",value:function(e,t){var n=t.keyCode,i=t.target;if(!([l.keyCodes.ARROW_UP,l.keyCodes.ARROW_DOWN].indexOf(n)>=0)){var r=this._filterForInputText(i.value),o=!r||isNaN(r);if(i.value=r,!o){var s=this._useDecimal?Number(r):(0,a.toInteger)(r);s=(0,a.clamp)(s,this._min,this.max),this.value=s,this.fire("change",s,e)}}}},{key:"_addClickEvent",value:function(){this.rangeElement.addEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_removeClickEvent",value:function(){this.rangeElement.removeEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_addDragEvent",value:function(){this.pointer.addEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_removeDragEvent",value:function(){this.pointer.removeEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_changeSlide",value:function(e){var t=e.screenX-this.firstPosition,n=this.firstLeft+t;n=(n=n>this.rangeWidth?this.rangeWidth:n)<0?0:n,this.pointer.style.left=n+"px",this.subbar.style.right=this.rangeWidth-n+"px";var i=n/this.rangeWidth,r=this._absMax*i+this._min,o=this._useDecimal?r:(0,a.toInteger)(r);this.value!==o&&(this.value=o,this.realTimeEvent&&this.fire("change",this._value,!1))}},{key:"_changeSlideFinally",value:function(e){if(e.stopPropagation(),"tui-image-editor-range"===e.target.className){var t=e.offsetX/this.rangeWidth,n=this._absMax*t+this._min;this.pointer.style.left=t*this.rangeWidth+"px",this.subbar.style.right=(1-t)*this.rangeWidth+"px",this.value=n,this.fire("change",n,!0)}}},{key:"_startChangingSlide",value:function(e){this.firstPosition=e.screenX,this.firstLeft=(0,a.toInteger)(this.pointer.style.left)||0,document.addEventListener("mousemove",this.eventHandler.changeSlide),document.addEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_stopChangingSlide",value:function(){this.fire("change",this._value,!0),document.removeEventListener("mousemove",this.eventHandler.changeSlide),document.removeEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_filterForInputText",value:function(e){return e.replace(u,"$1$2$3")}},{key:"max",set:function(e){this._max=e,this._absMax=-1*this._min+this._max,this.value=this._value},get:function(){return this._max}},{key:"min",set:function(e){this._min=e,this.max=this._max},get:function(){return this._min}},{key:"value",get:function(){return this._value},set:function(e){var t=((e=this._useDecimal?e:(0,a.toInteger)(e))-this._min)*this.rangeWidth/this._absMax;this.rangeWidth<t&&(t=this.rangeWidth),this.pointer.style.left=t+"px",this.subbar.style.right=this.rangeWidth-t+"px",this._value=e,this.rangeInputElement&&(this.rangeInputElement.value=e)}}]),e}();s.default.CustomEvents.mixin(h),t.default=h},
2"./src/js/util.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Promise=void 0,t.clamp=function(e,t,n){if(t>n){var i=[n,t];t=i[0],n=i[1]}return u(t,c(e,n))},t.keyMirror=function(){for(var e={},t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return(0,r.forEach)(n,(function(t){e[t]=t})),e},t.makeStyleText=function(e){var t="";return(0,r.forEach)(e,(function(e,n){t+=n+": "+e+";"})),t},t.getProperties=function(e,t){var n={},i=t.length,r=0,o=void 0;for(r=0;r<i;r+=1)o=t[r],n[o]=e[o];return n},t.toInteger=function(e){return parseInt(e,10)},t.toCamelCase=function(e){return e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))},t.isSupportFileApi=function(){return!!(window.File&&window.FileList&&window.FileReader)},t.getRgb=function(e,t){4===e.length&&(e=""+e+e.slice(1,4));var n=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"rgba("+n+", "+i+", "+r+", "+(t||1)+")"},t.sendHostName=function(){h||(h=!0,(0,r.sendHostname)("image-editor","UA-129999381-1"))},t.styleLoad=function(e,t){var n=document.getElementsByTagName("head")[0],i=document.createElement("link"),r=encodeURIComponent(e);t&&(i.id=t),i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href","data:text/css;charset=UTF-8,"+r),n.appendChild(i)},t.getSelector=function(e){return function(t){return e.querySelector(t)}},t.base64ToBlob=function(e){var t="",n=void 0,i=void 0,r=void 0;n=e.replace(/data:(image\/.+);base64,/,(function(e,n){return t=n,""}));var o=(n=atob(n)).length;for(i=new Uint8Array(o),r=0;r<o;r+=1)i[r]=n.charCodeAt(r);return new Blob([i],{type:t})},t.fixFloatingPoint=function(e){return Number(e.toFixed(2))},t.assignmentForDestroy=function(e){(0,r.forEach)(e,(function(t,n){e[n]=null}))},t.cls=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."===e.charAt(0)?"."+l+t+e.slice(1):""+l+t+e},t.changeOrigin=function(e,t){var n=t.originX,i=t.originY,r=e.getPointByOrigin(n,i),o=r.x,s=r.y;e.set({left:o,top:s,originX:n,originY:i}),e.setCoords()},t.flipObject=function(e){var t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t},t.setCustomProperty=function(e,t){e.customProps=e.customProps||{},(0,r.extend)(e.customProps,t)},t.getCustomProperty=function(e,t){var n={};return(0,r.isString)(t)&&(t=[t]),(0,r.forEach)(t,(function(t){n[t]=e.customProps[t]})),n},t.capitalizeString=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.includes=d,t.getFillTypeFromOption=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.pick)(e,"type")||a.SHAPE_FILL_TYPE.COLOR},t.getFillTypeFromObject=function(e){var t=e.fill;return(void 0===t?{}:t).source?a.SHAPE_FILL_TYPE.FILTER:a.SHAPE_FILL_TYPE.COLOR},t.isShape=function(e){return(0,r.inArray)(e.get("type"),a.SHAPE_TYPE)>=0},t.getObjectType=function(e){if(d(a.SHAPE_TYPE,e))return"Shape";switch(e){case"i-text":return"Text";case"path":case"line":return"Draw";case"activeSelection":return"Group";default:return p(e)}},t.isSilentCommand=function(e){var t=a.commandNames.LOAD_IMAGE;return"string"==typeof e?t===e:t===e.name},t.getHistoryTitle=function(e){var t=a.commandNames.FLIP_IMAGE,n=a.commandNames.ROTATE_IMAGE,i=a.commandNames.ADD_TEXT,r=a.commandNames.APPLY_FILTER,o=a.commandNames.REMOVE_FILTER,s=a.commandNames.CHANGE_SHAPE,l=a.commandNames.CHANGE_ICON_COLOR,c=a.commandNames.CHANGE_TEXT_STYLE,u=a.commandNames.CLEAR_OBJECTS,h=a.commandNames.ADD_IMAGE_OBJECT,d=a.commandNames.REMOVE_OBJECT,p=a.commandNames.RESIZE_IMAGE,g=e.name,m=e.args,v=void 0;switch(g){case t:v={name:g,detail:"reset"===m[1]?m[1]:m[1].slice(4)};break;case n:v={name:g,detail:m[2]};break;case r:v={name:a.historyNames.APPLY_FILTER,detail:f(m[1],m[2])};break;case o:v={name:a.historyNames.REMOVE_FILTER,detail:"Remove"};break;case s:v={name:a.historyNames.CHANGE_SHAPE,detail:"Change"};break;case l:v={name:a.historyNames.CHANGE_ICON_COLOR,detail:"Change"};break;case c:v={name:a.historyNames.CHANGE_TEXT_STYLE,detail:"Change"};break;case d:v={name:a.historyNames.REMOVE_OBJECT,detail:m[2]};break;case u:v={name:a.historyNames.CLEAR_OBJECTS,detail:"All"};break;case h:v={name:a.historyNames.ADD_IMAGE_OBJECT,detail:"Add"};break;case i:v={name:a.historyNames.ADD_TEXT};break;case p:v={name:a.historyNames.RESIZE,detail:~~m[1].width+"x"+~~m[1].height};break;default:v={name:g}}return"mask"===m[1]&&(v={name:a.historyNames.LOAD_MASK_IMAGE,detail:"Apply"}),v},t.getHelpMenuBarPosition=function(e){return"top"===e?"bottom":"left"===e?"right":"right"===e?"left"
2:"top"},t.isEmptyCropzone=function(e){var t=e.left,n=e.top,i=e.width,r=e.height,o=a.emptyCropRectValues.LEFT,s=a.emptyCropRectValues.TOP,l=a.emptyCropRectValues.WIDTH,c=a.emptyCropRectValues.HEIGHT;return t===o&&n===s&&i===l&&r===c};var i,r=n("tui-code-snippet"),o=n("./node_modules/core-js-pure/features/promise/index.js"),s=(i=o)&&i.__esModule?i:{default:i},a=n("./src/js/consts.js"),l="tui-image-editor-",c=Math.min,u=Math.max,h=!1;function d(e,t){return e.indexOf(t)>=0}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.useAlpha,i=void 0===n||n,r=t.mode,o=a.filterType.VINTAGE,s=a.filterType.REMOVE_COLOR,l=a.filterType.BLEND_COLOR,c=a.filterType.SEPIA2,u=a.filterType.COLOR_FILTER,h=a.filterType.REMOVE_WHITE,d=a.filterType.BLEND,f=void 0;switch(e){case o:f=c;break;case s:f=i?u:h;break;case l:f="add"===r?d:r;break;default:f=e}return p(f)}function p(e){return e.replace(/[a-z]/,(function(e){return e.toUpperCase()}))}t.Promise=s.default},
2"./src/svg/default.svg":function(e,t){e.exports='<svg display="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs id="tui-image-editor-svg-default-icons"><symbol id="ic-apply" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" stroke="none" fill="none"></path><path fill="none" stroke="inherit" d="M4 12.011l5 5L20.011 6"></path></symbol><symbol id="ic-cancel" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path fill="none" stroke="inherit" d="M6 6l12 12M18 6L6 18"></path></symbol><symbol id="ic-crop" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" stroke="none" fill="none"></path><path stroke="none" fill="inherit" d="M4 0h1v20a1 1 0 0 1-1-1V0zM20 17h-1V5h1v12zm0 2v5h-1v-5h1z"></path><path stroke="none" fill="inherit" d="M5 19h19v1H5zM4.762 4v1H0V4h4.762zM7 4h12a1 1 0 0 1 1 1H7V4z"></path></symbol><symbol id="ic-resize" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" stroke="none" fill="none"></path><path stroke="none" fill="inherit" d="M 18.988281 3.011719 C 18.800781 2.824219 18.5 2.824219 18.3125 3.011719 L 11.621094 9.707031 C 11.429688 9.894531 11.429688 10.195312 11.621094 10.378906 C 11.710938 10.472656 11.835938 10.519531 11.957031 10.519531 C 12.078125 10.519531 12.203125 10.472656 12.292969 10.378906 L 18.988281 3.6875 C 19.175781 3.5 19.175781 3.199219 18.988281 3.011719 Z M 18.988281 3.011719 "></path><path stroke="none" fill="inherit" d="M 18.652344 2.867188 C 18.386719 2.867188 18.171875 3.082031 18.171875 3.347656 L 18.171875 9.085938 C 18.171875 9.347656 18.386719 9.5625 18.652344 9.5625 C 18.917969 9.5625 19.132812 9.347656 19.132812 9.085938 L 19.132812 3.347656 C 19.132812 3.082031 18.917969 2.867188 18.652344 2.867188 Z M 18.652344 2.867188 "></path><path stroke="none" fill="inherit" d="M 18.652344 2.867188 L 12.914062 2.867188 C 12.652344 2.867188 12.4375 3.082031 12.4375 3.347656 C 12.4375 3.613281 12.652344 3.828125 12.914062 3.828125 L 18.652344 3.828125 C 18.917969 3.828125 19.132812 3.613281 19.132812 3.347656 C 19.132812 3.082031 18.917969 2.867188 18.652344 2.867188 Z M 18.652344 2.867188 "></path><path stroke="none" fill="inherit" d="M 10.378906 11.621094 C 10.195312 11.433594 9.890625 11.433594 9.703125 11.621094 L 3.007812 18.316406 C 2.820312 18.5 2.820312 18.804688 3.007812 18.992188 C 3.105469 19.085938 3.226562 19.132812 3.347656 19.132812 C 3.46875 19.132812 3.589844 19.085938 3.683594 18.992188 L 10.378906 12.296875 C 10.566406 12.109375 10.566406 11.804688 10.378906 11.621094 Z M 10.378906 11.621094 "></path><path stroke="none" fill="inherit" d="M 3.347656 12.4375 C 3.082031 12.4375 2.867188 12.652344 2.867188 12.914062 L 2.867188 18.652344 C 2.867188 18.917969 3.082031 19.132812 3.347656 19.132812 C 3.613281 19.132812 3.828125 18.917969 3.828125 18.652344 L 3.828125 12.914062 C 3.828125 12.652344 3.613281 12.4375 3.347656 12.4375 Z M 3.347656 12.4375 "></path><path stroke="none" fill="inherit" d="M 9.085938 18.171875 L 3.347656 18.171875 C 3.082031 18.171875 2.867188 18.386719 2.867188 18.652344 C 2.867188 18.917969 3.082031 19.132812 3.347656 19.132812 L 9.085938 19.132812 C 9.347656 19.132812 9.5625 18.917969 9.5625 18.652344 C 9.5625 18.386719 9.347656 18.171875 9.085938 18.171875 Z M 9.085938 18.171875 "></path><path stroke="none" fill="inherit" d="M 20.5625 0 L 1.4375 0 C 0.644531 0 0 0.644531 0 1.4375 L 0 20.5625 C 0 21.355469 0.644531 22 1.4375 22 L 20.5625 22 C 21.355469 22 22 21.355469 22 20.5625 L 22 1.4375 C 22 0.644531 21.355469 0 20.5625 0 Z M 21.042969 20.5625 C 21.042969 20.828125 20.828125 21.042969 20.5625 21.042969 L 1.4375 21.042969 C 1.171875 21.042969 0.957031 20.828125 0.957031 20.5625 L 0.957031 1.4375 C 0.957031 1.171875 1.171875 0.957031 1.4375 0.957031 L 20.5625 0.957031 C 20.828125 0.957031 21.042969 1.171875 21.042969 1.4375 Z M 21.042969 20.5625 "></path></symbol><symbol id="ic-delete-all" viewBox="0 0 24 24"><path stroke="none" fill="inherit" d="M5 23H3a1 1 0 0 1-1-1V6h1v16h2v1zm16-10h-1V6h1v7zM9 13H8v-3h1v3zm3 0h-1v-3h1v3zm3 0h-1v-3h1v3zM14.794 3.794L13 2h-3L8.206 3.794A.963.963 0 0 1 8 2.5l.703-1.055A1 1 0 0 1 9.535 1h3.93a1 1 0 0 1 .832.445L15 2.5a.965.965 0 0 1-.206 1.294zM14.197 4H8.803h5.394z"></path><path stroke="none" fill="inherit" d="M0 3h23v1H0zM11.286 21H8.714L8 23H7l1-2.8V20h.071L9.5 16h1l1.429 4H12v.2l1 2.8h-1l-.714-2zm-.357-1L10 17.4 9.071 20h1.858zM20 22h3v1h-4v-7h1v6zm-5 0h3v1h-4v-7h1v6z"></path></symbol><symbol id="ic-delete" viewBox="0 0 24 24">
2<path stroke="none" fill="inherit" d="M3 6v16h17V6h1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6h1zM14.794 3.794L13 2h-3L8.206 3.794A.963.963 0 0 1 8 2.5l.703-1.055A1 1 0 0 1 9.535 1h3.93a1 1 0 0 1 .832.445L15 2.5a.965.965 0 0 1-.206 1.294zM14.197 4H8.803h5.394z"></path><path stroke="none" fill="inherit" d="M0 3h23v1H0zM8 10h1v6H8v-6zm3 0h1v6h-1v-6zm3 0h1v6h-1v-6z"></path></symbol><symbol id="ic-draw-free" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M2.5 20.929C2.594 10.976 4.323 6 7.686 6c5.872 0 2.524 19 7.697 19s1.89-14.929 6.414-14.929 1.357 10.858 5.13 10.858c1.802 0 2.657-2.262 2.566-6.786"></path></symbol><symbol id="ic-draw-line" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M2 15.5h28"></path></symbol><symbol id="ic-draw" viewBox="0 0 24 24"><path fill="none" stroke="inherit" d="M2.5 21.5H5c.245 0 .48-.058.691-.168l.124-.065.14.01c.429.028.85-.127 1.16-.437L22.55 5.405a.5.5 0 0 0 0-.707l-3.246-3.245a.5.5 0 0 0-.707 0L3.162 16.888a1.495 1.495 0 0 0-.437 1.155l.01.14-.065.123c-.111.212-.17.448-.17.694v2.5z"></path><path stroke="none" fill="inherit" d="M16.414 3.707l3.89 3.89-.708.706-3.889-3.889z"></path></symbol><symbol id="ic-filter" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path stroke="none" fill="inherit" d="M12 7v1H2V7h10zm6 0h4v1h-4V7zM12 16v1h10v-1H12zm-6 0H2v1h4v-1z"></path><path stroke="none" fill="inherit" d="M8.5 20a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7zm0-1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM15.5 11a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7zm0-1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"></path></symbol><symbol id="ic-flip-reset" viewBox="0 0 31 32"><path fill="none" stroke="none" d="M31 0H0v32h31z"></path><path stroke="none" fill="inherit" d="M28 16a8 8 0 0 1-8 8H3v-1h1v-7H3a8 8 0 0 1 8-8h17v1h-1v7h1zM11 9a7 7 0 0 0-7 7v7h16a7 7 0 0 0 7-7V9H11z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M24 5l3.5 3.5L24 12M7 20l-3.5 3.5L7 27"></path></symbol><symbol id="ic-flip-x" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M32 32H0V0h32z"></path><path stroke="none" fill="inherit" d="M17 32h-1V0h1zM27.167 11l.5 3h-1.03l-.546-3h1.076zm-.5-3h-1.122L25 5h-5V4h5.153a1 1 0 0 1 .986.836L26.667 8zm1.5 9l.5 3h-.94l-.545-3h.985zm1 6l.639 3.836A1 1 0 0 1 28.819 28H26v-1h3l-.726-4h.894zM23 28h-3v-1h3v1zM13 4v1H7L3 27h10v1H3.18a1 1 0 0 1-.986-1.164l3.666-22A1 1 0 0 1 6.847 4H13z"></path></symbol>
2<symbol id="ic-flip-y" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M0 0v32h32V0z"></path><path stroke="none" fill="inherit" d="M0 16v1h32v-1zM11 27.167l3 .5v-1.03l-3-.546v1.076zm-3-.5v-1.122L5 25v-5H4v5.153a1 1 0 0 0 .836.986L8 26.667zm9 1.5l3 .5v-.94l-3-.545v.985zm6 1l3.836.639A1 1 0 0 0 28 28.82V26h-1v3l-4-.727v.894zM28 23v-3h-1v3h1zM4 13h1V7l22-4v10h1V3.18a1 1 0 0 0-1.164-.986l-22 3.667A1 1 0 0 0 4 6.847V13z"></path></symbol><symbol id="ic-flip" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path fill="inherit" stroke="none" d="M11 0h1v24h-1zM19 21v-1h2v-2h1v2a1 1 0 0 1-1 1h-2zm-2 0h-3v-1h3v1zm5-5h-1v-3h1v3zm0-5h-1V8h1v3zm0-5h-1V4h-2V3h2a1 1 0 0 1 1 1v2zm-5-3v1h-3V3h3zM9 3v1H2v16h7v1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7z"></path></symbol><symbol id="ic-history" viewBox="0 0 24 24"><path fill="none" stroke="none" d="M0 0H24V24H0z" transform="translate(-740 -16) translate(547 8) translate(193 8)"></path><path fill="inherit" stroke="none" d="M12.5 1C18.299 1 23 5.701 23 11.5S18.299 22 12.5 22c-5.29 0-9.665-3.911-10.394-8.999h1.012C3.838 17.534 7.764 21 12.5 21c5.247 0 9.5-4.253 9.5-9.5S17.747 2 12.5 2C8.49 2 5.06 4.485 3.666 8H3h4v1H2V4h1v3.022C4.68 3.462 8.303 1 12.5 1zm.5 5l-.001 5.291 2.537 2.537-.708.708L12.292 12H12V6h1z" transform="translate(-740 -16) translate(547 8) translate(193 8)"></path></symbol><symbol id="ic-history-check" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path stroke="#555555" d="M4.5 -1L1.5 2 6.5 7" transform="translate(-60 -804) translate(60 804) translate(2 3) rotate(-90 4 3)"></path></g></symbol><symbol id="ic-history-crop" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-84 -804) translate(84 804)"></path><path fill="#434343" d="M2 0h1v10c-.552 0-1-.448-1-1V0zM10 9v3H9V9h1zM9 2h1v6H9V2z" transform="translate(-84 -804) translate(84 804)"></path><path fill="#434343" d="M2 9H12V10H2zM9 2c.513 0 .936.386.993.883L10 3H3V2h6zM2 3H0V2h2v1z" transform="translate(-84 -804) translate(84 804)"></path></g></symbol><symbol id="ic-history-resize" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path fill="#434343" d="M 9.492188 1.507812 C 9.398438 1.414062 9.25 1.414062 9.15625 1.507812 L 5.8125 4.851562 C 5.714844 4.945312 5.714844 5.097656 5.8125 5.1875 C 5.855469 5.234375 5.917969 5.257812 5.976562 5.257812 C 6.039062 5.257812 6.101562 5.234375 6.148438 5.1875 L 9.492188 1.84375 C 9.585938 1.75 9.585938 1.601562 9.492188 1.507812 Z M 9.492188 1.507812 "></path><path fill="#434343" d="M 9.328125 1.433594 C 9.195312 1.433594 9.085938 1.539062 9.085938 1.671875 L 9.085938 4.542969 C 9.085938 4.671875 9.195312 4.78125 9.328125 4.78125 C 9.460938 4.78125 9.566406 4.671875 9.566406 4.542969 L 9.566406 1.671875 C 9.566406 1.539062 9.460938 1.433594 9.328125 1.433594 Z M 9.328125 1.433594 "></path><path fill="#434343" d="M 9.328125 1.433594 L 6.457031 1.433594 C 6.328125 1.433594 6.21875 1.539062 6.21875 1.671875 C 6.21875 1.804688 6.328125 1.914062 6.457031 1.914062 L 9.328125 1.914062 C 9.460938 1.914062 9.566406 1.804688 9.566406 1.671875 C 9.566406 1.539062 9.460938 1.433594 9.328125 1.433594 Z M 9.328125 1.433594 "></path><path fill="#434343" d="M 5.1875 5.8125 C 5.097656 5.71875 4.945312 5.71875 4.851562 5.8125 L 1.503906 9.15625 C 1.410156 9.25 1.410156 9.402344 1.503906 9.496094 C 1.554688 9.542969 1.613281 9.566406 1.671875 9.566406 C 1.734375 9.566406 1.796875 9.542969 1.84375 9.496094 L 5.1875 6.148438 C 5.28125 6.054688 5.28125 5.902344 5.1875 5.8125 Z M 5.1875 5.8125 "></path><path fill="#434343" d="M 1.671875 6.21875 C 1.539062 6.21875 1.433594 6.328125 1.433594 6.457031 L 1.433594 9.328125 C 1.433594 9.460938 1.539062 9.566406 1.671875 9.566406 C 1.804688 9.566406 1.914062 9.460938 1.914062 9.328125 L 1.914062 6.457031 C 1.914062 6.328125 1.804688 6.21875 1.671875 6.21875 Z M 1.671875 6.21875 "></path><path fill="#434343" d="M 4.542969 9.085938 L 1.671875 9.085938 C 1.539062 9.085938 1.433594 9.195312 1.433594 9.328125 C 1.433594 9.460938 1.539062 9.566406 1.671875 9.566406 L 4.542969 9.566406 C 4.671875 9.566406 4.78125 9.460938 4.78125 9.328125 C 4.78125 9.195312 4.671875 9.085938 4.542969 9.085938 Z M 4.542969 9.085938 "></path><path fill="#434343" d="M 10.28125 0 L 0.71875 0 C 0.320312 0 0 0.320312 0 0.71875 L 0 10.28125 C 0 10.679688 0.320312 11 0.71875 11 L 10.28125 11 C 10.679688 11 11 10.679688 11 10.28125 L 11 0.71875 C 11 0.320312 10.679688 0 10.28125 0 Z M 10.523438 10.28125 C 10.523438 10.414062 10.414062 10.523438 10.28125 10.523438 L 0.71875 10.523438 C 0.585938 10.523438 0.476562 10.414062 0.476562 10.28125 L 0.476562 0.71875 C 0.476562 0.585938 0.585938 0.476562 0.71875 0.476562 L 10.28125 0.476562 C 10.414062 0.476562 10.523438 0.585938 10.523438 0.71875 Z M 10.523438 10.28125 "></path></g></symbol>
2<symbol id="ic-history-draw" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 1H12V13H0z" transform="translate(-156 -804) translate(156 803)"></path><path stroke="#434343" d="M9.622 1.584l1.835 1.658-8.31 8.407L.5 12.5V11l9.122-9.416z" transform="translate(-156 -804) translate(156 803)"></path><path fill="#434343" d="M7.628 3.753L10.378 3.753 10.378 4.253 7.628 4.253z" transform="translate(-156 -804) translate(156 803) rotate(45 9.003 4.003)"></path></g></symbol><symbol id="ic-history-filter" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-276 -804) translate(276 804)"></path><path fill="#434343" d="M12 3v1H9V3h3zM7 4H0V3h7v1z" transform="translate(-276 -804) translate(276 804)"></path><path fill="#434343" d="M12 8v1H9V8h3zM7 9H0V8h7v1z" transform="translate(-276 -804) translate(276 804) matrix(-1 0 0 1 12 0)"></path><path fill="#434343" d="M8 1c1.105 0 2 .895 2 2s-.895 2-2 2-2-.895-2-2 .895-2 2-2zm0 1c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1zM4 7c1.105 0 2 .895 2 2s-.895 2-2 2-2-.895-2-2 .895-2 2-2zm0 1c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z" transform="translate(-276 -804) translate(276 804)"></path></g></symbol><symbol id="ic-history-flip" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-108 -804) translate(108 804)"></path><path fill="#434343" d="M6 0L7 0 7 12 6 12zM11 10V9h1v1.5c0 .276-.224.5-.5.5H10v-1h1zM5 1v1H1v8h4v1H.5c-.276 0-.5-.224-.5-.5v-9c0-.276.224-.5.5-.5H5zm7 5v2h-1V6h1zm0-3v2h-1V3h1zM9 1v1H7V1h2zm2.5 0c.276 0 .5.224.5.5V2h-2V1h1.5zM9 11H7v-1h2v1z" transform="translate(-108 -804) translate(108 804)"></path></g></symbol><symbol id="ic-history-icon" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-204 -804) translate(204 804)"></path><path stroke="#434343" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.1" d="M6 9.568L2.601 11 2.975 7.467 0.5 4.82 4.13 4.068 6 1 7.87 4.068 11.5 4.82 9.025 7.467 9.399 11z" transform="translate(-204 -804) translate(204 804)"></path></g></symbol><symbol id="ic-history-mask" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><g transform="translate(-252 -804) translate(252 804)"><path d="M0 0H12V12H0z"></path><circle cx="6" cy="6" r="2.5" stroke="#444"></circle><path fill="#434343" d="M11.5 0c.276 0 .5.224.5.5v11c0 .276-.224.5-.5.5H.5c-.276 0-.5-.224-.5-.5V.5C0 .224.224 0 .5 0h11zM11 1H1v10h10V1z"></path></g></g></symbol><symbol id="ic-history-rotate" viewBox="0 0 24 24"><defs><path id="rfn4rylffa" d="M7 12c-.335 0-.663-.025-.983-.074C3.171 11.492 1 9.205 1 6.444c0-1.363.534-2.613 1.415-3.58"></path><mask id="6f9gn2dysb" width="6" height="9.136" x="0" y="0" maskUnits="objectBoundingBox"><use xlink:href="#rfn4rylffa" stroke="434343"></use></mask></defs><g fill="none" stroke="none" fill-rule="evenodd"><g transform="translate(-132 -804) translate(132 804)"><path d="M0 0.5H12V12.5H0z"></path><path fill="#434343" d="M6.5 1C9.538 1 12 3.462 12 6.5c0 2.37-1.5 4.39-3.6 5.163l-.407-.916C9.744 10.13 11 8.462 11 6.5 11 4.015 8.985 2 6.5 2c-.777 0-1.509.197-2.147.544L4 1.75l-.205-.04C4.594 1.258 5.517 1 6.5 1z"></path><use stroke="#434343" stroke-dasharray="2 1.25" stroke-width="1" mask="url(#6f9gn2dysb)" xlink:href="#rfn4rylffa"></use><path fill="#434343" d="M4.279 0L6 1.75 4.25 3.571 3.543 2.864 4.586 1.75 3.572 0.707z" transform="matrix(-1 0 0 1 9.543 0)"></path></g></g></symbol><symbol id="ic-history-shape" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-180 -804) translate(180 804)"></path><path fill="#434343" d="M11.5 4c.276 0 .5.224.5.5v7c0 .276-.224.5-.5.5h-7c-.276 0-.5-.224-.5-.5V8.8h1V11h6V5H8.341l-.568-1H11.5z" transform="translate(-180 -804) translate(180 804)"></path><path stroke="#434343" stroke-linecap="round" stroke-linejoin="round" d="M4.5 0.5L8.5 7.611 0.5 7.611z" transform="translate(-180 -804) translate(180 804)"></path></g></symbol><symbol id="ic-history-text" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-228 -804) translate(228 804)"></path><path fill="#434343" d="M2 1h8c.552 0 1 .448 1 1H1c0-.552.448-1 1-1z" transform="translate(-228 -804) translate(228 804)"></path><path fill="#434343" d="M1 1H2V3H1zM10 1H11V3H10zM5.5 1L6.5 1 6.5 11 5.5 11z" transform="translate(-228 -804) translate(228 804)"></path><path fill="#434343" d="M4 10H8V11H4z" transform="translate(-228 -804) translate(228 804)"></path></g></symbol><symbol id="ic-history-load" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-324 -805) translate(324 805)"></path><path fill="#434343" d="M5 0c.552 0 1 .448 1 1v1h5.5c.276 0 .5.224.5.5v8c0 .276-.224.5-.5.5H.5c-.276 0-.5-.224-.5-.5V1c0-.552.448-1 1-1h4zm0 1H1v9h10V3H5V1z" transform="translate(-324 -805) translate(324 805)"></path><path fill="#434343" d="M1 2L5 2 5 3 1 3z" transform="translate(-324 -805) translate(324 805)"></path></g></symbol><symbol id="ic-history-delete" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><g fill="#434343"><path d="M2 9h8V1h1v8.5c0 .276-.224.5-.5.5h-9c-.276 0-.5-.224-.5-.5V1h1v8zM0 0H12V1H0z" transform="translate(-300 -804) translate(300 804) translate(0 2)"></path><path d="M4 3H5V7H4zM7 3H8V7H7z" transform="translate(-300 -804) translate(300 804) translate(0 2)"></path><path d="M4 1h4V0h1v1.5c0 .276-.224.5-.5.5h-5c-.276 0-.5-.224-.5-.5V0h1v1z" transform="translate(-300 -804) translate(300 804) matrix(1 0 0 -1 0 2)"></path></g></g></symbol>
2<symbol id="ic-history-group" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><g transform="translate(-348 -804) translate(348 804)"><path d="M0 0H12V12H0z"></path><path fill="#434343" d="M1 9v2h1v1H.5c-.276 0-.5-.224-.5-.5V9h1zm11 1v1.5c0 .276-.224.5-.5.5H9v-1h2v-1h1zm-4 1v1H6v-1h2zm-3 0v1H3v-1h2zm7-4v2h-1V7h1zM1 6v2H0V6h1zm11-2v2h-1V4h1zM1 3v2H0V3h1zm10.5-3c.276 0 .5.224.5.5V3h-1V1h-1V0h1.5zM6 0v1H4V0h2zm3 0v1H7V0h2zM0 .5C0 .224.224 0 .5 0H3v1H1v1H0V.5zM9.5 4c.276 0 .5.224.5.5v5c0 .276-.224.5-.5.5h-5c-.276 0-.5-.224-.5-.5V8.355c.317.094.652.145 1 .145V9h4V5h-.5c0-.348-.05-.683-.145-1H9.5z"></path><circle cx="5" cy="5" r="2.5" stroke="#434343"></circle></g></g></symbol><symbol id="ic-icon-arrow-2" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M21.793 18.5H2.5v-5h18.935l-7.6-8h5.872l10.5 10.5-10.5 10.5h-5.914l8-8z"></path></symbol><symbol id="ic-icon-arrow-3" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M25.288 16.42L14.208 27.5H6.792l11.291-11.291L6.826 4.5h7.381l11.661 11.661-.58.258z"></path></symbol>
2<symbol id="ic-icon-arrow" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M2.5 11.5v9h18v5.293L30.293 16 20.5 6.207V11.5h-18z"></path></symbol><symbol id="ic-icon-bubble" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M22.207 24.5L16.5 30.207V24.5H8A6.5 6.5 0 0 1 1.5 18V9A6.5 6.5 0 0 1 8 2.5h16A6.5 6.5 0 0 1 30.5 9v9a6.5 6.5 0 0 1-6.5 6.5h-1.793z"></path></symbol><symbol id="ic-icon-heart" viewBox="0 0 32 32"><path fill-rule="nonzero" fill="none" stroke="inherit" d="M15.996 30.675l1.981-1.79c7.898-7.177 10.365-9.718 12.135-13.012.922-1.716 1.377-3.37 1.377-5.076 0-4.65-3.647-8.297-8.297-8.297-2.33 0-4.86 1.527-6.817 3.824l-.38.447-.381-.447C13.658 4.027 11.126 2.5 8.797 2.5 4.147 2.5.5 6.147.5 10.797c0 1.714.46 3.375 1.389 5.098 1.775 3.288 4.26 5.843 12.123 12.974l1.984 1.806z"></path></symbol><symbol id="ic-icon-load" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M17.314 18.867l1.951-2.53 4 5.184h-17l6.5-8.84 4.549 6.186z"></path><path stroke="none" fill="inherit" d="M18.01 4a11.798 11.798 0 0 0 0 1H3v24h24V14.986a8.738 8.738 0 0 0 1 0V29a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h15.01z"></path><path stroke="none" fill="inherit" d="M25 3h1v9h-1z"></path><path fill="none" stroke="inherit" d="M22 6l3.5-3.5L29 6"></path></symbol><symbol id="ic-icon-location" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M16 31.28C23.675 23.302 27.5 17.181 27.5 13c0-6.351-5.149-11.5-11.5-11.5S4.5 6.649 4.5 13c0 4.181 3.825 10.302 11.5 18.28z"></path><circle fill="none" stroke="inherit" cx="16" cy="13" r="4.5"></circle></symbol><symbol id="ic-icon-polygon" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M.576 16L8.29 29.5h15.42L31.424 16 23.71 2.5H8.29L.576 16z"></path></symbol><symbol id="ic-icon-star-2" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M19.446 31.592l2.265-3.272 3.946.25.636-3.94 3.665-1.505-1.12-3.832 2.655-2.962-2.656-2.962 1.12-3.832-3.664-1.505-.636-3.941-3.946.25-2.265-3.271L16 3.024 12.554 1.07 10.289 4.34l-3.946-.25-.636 3.941-3.665 1.505 1.12 3.832L.508 16.33l2.656 2.962-1.12 3.832 3.664 1.504.636 3.942 3.946-.25 2.265 3.27L16 29.638l3.446 1.955z"></path></symbol><symbol id="ic-icon-star" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M25.292 29.878l-1.775-10.346 7.517-7.327-10.388-1.51L16 1.282l-4.646 9.413-10.388 1.51 7.517 7.327-1.775 10.346L16 24.993l9.292 4.885z"></path></symbol><symbol id="ic-icon" viewBox="0 0 24 24"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M11.923 19.136L5.424 22l.715-7.065-4.731-5.296 6.94-1.503L11.923 2l3.574 6.136 6.94 1.503-4.731 5.296L18.42 22z"></path></symbol><symbol id="ic-mask-load" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M18.01 4a11.798 11.798 0 0 0 0 1H3v24h24V14.986a8.738 8.738 0 0 0 1 0V29a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h15.01zM15 23a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-1a5 5 0 1 0 0-10 5 5 0 0 0 0 10z"></path><path stroke="none" fill="inherit" d="M25 3h1v9h-1z"></path><path fill="none" stroke="inherit" d="M22 6l3.5-3.5L29 6"></path></symbol><symbol id="ic-mask" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4.5" stroke="inherit" fill="none"></circle><path stroke="none" fill="inherit" d="M2 1h20a1 1 0 0 1 1 1v20a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm0 1v20h20V2H2z"></path></symbol><symbol id="ic-redo" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" opacity=".5" fill="none" stroke="none"></path><path stroke="none" fill="inherit" d="M21 6H9a6 6 0 1 0 0 12h12v1H9A7 7 0 0 1 9 5h12v1z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M19 3l2.5 2.5L19 8"></path></symbol><symbol id="ic-reset" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" opacity=".5" stroke="none" fill="none"></path><path stroke="none" fill="inherit" d="M2 13v-1a7 7 0 0 1 7-7h13v1h-1v5h1v1a7 7 0 0 1-7 7H2v-1h1v-5H2zm7-7a6 6 0 0 0-6 6v6h12a6 6 0 0 0 6-6V6H9z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M19 3l2.5 2.5L19 8M5 16l-2.5 2.5L5 21"></path></symbol><symbol id="ic-rotate-clockwise" viewBox="0 0 32 32">
2<path stroke="none" fill="inherit" d="M29 17h-.924c0 6.627-5.373 12-12 12-6.628 0-12-5.373-12-12C4.076 10.398 9.407 5.041 16 5V4C8.82 4 3 9.82 3 17s5.82 13 13 13 13-5.82 13-13z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M16 1.5l4 3-4 3"></path><path stroke="none" fill="inherit" fill-rule="nonzero" d="M16 4h4v1h-4z"></path></symbol><symbol id="ic-rotate-counterclockwise" viewBox="0 0 32 32"><path stroke="none" d="M3 17h.924c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.602-5.331-11.96-11.924-12V4c7.18 0 13 5.82 13 13s-5.82 13-13 13S3 24.18 3 17z"></path><path stroke="none" fill="inherit" fill-rule="nonzero" d="M12 4h4v1h-4z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M16 1.5l-4 3 4 3"></path></symbol><symbol id="ic-rotate" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path fill="inherit" stroke="none" d="M8.349 22.254a10.002 10.002 0 0 1-2.778-1.719l.65-.76a9.002 9.002 0 0 0 2.495 1.548l-.367.931zm2.873.704l.078-.997a9 9 0 1 0-.557-17.852l-.14-.99A10.076 10.076 0 0 1 12.145 3c5.523 0 10 4.477 10 10s-4.477 10-10 10c-.312 0-.62-.014-.924-.042zm-7.556-4.655a9.942 9.942 0 0 1-1.253-2.996l.973-.234a8.948 8.948 0 0 0 1.124 2.693l-.844.537zm-1.502-5.91A9.949 9.949 0 0 1 2.88 9.23l.925.382a8.954 8.954 0 0 0-.644 2.844l-.998-.062zm2.21-5.686c.687-.848 1.51-1.58 2.436-2.166l.523.852a9.048 9.048 0 0 0-2.188 1.95l-.771-.636z"></path><path stroke="inherit" fill="none" stroke-linecap="square" d="M13 1l-2.5 2.5L13 6"></path></symbol><symbol id="ic-shape-circle" viewBox="0 0 32 32"><circle cx="16" cy="16" r="14.5" fill="none" stroke="inherit"></circle></symbol><symbol id="ic-shape-rectangle" viewBox="0 0 32 32"><rect width="27" height="27" x="2.5" y="2.5" fill="none" stroke="inherit" rx="1"></rect></symbol><symbol id="ic-shape-triangle" viewBox="0 0 32 32"><path fill="none" stroke-linecap="round" stroke-linejoin="round" d="M16 2.5l15.5 27H.5z"></path></symbol><symbol id="ic-shape" viewBox="0 0 24 24"><path stroke="none" fill="inherit" d="M14.706 8H21a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-4h1v4h12V9h-5.706l-.588-1z"></path><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M8.5 1.5l7.5 13H1z"></path></symbol><symbol id="ic-text-align-center" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M2 5h28v1H2zM8 12h16v1H8zM2 19h28v1H2zM8 26h16v1H8z"></path></symbol><symbol id="ic-text-align-left" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M2 5h28v1H2zM2 12h16v1H2zM2 19h28v1H2zM2 26h16v1H2z"></path></symbol><symbol id="ic-text-align-right" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M2 5h28v1H2zM14 12h16v1H14zM2 19h28v1H2zM14 26h16v1H14z"></path></symbol>
2<symbol id="ic-text-bold" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M7 2h2v2H7zM7 28h2v2H7z"></path><path fill="none" stroke="inherit" stroke-width="2" d="M9 3v12h9a6 6 0 1 0 0-12H9zM9 15v14h10a7 7 0 0 0 0-14H9z"></path></symbol><symbol id="ic-text-italic" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M15 2h5v1h-5zM11 29h5v1h-5zM17 3h1l-4 26h-1z"></path></symbol><symbol id="ic-text-underline" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M8 2v14a8 8 0 1 0 16 0V2h1v14a9 9 0 0 1-18 0V2h1zM3 29h26v1H3z"></path><path stroke="none" fill="inherit" d="M5 2h5v1H5zM22 2h5v1h-5z"></path></symbol><symbol id="ic-text" viewBox="0 0 24 24"><path stroke="none" fill="inherit" d="M4 3h15a1 1 0 0 1 1 1H3a1 1 0 0 1 1-1zM3 4h1v1H3zM19 4h1v1h-1z"></path><path stroke="none" fill="inherit" d="M11 3h1v18h-1z"></path><path stroke="none" fill="inherit" d="M10 20h3v1h-3z"></path></symbol><symbol id="ic-undo" viewBox="0 0 24 24"><path d="M24 0H0v24h24z" opacity=".5" fill="none" stroke="none"></path><path stroke="none" fill="inherit" d="M3 6h12a6 6 0 1 1 0 12H3v1h12a7 7 0 0 0 0-14H3v1z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M5 3L2.5 5.5 5 8"></path></symbol><symbol id="ic-zoom-in" viewBox="0 0 24 24"><g transform="translate(-229 -290) translate(229 290)"><circle cx="10.5" cy="10.5" r="9" stroke="inherit" fill="none"></circle><path fill="inherit" d="M18.828 15.828H19.828V22.828H18.828z" transform="rotate(-45 19.328 19.328)"></path><path fill="inherit" d="M7 10H14V11H7z"></path><path fill="inherit" d="M10 7H11V14H10z"></path></g></symbol><symbol id="ic-zoom-out" viewBox="0 0 24 24"><g transform="translate(-263 -290) translate(263 290)"><circle cx="10.5" cy="10.5" r="9" stroke="inherit" fill="none"></circle><path fill="inherit" d="M18.828 15.828H19.828V22.828H18.828z" transform="rotate(-45 19.328 19.328)"></path><path fill="inherit" d="M7 10H14V11H7z"></path></g></symbol><symbol id="ic-hand" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd" stroke-linejoin="round"><path fill="inherit" fill-rule="nonzero" d="M8.672 3.36c1.328 0 2.114.78 2.29 1.869l.014.101.023.006v1.042l-.638-.185c-.187-.055-.323-.211-.354-.399L10 5.713c0-.825-.42-1.353-1.328-1.353C7.695 4.36 7 5.041 7 5.713v7.941c0 .439-.524.665-.843.364l-1.868-1.761c-.595-.528-1.316-.617-1.918-.216-.522.348-.562 1.203-.18 1.8L7.738 22h11.013l.285-.518c1.247-2.326 1.897-4.259 1.96-5.785l.004-.239V8.035c0-.656-.5-1.17-1-1.17-.503 0-1 .456-1 1.17 0 .333-.32.573-.64.48L18 8.41V7.368l.086.026.042-.136c.279-.805.978-1.332 1.738-1.388L20 5.865c1.057 0 2 .967 2 2.17v7.423c0 1.929-.845 4.352-2.521 7.29-.09.156-.255.252-.435.252H7.474c-.166 0-.321-.082-.414-.219l-5.704-8.39c-.653-1.019-.584-2.486.46-3.182 1-.666 2.216-.516 3.148.31L6 12.495V5.713c0-1.18 1.058-2.263 2.49-2.348z" transform="translate(-297 -290) translate(297 290)"></path><path fill="inherit" fill-rule="nonzero" d="M12.5 1.5c1.325 0 2.41 1.032 2.495 2.336L15 4v7.22h-1V4c0-.828-.672-1.5-1.5-1.5-.78 0-1.42.595-1.493 1.356L11 4v7.22h-1V4c0-1.38 1.12-2.5 2.5-2.5z" transform="translate(-297 -290) translate(297 290)"></path><path fill="inherit" fill-rule="nonzero" d="M16.5 3.5c1.325 0 2.41 1.032 2.495 2.336L19 6v6.3h-1V6c0-.828-.672-1.5-1.5-1.5-.78 0-1.42.595-1.493 1.356L15 6v2.44h-1V6c0-1.38 1.12-2.5 2.5-2.5z" transform="translate(-297 -290) translate(297 290)"></path></g></symbol></defs></svg>'}
2,fabric:function(t,n){t.exports=e},"tui-code-snippet":function(e,n){e.exports=t},"tui-color-picker":function(e,t){e.exports=n}})},e.exports=i(n(32777).fabric,n(68738),n(51191))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.