PHP Classes

File: dist/tui-image-editor.min.js

Recommend this page to a friend!
  Classes of Mark de Leon  >  PHP Document Scanner using SANE or eSCL AirPrint  >  dist/tui-image-editor.min.js  >  Download  
File: dist/tui-image-editor.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Document Scanner using SANE or eSCL AirPrint
Web interface to scan printed documents
Author: By
Last change:
Date: 1 year ago
Size: 241,485 bytes
 

Contents

Class file image Download
/*!
 * tui-image-editor.min.js
 * @version 3.5.2
 * @author NHNEnt FE Development Lab <dl_javascript@nhnent.com>
 * @license MIT
 */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("tui-code-snippet"),require("fabric/dist/fabric.require"),require("tui-color-picker")):"function"==typeof define&&define.amd?define(["tui-code-snippet","fabric/dist/fabric.require","tui-color-picker"],t):"object"==typeof exports?exports.ImageEditor=t(require("tui-code-snippet"),require("fabric/dist/fabric.require"),require("tui-color-picker")):(e.tui=e.tui||{},e.tui.ImageEditor=t(e.tui&&e.tui.util,e.fabric,e.tui&&e.tui.colorPicker))}(this,function(e,t,n){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="dist",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}n(91);var o=n(88),a=i(o);n(149),n(45),n(46),n(47),n(48),n(49),n(50),n(51),n(52),n(53),n(54),n(55),n(56),n(57),n(58),n(59),n(60),n(61),n(63),n(62),e.exports=a.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(5),a=i(o);e.exports={componentNames:a.default.keyMirror("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE"),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"},eventNames:{OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",OBJECT_CREATED:"objectCreated",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"},drawingModes:a.default.keyMirror("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE"),keyCodes:{Z:90,Y:89,SHIFT:16,BACKSPACE:8,DEL:46},fObjectOptions:{SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},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."},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,10.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"},defaultRotateRangeValus:{realTimeEvent:!0,min:-360,max:360,value:0},defaultDrawRangeValus:{min:5,max:30,value:12},defaultShapeStrokeValus:{realTimeEvent:!1,min:2,max:300,value:3},defaultTextRangeValus:{realTimeEvent:!0,min:10,max:100,value:50},defaultFilterRangeValus:{tintOpacityRange:{min:0,max:1,value:.7},removewhiteThresholdRange:{min:0,max:255,value:60},removewhiteDistanceRange:{min:0,max:255,value:10},gradientTransparencyRange:{min:0,max:255,value:100},brightnessRange:{min:-255,max:255,value:100},noiseRange:{min:0,max:1e3,value:100},pixelateRange:{min:2,max:20,value:4},colorfilterThresholeRange:{min:0,max:255,value:45}}}},function(e,t,n){n(145),n(147),n(148),n(146),e.exports=n(16).Promise},function(t,n){t.exports=e},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=l[e];if(t){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return new s.default(t,i)}return null}function a(e){l[e.name]=e}var r=n(89),s=i(r),l={};e.exports={create:o,register:a}},function(e,t,n){"use strict";var i=n(3),o=Math.min,a=Math.max,r=!1;e.exports={clamp:function(e,t,n){var i=void 0;return t>n&&(i=t,t=n,n=i),a(t,o(e,n))},keyMirror:function(){for(var e={},t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,i.forEach)(n,function(t){e[t]=t}),e},makeStyleText:function(e){var t="";return(0,i.forEach)(e,function(e,n){t+=n+": "+e+";"}),t},getProperties:function(e,t){var n={},i=t.length,o=0,a=void 0;for(o=0;o<i;o+=1)a=t[o],n[a]=e[a];return n},toInteger:function(e){return parseInt(e,10)},toCamelCase:function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},isSupportFileApi:function(){return!!(window.File&&window.FileList&&window.FileReader)},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),o=parseInt(e.slice(5,7),16),a=t||1;return"rgba("+n+", "+i+", "+o+", "+a+")"},sendHostName:function(){r||(r=!0,(0,i.sendHostname)("image-editor","UA-129999381-1"))},styleLoad:function(e,t){var n=document.getElementsByTagName("head"),i=n[0],o=document.createElement("link"),a=encodeURIComponent(e);t&&(o.id=t),o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href","data:text/css;charset=UTF-8,"+a),i.appendChild(o)},getSelector:function(e){return function(t){return e.querySelector(t)}},base64ToBlob:function(e){var t=/data:(image\/.+);base64,/,n="",i=void 0,o=void 0,a=void 0;i=e.replace(t,function(e,t){return n=t,""}),i=atob(i);var r=i.length;for(o=new Uint8Array(r),a=0;a<r;a+=1)o[a]=i.charCodeAt(a);return new Blob([o],{type:n})}}},function(e,n){e.exports=t},function(e,t,n){var i=n(40)("wks"),o=n(43),a=n(9).Symbol,r="function"==typeof a,s=e.exports=function(e){return i[e]||(i[e]=r&&a[e]||(r?a:o)("Symbol."+e))};s.store=i},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}}(),o=function(){function e(t,i){n(this,e),this.name=t,this.graphics=i}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()}}]),e}();e.exports=o},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}}(),o=function(){function e(t,i){var o=i.locale,a=i.name,r=i.iconStyle,s=i.menuBarPosition,l=i.templateHtml;n(this,e),this.selector=function(e){return t.querySelector(e)},this.menuBarPosition=s,this.toggleDirection="top"===s?"down":"up",this.colorPickerControls=[],this._makeSubMenuElement(t,{locale:o,name:a,iconStyle:r,templateHtml:l})}return i(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,t){var n=t.locale,i=t.name,o=t.iconStyle,a=t.templateHtml,r=document.createElement("div");r.className="tui-image-editor-menu-"+i,r.innerHTML=a({locale:n,iconStyle:o}),e.appendChild(r)}}]),e}();t.default=o},function(e,t,n){var i=n(22);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var i=n(23),o=n(39);e.exports=n(17)?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=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(31),s=i(r),l=s.default.create,c=s.default.types,u=function(){function e(t){o(this,e),this.name=t}return a(e,[{key:"getName",value:function(){return this.name}},{key:"start",value:function(){throw new Error(l(c.UN_IMPLEMENTATION,"start"))}},{key:"stop",value:function(){throw new Error(l(c.UN_IMPLEMENTATION,"stop"))}}]),e}();e.exports=u},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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(3),s=i(r),l=n(150),c=i(l),u=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],d=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";o(this,e);var a=t.getAttribute("title");this._show=!1,this._colorpickerElement=t,this._toggleDirection=i,this._makePickerButtonElement(t,n),this._makePickerLayerElement(t,a),this._color=n,this.picker=c.default.create({container:this.pickerElement,preset:u,color:n}),this._addEvent(t)}return a(e,[{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,t){e.classList.add("tui-image-editor-button"),this.colorElement=document.createElement("div"),this.colorElement.className="color-picker-value",t?this.colorElement.style.backgroundColor=t: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(e){var t=this;this.picker.on("selectColor",function(e){t._changeColorElement(e.color),t._color=e.color,t.fire("change",e.color)}),e.addEventListener("click",function(e){var n=e.target,i=n&&t._isElementInColorPickerControl(n);(!i||i&&t._isPaletteButton(n))&&(t._show=!t._show,t.pickerControl.style.display=t._show?"block":"none",t._setPickerControlPosition(),t.fire("changeShow",t)),e.stopPropagation()}),document.body.addEventListener("click",function(){t.hide()})}},{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=(this.pickerControl.offsetHeight+10)*-1;"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}();s.default.CustomEvents.mixin(d),t.default=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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(3),s=i(r),l=n(5),c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this._value=n.value||0,this.rangeElement=t,this._drawRangeElement(),this.rangeWidth=(0,l.toInteger)(window.getComputedStyle(t,null).width)-12,this._min=n.min||0,this._max=n.max||100,this._absMax=this._min*-1+this._max,this.realTimeEvent=n.realTimeEvent||!1,this._addClickEvent(),this._addDragEvent(),this.value=n.value,this.trigger("change")}return a(e,[{key:"trigger",value:function(e){this.fire(e,this._value)}},{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:"_addClickEvent",value:function(){var e=this;this.rangeElement.addEventListener("click",function(t){if(t.stopPropagation(),"tui-image-editor-range"===t.target.className){var n=t.offsetX,i=n/e.rangeWidth,o=e._absMax*i+e._min;e.pointer.style.left=i*e.rangeWidth+"px",e.subbar.style.right=(1-i)*e.rangeWidth+"px",e._value=o,e.fire("change",o)}})}},{key:"_addDragEvent",value:function(){var e=this;this.pointer.addEventListener("mousedown",function(t){e.firstPosition=t.screenX,e.firstLeft=(0,l.toInteger)(e.pointer.style.left)||0,e.dragEventHandler={changeAngle:e._changeAngle.bind(e),stopChangingAngle:e._stopChangingAngle.bind(e)},document.addEventListener("mousemove",e.dragEventHandler.changeAngle),document.addEventListener("mouseup",e.dragEventHandler.stopChangingAngle)})}},{key:"_changeAngle",value:function(e){var t=e.screenX,n=t-this.firstPosition,i=this.firstLeft+n;i=i>this.rangeWidth?this.rangeWidth:i,i=i<0?0:i,this.pointer.style.left=i+"px",this.subbar.style.right=this.rangeWidth-i+"px";var o=i/this.rangeWidth,a=this._absMax*o+this._min;this._value=a,this.realTimeEvent&&this.fire("change",a)}},{key:"_stopChangingAngle",value:function(){this.fire("change",this._value),document.removeEventListener("mousemove",this.dragEventHandler.changeAngle),document.removeEventListener("mouseup",this.dragEventHandler.stopChangingAngle)}},{key:"max",set:function(e){this._max=e,this._absMax=this._min*-1+this._max,this.value=this._value},get:function(){return this._max}},{key:"value",get:function(){return this._value},set:function(e){var t=e-this._min,n=t*this.rangeWidth/this._absMax;this.rangeWidth<n&&(n=this.rangeWidth),this.pointer.style.left=n+"px",this.subbar.style.right=this.rangeWidth-n+"px",this._value=e}}]),e}();s.default.CustomEvents.mixin(c),t.default=c},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){e.exports=!n(35)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports={}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var i=n(24);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){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,o){return e.call(t,n,i,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var i=n(11),o=n(121),a=n(142),r=Object.defineProperty;t.f=n(17)?Object.defineProperty:function(e,t,n){if(i(e),t=a(t,!0),i(n),o)try{return r(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}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,n){var i=n(22),o=n(9).document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,n){var i=n(23).f,o=n(21),a=n(7)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,a)&&i(e,a,{configurable:!0,value:t})}},function(e,t,n){var i=n(40)("keys"),o=n(43);e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},function(e,t,n){var i=n(123),o=n(25);e.exports=function(e){return i(o(e))}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(3),a=i(o),r=n(5),s=(0,r.keyMirror)("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),l={UN_IMPLEMENTATION:"Should implement a method: ",NO_COMPONENT_NAME:"Should set a component name"},c={UN_IMPLEMENTATION:function(e){return l.UN_IMPLEMENTATION+e},NO_COMPONENT_NAME:function(){return l.NO_COMPONENT_NAME}};e.exports={types:a.default.extend({},s),create:function(e){e=e.toLowerCase();for(var t=c[e],n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.apply(void 0,i)}}},function(e,t,n){var i=n(19),o=n(7)("toStringTag"),a="Arguments"==i(function(){return arguments}()),r=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=r(t=Object(e),o))?n:a?i(t):"Object"==(s=i(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var i=n(9),o=n(16),a=n(20),r=n(12),s="prototype",l=function(e,t,n){var c,u,d,h=e&l.F,f=e&l.G,p=e&l.S,g=e&l.P,v=e&l.B,m=e&l.W,b=f?o:o[t]||(o[t]={}),y=b[s],_=f?i:p?i[t]:(i[t]||{})[s];f&&(n=t);for(c in n)u=!h&&_&&void 0!==_[c],u&&c in b||(d=u?_[c]:n[c],b[c]=f&&"function"!=typeof _[c]?n[c]:v&&u?a(d,i):m&&_[c]==d?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[s]=e[s],t}(d):g&&"function"==typeof d?a(Function.call,d):d,g&&((b.virtual||(b.virtual={}))[c]=d,e&l.R&&y&&!y[c]&&r(y,c,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){e.exports=n(9).document&&document.documentElement},function(e,t,n){"use strict";var i=n(38),o=n(34),a=n(136),r=n(12),s=n(21),l=n(18),c=n(126),u=n(27),d=n(132),h=n(7)("iterator"),f=!([].keys&&"next"in[].keys()),p="@@iterator",g="keys",v="values",m=function(){return this};e.exports=function(e,t,n,b,y,_,k){c(n,t,b);var w,x,E,C=function(e){if(!f&&e in j)return j[e];switch(e){case g:return function(){return new n(this,e)};case v:return function(){return new n(this,e)}}return function(){return new n(this,e)}},O=t+" Iterator",S=y==v,M=!1,j=e.prototype,T=j[h]||j[p]||y&&j[y],P=T||C(y),A=y?S?C("entries"):P:void 0,I="Array"==t?j.entries||T:T;if(I&&(E=d(I.call(new e)),E!==Object.prototype&&(u(E,O,!0),i||s(E,h)||r(E,h,m))),S&&T&&T.name!==v&&(M=!0,P=function(){return T.call(this)}),i&&!k||!f&&!M&&j[h]||r(j,h,P),l[t]=P,l[O]=m,y)if(w={values:S?P:C(v),keys:_?P:C(g),entries:A},k)for(x in w)x in j||a(j,x,w[x]);else o(o.P+o.F*(f||M),t,w);return w}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(9),o="__core-js_shared__",a=i[o]||(i[o]={});e.exports=function(e){return a[e]||(a[e]={})}},function(e,t,n){var i,o,a,r=n(20),s=n(122),l=n(36),c=n(26),u=n(9),d=u.process,h=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,g=0,v={},m="onreadystatechange",b=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},y=function(e){b.call(e.data)};h&&f||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return v[++g]=function(){s("function"==typeof e?e:Function(e),t)},i(g),g},f=function(e){delete v[e]},"process"==n(19)(d)?i=function(e){d.nextTick(r(b,e,1))}:p?(o=new p,a=o.port2,o.port1.onmessage=y,i=r(a.postMessage,a,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(i=function(e){u.postMessage(e+"","*")},u.addEventListener("message",y,!1)):i=m in c("script")?function(e){l.appendChild(c("script"))[m]=function(){l.removeChild(this),b.call(e)}}:function(e){setTimeout(r(b,e,1),0)}),e.exports={set:h,clear:f}},function(e,t,n){var i=n(29),o=Math.min;e.exports=function(e){return e>0?o(i(e),9007199254740991):0}},function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),a=n(5),r=i(a),s=n(86),l=i(s);t.default={getActions:function(){return{main:this._mainAction(),shape:this._shapeAction(),crop:this._cropAction(),flip:this._flipAction(),rotate:this._rotateAction(),text:this._textAction(),mask:this._maskAction(),draw:this._drawAction(),icon:this._iconAction(),filter:this._filterAction()}},_mainAction:function(){var e=this,t=function(){"crop"===e.ui.submenu&&(e.stopDrawingMode(),e.ui.changeMenu("crop"))};return(0,o.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()})},undo:function(){e.isEmptyUndoStack()||(t(),e.undo())},redo:function(){e.isEmptyRedoStack()||(t(),e.redo())},reset:function(){t(),e.loadImageFromURL(e.ui.initializeImgUrl,"resetImage").then(function(n){t(),e.ui.resizeEditor({imageSize:n}),e.clearUndoStack()})},delete:function(){e.ui.changeDeleteButtonEnabled(!1),t(),e.removeActiveObject(),e.activeObjectId=null},deleteAll:function(){t(),e.clearObjects(),e.ui.changeDeleteButtonEnabled(!1),e.ui.changeDeleteAllButtonEnabled(!1)},load:function(n){r.default.isSupportFileApi()||alert("This browser does not support file-api"),e.ui.initializeImgUrl=URL.createObjectURL(n),e.loadImageFromFile(n).then(function(n){t(),e.clearUndoStack(),e.ui.activeMenuEvent(),e.ui.resizeEditor({imageSize:n})}).catch(function(e){return Promise.reject(e)})},download:function(){var t=e.toDataURL(),n=e.getImageName(),i=void 0,o=void 0,a=void 0;r.default.isSupportFileApi()&&window.saveAs?(i=r.default.base64ToBlob(t),o=i.type.split("/")[1],n.split(".").pop()!==o&&(n+="."+o),saveAs(i,n)):(a=window.open(),a.document.body.innerHTML="<img src='"+t+"'>")}},this._commonAction())},_iconAction:function(){var e=this,t=void 0,n=void 0,i=void 0,a=void 0,r=void 0,s=void 0,c=void 0;this.on({iconCreateResize:function(t){var n=t.moveOriginPointer,o=(n.x-i)/r,l=(n.y-a)/s;e.setObjectPropertiesQuietly(c,{scaleX:Math.abs(2*o),scaleY:Math.abs(2*l)})},iconCreateEnd:function(){e.ui.icon.clearIconType(),e.changeSelectableAll(!0)}});var u=function(o,l){i=l.x,a=l.y,e.addIcon(t,{left:l.x,top:l.y,fill:n}).then(function(e){c=e.id,r=e.width,s=e.height})};return(0,o.extend)({changeColor:function(t){e.activeObjectId&&e.changeIconColor(e.activeObjectId,t)},addIcon:function(i,o){t=i,n=o,e.changeCursor("crosshair"),e.off("mousedown"),e.once("mousedown",u.bind(e))},cancelAddIcon:function(){e.off("mousedown"),e.ui.icon.clearIconType(),e.changeSelectableAll(!0),e.changeCursor("default")},registDefalutIcons:function(t,n){var i={};i[t]=n,e.registerIcons(i)},registCustomIcon:function(t,n){var i=new l.default;i.imageToSVG(t,function(t){var i=t.match(/path[^>]*d="([^"]*)"/),o=i[1],a={};a[n.name]=o,e.registerIcons(a),e.addIcon(n.name,{left:100,top:100})},l.default.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var e=this;return(0,o.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,o.extend)({loadImageFromURL:function(t,n){return e.loadImageFromURL(e.toDataURL(),"FilterImage").then(function(){e.addImageObject(t).then(function(){URL.revokeObjectURL(n)})})},applyFilter:function(){e.applyFilter("mask",{maskObjId:e.activeObjectId})}},this._commonAction())},_textAction:function(){var e=this;return(0,o.extend)({changeTextStyle:function(t){e.activeObjectId&&e.changeTextStyle(e.activeObjectId,t)}},this._commonAction())},_rotateAction:function(){var e=this;return(0,o.extend)({rotate:function(t){e.rotate(t),e.ui.resizeEditor()},setAngle:function(t){e.setAngle(t),e.ui.resizeEditor()}},this._commonAction())},_shapeAction:function(){var e=this;return(0,o.extend)({changeShape:function(t){e.activeObjectId&&e.changeShape(e.activeObjectId,t)},setDrawingShape:function(t){e.setDrawingShape(t)}},this._commonAction())},_cropAction:function(){var e=this;return(0,o.extend)({crop:function(){var t=e.getCropzoneRect();t&&e.crop(t).then(function(){e.stopDrawingMode(),e.ui.resizeEditor(),e.ui.changeMenu("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())},_flipAction:function(){var e=this;return(0,o.extend)({flip:function(t){return e[t]()}},this._commonAction())},_filterAction:function(){var e=this;return(0,o.extend)({applyFilter:function(t,n,i){t?e.applyFilter(n,i):e.hasFilter(n)&&e.removeFilter(n)}},this._commonAction())},setReAction:function(){var e=this;this.on({undoStackChanged:function(t){t?(e.ui.changeUndoButtonStatus(!0),e.ui.changeResetButtonStatus(!0)):(e.ui.changeUndoButtonStatus(!1),e.ui.changeResetButtonStatus(!1)),e.ui.resizeEditor()},redoStackChanged:function(t){t?e.ui.changeRedoButtonStatus(!0):e.ui.changeRedoButtonStatus(!1),e.ui.resizeEditor()},objectActivated:function(t){e.activeObjectId=t.id,e.ui.changeDeleteButtonEnabled(!0),e.ui.changeDeleteAllButtonEnabled(!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):"icon"===t.type&&(e.stopDrawingMode(),"icon"!==e.ui.submenu&&e.ui.changeMenu("icon",!1,!1),e.ui.icon.setIconPickerColor(t.fill))},addText:function(t){e.addText("Double Click",{position:t.originPosition,styles:{fill:e.ui.text.textColor,fontSize:r.default.toInteger(e.ui.text.fontSize),fontFamily:"Noto Sans"}}).then(function(){e.changeCursor("default")})},addObjectAfter:function(t){["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=r.default.toInteger(t.fontSize);else if(["rect","circle","triangle"].indexOf(t.type)>=0){var n=t.width,i=t.height,o=e.ui.shape.getStrokeValue();n<o&&e.ui.shape.setStrokeValue(n),i<o&&e.ui.shape.setStrokeValue(i)}},selectionCleared:function(){e.activeObjectId=null,"text"===e.ui.submenu?e.changeCursor("text"):"draw"!==e.ui.submenu&&"crop"!==e.ui.submenu&&e.stopDrawingMode()}})},_commonAction:function(){var e=this;return{modeChange:function(t){switch(t){case"text":e._changeActivateMode("TEXT");break;case"crop":e.startDrawingMode("CROPPER");break;case"shape":e._changeActivateMode("SHAPE"),e.setDrawingShape(e.ui.shape.type,e.ui.shape.options)}},deactivateAll:this.deactivateAll.bind(this),changeSelectableAll:this.changeSelectableAll.bind(this),discardSelection:this.discardSelection.bind(this),stopDrawingMode:this.stopDrawingMode.bind(this)
}},mixin:function(e){(0,o.extend)(e.prototype,this)}}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.componentNames,d=c.default.commandNames,h=u.ICON,f={name:d.ADD_ICON,execute:function(e,t,n){var i=this,o=e.getComponent(h);return o.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.default.resolve()}};a.default.register(f),e.exports=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.commandNames,d={name:u.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.default.resolve()}};a.default.register(d),e.exports=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.commandNames,d=c.default.rejectMessages,h={name:u.ADD_OBJECT,execute:function(e,t){return new s.default(function(n,i){e.contains(t)?i(d.addedObject):(e.add(t),n(t))})},undo:function(e,t){return new s.default(function(n,i){e.contains(t)?(e.remove(t),n(t)):i(d.noObject)})}};a.default.register(h),e.exports=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.componentNames,d=c.default.commandNames,h=u.SHAPE,f={name:d.ADD_SHAPE,execute:function(e,t,n){var i=this,o=e.getComponent(h);return o.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.default.resolve()}};a.default.register(f),e.exports=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.componentNames,d=c.default.commandNames,h=u.TEXT,f={name:d.ADD_TEXT,execute:function(e,t,n){var i=this,o=e.getComponent(h);return o.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.default.resolve()}};a.default.register(f),e.exports=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(1),s=i(r),l=s.default.componentNames,c=s.default.rejectMessages,u=s.default.commandNames,d=l.FILTER,h={name:u.APPLY_FILTER,execute:function(e,t,n){var i=e.getComponent(d);if("mask"===t){var o=e.getObject(n.maskObjId);if(!o||!o.isType("image"))return Promise.reject(c.invalidParameters);n={mask:o}}return"mask"===t?(this.undoData.object=n.mask,e.remove(n.mask)):this.undoData.options=i.getOptions(t),i.add(t,n)},undo:function(e,t){var n=e.getComponent(d);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)}};a.default.register(h),e.exports=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.componentNames,d=c.default.rejectMessages,h=c.default.commandNames,f=u.ICON,p={name:h.CHANGE_ICON_COLOR,execute:function(e,t,n){var i=this;return new s.default(function(o,a){var r=e.getComponent(f),s=e.getObject(t);s||a(d.noObject),i.undoData.object=s,i.undoData.color=r.getColor(s),r.setColor(n,s),o()})},undo:function(e){var t=e.getComponent(f),n=this.undoData.object,i=n.object,o=n.color;return t.setColor(o,i),s.default.resolve()}};a.default.register(p),e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(3),a=i(o),r=n(4),s=i(r),l=n(2),c=i(l),u=n(1),d=i(u),h=d.default.componentNames,f=d.default.rejectMessages,p=d.default.commandNames,g=h.SHAPE,v={name:p.CHANGE_SHAPE,execute:function(e,t,n){var i=this,o=e.getComponent(g),r=e.getObject(t);return r?(this.undoData.object=r,this.undoData.options={},a.default.forEachOwnProperties(n,function(e,t){i.undoData.options[t]=r[t]}),o.change(r,n)):c.default.reject(f.noObject)},undo:function(e){var t=e.getComponent(g),n=this.undoData,i=n.object,o=n.options;return t.change(i,o)}};s.default.register(v),e.exports=v},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.componentNames,d=c.default.rejectMessages,h=c.default.commandNames,f=u.TEXT,p={name:h.CHANGE_TEXT,execute:function(e,t,n){var i=e.getComponent(f),o=e.getObject(t);return o?(this.undoData.object=o,this.undoData.text=i.getText(o),i.change(o,n)):s.default.reject(d.noObject)},undo:function(e){var t=e.getComponent(f),n=this.undoData,i=n.object,o=n.text;return t.change(i,o)}};a.default.register(p),e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(3),a=i(o),r=n(4),s=i(r),l=n(2),c=i(l),u=n(1),d=i(u),h=d.default.componentNames,f=d.default.rejectMessages,p=d.default.commandNames,g=h.TEXT,v={name:p.CHANGE_TEXT_STYLE,execute:function(e,t,n){var i=this,o=e.getComponent(g),r=e.getObject(t);return r?(this.undoData.object=r,this.undoData.styles={},a.default.forEachOwnProperties(n,function(e,t){i.undoData.styles[t]=r[t]}),o.setStyle(r,n)):c.default.reject(f.noObject)},undo:function(e){var t=e.getComponent(g),n=this.undoData,i=n.object,o=n.styles;return t.setStyle(i,o)}};s.default.register(v),e.exports=v},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.commandNames,d={name:u.CLEAR_OBJECTS,execute:function(e){var t=this;return new s.default(function(n){t.undoData.objects=e.removeAll(),n()})},undo:function(e){return e.add(this.undoData.objects),s.default.resolve()}};a.default.register(d),e.exports=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(1),s=i(r),l=s.default.componentNames,c=s.default.commandNames,u=l.FLIP,d={name:c.FLIP_IMAGE,execute:function(e,t){var n=e.getComponent(u);return this.undoData.setting=n.getCurrentSetting(),n[t]()},undo:function(e){var t=e.getComponent(u);return t.set(this.undoData.setting)}};a.default.register(d),e.exports=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(1),s=i(r),l=s.default.componentNames,c=s.default.commandNames,u=l.IMAGE_LOADER,d={name:c.LOAD_IMAGE,execute:function(e,t,n){var i=e.getComponent(u),o=i.getCanvasImage(),a=o?o.width:0,r=o?o.height:0,s=e.removeAll(!0).filter(function(e){return"cropzone"!==e.type});return s.forEach(function(e){e.evented=!0}),this.undoData={name:i.getImageName(),image:o,objects:s},i.load(t,n).then(function(e){return{oldWidth:a,oldHeight:r,newWidth:e.width,newHeight:e.height}})},undo:function(e){var t=e.getComponent(u),n=this.undoData,i=n.objects,o=n.name,a=n.image;return e.removeAll(!0),e.add(i),t.load(o,a)}};a.default.register(d),e.exports=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(1),s=i(r),l=s.default.componentNames,c=s.default.commandNames,u=l.FILTER,d={name:c.REMOVE_FILTER,execute:function(e,t){var n=e.getComponent(u);return this.undoData.options=n.getOptions(t),n.remove(t)},undo:function(e,t){var n=e.getComponent(u),i=this.undoData.options;return n.add(t,i)}};a.default.register(d),e.exports=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.commandNames,d=c.default.rejectMessages,h={name:u.REMOVE_OBJECT,execute:function(e,t){var n=this;return new s.default(function(i,o){n.undoData.objects=e.removeObjectById(t),n.undoData.objects.length?i():o(d.noObject)})},undo:function(e){return e.add(this.undoData.objects),s.default.resolve()}};a.default.register(h),e.exports=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.commandNames,d={name:u.RESIZE_CANVAS_DIMENSION,execute:function(e,t){var n=this;return new s.default(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.default.resolve()}};a.default.register(d),e.exports=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(1),s=i(r),l=s.default.componentNames,c=s.default.commandNames,u=l.ROTATION,d={name:c.ROTATE_IMAGE,execute:function(e,t,n){var i=e.getComponent(u);return this.undoData.angle=i.getCurrentAngle(),i[t](n)},undo:function(e){var t=e.getComponent(u),n=this.undoData.angle;return t.setAngle(n)}};a.default.register(d),e.exports=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=i(o),r=n(2),s=i(r),l=n(1),c=i(l),u=c.default.commandNames,d=c.default.rejectMessages,h={name:u.SET_OBJECT_POSITION,execute:function(e,t,n){var i=e.getObject(t);return i?(this.undoData.objectId=t,this.undoData.props=e.getObjectProperties(t,["left","top"]),e.setObjectPosition(t,n),e.renderAll(),s.default.resolve()):s.default.reject(d.noObject)},undo:function(e){var t=this.undoData,n=t.objectId,i=t.props;return e.setObjectProperties(n,i),e.renderAll(),s.default.resolve()}};a.default.register(h),e.exports=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(3),a=i(o),r=n(4),s=i(r),l=n(2),c=i(l),u=n(1),d=i(u),h=d.default.commandNames,f=d.default.rejectMessages,p={name:h.SET_OBJECT_PROPERTIES,execute:function(e,t,n){var i=this,o=e.getObject(t);return o?(this.undoData.props={},a.default.forEachOwnProperties(n,function(e,t){i.undoData.props[t]=o[t]}),e.setObjectProperties(t,n),c.default.resolve()):c.default.reject(f.noObject)},undo:function(e,t){var n=this.undoData.props;return e.setObjectProperties(t,n),c.default.resolve()}};s.default.register(p),e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(3),c=i(l),u=n(6),d=i(u),h=n(8),f=i(h),p=n(81),g=i(p),v=n(1),m=n(5),b=10,y={top:-10,left:-10,height:1,width:1},_=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,v.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 r(t,e),s(t,[{key:"start",value:function(){if(!this._cropzone){var e=this.getCanvas();e.forEachObject(function(e){e.evented=!1}),this._cropzone=new g.default({left:-10,top:-10,width:1,height:1,strokeWidth:0,cornerSize:10,cornerColor:"black",fill:"transparent",hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0},this.graphics.cropSelectionStyle),e.deactivateAll(),e.add(this._cropzone),e.on("mouse:down",this._listeners.mousedown),e.selection=!1,e.defaultCursor="crosshair",d.default.util.addListener(document,"keydown",this._listeners.keydown),d.default.util.addListener(document,"keyup",this._listeners.keyup)}}},{key:"end",value:function(){var e=this.getCanvas(),t=this._cropzone;t&&(t.remove(),e.selection=!0,e.defaultCursor="default",e.off("mouse:down",this._listeners.mousedown),e.forEachObject(function(e){e.evented=!0}),this._cropzone=null,d.default.util.removeListener(document,"keydown",this._listeners.keydown),d.default.util.removeListener(document,"keyup",this._listeners.keyup))}},{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,o=n.y,a=this._cropzone;Math.abs(i-this._startX)+Math.abs(o-this._startY)>b&&(a.remove(),a.set(this._calcRectDimensionFromPoint(i,o)),t.add(a))}},{key:"_calcRectDimensionFromPoint",value:function(e,t){var n=this.getCanvas(),i=n.getWidth(),o=n.getHeight(),a=this._startX,r=this._startY,s=(0,m.clamp)(e,0,a),l=(0,m.clamp)(t,0,r),c=(0,m.clamp)(e,a,i)-s,u=(0,m.clamp)(t,r,o)-l;return this._withShiftKey&&(c>u?u=c:u>c&&(c=u),a>=e&&(s=a-c),r>=t&&(l=r-u)),{left:s,top:l,width:c,height:u}}},{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&&this._cropzone.remove();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.getLeft(),top:e.getTop(),width:e.getWidth(),height:e.getHeight()}:null}},{key:"setCropzoneRect",value:function(e){var t=this.getCanvas(),n=this._cropzone;t.deactivateAll(),t.selection=!1,n.remove(),n.set(e?this._getPresetCropSizePosition(e):y),t.add(n),t.selection=!0,e&&t.setActiveObject(n)}},{key:"_getPresetCropSizePosition",value:function(e){var t=this.getCanvas(),n=t.getWidth(),i=t.getHeight(),o=n>=i?n:i,a=function(e,t){return e>t?t/e:1},r=o*e,s=o,l=a(r,n),u=c.default.map([r,s],function(e){return e*l});r=u[0],s=u[1];var d=a(s,i),h=c.default.map([r,s],function(e){return e*d});return r=h[0],s=h[1],{top:(i-s)/2,left:(n-r)/2,width:r,height:s}}},{key:"_onKeyDown",value:function(e){e.keyCode===v.keyCodes.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(e){e.keyCode===v.keyCodes.SHIFT&&(this._withShiftKey=!1)}}]),t}(f.default);e.exports=_},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(3),c=n(2),u=i(c),d=n(6),h=i(d),f=n(8),p=i(f),g=n(83),v=i(g),m=n(1),b=i(m),y=n(79),_=i(y),k=n(84),w=i(k),x=n(82),E=i(x),C=n(80),O=i(C),S=b.default.rejectMessages,M=h.default.Image.filters;M.Mask=v.default,M.Blur=_.default,M.Sharpen=w.default,M.Emboss=E.default,M.ColorFilter=O.default;var j=function(e){function t(e){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,b.default.componentNames.FILTER,e))}return r(t,e),s(t,[{key:"add",value:function(e,t){var n=this;return new u.default(function(i,o){var a=n._getSourceImage(),r=n.getCanvas(),s=n._getFilter(a,e);s||(s=n._createFilter(a,e,t)),s||o(S.invalidParameters),n._changeFilterValues(s,t),n._apply(a,function(){r.renderAll(),i({type:e,action:"add"})})})}},{key:"remove",value:function(e){var t=this;return new u.default(function(n,i){var o=t._getSourceImage(),a=t.getCanvas();o.filters.length||i(S.unsupportedOperation),t._removeFilter(o,e),t._apply(o,function(){a.renderAll(),n({type:e,action:"remove"})})})}},{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,l.extend)({},n.options):null}},{key:"_changeFilterValues",value:function(e,t){(0,l.forEach)(t,function(t,n){(0,l.isUndefined)(e[n])||(e[n]=t)}),(0,l.forEach)(e.options,function(n,i){(0,l.isUndefined)(t[i])||(e.options[i]=t[i])})}},{key:"_apply",value:function(e,t){e.applyFilters(t)}},{key:"_getSourceImage",value:function(){return this.getCanvasImage()}},{key:"_createFilter",value:function(e,t,n){var i=void 0,o=this._getFabricFilterType(t),a=h.default.Image.filters[o];return a&&(i=new a(n),i.options=n,e.filters.push(i)),i}},{key:"_getFilter",value:function(e,t){var n=null;if(e){var i=this._getFabricFilterType(t),o=e.filters.length,a=void 0,r=void 0;for(r=0;r<o;r+=1)if(a=e.filters[r],a.type===i){n=a;break}}return n}},{key:"_removeFilter",value:function(e,t){var n=this._getFabricFilterType(t);e.filters=(0,l.filter)(e.filters,function(e){return e.type!==n})}},{key:"_getFabricFilterType",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}}]),t}(p.default);e.exports=j},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(3),c=i(l),u=n(2),d=i(u),h=n(8),f=i(h),p=n(1),g=i(p),v=g.default.componentNames,m=g.default.rejectMessages,b=function(e){function t(e){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,v.FLIP,e))}return r(t,e),s(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?(c.default.extend(t,e),this.setImageProperties(t,!0),this._invertAngle(n,i),this._flipObjects(n,i),d.default.resolve({flipX:t.flipX,flipY:t.flipY,angle:this.getCanvasImage().angle})):d.default.reject(m.flip)}},{key:"_invertAngle",value:function(e,t){var n=this.getCanvasImage(),i=n.angle;e&&(i*=-1),t&&(i*=-1),n.setAngle(parseFloat(i)).setCoords()}},{key:"_flipObjects",value:function(e,t){var n=this.getCanvas();e&&n.forEachObject(function(e){e.set({angle:parseFloat(e.angle*-1),flipX:!e.flipX,left:n.width-e.left}).setCoords()}),t&&n.forEachObject(function(e){e.set({angle:parseFloat(e.angle*-1),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}(f.default);e.exports=b},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(6),c=i(l),u=n(8),d=i(u),h=n(1),f=i(h),p=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,f.default.componentNames.FREE_DRAWING,e));return n.width=12,n.oColor=new c.default.Color("rgba(0, 0, 0, 0.5)"),n}return r(t,e),s(t,[{key:"start",value:function(e){var t=this.getCanvas();t.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 c.default.Color(e.color)),t.width=this.width,t.color=this.oColor.toRgba()}},{key:"end",value:function(){var e=this.getCanvas();e.isDrawingMode=!1}}]),t}(d.default);e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(6),c=i(l),u=n(3),d=i(u),h=n(2),f=i(h),p=n(8),g=i(p),v=n(1),m=i(v),b=m.default.eventNames,y=m.default.rejectMessages,_={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"},k=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,m.default.componentNames.ICON,e));return n._oColor="#000000",n._pathMap=_,n.useDragAddIcon=e.useDragAddIcon,n}return r(t,e),s(t,[{key:"add",value:function(e,t){var n=this;return new f.default(function(i,o){var a=n.getCanvas(),r=n._pathMap[e],s=m.default.fObjectOptions.SELECTION_STYLE,l=Object.keys(m.default.defaultIconPath).indexOf(e)>=0,c=n.useDragAddIcon&&l,u=r?n._createIcon(r):null;u||o(y.invalidParameters),u.set(d.default.extend({type:"icon",fill:n._oColor},s,t,n.graphics.controlStyle)),a.add(u).setActiveObject(u),c&&n._addWithDragEvent(a),i(n.graphics.createObjectProperties(u))})}},{key:"_addWithDragEvent",value:function(e){var t=this;e.on({"mouse:move":function(n){e.selection=!1,t.fire(b.ICON_CREATE_RESIZE,{moveOriginPointer:e.getPointer(n.e)})},"mouse:up":function(n){t.fire(b.ICON_CREATE_END,{moveOriginPointer:e.getPointer(n.e)}),e.defaultCursor="default",e.off("mouse:up"),e.off("mouse:move"),e.selection=!0}})}},{key:"registerPaths",value:function(e){var t=this;d.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.setFill(this._oColor),this.getCanvas().renderAll())}},{key:"getColor",value:function(e){return e.fill}},{key:"_createIcon",value:function(e){return new c.default.Path(e)}}]),t}(g.default);e.exports=k},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(2),c=i(l),u=n(8),d=i(u),h=n(1),f=i(h),p=f.default.componentNames,g=f.default.rejectMessages,v={padding:0,crossOrigin:"Anonymous"},m=function(e){function t(e){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,p.IMAGE_LOADER,e))}return r(t,e),s(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 o=this.getCanvas();o.backgroundImage=null,o.renderAll(),i=new c.default(function(e){n.setCanvasImage("",null),e()})}return i}},{key:"_setBackgroundImage",value:function(e){var t=this;return e?new c.default(function(n,i){var o=t.getCanvas();o.setBackgroundImage(e,function(){var e=o.backgroundImage;e&&e.getElement()?n(e):i(g.loadingImageFailed)},v)}):c.default.reject(g.loadImage)}}]),t}(d.default);e.exports=m},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(6),c=i(l),u=n(8),d=i(u),h=n(1),f=i(h),p=f.default.eventNames,g=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,f.default.componentNames.LINE,e));return n._width=12,n._oColor=new c.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 r(t,e),s(t,[{key:"start",value:function(e){var t=this.getCanvas();t.defaultCursor="crosshair",t.selection=!1,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 c.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,n.y,n.x,n.y];this._line=new c.default.Line(i,{stroke:this._oColor.toRgba(),strokeWidth:this._width,evented:!1}),this._line.set(f.default.fObjectOptions.SELECTION_STYLE),t.add(this._line),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);this._line.set({x2:n.x,y2:n.y}),this._line.setCoords(),t.renderAll()}},{key:"_onFabricMouseUp",value:function(){var e=this.getCanvas(),t=this.graphics.createObjectProperties(this._line);this.fire(p.ADD_OBJECT,t),this._line=null,e.off({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}}]),t}(d.default);e.exports=g},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(6),c=i(l),u=n(2),d=i(u),h=n(8),f=i(h),p=n(1),g=i(p),v=g.default.componentNames,m=function(e){function t(e){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,v.ROTATION,e))}return r(t,e),s(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.setAngle(e).setCoords(),this.adjustCanvasDimension();var o=n.getCenterPoint();return this._rotateForEachObject(i,o,e-t),d.default.resolve(e)}},{key:"_rotateForEachObject",value:function(e,t,n){var i=this.getCanvas(),o={x:e.x-t.x,y:e.y-t.y};i.forEachObject(function(t){var i=t.getCenterPoint(),a=c.default.util.degreesToRadians(n),r=c.default.util.rotatePoint(i,e,a);t.set({left:r.x-o.x,top:r.y-o.y,angle:(t.angle+n)%360}),t.setCoords()}),i.renderAll()}},{key:"rotate",value:function(e){var t=this.getCurrentAngle();return this.setAngle(t+e)}}]),t}(f.default);e.exports=m},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(6),c=i(l),u=n(2),d=i(u),h=n(8),f=i(h),p=n(1),g=i(p),v=n(87),m=i(v),b=n(3),y=g.default.rejectMessages,_=g.default.eventNames,k=g.default.keyCodes,w="rect",x=20,E=20,C={strokeWidth:1,stroke:"#000000",fill:"#ffffff",width:1,height:1,rx:0,ry:0,lockSkewingX:!0,lockSkewingY:!0,lockUniScaling:!1,bringForward:!0,isRegular:!1},O=["rect","circle","triangle"],S=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,g.default.componentNames.SHAPE,e));
return n._shapeObj=null,n._type=w,n._options=(0,b.extend)({},C),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 r(t,e),s(t,[{key:"start",value:function(){var e=this.getCanvas();this._isSelected=!1,e.defaultCursor="crosshair",e.selection=!1,e.uniScaleTransform=!0,e.on({"mouse:down":this._handlers.mousedown}),c.default.util.addListener(document,"keydown",this._handlers.keydown),c.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.uniScaleTransform=!1,e.off({"mouse:down":this._handlers.mousedown}),c.default.util.removeListener(document,"keydown",this._handlers.keydown),c.default.util.removeListener(document,"keyup",this._handlers.keyup)}},{key:"setStates",value:function(e,t){this._type=e,t&&(this._options=(0,b.extend)(this._options,t))}},{key:"add",value:function(e,t){var n=this;return new d.default(function(i){var o=n.getCanvas();t=n._extendOptions(t);var a=n._createInstance(e,t);n._bindEventOnShape(a),o.add(a).setActiveObject(a);var r=n.graphics.createObjectProperties(a);i(r)})}},{key:"change",value:function(e,t){var n=this;return new d.default(function(i,o){(0,b.inArray)(e.get("type"),O)<0&&o(y.unsupportedType),e.set(t),n.getCanvas().renderAll(),i()})}},{key:"_createInstance",value:function(e,t){var n=void 0;switch(e){case"rect":n=new c.default.Rect(t);break;case"circle":n=new c.default.Ellipse((0,b.extend)({type:"circle"},t));break;case"triangle":n=new c.default.Triangle(t);break;default:n={}}return n}},{key:"_extendOptions",value:function(e){var t=g.default.fObjectOptions.SELECTION_STYLE;return e=(0,b.extend)({},C,this._options,t,e),e.isRegular&&(e.lockUniScaling=!0),e}},{key:"_bindEventOnShape",value:function(e){var t=this,n=this.getCanvas();e.on({added:function(){t._shapeObj=this,m.default.setOrigins(t._shapeObj)},selected:function(){t._isSelected=!0,t._shapeObj=this,n.uniScaleTransform=!0,n.defaultCursor="default",m.default.setOrigins(t._shapeObj)},deselected:function(){t._isSelected=!1,t._shapeObj=null,n.defaultCursor="crosshair",n.uniScaleTransform=!1},modified:function(){var e=t._shapeObj;m.default.adjustOriginToCenter(e),m.default.setOrigins(e)},scaling:function(e){var i=n.getPointer(e.e),o=t._shapeObj;n.setCursor("crosshair"),m.default.resize(o,i,!0)}})}},{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),o=this._startPoint.x,a=this._startPoint.y,r=o-i.x,s=a-i.y,l=this._shapeObj;l?(this._shapeObj.set({isRegular:this._withShiftKey}),m.default.resize(l,i),n.renderAll()):this.add(this._type,{left:o,top:a,width:r,height:s}).then(function(e){t.fire(_.ADD_OBJECT,e)})}},{key:"_onFabricMouseUp",value:function(){var e=this,t=this.getCanvas(),n=this._startPoint.x,i=this._startPoint.y,o=this._shapeObj;o?o&&(m.default.adjustOriginToCenter(o),this.fire(_.ADD_OBJECT_AFTER,this.graphics.createObjectProperties(o))):this.add(this._type,{left:n,top:i,width:x,height:E}).then(function(t){e.fire(_.ADD_OBJECT,t)}),t.off({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}},{key:"_onKeyDown",value:function(e){e.keyCode===k.SHIFT&&(this._withShiftKey=!0,this._shapeObj&&(this._shapeObj.isRegular=!0))}},{key:"_onKeyUp",value:function(e){e.keyCode===k.SHIFT&&(this._withShiftKey=!1,this._shapeObj&&(this._shapeObj.isRegular=!1))}}]),t}(f.default);e.exports=S},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(6),c=i(l),u=n(3),d=i(u),h=n(2),f=i(h),p=n(8),g=i(p),v=n(1),m=i(v),b=n(5),y=i(b),_=m.default.eventNames,k={fill:"#000000",left:0,top:0},w={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"left",textDecoraiton:""},x=d.default.browser,E="tui-image-eidtor-textarea",C=y.default.makeStyleText({position:"absolute",padding:0,display:"none",border:"1px dotted red",overflow:"hidden",resize:"none",outline:"none","border-radius":0,"background-color":"transparent","-webkit-appearance":"none","z-index":9999,"white-space":"pre"}),O=.1,S=500,M=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,m.default.componentNames.TEXT,e));return n._defaultStyles=k,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)},n._textarea=null,n._ratio=1,n._lastClickTime=(new Date).getTime(),n._editingObjInfos={},n.isPrevEditing=!1,n.useItext=e.useItext,n}return r(t,e),s(t,[{key:"start",value:function(){var e=this.getCanvas();e.selection=!1,e.defaultCursor="text",e.on({"mouse:down":this._listeners.mousedown,"object:selected":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:editing":this._listeners.modify}),this.useItext?e.forEachObject(function(e){"i-text"===e.type&&e.set({left:e.left-e.width/2,top:e.top-e.height/2,originX:"left",originY:"top"})}):this._createTextarea(),this.setCanvasRatio()}},{key:"end",value:function(){var e=this.getCanvas();e.selection=!0,e.defaultCursor="default",this.useItext?e.forEachObject(function(e){"i-text"===e.type&&(""===e.text?e.remove():e.set({left:e.left+e.width/2,top:e.top+e.height/2,originX:"center",originY:"center"}))}):(e.deactivateAllWithDispatch(),this._removeTextarea()),e.off({"mouse:down":this._listeners.mousedown,"object:selected":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:editing":this._listeners.modify})}},{key:"add",value:function(e,t){var n=this;return new f.default(function(i){var o=n.getCanvas(),a=null,r=m.default.fObjectOptions.SELECTION_STYLE,s=n._defaultStyles;n._setInitPos(t.position),t.styles&&(s=d.default.extend(s,t.styles)),n.useItext?(a=new c.default.IText(e,s),r=d.default.extend({},r,{originX:"left",originY:"top"})):a=new c.default.Text(e,s),a.set(r),a.on({mouseup:n._onFabricMouseUp.bind(n)}),o.add(a),o.getActiveObject()||o.setActiveObject(a),n.isPrevEditing=!0,i(n.graphics.createObjectProperties(a))})}},{key:"change",value:function(e,t){var n=this;return new f.default(function(i){e.set("text",t),n.getCanvas().renderAll(),i()})}},{key:"setStyle",value:function(e,t){var n=this;return new f.default(function(i){d.default.forEach(t,function(n,i){e[i]===n&&(t[i]=w[i]||"")},n),e.set(t),n.getCanvas().renderAll(),i()})}},{key:"getText",value:function(e){return e.getText()}},{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,i=n/t;this._ratio=i}},{key:"getCanvasRatio",value:function(){return this._ratio}},{key:"_setInitPos",value:function(e){e=e||this.getCanvasImage().getCenterPoint(),this._defaultStyles.left=e.x,this._defaultStyles.top=e.y}},{key:"_createTextarea",value:function(){var e=this.getCanvasElement().parentNode,t=document.createElement("textarea");t.className=E,t.setAttribute("style",C),t.setAttribute("wrap","off"),e.appendChild(t),this._textarea=t,this._listeners=d.default.extend(this._listeners,{input:this._onInput.bind(this),keydown:this._onKeyDown.bind(this),blur:this._onBlur.bind(this),scroll:this._onScroll.bind(this)}),x.msie&&9===x.version?c.default.util.addListener(t,"keydown",this._listeners.keydown):c.default.util.addListener(t,"input",this._listeners.input),c.default.util.addListener(t,"blur",this._listeners.blur),c.default.util.addListener(t,"scroll",this._listeners.scroll)}},{key:"_removeTextarea",value:function(){var e=this.getCanvasElement().parentNode,t=e.querySelector("textarea");e.removeChild(t),this._textarea=null,x.msie&&x.version<10?c.default.util.removeListener(t,"keydown",this._listeners.keydown):c.default.util.removeListener(t,"input",this._listeners.input),c.default.util.removeListener(t,"blur",this._listeners.blur),c.default.util.removeListener(t,"scroll",this._listeners.scroll)}},{key:"_onInput",value:function(){var e=this.getCanvasRatio(),t=this._editingObj,n=this._textarea.style;n.width=Math.ceil(t.getWidth()/e)+"px",n.height=Math.ceil(t.getHeight()/e)+"px"}},{key:"_onKeyDown",value:function(){var e=this,t=this.getCanvasRatio(),n=this._editingObj,i=this._textarea.style;setTimeout(function(){n.setText(e._textarea.value),i.width=Math.ceil(n.getWidth()/t)+"px",i.height=Math.ceil(n.getHeight()/t)+"px"},0)}},{key:"_onBlur",value:function(){var e=this.getCanvasRatio(),t=this._editingObj,n=this._editingObjInfos,i=this._textarea.value,o=t.getWidth()/e-n.width/e,a=t.getHeight()/e-n.height/e;if(1===e&&(o/=2,a/=2),this._textarea.style.display="none",t.set({left:n.left+o,top:n.top+a}),i.length){this.getCanvas().add(t);var r={id:d.default.stamp(t),type:t.type,text:i};this.fire(_.TEXT_CHANGED,r)}}},{key:"_onScroll",value:function(){this._textarea.scrollLeft=0,this._textarea.scrollTop=0}},{key:"_onFabricScaling",value:function(e){var t=e.target,n=t.getFontSize()*t.getScaleY();t.setFontSize(n),t.setScaleX(1),t.setScaleY(1)}},{key:"_onFabricSelectClear",value:function(e){var t=this.getSelectedObj();this.isPrevEditing=!0,this.setSelectedInfo(e.target,!1),t&&""===t.text&&t.remove()}},{key:"_onFabricSelect",value:function(e){this.isPrevEditing=!0,this.setSelectedInfo(e.target,!0)}},{key:"_onFabricMouseDown",value:function(e){var t=e.target;if(!t||t.isType("text"))return this.isPrevEditing?void(this.isPrevEditing=!1):void this._fireAddText(e)}},{key:"_fireAddText",value:function(e){var t=e.target,n=e.e||{},i=this.getCanvas().getPointer(n);t||this.fire(_.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=(new Date).getTime();this._isDoubleClick(t)&&(this.useItext||this._changeToEditingMode(e.target),this.fire(_.TEXT_EDITING)),this._lastClickTime=t}},{key:"_isDoubleClick",value:function(e){return e-this._lastClickTime<S}},{key:"_changeToEditingMode",value:function(e){var t=this.getCanvasRatio(),n=this._textarea.style;this.isPrevEditing=!0,e.remove(),this._editingObj=e,this._textarea.value=e.getText(),this._editingObjInfos={left:this._editingObj.getLeft(),top:this._editingObj.getTop(),width:this._editingObj.getWidth(),height:this._editingObj.getHeight()},n.display="block",n.left=e.oCoords.tl.x/t+"px",n.top=e.oCoords.tl.y/t+"px",n.width=Math.ceil(e.getWidth()/t)+"px",n.height=Math.ceil(e.getHeight()/t)+"px",n.transform="rotate("+e.getAngle()+"deg)",n.color=e.getFill(),n["font-size"]=e.getFontSize()/t+"px",n["font-family"]=e.getFontFamily(),n["font-style"]=e.getFontStyle(),n["font-weight"]=e.getFontWeight(),n["text-align"]=e.getTextAlign(),n["line-height"]=e.getLineHeight()+O,n["transform-origin"]="left top",this._textarea.focus()}}]),t}(g.default);e.exports=M},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(13),c=i(l),u=n(1),d=i(u),h=d.default.drawingModes,f=d.default.componentNames,p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.CROPPER))}return r(t,e),s(t,[{key:"start",value:function(e){var t=e.getComponent(f.CROPPER);t.start()}},{key:"end",value:function(e){var t=e.getComponent(f.CROPPER);t.end()}}]),t}(c.default);e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(13),c=i(l),u=n(1),d=i(u),h=d.default.drawingModes,f=d.default.componentNames,p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.FREE_DRAWING))}return r(t,e),s(t,[{key:"start",value:function(e,t){var n=e.getComponent(f.FREE_DRAWING);n.start(t)}},{key:"end",value:function(e){var t=e.getComponent(f.FREE_DRAWING);t.end()}}]),t}(c.default);e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(13),c=i(l),u=n(1),d=i(u),h=d.default.drawingModes,f=d.default.componentNames,p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.LINE_DRAWING))}return r(t,e),s(t,[{key:"start",value:function(e,t){var n=e.getComponent(f.LINE);n.start(t)}},{key:"end",value:function(e){var t=e.getComponent(f.LINE);t.end()}}]),t}(c.default);e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(13),c=i(l),u=n(1),d=i(u),h=d.default.drawingModes,f=d.default.componentNames,p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.SHAPE))}return r(t,e),s(t,[{key:"start",value:function(e){var t=e.getComponent(f.SHAPE);t.start()}},{key:"end",value:function(e){var t=e.getComponent(f.SHAPE);t.end()}}]),t}(c.default);e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}var s=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}}(),l=n(13),c=i(l),u=n(1),d=i(u),h=d.default.drawingModes,f=d.default.componentNames,p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,h.TEXT))}return r(t,e),s(t,[{key:"start",value:function(e){var t=e.getComponent(f.TEXT);t.start()}},{key:"end",value:function(e){var t=e.getComponent(f.TEXT);t.end()}}]),t}(c.default);e.exports=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(6),a=i(o),r=a.default.util.createClass(a.default.Image.filters.Convolute,{type:"Blur",initialize:function(){var e=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9];this.matrix=e}});e.exports=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(6),a=i(o),r=a.default.util.createClass(a.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=e.getContext("2d"),n=t.getImageData(0,0,e.width,e.height),i=n.data,o=this.threshold,r=a.default.Color.sourceFromHex(this.color),s=void 0,l=void 0;for(this.x&&this.y&&(r=this._getColor(n,this.x,this.y)),s=0,l=i.length;s<l;s+=4)this._isOutsideThreshold(i[s],r[0],o)||this._isOutsideThreshold(i[s+1],r[1],o)||this._isOutsideThreshold(i[s+2],r[2],o)||(i[s]=i[s+1]=i[s+2]=i[s+3]=0);t.putImageData(n,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],o=e.data,a=e.width,r=4,s=(a*n+t)*r;return i[0]=o[s],i[1]=o[s+1],i[2]=o[s+2],i[3]=o[s+3],i}});e.exports=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(3),a=i(o),r=n(6),s=i(r),l=n(5),c="tl",u="tr",d="mt",h="ml",f="mr",p="mb",g="bl",v="br",m=s.default.util.createClass(s.default.Rect,{initialize:function(e,t){e=a.default.extend(e,t),e.type="cropzone",this.callSuper("initialize",e),this.options=e,this.on({moving:this._onMoving,scaling:this._onScaling})},_render:function(e){var t=7,n=7;this.callSuper("_render",e);var i=this.flipX?-1:1,o=this.flipY?-1:1,a=i/this.scaleX,r=o/this.scaleY;e.scale(a,r),this._fillOuterRect(e,"rgba(0, 0, 0, 0.55)"),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:t}),this._strokeBorder(e,"rgb(255, 255, 255)",{lineDashWidth:t,lineDashOffset:n})),e.scale(1/a,1/r)},_fillOuterRect:function(e,t){var n=this._getCoordinates(e),i=n.x,o=n.y;e.save(),e.fillStyle=t,e.beginPath(),e.moveTo(i[0]-1,o[0]-1),e.lineTo(i[3]+1,o[0]-1),e.lineTo(i[3]+1,o[3]+1),e.lineTo(i[0]-1,o[3]+1),e.lineTo(i[0]-1,o[0]-1),e.closePath(),e.moveTo(i[1],o[1]),e.lineTo(i[1],o[2]),e.lineTo(i[2],o[2]),e.lineTo(i[2],o[1]),e.lineTo(i[1],o[1]),e.closePath(),e.fill(),e.restore()},_fillInnerRect:function(e){var t=this._getCoordinates(e),n=t.x,i=t.y,o=this._caculateInnerPosition(n,(n[2]-n[1])/3),a=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(o[0],a[1]),e.lineTo(o[3],a[1]),e.moveTo(o[0],a[2]),e.lineTo(o[3],a[2]),e.moveTo(o[1],a[0]),e.lineTo(o[1],a[3]),e.moveTo(o[2],a[0]),e.lineTo(o[2],a[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(e){var t=this.getWidth(),n=this.getHeight(),i=t/2,o=n/2,r=this.getLeft(),s=this.getTop(),l=e.canvas;return{x:a.default.map([-(i+r),-i,i,i+(l.width-r-t)],Math.ceil),y:a.default.map([-(o+s),-o,o,o+(l.height-s-n)],Math.ceil)}},_strokeBorder:function(e,t,n){var i=n.lineDashWidth,o=n.lineDashOffset,a=n.lineWidth,r=this.getWidth()/2,s=this.getHeight()/2;e.save(),e.strokeStyle=t,e.setLineDash&&e.setLineDash([i,i]),o&&(e.lineDashOffset=o),a&&(e.lineWidth=a),e.beginPath(),e.moveTo(-r,-s),e.lineTo(r,-s),e.lineTo(r,s),e.lineTo(-r,s),e.lineTo(-r,-s),e.stroke(),e.restore()},_onMoving:function(){var e=this.getLeft(),t=this.getTop(),n=this.getWidth(),i=this.getHeight(),o=this.canvas.getWidth()-n,a=this.canvas.getHeight()-i;this.setLeft((0,l.clamp)(e,0,o)),this.setTop((0,l.clamp)(t,0,a))},_onScaling:function(e){var t=this.canvas.getPointer(e.e),n=this._calcScalingSizeFromPointer(t);this.scale(1).set(n)},_calcScalingSizeFromPointer:function(e){var t=e.x,n=e.y,i=this._calcTopLeftScalingSizeFromPointer(t,n),o=this._calcBottomRightScalingSizeFromPointer(t,n);return this._makeScalingSettings(i,o)},_calcTopLeftScalingSizeFromPointer:function(e,t){var n=this.getHeight()+this.top,i=this.getWidth()+this.left,o=(0,l.clamp)(t,0,n-1),a=(0,l.clamp)(e,0,i-1);return{top:o,left:a,width:i-a,height:n-o}},_calcBottomRightScalingSizeFromPointer:function(e,t){var n=this.canvas,i=n.width,o=n.height,a=this.left,r=this.top;return{width:(0,l.clamp)(e,a+1,i)-a,height:(0,l.clamp)(t,r+1,o)-r}},_makeScalingSettings:function(e,t){var n=e.width,i=e.height,o=t.height,a=t.width,r=e.left,s=e.top,l=void 0;switch(this.__corner){case c:l=e;break;case u:l={width:a,height:i,top:s};break;case g:l={width:n,height:o,left:r};break;case v:l=t;break;case h:l={width:n,left:r};break;case d:l={height:i,top:s};break;case f:l={width:a};break;case p:l={height:o}}return l},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0}});e.exports=m},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(6),a=i(o),r=a.default.util.createClass(a.default.Image.filters.Convolute,{type:"Emboss",initialize:function(){var e=[1,1,1,1,.7,-1,-1,-1,-1];this.matrix=e}});e.exports=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(6),a=i(o),r=a.default.util.createClass(a.default.Image.filters.Mask,{applyTo:function(e){if(this.mask){var t=e.width,n=e.height,i=this._createCanvasOfMask(t,n),o=e.getContext("2d"),a=i.getContext("2d"),r=o.getImageData(0,0,t,n);this._drawMask(a,e,o),this._mapData(a,r,t,n),o.putImageData(r,0,0)}},_createCanvasOfMask:function(e,t){var n=a.default.util.createCanvasElement();return n.width=e,n.height=t,n},_drawMask:function(e){var t=this.mask,n=t.getElement(),i=t.getLeft(),o=t.getTop(),a=t.getAngle();e.save(),e.translate(i,o),e.rotate(a*Math.PI/180),e.scale(t.scaleX,t.scaleY),e.drawImage(n,-n.width/2,-n.height/2),e.restore()},_mapData:function(e,t,n,i){for(var o=t.data,a=e.getImageData(0,0,n,i).data,r=this.channel,s=t.width*t.height*4,l=0;l<s;l+=4)o[l+3]=a[l+r]}});e.exports=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=n(6),a=i(o),r=a.default.util.createClass(a.default.Image.filters.Convolute,{type:"Sharpen",initialize:function(){var e=[0,-1,0,-1,5,-1,0,-1,0];this.matrix=e}});e.exports=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=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(3),s=i(r),l=n(2),c=i(l),u=n(6),d=i(u),h=n(69),f=i(h),p=n(64),g=i(p),v=n(66),m=i(v),b=n(71),y=i(b),_=n(67),k=i(_),w=n(70),x=i(w),E=n(73),C=i(E),O=n(68),S=i(O),M=n(65),j=i(M),T=n(72),P=i(T),A=n(74),I=i(A),R=n(75),D=i(R),L=n(76),N=i(L),B=n(77),z=i(B),F=n(78),H=i(F),W=n(1),U=i(W),V=n(5),X=i(V),q=U.default.componentNames,G=U.default.eventNames,Y=U.default.drawingModes,J=U.default.fObjectOptions,K=s.default.extend,Z=s.default.stamp,Q=s.default.isArray,$=s.default.isString,ee=s.default.forEachArray,te=s.default.forEachOwnProperties,ne=s.default.CustomEvents,ie=1e3,oe=800,ae={cssOnly:!0},re={backstoreOnly:!0},se=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.cssMaxWidth,a=n.cssMaxHeight,r=n.useItext,s=void 0!==r&&r,l=n.useDragAddIcon,c=void 0!==l&&l;o(this,e),this.canvasImage=null,this.cssMaxWidth=i||ie,this.cssMaxHeight=a||oe,this.useItext=s,this.useDragAddIcon=c,this.cropSelectionStyle={},this.imageName="",this._objects={},this._canvas=null,this._drawingMode=Y.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),onObjectSelected:this._onObjectSelected.bind(this),onPathCreated:this._onPathCreated.bind(this),onSelectionCleared:this._onSelectionCleared.bind(this),onSelectionCreated:this._onSelectionCreated.bind(this)},this._setCanvasElement(t),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents()}return a(e,[{key:"destroy",value:function(){var e=this._canvas.wrapperEl;this._canvas.clear(),e.parentNode.removeChild(e)}},{key:"deactivateAll",value:function(){return this._canvas.deactivateAll(),this}},{key:"renderAll",value:function(){return this._canvas.renderAll(),this}},{key:"add",value:function(e){var t,n=[];Q(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),o=i&&i.isType("group")&&!i.isEmpty();return o?(n.discardActiveGroup(),i.forEachObject(function(e){t.push(e),e.remove()})):n.contains(i)&&(t.push(i),i.remove()),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.getActiveObject()}},{key:"getActiveGroupObject",value:function(){return this._canvas.getActiveGroup()}},{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(Y.NORMAL)){var e=this._getDrawingModeInstance(this.getDrawingMode());e&&e.end&&e.end(this),this._drawingMode=Y.NORMAL}}},{key:"toDataURL",value:function(e){return this._canvas&&this._canvas.toDataURL(e)}},{key:"setCanvasImage",value:function(e,t){t&&Z(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(){var e=this.canvasImage.scale(1),t=e.getBoundingRect(),n=t.width,i=t.height,o=this._calcMaxDimension(n,i);this.setCanvasCssDimension({width:"100%",height:"100%","max-width":o.width+"px","max-height":o.height+"px"}),this.setCanvasBackstoreDimension({width:n,height:i}),this._canvas.centerObject(e)}},{key:"setCanvasCssDimension",value:function(e){this._canvas.setDimensions(e,ae)}},{key:"setCanvasBackstoreDimension",value:function(e){this._canvas.setDimensions(e,re)}},{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 c.default(function(i){d.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(q.CROPPER).getCropzoneRect()}},{key:"setCropzoneRect",value:function(e){this.getComponent(q.CROPPER).setCropzoneRect(e)}},{key:"getCroppedImageData",value:function(e){return this.getComponent(q.CROPPER).getCroppedImageData(e)}},{key:"setBrush",value:function(e){var t=this._drawingMode,n=q.FREE_DRAWING;t===Y.LINE&&(n=Y.LINE),this.getComponent(n).setBrush(e)}},{key:"setDrawingShape",value:function(e,t){this.getComponent(q.SHAPE).setStates(e,t)}},{key:"registerPaths",value:function(e){this.getComponent(q.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(q.FILTER).hasFilter(e)}},{key:"setSelectionStyle",value:function(e){K(J.SELECTION_STYLE,e)}},{key:"setObjectProperties",value:function(e,t){var n=this.getObject(e),i=K({},t);return n.set(i),n.setCoords(),this.getCanvas().renderAll(),i}},{key:"getObjectProperties",value:function(e,t){var n=this.getObject(e),i={};return $(t)?i[t]=n[t]:Q(t)?ee(t,function(e){i[e]=n[e]}):te(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,o=t.y,a=t.originX,r=t.originY;
if(!n)return!1;var s=n.getPointByOrigin(a,r),l=n.getPointByOrigin("center","center"),c=l.x-s.x,u=l.y-s.y;return n.set({left:i+c,top:o+u}),n.setCoords(),!0}},{key:"getCanvasSize",value:function(){var e=this.getCanvasImage();return{width:e?e.width:0,height:e?e.height:0}}},{key:"_getDrawingModeInstance",value:function(e){return this._drawingModeMap[e]}},{key:"_setCanvasElement",value:function(e){var t=void 0,n=void 0;t=e.nodeType?e:document.querySelector(e),"CANVAS"!==t.nodeName.toUpperCase()&&(n=document.createElement("canvas"),t.appendChild(n)),this._canvas=new d.default.Canvas(n,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})}},{key:"_createDrawingModeInstances",value:function(){this._register(this._drawingModeMap,new I.default),this._register(this._drawingModeMap,new D.default),this._register(this._drawingModeMap,new N.default),this._register(this._drawingModeMap,new z.default),this._register(this._drawingModeMap,new H.default)}},{key:"_createComponents",value:function(){this._register(this._componentMap,new f.default(this)),this._register(this._componentMap,new g.default(this)),this._register(this._componentMap,new m.default(this)),this._register(this._componentMap,new y.default(this)),this._register(this._componentMap,new k.default(this)),this._register(this._componentMap,new x.default(this)),this._register(this._componentMap,new C.default(this)),this._register(this._componentMap,new S.default(this)),this._register(this._componentMap,new j.default(this)),this._register(this._componentMap,new P.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,o=Math.min(e,this.cssMaxWidth),a=Math.min(t,this.cssMaxHeight);return n<1&&n<i?(o=e*n,a=t*n):i<1&&i<n&&(o=e*i,a=t*i),{width:Math.floor(o),height:Math.floor(a)}}},{key:"_callbackAfterLoadingImageObject",value:function(e){var t=this.getCanvasImage().getCenterPoint();e.set(U.default.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:selected":t.onObjectSelected,"path:created":t.onPathCreated,"selection:cleared":t.onSelectionCleared,"selection:created":t.onSelectionCreated})}},{key:"_onMouseDown",value:function(e){var t=this._canvas.getPointer(e.e);this.fire(G.MOUSE_DOWN,e.e,t)}},{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(Z(t))}},{key:"_onObjectMoved",value:function(e){var t=e.target,n=this.createObjectProperties(t);this.fire(G.OBJECT_MOVED,n)}},{key:"_onObjectScaled",value:function(e){var t=e.target,n=this.createObjectProperties(t);this.fire(G.OBJECT_SCALED,n)}},{key:"_onObjectSelected",value:function(e){var t=e.target,n=this.createObjectProperties(t);this.fire(G.OBJECT_ACTIVATED,n)}},{key:"_onPathCreated",value:function(e){e.path.set(U.default.fObjectOptions.SELECTION_STYLE);var t=this.createObjectProperties(e.path);this.fire(G.ADD_OBJECT,t)}},{key:"_onSelectionCleared",value:function(){this.fire(G.SELECTION_CLEARED)}},{key:"_onSelectionCreated",value:function(e){this.fire(G.SELECTION_CREATED,e.target)}},{key:"discardSelection",value:function(){this._canvas.discardActiveGroup(),this._canvas.discardActiveObject(),this._canvas.renderAll()}},{key:"changeSelectableAll",value:function(e){this._canvas.forEachObject(function(t){t.selectable=e,t.hoverCursor=e?"move":"crosshair"})}},{key:"createObjectProperties",value:function(e){var t=["left","top","width","height","fill","stroke","strokeWidth","opacity"],n={id:Z(e),type:e.type};return K(n,X.default.getProperties(e,t)),["i-text","text"].indexOf(e.type)>-1&&K(n,this._createTextProperties(e,n)),n}},{key:"_createTextProperties",value:function(e){var t=["text","fontFamily","fontSize","fontStyle","textAlign","textDecoration"],n={};return K(n,X.default.getProperties(e,t)),n}},{key:"_addFabricObject",value:function(e){var t=Z(e);return this._objects[t]=e,t}},{key:"_removeFabricObject",value:function(e){delete this._objects[e]}}]),e}();ne.mixin(se),e.exports=se},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}}(),o=function(){function e(){n(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 o=0;o<n.palette.length;o+=1){var a=this.batchtracepaths(this.internodes(this.pathscan(this.layeringstep(n,o),t.pathomit),t),t.ltres,t.qtres);i.layers.push(a)}}else{var r=this.layering(n);t.layercontainerid&&this.drawLayers(r,this.specpalette,t.scale,t.layercontainerid);var s=this.batchpathscan(r,t.pathomit),l=this.batchinternodes(s,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){e=e||{},"string"==typeof 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,o=void 0,a=void 0,r=void 0,s=[],l=e.width*e.height,c=void 0,u=void 0,d=void 0,h=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)),h=0;h<t.colorquantcycles;h+=1){if(h>0)for(d=0;d<f.length;d+=1)s[d].n>0&&(f[d]={r:Math.floor(s[d].r/s[d].n),g:Math.floor(s[d].g/s[d].n),b:Math.floor(s[d].b/s[d].n),a:Math.floor(s[d].a/s[d].n)}),s[d].n/l<t.mincolorratio&&h<t.colorquantcycles-1&&(f[d]={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)s[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),r=0,a=1024,d=0;d<f.length;d+=1)o=Math.abs(f[d].r-e.data[i])+Math.abs(f[d].g-e.data[i+1])+Math.abs(f[d].b-e.data[i+2])+Math.abs(f[d].a-e.data[i+3]),o<a&&(a=o,r=d);s[r].r+=e.data[i],s[r].g+=e.data[i+1],s[r].b+=e.data[i+2],s[r].a+=e.data[i+3],s[r].n+=1,n[u+1][c+1]=r}}return{array:n,palette:f}}},{key:"samplepalette",value:function(e,t){for(var n=void 0,i=[],o=0;o<e;o+=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=[],o=Math.ceil(Math.sqrt(e)),a=Math.ceil(e/o),r=t.width/(o+1),s=t.height/(a+1),l=0;l<a;l+=1)for(var c=0;c<o&&i.length!==e;c+=1)n=4*Math.floor((l+1)*s*t.width+(c+1)*r),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,o=void 0;if(e<8)for(var a=Math.floor(255/(e-1)),r=0;r<e;r+=1)t.push({r:r*a,g:r*a,b:r*a,a:255});else{var s=Math.floor(Math.pow(e,1/3)),l=Math.floor(255/(s-1)),c=e-s*s*s;for(n=0;n<s;n+=1)for(i=0;i<s;i+=1)for(o=0;o<s;o+=1)t.push({r:n*l,g:i*l,b:o*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,o=e.array[0].length,a=void 0,r=void 0,s=void 0,l=void 0,c=void 0,u=void 0,d=void 0,h=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<o;f+=1)t[g][p][f]=0;for(p=1;p<i-1;p+=1)for(f=1;f<o-1;f+=1)n=e.array[p][f],a=e.array[p-1][f-1]===n?1:0,r=e.array[p-1][f]===n?1:0,s=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,d=e.array[p+1][f]===n?1:0,h=e.array[p+1][f+1]===n?1:0,t[n][p+1][f+1]=1+2*c+4*h+8*d,l||(t[n][p+1][f]=2+4*d+8*u),r||(t[n][p][f+1]=0+2*s+4*c+8),a||(t[n][p][f]=0+2*r+4+8*l);return t}},{key:"layeringstep",value:function(e,t){var n=[],i=e.array.length,o=e.array[0].length,a=void 0,r=void 0;for(r=0;r<i;r+=1)for(n[r]=[],a=0;a<o;a+=1)n[r][a]=0;for(r=1;r<i;r+=1)for(a=1;a<o;a+=1)n[r][a]=(e.array[r-1][a-1]===t?1:0)+(e.array[r-1][a]===t?2:0)+(e.array[r][a-1]===t?8:0)+(e.array[r][a]===t?4:0);return n}},{key:"pathscan",value:function(e,t){for(var n=[],i=0,o=0,a=0,r=0,s=e[0].length,l=e.length,c=0,u=!0,d=!1,h=void 0,f=0;f<l;f+=1)for(var p=0;p<s;p+=1)if(4===e[f][p]||11===e[f][p])for(a=p,r=f,n[i]={},n[i].points=[],n[i].boundingbox=[a,r,a,r],n[i].holechildren=[],u=!1,o=0,d=11===e[f][p],c=1;!u;){if(n[i].points[o]={},n[i].points[o].x=a-1,n[i].points[o].y=r-1,n[i].points[o].t=e[r][a],a-1<n[i].boundingbox[0]&&(n[i].boundingbox[0]=a-1),a-1>n[i].boundingbox[2]&&(n[i].boundingbox[2]=a-1),r-1<n[i].boundingbox[1]&&(n[i].boundingbox[1]=r-1),r-1>n[i].boundingbox[3]&&(n[i].boundingbox[3]=r-1),h=this.pathscan_combined_lookup[e[r][a]][c],e[r][a]=h[0],c=h[1],a+=h[2],r+=h[3],a-1===n[i].points[0].x&&r-1===n[i].points[0].y)if(u=!0,n[i].points.length<t)n.pop();else{if(n[i].isholepath=!!d,d){for(var g=0,v=[-1,-1,s+1,l+1],m=0;m<i;m++)!n[m].isholepath&&this.boundingboxincludes(n[m].boundingbox,n[i].boundingbox)&&this.boundingboxincludes(v,n[m].boundingbox)&&(g=m,v=n[m].boundingbox);n[g].holechildren.push(i)}i+=1}o+=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}},{key:"internodes",value:function(e,t){var n=[],i=0,o=0,a=0,r=0,s=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)o=(c+1)%i,a=(c+2)%i,r=(c-1+i)%i,s=(c-2+i)%i,t.rightangleenhance&&this.testrightangle(e[l],s,r,c,o,a)&&(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[o].x)/2,(e[l].points[c].y+e[l].points[o].y)/2)})),n[l].points.push({x:(e[l].points[c].x+e[l].points[o].x)/2,y:(e[l].points[c].y+e[l].points[o].y)/2,linesegment:this.getdirection((e[l].points[c].x+e[l].points[o].x)/2,(e[l].points[c].y+e[l].points[o].y)/2,(e[l].points[o].x+e[l].points[a].x)/2,(e[l].points[o].y+e[l].points[a].y)/2)});return n}},{key:"testrightangle",value:function(e,t,n,i,o,a){return e.points[i].x===e.points[t].x&&e.points[i].x===e.points[n].x&&e.points[i].y===e.points[o].y&&e.points[i].y===e.points[a].y||e.points[i].y===e.points[t].y&&e.points[i].y===e.points[n].y&&e.points[i].x===e.points[o].x&&e.points[i].x===e.points[a].x}},{key:"getdirection",value:function(e,t,n,i){var o=8;return o=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,o=void 0,a=void 0,r=void 0,s={};for(s.segments=[],s.boundingbox=e.boundingbox,s.holechildren=e.holechildren,s.isholepath=e.isholepath;i<e.points.length;){for(o=e.points[i].linesegment,a=-1,r=i+1;(e.points[r].linesegment===o||e.points[r].linesegment===a||a===-1)&&r<e.points.length-1;)e.points[r].linesegment!==o&&a===-1&&(a=e.points[r].linesegment),r+=1;r===e.points.length-1&&(r=0),s.segments=s.segments.concat(this.fitseq(e,t,n,i,r)),i=r>0?r:e.points.length}return s}},{key:"fitseq",value:function(e,t,n,i,o){if(o>e.points.length||o<0)return[];var a=i,r=0,s=!0,l=void 0,c=void 0,u=void 0,d=o-i;d<0&&(d+=e.points.length);for(var h=(e.points[o].x-e.points[i].x)/d,f=(e.points[o].y-e.points[i].y)/d,p=(i+1)%e.points.length,g=void 0;p!=o;)g=p-i,g<0&&(g+=e.points.length),l=e.points[i].x+h*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),u>t&&(s=!1),u>r&&(a=p,r=u),p=(p+1)%e.points.length;if(s)return[{type:"L",x1:e.points[i].x,y1:e.points[i].y,x2:e.points[o].x,y2:e.points[o].y}];var v=a;s=!0,r=0;var m=(v-i)/d,b=(1-m)*(1-m),y=2*(1-m)*m,_=m*m,k=(b*e.points[i].x+_*e.points[o].x-e.points[v].x)/-y,w=(b*e.points[i].y+_*e.points[o].y-e.points[v].y)/-y;for(p=i+1;p!=o;)m=(p-i)/d,b=(1-m)*(1-m),y=2*(1-m)*m,_=m*m,l=b*e.points[i].x+y*k+_*e.points[o].x,c=b*e.points[i].y+y*w+_*e.points[o].y,u=(e.points[p].x-l)*(e.points[p].x-l)+(e.points[p].y-c)*(e.points[p].y-c),u>n&&(s=!1),u>r&&(a=p,r=u),p=(p+1)%e.points.length;if(s)return[{type:"Q",x1:e.points[i].x,y1:e.points[i].y,x2:k,y2:w,x3:e.points[o].x,y3:e.points[o].y}];var x=v;return this.fitseq(e,t,n,i,x).concat(this.fitseq(e,t,n,x,o))}},{key:"batchtracepaths",value:function(e,t,n){var i=[];for(var o in e)e.hasOwnProperty(o)&&i.push(this.tracepath(e[o],t,n));return i}},{key:"batchtracelayers",value:function(e,t,n){var i=[];for(var o in e)e.hasOwnProperty(o)&&(i[o]=this.batchtracepaths(e[o],t,n));return i}},{key:"roundtodec",value:function(e,t){return Number(e.toFixed(t))}},{key:"svgpathstring",value:function(e,t,n,i){var o=e.layers[t],a=o[n],r="",s=void 0;if(i.linefilter&&a.segments.length<3)return r;if(r="<path "+(i.desc?'desc="l '+t+" p "+n+'" ':"")+this.tosvgcolorstr(e.palette[t],i)+'d="',i.roundcoords===-1){for(r+="M "+a.segments[0].x1*i.scale+" "+a.segments[0].y1*i.scale+" ",s=0;s<a.segments.length;s++)r+=a.segments[s].type+" "+a.segments[s].x2*i.scale+" "+a.segments[s].y2*i.scale+" ",a.segments[s].hasOwnProperty("x3")&&(r+=a.segments[s].x3*i.scale+" "+a.segments[s].y3*i.scale+" ");r+="Z "}else{for(r+="M "+this.roundtodec(a.segments[0].x1*i.scale,i.roundcoords)+" "+this.roundtodec(a.segments[0].y1*i.scale,i.roundcoords)+" ",s=0;s<a.segments.length;s++)r+=a.segments[s].type+" "+this.roundtodec(a.segments[s].x2*i.scale,i.roundcoords)+" "+this.roundtodec(a.segments[s].y2*i.scale,i.roundcoords)+" ",a.segments[s].hasOwnProperty("x3")&&(r+=this.roundtodec(a.segments[s].x3*i.scale,i.roundcoords)+" "+this.roundtodec(a.segments[s].y3*i.scale,i.roundcoords)+" ");r+="Z "}for(var l=0;l<a.holechildren.length;l++){var c=o[a.holechildren[l]];if(i.roundcoords===-1)for(r+=c.segments[c.segments.length-1].hasOwnProperty("x3")?"M "+c.segments[c.segments.length-1].x3*i.scale+" "+c.segments[c.segments.length-1].y3*i.scale+" ":"M "+c.segments[c.segments.length-1].x2*i.scale+" "+c.segments[c.segments.length-1].y2*i.scale+" ",s=c.segments.length-1;s>=0;s--)r+=c.segments[s].type+" ",c.segments[s].hasOwnProperty("x3")&&(r+=c.segments[s].x2*i.scale+" "+c.segments[s].y2*i.scale+" "),r+=c.segments[s].x1*i.scale+" "+c.segments[s].y1*i.scale+" ";else for(r+=c.segments[c.segments.length-1].hasOwnProperty("x3")?"M "+this.roundtodec(c.segments[c.segments.length-1].x3*i.scale)+" "+this.roundtodec(c.segments[c.segments.length-1].y3*i.scale)+" ":"M "+this.roundtodec(c.segments[c.segments.length-1].x2*i.scale)+" "+this.roundtodec(c.segments[c.segments.length-1].y2*i.scale)+" ",s=c.segments.length-1;s>=0;s--)r+=c.segments[s].type+" ",c.segments[s].hasOwnProperty("x3")&&(r+=this.roundtodec(c.segments[s].x2*i.scale)+" "+this.roundtodec(c.segments[s].y2*i.scale)+" "),r+=this.roundtodec(c.segments[s].x1*i.scale)+" "+this.roundtodec(c.segments[s].y1*i.scale)+" ";r+="Z "}if(r+='" />',i.lcpr||i.qcpr){for(s=0;s<a.segments.length;s++)a.segments[s].hasOwnProperty("x3")&&i.qcpr&&(r+='<circle cx="'+a.segments[s].x2*i.scale+'" cy="'+a.segments[s].y2*i.scale+'" r="'+i.qcpr+'" fill="cyan" stroke-width="'+.2*i.qcpr+'" stroke="black" />',r+='<circle cx="'+a.segments[s].x3*i.scale+'" cy="'+a.segments[s].y3*i.scale+'" r="'+i.qcpr+'" fill="white" stroke-width="'+.2*i.qcpr+'" stroke="black" />',r+='<line x1="'+a.segments[s].x1*i.scale+'" y1="'+a.segments[s].y1*i.scale+'" x2="'+a.segments[s].x2*i.scale+'" y2="'+a.segments[s].y2*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />',r+='<line x1="'+a.segments[s].x2*i.scale+'" y1="'+a.segments[s].y2*i.scale+'" x2="'+a.segments[s].x3*i.scale+'" y2="'+a.segments[s].y3*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />'),!a.segments[s].hasOwnProperty("x3")&&i.lcpr&&(r+='<circle cx="'+a.segments[s].x2*i.scale+'" cy="'+a.segments[s].y2*i.scale+'" r="'+i.lcpr+'" fill="white" stroke-width="'+.2*i.lcpr+'" stroke="black" />');for(var l=0;l<a.holechildren.length;l++){var c=o[a.holechildren[l]];for(s=0;s<c.segments.length;s++)c.segments[s].hasOwnProperty("x3")&&i.qcpr&&(r+='<circle cx="'+c.segments[s].x2*i.scale+'" cy="'+c.segments[s].y2*i.scale+'" r="'+i.qcpr+'" fill="cyan" stroke-width="'+.2*i.qcpr+'" stroke="black" />',r+='<circle cx="'+c.segments[s].x3*i.scale+'" cy="'+c.segments[s].y3*i.scale+'" r="'+i.qcpr+'" fill="white" stroke-width="'+.2*i.qcpr+'" stroke="black" />',r+='<line x1="'+c.segments[s].x1*i.scale+'" y1="'+c.segments[s].y1*i.scale+'" x2="'+c.segments[s].x2*i.scale+'" y2="'+c.segments[s].y2*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />',r+='<line x1="'+c.segments[s].x2*i.scale+'" y1="'+c.segments[s].y2*i.scale+'" x2="'+c.segments[s].x3*i.scale+'" y2="'+c.segments[s].y3*i.scale+'" stroke-width="'+.2*i.qcpr+'" stroke="cyan" />'),!c.segments[s].hasOwnProperty("x3")&&i.lcpr&&(r+='<circle cx="'+c.segments[s].x2*i.scale+'" cy="'+c.segments[s].y2*i.scale+'" r="'+i.lcpr+'" fill="white" stroke-width="'+.2*i.lcpr+'" stroke="black" />')}}return r}},{key:"getsvgstring",value:function(e,t){t=this.checkoptions(t);for(var n=e.width*t.scale,i=e.height*t.scale,o="<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+'" >',a=0;a<e.layers.length;a+=1)for(var r=0;r<e.layers[a].length;r+=1)e.layers[a][r].isholepath||(o+=this.svgpathstring(e,a,r,t));return o+="</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||(n=document.createElement("div"),n.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,o=void 0,a=void 0,r=void 0,s=void 0,l=void 0,c=void 0,u=void 0,d=void 0,h=void 0,f={width:e.width,height:e.height,data:[]};if(t=Math.floor(t),t<1)return e;t>5&&(t=5),n=Math.abs(n),n>1024&&(n=1024);var p=this.gks[t-1];for(o=0;o<e.height;o++)for(i=0;i<e.width;i++){for(l=0,c=0,u=0,d=0,h=0,a=-t;a<t+1;a++)i+a>0&&i+a<e.width&&(s=4*(o*e.width+i+a),l+=e.data[s]*p[a+t],c+=e.data[s+1]*p[a+t],u+=e.data[s+2]*p[a+t],d+=e.data[s+3]*p[a+t],h+=p[a+t]);s=4*(o*e.width+i),f.data[s]=Math.floor(l/h),f.data[s+1]=Math.floor(c/h),f.data[s+2]=Math.floor(u/h),f.data[s+3]=Math.floor(d/h)}var g=new Uint8ClampedArray(f.data);for(o=0;o<e.height;o++)for(i=0;i<e.width;i++){for(l=0,c=0,u=0,d=0,h=0,a=-t;a<t+1;a++)o+a>0&&o+a<e.height&&(s=4*((o+a)*e.width+i),l+=g[s]*p[a+t],c+=g[s+1]*p[a+t],u+=g[s+2]*p[a+t],d+=g[s+3]*p[a+t],h+=p[a+t]);s=4*(o*e.width+i),f.data[s]=Math.floor(l/h),f.data[s+1]=Math.floor(c/h),f.data[s+2]=Math.floor(u/h),f.data[s+3]=Math.floor(d/h)}for(o=0;o<e.height;o++)for(i=0;i<e.width;i++)s=4*(o*e.width+i),r=Math.abs(f.data[s]-e.data[s])+Math.abs(f.data[s+1]-e.data[s+1])+Math.abs(f.data[s+2]-e.data[s+2])+Math.abs(f.data[s+3]-e.data[s+3]),r>n&&(f.data[s]=e.data[s],f.data[s+1]=e.data[s+1],f.data[s+2]=e.data[s+2],f.data[s+3]=e.data[s+3]);return f}},{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;var n=e.getContext("2d");n.drawImage(i,0,0),t(e)}}},{key:"getImgdata",value:function(e){var t=e.getContext("2d");return t.getImageData(0,0,e.width,e.height)}},{key:"drawLayers",value:function(e,t,n,i){n=n||1;var o=void 0,a=void 0,r=void 0,s=void 0,l=void 0,c=void 0;i?(c=document.getElementById(i),c||(c=document.createElement("div"),c.id=i,document.body.appendChild(c))):(c=document.createElement("div"),document.body.appendChild(c));for(l in e)if(e.hasOwnProperty(l)){o=e[l][0].length,a=e[l].length;var u=document.createElement("canvas");u.width=o*n,u.height=a*n;var d=u.getContext("2d");for(s=0;s<a;s+=1)for(r=0;r<o;r+=1)d.fillStyle=this.torgbastr(t[e[l][s][r]%t.length]),d.fillRect(r*n,s*n,n,n);c.appendChild(u)}}}]),e}();t.default=o},function(e,t){"use strict";function n(e){var t=e.getOriginX(),n=e.getOriginY(),i=t.substring(0,1)+n.substring(0,1);e.startPoint=e.origins[i]}function i(e,t,n){var i=e.x,o=e.y,a=t.x,r=t.y,s=n*Math.PI/180,l=(a-i)*Math.cos(s)-(r-o)*Math.sin(s)+i,c=(a-i)*Math.sin(s)+(r-o)*Math.cos(s)+o;return{originX:i>l?"right":"left",originY:o>c?"bottom":"top"}}function o(e){return"center"===e.getOriginX()&&"center"===e.getOriginY()}function a(e,t){var n=t.getPointByOrigin("center","center"),o=-t.getAngle(),a=i(n,e,o),r=a.originX,s=a.originY,l=t.getPointByOrigin(r,s),c=t.getLeft()-(n.x-l.x),u=t.getTop()-(n.x-l.y);t.set({originX:r,originY:s,left:c,top:u}),t.setCoords()}function r(e,t){var n=t.startPoint,o=-t.getAngle(),a=i(n,e,o),r=a.originX,s=a.originY;t.setPositionByOrigin(n,r,s)}function s(e){var t=e.type,n=e.scaleX,i=e.scaleY,o=u[t],a=e[o.w]*n,r=e[o.h]*i;if(e.isRegular){var s=Math.max(n,i);a=e[o.w]*s,r=e[o.h]*s}var l={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};l[o.w]=a,l[o.h]=r,e.set(l)}function l(e,t){var n=t.type,i=t.strokeWidth,o=t.startPoint,a=c[n],r=u[n],s=!("triangle"!==t.type),l={},d=Math.abs(o.x-e.x)/a,h=Math.abs(o.y-e.y)/a;d>i&&(d-=i/a),h>i&&(h-=i/a),t.isRegular&&(d=h=Math.max(d,h),s&&(h=Math.sqrt(3)/2*d)),l[r.w]=d,l[r.h]=h,t.set(l)}var c={rect:1,circle:2,triangle:1},u={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};e.exports={setOrigins:function(e){var t=e.getPointByOrigin("left","top"),n=e.getPointByOrigin("right","top"),i=e.getPointByOrigin("right","bottom"),o=e.getPointByOrigin("left","bottom");e.origins={lt:t,rt:n,rb:i,lb:o}},resize:function(e,t,i){o(e)&&(a(t,e),n(e)),i?s(e,t):l(t,e),r(t,e)},adjustOriginToCenter:function(e){var t=e.getPointByOrigin("center","center"),n=e.getOriginX(),i=e.getOriginY(),o=e.getPointByOrigin(n,i),a=e.getLeft()+(t.x-o.x),r=e.getTop()+(t.y-o.y);e.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:a,top:r}),e.setCoords()}}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=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(3),s=i(r),l=n(2),c=i(l),u=n(90),d=i(u),h=n(92),f=i(h),p=n(44),g=i(p),v=n(4),m=i(v),b=n(85),y=i(b),_=n(1),k=i(_),w=n(5),x=k.default.eventNames,E=k.default.commandNames,C=k.default.keyCodes,O=k.default.rejectMessages,S=s.default.isUndefined,M=s.default.forEach,j=s.default.CustomEvents,T=function(){function e(t,n){o(this,e),n=s.default.extend({includeUI:!1,usageStatistics:!0},n),this.mode=null,this.activeObjectId=null,n.includeUI&&(this.ui=new f.default(t,n.includeUI,this.getActions()),n=this.ui.setUiDefaultSelectionStyle(n)),this._invoker=new d.default,this._graphics=new y.default(this.ui?this.ui.getEditorArea():t,{cssMaxWidth:n.cssMaxWidth,cssMaxHeight:n.cssMaxHeight,useItext:!!this.ui,useDragAddIcon:!!this.ui}),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),createdPath:this._onCreatedPath,addText:this._onAddText.bind(this),addObject:this._onAddObject.bind(this),addObjectAfter:this._onAddObjectAfter.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,w.sendHostName)(),this.ui&&(this.ui.initCanvas(),this.setReAction())}return a(e,[{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){"group"===t.type&&t.set(e)})}},{key:"_attachInvokerEvents",value:function(){var e=x.UNDO_STACK_CHANGED,t=x.REDO_STACK_CHANGED;this._invoker.on(e,this.fire.bind(this,e)),this._invoker.on(t,this.fire.bind(this,t))}},{key:"_attachGraphicsEvents",value:function(){this._graphics.on({mousedown:this._handlers.mousedown,objectMoved:this._handlers.objectMoved,objectScaled:this._handlers.objectScaled,objectActivated:this._handlers.objectActivated,addText:this._handlers.addText,addObject:this._handlers.addObject,textEditing:this._handlers.textEditing,textChanged:this._handlers.textChanged,iconCreateResize:this._handlers.iconCreateResize,iconCreateEnd:this._handlers.iconCreateEnd,selectionCleared:this._handlers.selectionCleared,selectionCreated:this._handlers.selectionCreated,addObjectAfter:this._handlers.addObjectAfter})}},{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=this._graphics.getActiveObject(),n=this._graphics.getActiveGroupObject(),i=t||n;(e.ctrlKey||e.metaKey)&&e.keyCode===C.Z&&this.undo().catch(function(){}),(e.ctrlKey||e.metaKey)&&e.keyCode===C.Y&&this.redo().catch(function(){}),e.keyCode!==C.BACKSPACE&&e.keyCode!==C.DEL||!i||(e.preventDefault(),this.removeActiveObject())}},{key:"removeActiveObject",value:function(){var e=this._graphics.getActiveObject(),t=this._graphics.getActiveGroupObject();if(t){var n=t.getObjects();this.discardSelection(),this._removeObjectStream(n)}else if(e){var i=this._graphics.getObjectId(e);this.removeObject(i)}}},{key:"_removeObjectStream",value:function(e){var t=this;if(!e.length)return!0;var n=e.pop();return this.removeObject(this._graphics.getObjectId(n)).then(function(){return t._removeObjectStream(e)})}},{key:"_onMouseDown",value:function(e,t){this.fire(x.MOUSE_DOWN,e,t)}},{key:"_pushAddObjectCommand",value:function(e){var t=m.default.create(E.ADD_OBJECT,this._graphics,e);this._invoker.pushUndoStack(t)}},{key:"_onObjectActivated",value:function(e){this.fire(x.OBJECT_ACTIVATED,e)}},{key:"_onObjectMoved",value:function(e){this.fire(x.OBJECT_MOVED,e)}},{key:"_onObjectScaled",value:function(e){this.fire(x.OBJECT_SCALED,e)}},{key:"getDrawingMode",value:function(){return this._graphics.getDrawingMode()}},{key:"clearObjects",value:function(){return this.execute(E.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:"execute",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var a=[this._graphics].concat(i);return(t=this._invoker).execute.apply(t,[e].concat(a))}},{key:"undo",value:function(){return this._invoker.undo()}},{key:"redo",value:function(){return this._invoker.redo()}},{key:"loadImageFromFile",value:function(e,t){if(!e)return c.default.reject(O.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(E.LOAD_IMAGE,t,e):c.default.reject(O.invalidParameters)}},{key:"addImageObject",value:function(e){return e?this.execute(E.ADD_IMAGE_OBJECT,e):c.default.reject(O.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):c.default.reject(O.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(E.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){return this.execute(E.ROTATE_IMAGE,e,t)}},{key:"rotate",value:function(e){return this._rotate("rotate",e)}},{key:"setAngle",value:function(e){return this._rotate("setAngle",e)}},{key:"setBrush",value:function(e){this._graphics.setBrush(e)}},{key:"setDrawingShape",value:function(e,t){this._graphics.setDrawingShape(e,t)}},{key:"addShape",value:function(e,t){return t=t||{},this._setPositions(t),this.execute(E.ADD_SHAPE,e,t)}},{key:"changeShape",value:function(e,t){return this.execute(E.CHANGE_SHAPE,e,t)}},{key:"addText",value:function(e,t){return e=e||"",t=t||{},this.execute(E.ADD_TEXT,e,t)}},{key:"changeText",value:function(e,t){return t=t||"",this.execute(E.CHANGE_TEXT,e,t)}},{key:"changeTextStyle",value:function(e,t){return this.execute(E.CHANGE_TEXT_STYLE,e,t)}},{key:"_changeActivateMode",value:function(e){"ICON"!==e&&this.getDrawingMode()!==e&&this.startDrawingMode(e)}},{key:"_onTextChanged",value:function(e){this.changeText(e.id,e.text)}},{key:"_onIconCreateResize",value:function(e){this.fire(x.ICON_CREATE_RESIZE,e)}},{key:"_onIconCreateEnd",value:function(e){this.fire(x.ICON_CREATE_END,e)}},{key:"_onTextEditing",value:function(){this.fire(x.TEXT_EDITING)}},{key:"_onAddText",value:function(e){this.fire(x.ADD_TEXT,{originPosition:e.originPosition,clientPosition:e.clientPosition})}},{key:"_onAddObject",value:function(e){var t=this._graphics.getObject(e.id);this._pushAddObjectCommand(t)}},{key:"_onAddObjectAfter",value:function(e){this.fire(x.ADD_OBJECT_AFTER,e)}},{key:"_selectionCleared",value:function(){this.fire(x.SELECTION_CLEARED)}},{key:"_selectionCreated",value:function(e){this.fire(x.SELECTION_CREATED,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(E.ADD_ICON,e,t)}},{key:"changeIconColor",value:function(e,t){return this.execute(E.CHANGE_ICON_COLOR,e,t)}},{key:"removeObject",value:function(e){return this.execute(E.REMOVE_OBJECT,e)}},{key:"hasFilter",value:function(e){return this._graphics.hasFilter(e)}},{key:"removeFilter",value:function(e){return this.execute(E.REMOVE_FILTER,e)}},{key:"applyFilter",value:function(e,t){return this.execute(E.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(E.RESIZE_CANVAS_DIMENSION,e):c.default.reject(O.invalidParameters)}},{key:"destroy",value:function(){var e=this;this.stopDrawingMode(),this._detachDomEvents(),this._graphics.destroy(),this._graphics=null,M(this,function(t,n){e[n]=null},this)}},{key:"_setPositions",value:function(e){var t=this._graphics.getCenter();S(e.left)&&(e.left=t.left),S(e.top)&&(e.top=t.top)}},{key:"setObjectProperties",value:function(e,t){return this.execute(E.SET_OBJECT_PROPERTIES,e,t)}},{key:"setObjectPropertiesQuietly",value:function(e,t){this._graphics.setObjectProperties(e,t)}},{key:"getObjectProperties",value:function(e,t){var n=this._graphics.getObject(e);return n?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(E.SET_OBJECT_POSITION,e,t)}}]),e}();g.default.mixin(T),j.mixin(T),e.exports=T},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=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(31),s=i(r),l=s.default.create,c=s.default.types,u=function(){function e(t,n){o(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 a(e,[{key:"execute",value:function(){throw new Error(l(c.UN_IMPLEMENTATION,"execute"))}},{key:"undo",value:function(){throw new Error(l(c.UN_IMPLEMENTATION,"undo"))}},{key:"setExecuteCallback",value:function(e){return this.executeCallback=e,this}},{key:"setUndoCallback",value:function(e){return this.undoCallback=e,this}}]),e}();e.exports=u},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=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(3),s=i(r),l=n(2),c=i(l),u=n(4),d=i(u),h=n(1),f=i(h),p=f.default.eventNames,g=f.default.rejectMessages,v=s.default.isFunction,m=s.default.isString,b=s.default.CustomEvents,y=function(){function e(){o(this,e),this._undoStack=[],this._redoStack=[],this._isLocked=!1}return a(e,[{key:"_invokeExecution",value:function(e){var t=this;this.lock();var n=e.args;return n||(n=[]),e.execute.apply(e,n).then(function(n){return t.pushUndoStack(e),t.unlock(),v(e.executeCallback)&&e.executeCallback(n),n}).catch(function(e){return t.unlock(),c.default.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.unlock(),v(e.undoCallback)&&e.undoCallback(n),n}).catch(function(e){return t.unlock(),c.default.reject(e)})}},{key:"_fireRedoStackChanged",value:function(){this.fire(p.REDO_STACK_CHANGED,this._redoStack.length)}},{key:"_fireUndoStackChanged",value:function(){this.fire(p.UNDO_STACK_CHANGED,this._undoStack.length)}},{key:"lock",value:function(){this._isLocked=!0}},{key:"unlock",value:function(){this._isLocked=!1}},{key:"execute",value:function(){var e=this;if(this._isLocked)return c.default.reject(g.isLock);for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var o=n[0];return m(o)&&(o=d.default.create.apply(d.default,n)),this._invokeExecution(o).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=g.undo,this._isLocked&&(n=n+" Because "+g.isLock),t=c.default.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)):(n=g.redo,this._isLocked&&(n=n+" Because "+g.isLock),t=c.default.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}();b.mixin(y),e.exports=y},function(e,t){"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}),/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
"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="prototype",i=e.Element[n],o=Object,a=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[n].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},l=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 r.call(e,t)},c=function(e){for(var t=a.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())}},u=c[n]=[],d=function(){return new c(this)};if(s[n]=Error[n],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",l(this,e)!==-1},u.add=function(){var e,t=arguments,n=0,i=t.length,o=!1;do e=t[n]+"",l(this,e)===-1&&(this.push(e),o=!0);while(++n<i);o&&this._updateClassName()},u.remove=function(){var e,t,n=arguments,i=0,o=n.length,a=!1;do for(e=n[i]+"",t=l(this,e);t!==-1;)this.splice(t,1),a=!0,t=l(this,e);while(++i<o);a&&this._updateClassName()},u.toggle=function(e,t){e+="";var n=this.contains(e),i=n?t!==!0&&"remove":t!==!1&&"add";return i&&this[i](e),t===!0||t===!1?t:!n},u.toString=function(){return this.join(" ")},o.defineProperty){var h={get:d,enumerable:!0,configurable:!0};try{o.defineProperty(i,t,h)}catch(e){void 0!==e.number&&e.number!==-2146823252||(h.enumerable=!1,o.defineProperty(i,t,h))}}else o[n].__defineGetter__&&i.__defineGetter__(t,d)}}(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}()),/*!
	 * @copyright Copyright (c) 2017 IcoMoon.io
	 * @license   Licensed under MIT license
	 *            See https://github.com/Keyamoon/svgxuse
	 * @version   1.2.6
	 */
function(){if("undefined"!=typeof window&&window.addEventListener){var e,t,n=Object.create(null),i=function(){clearTimeout(t),t=setTimeout(e,100)},o=function(){},a=function(){var e;window.addEventListener("resize",i,!1),window.addEventListener("orientationchange",i,!1),window.MutationObserver?(e=new MutationObserver(i),e.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),o=function(){try{e.disconnect(),window.removeEventListener("resize",i,!1),window.removeEventListener("orientationchange",i,!1)}catch(e){}}):(document.documentElement.addEventListener("DOMSubtreeModified",i,!1),o=function(){document.documentElement.removeEventListener("DOMSubtreeModified",i,!1),window.removeEventListener("resize",i,!1),window.removeEventListener("orientationchange",i,!1)})},r=function(e){function t(e){var t;return void 0!==e.protocol?t=e:(t=document.createElement("a"),t.href=e),t.protocol.replace(/:/g,"")+t.host}var n,i,o;return window.XMLHttpRequest&&(n=new XMLHttpRequest,i=t(location),o=t(e),n=void 0===n.withCredentials&&""!==o&&o!==i?XDomainRequest||void 0:XMLHttpRequest),n},s="http://www.w3.org/1999/xlink";e=function(){function e(){_-=1,0===_&&(o(),a())}function t(e){return function(){n[e.base]!==!0&&(e.useEl.setAttributeNS(s,"xlink:href","#"+e.hash),e.useEl.hasAttribute("href")&&e.useEl.setAttribute("href","#"+e.hash))}}function i(t){return function(){var n,i=document.body,o=document.createElement("x");t.onload=null,o.innerHTML=t.responseText,n=o.getElementsByTagName("svg")[0],n&&(n.setAttribute("aria-hidden","true"),n.style.position="absolute",n.style.width=0,n.style.height=0,n.style.overflow="hidden",i.insertBefore(n,i.firstChild)),e()}}function l(t){return function(){t.onerror=null,t.ontimeout=null,e()}}var c,u,d,h,f,p,g,v,m,b,y="",_=0;for(o(),m=document.getElementsByTagName("use"),f=0;f<m.length;f+=1){try{u=m[f].getBoundingClientRect()}catch(e){u=!1}h=m[f].getAttribute("href")||m[f].getAttributeNS(s,"href")||m[f].getAttribute("xlink:href"),v=h&&h.split?h.split("#"):["",""],c=v[0],d=v[1],p=u&&0===u.left&&0===u.right&&0===u.top&&0===u.bottom,u&&0===u.width&&0===u.height&&!p?(y&&!c.length&&d&&!document.getElementById(d)&&(c=y),m[f].hasAttribute("href")&&m[f].setAttributeNS(s,"xlink:href",h),c.length&&(b=n[c],b!==!0&&setTimeout(t({useEl:m[f],base:c,hash:d}),0),void 0===b&&(g=r(c),void 0!==g&&(b=new g,n[c]=b,b.onload=i(b),b.onerror=l(b),b.ontimeout=l(b),b.open("GET",c),b.send(),_+=1)))):p?c.length&&n[c]&&setTimeout(t({useEl:m[f],base:c,hash:d}),0):void 0===n[c]?n[c]=!0:n[c].onload&&(n[c].abort(),delete n[c].onload,n[c]=!0)}m="",_+=1,e()};var l;l=function(){window.removeEventListener("load",l,!1),t=setTimeout(e,0)},"complete"!==document.readyState?window.addEventListener("load",l,!1):l()}}()},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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(3),s=i(r),l=n(5),c=i(l),u=n(103),d=i(u),h=n(102),f=i(h),p=n(116),g=i(p),v=n(101),m=i(v),b=n(93),y=i(b),_=n(96),k=i(_),w=n(100),x=i(w),E=n(114),C=i(E),O=n(99),S=i(O),M=n(97),j=i(M),T=n(94),P=i(T),A=n(95),I=i(A),R=n(98),D=i(R),L={Shape:m.default,Crop:y.default,Flip:k.default,Rotate:x.default,Text:C.default,Mask:S.default,Icon:j.default,Draw:P.default,Filter:I.default},N="1300",B=function(){function e(t,n,i){o(this,e),this.options=this._initializeOption(n),this._actions=i,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new D.default(this.options.locale),this.theme=new g.default(this.options.theme),this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuElement=null,this._subMenuElement=null,this._makeUiElement(t),this._setUiSize(),this._initMenuEvent=!1,this._els={undo:this._menuElement.querySelector("#tie-btn-undo"),redo:this._menuElement.querySelector("#tie-btn-redo"),reset:this._menuElement.querySelector("#tie-btn-reset"),delete:this._menuElement.querySelector("#tie-btn-delete"),deleteAll:this._menuElement.querySelector("#tie-btn-delete-all"),download:this._selectedElement.querySelectorAll(".tui-image-editor-download-btn"),load:this._selectedElement.querySelectorAll(".tui-image-editor-load-btn")},this._makeSubMenu()}return a(e,[{key:"setUiDefaultSelectionStyle",value:function(e){return s.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 o=this._getEditorDimension(),a=o.width,r=o.height,s=this._editorElement.style,l=this.options.menuBarPosition;s.height=r+"px",s.width=a+"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<N?c.add("tui-image-editor-top-optimization"):c.remove("tui-image-editor-top-optimization")}},{key:"changeUndoButtonStatus",value:function(e){e?this._els.undo.classList.add("enabled"):this._els.undo.classList.remove("enabled")}},{key:"changeRedoButtonStatus",value:function(e){e?this._els.redo.classList.add("enabled"):this._els.redo.classList.remove("enabled")}},{key:"changeResetButtonStatus",value:function(e){e?this._els.reset.classList.add("enabled"):this._els.reset.classList.remove("enabled")}},{key:"changeDeleteAllButtonEnabled",value:function(e){e?this._els.deleteAll.classList.add("enabled"):this._els.deleteAll.classList.remove("enabled")}},{key:"changeDeleteButtonEnabled",value:function(e){e?this._els.delete.classList.add("enabled"):this._els.delete.classList.remove("enabled")}},{key:"_initializeOption",value:function(e){return s.default.extend({loadImage:{path:"",name:""},locale:{},menuIconPath:"",menu:["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;s.default.forEach(this.options.menu,function(t){var n=L[t.replace(/^[a-z]/,function(e){return e.toUpperCase()})];e._makeMenuElement(t),e._els[t]=e._menuElement.querySelector("#tie-btn-"+t),e[t]=new n(e._subMenuElement,{locale:e._locale,iconStyle:e.theme.getStyle("submenu.icon"),menuBarPosition:e.options.menuBarPosition})})}},{key:"_makeUiElement",value:function(e){var t=void 0;window.snippet=s.default,t=e.nodeType?e:document.querySelector(e);var n=c.default.getSelector(t);t.classList.add("tui-image-editor-container"),t.innerHTML=(0,f.default)({locale:this._locale,biImage:this.theme.getStyle("common.bi"),iconStyle:this.theme.getStyle("menu.icon"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton")})+(0,d.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._menuElement=n(".tui-image-editor-menu"),this._subMenuElement=n(".tui-image-editor-submenu")}},{key:"_makeMenuElement",value:function(e){var t=document.createElement("li"),n=this.theme.getStyle("menu.icon"),i=n.normal,o=n.active,a=n.hover,r='\n            <svg class="svg_ic-menu">\n                <use xlink:href="'+i.path+"#"+i.name+"-ic-"+e+'" class="normal"/>\n                <use xlink:href="'+o.path+"#"+o.name+"-ic-"+e+'" class="active"/>\n                <use xlink:href="'+a.path+"#"+a.name+"-ic-"+e+'" class="hover"/>\n            </svg>\n        ';t.id="tie-btn-"+e,t.className="tui-image-editor-item normal",t.title=this._locale.localize(e.replace(/^[a-z]/g,function(e){return e.toUpperCase()})),t.innerHTML=r,this._menuElement.appendChild(t)}},{key:"_addHelpActionEvent",value:function(e){var t=this;this._els[e].addEventListener("click",function(){t._actions.main[e]()})}},{key:"_addDownloadEvent",value:function(){var e=this;s.default.forEach(this._els.download,function(t){t.addEventListener("click",function(){e._actions.main.download()})})}},{key:"_addLoadEvent",value:function(){var e=this;s.default.forEach(this._els.load,function(t){t.addEventListener("change",function(t){e._actions.main.load(t.target.files[0])})})}},{key:"_addMenuEvent",value:function(e){var t=this;this._els[e].addEventListener("click",function(){t.changeMenu(e)})}},{key:"_addSubMenuEvent",value:function(e){this[e].addEvent(this._actions[e])}},{key:"getEditorArea",value:function(){return this._editorElement}},{key:"activeMenuEvent",value:function(){var e=this;this._initMenuEvent||(this._addHelpActionEvent("undo"),this._addHelpActionEvent("redo"),this._addHelpActionEvent("reset"),this._addHelpActionEvent("delete"),this._addHelpActionEvent("deleteAll"),this._addDownloadEvent(),s.default.forEach(this.options.menu,function(t){e._addMenuEvent(t),e._addSubMenuEvent(t)}),this._initMenu(),this._initMenuEvent=!0)}},{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="tui-image-editor-grid-visual";var i='<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>';n.innerHTML=i,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._els[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._els[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._els[this.options.initMenu].dispatchEvent(e)}this.icon&&this.icon.registDefaultIcon()}},{key:"_getEditorDimension",value:function(){var e=parseFloat(this._editorContainerElement.style.maxHeight),t=this.imageSize.newHeight>e?e:this.imageSize.newHeight,n=parseFloat(this._editorContainerElement.style.maxWidth),i=this.imageSize.newWidth>n?n:this.imageSize.newWidth;return{width:i,height:t}}},{key:"_setEditorPosition",value:function(e){var t=this._getEditorDimension(),n=t.width,i=t.height,o=this._editorElement.style,a=0,r=0;this.submenu&&("bottom"===e?a=i>this._editorElementWrap.scrollHeight-150?(i-this._editorElementWrap.scrollHeight)/2:-75:"top"===e?a=i>this._editorElementWrap.offsetHeight-150?75-(i-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===e?r=n>this._editorElementWrap.offsetWidth-248?124-(n-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===e&&(r=n>this._editorElementWrap.scrollWidth-248?(n-this._editorElementWrap.scrollWidth)/2:-124)),o.top=a+"px",o.left=r+"px"}}]),e}();t.default=B},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(3),c=i(l),u=n(10),d=i(u),h=n(105),f=i(h),p=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"crop",iconStyle:r,menuBarPosition:s,templateHtml:f.default}));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 r(t,e),s(t,[{key:"addEvent",value:function(e){var t=this;this.actions=e,this._els.apply.addEventListener("click",function(){t.actions.crop(),t._els.apply.classList.remove("active")}),this._els.cancel.addEventListener("click",function(){t.actions.cancel(),t._els.apply.classList.remove("active")}),this._els.preset.addEventListener("click",function(e){var n=e.target.closest(".tui-image-editor-button.preset");if(n){var i=n.className.match(/preset-[^\s]+/),o=i[0];t._setPresetButtonActive(n),t.actions.preset(o)}})}},{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;c.default.forEach([].slice.call(this._els.preset.querySelectorAll(".preset")),function(e){e.classList.remove("active")}),e&&e.classList.add("active")}}]),t}(d.default);t.default=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(5),c=i(l),u=n(14),d=i(u),h=n(15),f=i(h),p=n(10),g=i(p),v=n(106),m=i(v),b=n(1),y=.7,_=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"draw",iconStyle:r,menuBarPosition:s,templateHtml:m.default}));return l._els={lineSelectButton:l.selector("#tie-draw-line-select-button"),drawColorpicker:new d.default(l.selector("#tie-draw-color"),"#00a9ff",l.toggleDirection),drawRange:new f.default(l.selector("#tie-draw-range"),b.defaultDrawRangeValus),drawRangeValue:l.selector("#tie-draw-range-value")},l.type=null,l.color=l._els.drawColorpicker.color,l.width=l._els.drawRange.value,l}return r(t,e),s(t,[{key:"addEvent",value:function(e){this.actions=e,this._els.lineSelectButton.addEventListener("click",this._changeDrawType.bind(this)),this._els.drawColorpicker.on("change",this._changeDrawColor.bind(this)),this._els.drawRange.on("change",this._changeDrawRange.bind(this)),this._els.drawRangeValue.value=this._els.drawRange.value,this._els.drawRangeValue.setAttribute("readonly",!0)}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:c.default.getRgb(this.color,y)})}},{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){e=c.default.toInteger(e),this._els.drawRangeValue.value=e,this.width=e,this.type?this.setDrawMode():this.changeStartMode()}}]),t}(g.default);t.default=_},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(3),c=i(l),u=n(14),d=i(u),h=n(15),f=i(h),p=n(10),g=i(p),v=n(107),m=i(v),b=n(5),y=n(1),_="130px",k=["add","diff","subtract","multiply","screen","lighten","darken"],w=["grayscale","invert","sepia","sepia2","blur","sharpen","emboss","remove-white","gradient-transparency","brightness","noise","pixelate","color-filter","tint","multiply","blend"],x=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"filter",iconStyle:r,menuBarPosition:s,templateHtml:m.default}));return l.selectBoxShow=!1,l.checkedMap={},l._makeControlElement(),l}return r(t,e),s(t,[{key:"addEvent",value:function(e){var t=this,n=e.applyFilter,i=this._changeRangeValue.bind(this,n);c.default.forEach(w,function(e){var n=t.selector("#tie-"+e),o=(0,b.toCamelCase)(e);t.checkedMap[o]=n,n.addEventListener("change",function(){return i(o)})}),this._els.removewhiteThresholdRange.on("change",function(){return i("removeWhite")}),this._els.removewhiteDistanceRange.on("change",function(){return i("removeWhite")}),this._els.gradientTransparencyRange.on("change",function(){return i("gradientTransparency")}),this._els.colorfilterThresholeRange.on("change",function(){return i("colorFilter")}),this._els.pixelateRange.on("change",function(){return i("pixelate")}),this._els.noiseRange.on("change",function(){return i("noise")}),this._els.brightnessRange.on("change",function(){return i("brightness")}),this._els.blendType.addEventListener("change",function(){return i("blend")}),this._els.filterBlendColor.on("change",function(){return i("blend")}),this._els.filterMultiplyColor.on("change",function(){return i("multiply")}),this._els.tintOpacity.on("change",function(){return i("tint")}),this._els.filterTintColor.on("change",function(){return i("tint")}),this._els.blendType.addEventListener("click",function(e){return e.stopPropagation()}),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))}},{key:"_changeRangeValue",value:function(e,t){var n=this.checkedMap[t].checked,i=t,o=this.checkedMap[t].closest(".tui-image-editor-checkbox-group");o&&(n?o.classList.remove("tui-image-editor-disabled"):o.classList.add("tui-image-editor-disabled")),e(n,i,this._getFilterOption(i))}},{key:"_getFilterOption",value:function(e){var t={};switch(e){case"removeWhite":t.threshold=(0,b.toInteger)(this._els.removewhiteThresholdRange.value),t.distance=(0,b.toInteger)(this._els.removewhiteDistanceRange.value);break;case"gradientTransparency":t.threshold=(0,b.toInteger)(this._els.gradientTransparencyRange.value);break;case"colorFilter":t.color="#FFFFFF",t.threshold=this._els.colorfilterThresholeRange.value;break;case"pixelate":t.blocksize=(0,b.toInteger)(this._els.pixelateRange.value);break;case"noise":t.noise=(0,b.toInteger)(this._els.noiseRange.value);break;case"brightness":t.brightness=(0,b.toInteger)(this._els.brightnessRange.value);break;case"blend":t.color=this._els.filterBlendColor.color,t.mode=this._els.blendType.value;break;case"multiply":t.color=this._els.filterMultiplyColor.color;break;case"tint":t.color=this._els.filterTintColor.color,t.opacity=this._els.tintOpacity.value}return t}},{key:"_makeControlElement",value:function(){var e=this.selector;this._els={removewhiteThresholdRange:new f.default(e("#tie-removewhite-threshold-range"),y.defaultFilterRangeValus.removewhiteThresholdRange),removewhiteDistanceRange:new f.default(e("#tie-removewhite-distance-range"),y.defaultFilterRangeValus.removewhiteDistanceRange),gradientTransparencyRange:new f.default(e("#tie-gradient-transparency-range"),y.defaultFilterRangeValus.gradientTransparencyRange),brightnessRange:new f.default(e("#tie-brightness-range"),y.defaultFilterRangeValus.brightnessRange),noiseRange:new f.default(e("#tie-noise-range"),y.defaultFilterRangeValus.noiseRange),pixelateRange:new f.default(e("#tie-pixelate-range"),y.defaultFilterRangeValus.pixelateRange),colorfilterThresholeRange:new f.default(e("#tie-colorfilter-threshole-range"),y.defaultFilterRangeValus.colorfilterThresholeRange),filterTintColor:new d.default(e("#tie-filter-tint-color"),"#03bd9e",this.toggleDirection),filterMultiplyColor:new d.default(e("#tie-filter-multiply-color"),"#515ce6",this.toggleDirection),filterBlendColor:new d.default(e("#tie-filter-blend-color"),"#ffbb3b",this.toggleDirection)},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)}},{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=_,new f.default(i,y.defaultFilterRangeValus.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=_,this._drawSelectOptionList(n,i),this._pickerWithSelectboxForAddEvent(n,i),n}},{key:"_drawSelectOptionList",value:function(e,t){var n=e.querySelectorAll("option");c.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 o=i.target.getAttribute("data-item"),a=document.createEvent("HTMLEvents");e.querySelector('[value="'+o+'"]').selected=!0,a.initEvent("change",!0,!0),e.dispatchEvent(a),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){c.default.forEach(k,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}(g.default);t.default=x},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(3),c=i(l),u=n(10),d=i(u),h=n(108),f=i(h),p=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"flip",iconStyle:r,menuBarPosition:s,templateHtml:f.default}));return l.flipStatus=!1,l._els={flipButton:l.selector("#tie-flip-button")},l}return r(t,e),s(t,[{key:"addEvent",value:function(e){this._actions=e,this._els.flipButton.addEventListener("click",this._changeFlip.bind(this))}},{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"),c.default.forEach(["flipX","flipY"],function(i){n.remove(i),e[i]&&(n.add(i),n.add("resetFlip"),t.flipStatus=!0)})})}}}]),t}(d.default);t.default=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(3),c=i(l),u=n(14),d=i(u),h=n(10),f=i(h),p=n(109),g=i(p),v=n(5),m=n(1),b=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"icon",iconStyle:r,menuBarPosition:s,templateHtml:g.default}));return l.iconType=null,l._iconMap={},l._els={registIconButton:l.selector("#tie-icon-image-file"),addIconButton:l.selector("#tie-icon-add-button"),iconColorpicker:new d.default(l.selector("#tie-icon-color"),"#ffbb3b",l.toggleDirection)},l}return r(t,e),s(t,[{key:"addEvent",value:function(e){this.actions=e,this._els.iconColorpicker.on("change",this._changeColorHandler.bind(this)),this._els.registIconButton.addEventListener("change",this._registeIconHandler.bind(this)),this._els.addIconButton.addEventListener("click",this._addIconHandler.bind(this))}},{key:"clearIconType",value:function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null}},{key:"registDefaultIcon",value:function(){var e=this;c.default.forEach(m.defaultIconPath,function(t,n){e.actions.registDefalutIcons(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:"_registeIconHandler",value:function(e){var t=void 0;v.isSupportFileApi||alert("This browser does not support file-api");var n=e.target.files,i=n[0];i&&(t=URL.createObjectURL(i),this.actions.registCustomIcon(t,i))}}]),t}(f.default);t.default=b},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}}(),o=function(){function e(t){n(this,e),this._locale=t}return i(e,[{key:"localize",value:function(e){return this._locale[e]||e}}]),e}();t.default=o},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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;
}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(10),c=i(l),u=n(5),d=i(u),h=n(110),f=i(h),p=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"mask",iconStyle:r,menuBarPosition:s,templateHtml:f.default}));return l._els={applyButton:l.selector("#tie-mask-apply"),maskImageButton:l.selector("#tie-mask-image-file")},l}return r(t,e),s(t,[{key:"addEvent",value:function(e){this.actions=e,this._els.maskImageButton.addEventListener("change",this._loadMaskFile.bind(this)),this._els.applyButton.addEventListener("click",this._applyMask.bind(this))}},{key:"_applyMask",value:function(){this.actions.applyFilter(),this._els.applyButton.classList.remove("active")}},{key:"_loadMaskFile",value:function(e){var t=void 0;d.default.isSupportFileApi()||alert("This browser does not support file-api");var n=e.target.files,i=n[0];i&&(t=URL.createObjectURL(i),this.actions.loadImageFromURL(t,i),this._els.applyButton.classList.add("active"))}}]),t}(c.default);t.default=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(15),c=i(l),u=n(10),d=i(u),h=n(111),f=i(h),p=n(5),g=n(1),v=30,m=-30,b=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"rotate",iconStyle:r,menuBarPosition:s,templateHtml:f.default}));return l._els={rotateButton:l.selector("#tie-retate-button"),rotateRange:new c.default(l.selector("#tie-rotate-range"),g.defaultRotateRangeValus),rotateRangeValue:l.selector("#tie-ratate-range-value")},l}return r(t,e),s(t,[{key:"addEvent",value:function(e){this.actions=e,this._els.rotateButton.addEventListener("click",this._changeRotateForButton.bind(this)),this._els.rotateRange.on("change",this._changeRotateForRange.bind(this)),this._els.rotateRangeValue.setAttribute("readonly",!0)}},{key:"_changeRotateForRange",value:function(e){var t=(0,p.toInteger)(e);this._els.rotateRangeValue.value=t,this.actions.setAngle(t)}},{key:"_changeRotateForButton",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=this.getButtonType(t,["counterclockwise","clockwise"]),i={clockwise:v,counterclockwise:m}[n];this.actions.rotate(i)}}}]),t}(d.default);t.default=b},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(14),c=i(l),u=n(15),d=i(u),h=n(10),f=i(h),p=n(112),g=i(p),v=n(5),m=n(1),b={stroke:"#ffbb3b",fill:"",strokeWidth:3},y=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"shape",iconStyle:r,menuBarPosition:s,templateHtml:g.default}));return l.type=null,l.options=b,l._els={shapeSelectButton:l.selector("#tie-shape-button"),shapeColorButton:l.selector("#tie-shape-color-button"),strokeRange:new d.default(l.selector("#tie-stroke-range"),m.defaultShapeStrokeValus),strokeRangeValue:l.selector("#tie-stroke-range-value"),fillColorpicker:new c.default(l.selector("#tie-color-fill"),"",l.toggleDirection),strokeColorpicker:new c.default(l.selector("#tie-color-stroke"),"#ffbb3b",l.toggleDirection)},l.colorPickerControls.push(l._els.fillColorpicker),l.colorPickerControls.push(l._els.strokeColorpicker),l}return r(t,e),s(t,[{key:"addEvent",value:function(e){this.actions=e,this._els.shapeSelectButton.addEventListener("click",this._changeShapeHandler.bind(this)),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)),this._els.strokeRangeValue.value=this._els.strokeRange.value,this._els.strokeRangeValue.setAttribute("readonly",!0)}},{key:"setShapeStatus",value:function(e){var t=e.strokeWidth,n=e.strokeColor,i=e.fillColor;this._els.strokeRange.value=t,this._els.strokeRange.trigger("change"),this._els.strokeColorpicker.color=n,this._els.fillColorpicker.color=i,this.options.stroke=n,this.options.fill=i,this.options.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("triangle"),this._els.shapeSelectButton.classList.remove("rect")}},{key:"setMaxStrokeValue",value:function(e){var t=e;t<=0&&(t=m.defaultShapeStrokeValus.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){this.options.strokeWidth=(0,v.toInteger)(e),this._els.strokeRangeValue.value=(0,v.toInteger)(e),this.actions.changeShape({strokeWidth:e}),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}(f.default);t.default=y},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.biImage,i=e.iconStyle,o=i.normal,a=i.hover,r=i.disabled,s=e.loadButtonStyle,l=e.downloadButtonStyle;return'\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">\n            <li id="tie-btn-undo" class="tui-image-editor-item" title="'+t.localize("Undo")+'">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-undo" class="enabled"/>\n                    <use xlink:href="'+r.path+"#"+r.name+'-ic-undo" class="normal"/>\n                    <use xlink:href="'+a.path+"#"+a.name+'-ic-undo" class="hover"/>\n                </svg>\n            </li>\n            <li id="tie-btn-redo" class="tui-image-editor-item" title="'+t.localize("Redo")+'">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-redo" class="enabled"/>\n                    <use xlink:href="'+r.path+"#"+r.name+'-ic-redo" class="normal"/>\n                    <use xlink:href="'+a.path+"#"+a.name+'-ic-redo" class="hover"/>\n                </svg>\n            </li>\n            <li id="tie-btn-reset" class="tui-image-editor-item" title="'+t.localize("Reset")+'">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-reset" class="enabled"/>\n                    <use xlink:href="'+r.path+"#"+r.name+'-ic-reset" class="normal"/>\n                    <use xlink:href="'+a.path+"#"+a.name+'-ic-reset" class="hover"/>\n                </svg>\n            </li>\n            <li class="tui-image-editor-item">\n                <div class="tui-image-editor-icpartition"></div>\n            </li>\n            <li id="tie-btn-delete" class="tui-image-editor-item" title="'+t.localize("Delete")+'">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-delete" class="enabled"/>\n                    <use xlink:href="'+r.path+"#"+r.name+'-ic-delete" class="normal"/>\n                    <use xlink:href="'+a.path+"#"+a.name+'-ic-delete" class="hover"/>\n                </svg>\n            </li>\n            <li id="tie-btn-delete-all" class="tui-image-editor-item" title="'+t.localize("Delete-all")+'">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-delete-all" class="enabled"/>\n                    <use xlink:href="'+r.path+"#"+r.name+'-ic-delete-all" class="normal"/>\n                    <use xlink:href="'+a.path+"#"+a.name+'-ic-delete-all" class="hover"/>\n                </svg>\n            </li>\n            <li class="tui-image-editor-item">\n                <div class="tui-image-editor-icpartition"></div>\n            </li>\n        </ul>\n\n        <div class="tui-image-editor-controls-buttons">\n            <div style="'+s+'">\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="'+l+'">\n                '+t.localize("Download")+"\n            </button>\n        </div>\n    </div>\n"}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.biImage,i=e.commonStyle,o=e.headerStyle,a=e.loadButtonStyle,r=e.downloadButtonStyle,s=e.submenuStyle;return'\n    <div class="tui-image-editor-main-container" style="'+i+'">\n        <div class="tui-image-editor-header" style="'+o+'">\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="'+a+'">\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="'+r+'">\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="'+s+'"></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'}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.subMenuLabelActive,n=e.subMenuLabelNormal,i=e.subMenuRangeTitle,o=e.submenuPartitionVertical,a=e.submenuPartitionHorizontal,r=e.submenuCheckbox,s=e.submenuRangePointer,l=e.submenuRangeValue,c=e.submenuColorpickerTitle,u=e.submenuColorpickerButton,d=e.submenuRangeBar,h=e.submenuRangeSubbar,f=e.submenuDisabledRangePointer,p=e.submenuDisabledRangeBar,g=e.submenuDisabledRangeSubbar,v=e.submenuIconSize,m=e.menuIconSize,b=e.biSize;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-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.left .tui-image-editor-button.left label,\n    #tie-text-align-button.center .tui-image-editor-button.center label,\n    #tie-text-align-button.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 input + label {\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        "+n+"\n    }\n    .tui-image-editor-container .tui-image-editor-range-wrap label {\n        "+i+"\n    }\n    .tui-image-editor-container .tui-image-editor-partition > div {\n        "+o+"\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        "+a+"\n    }\n    .tui-image-editor-container .tui-image-editor-checkbox input + label:before {\n        "+r+"\n    }\n    .tui-image-editor-container .tui-image-editor-checkbox input:checked + label:before {\n        border: 0;\n    }\n    .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n        "+s+"\n    }\n    .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n        "+d+"\n    }\n    .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n        "+h+"\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        "+m+"\n    }\n    .tui-image-editor-container .svg_ic-submenu {\n        "+v+"\n    }\n    .tui-image-editor-container .tui-image-editor-controls-logo > img,\n    .tui-image-editor-container .tui-image-editor-header-logo > img {\n        "+b+"\n    }\n\n"}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li id="tie-crop-preset-button">\n            <div class="tui-image-editor-button preset preset-none active">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-shape-rectangle"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-shape-rectangle"\n                            class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Custom")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-square">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-crop"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-crop"\n                            class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Square")+' </label>\n            </div>\n            <div class="tui-image-editor-button preset preset-3-2">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-crop"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-crop"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-crop"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-crop"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-crop"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-crop"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-crop"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-crop"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-crop"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-crop"\n                            class="active"/>\n                    </svg>\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 id="tie-crop-button" class="action">\n            <div class="tui-image-editor-button apply">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+i.path+"#"+i.name+'-ic-apply" class="normal"/>\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-apply" class="active"/>\n                </svg>\n                <label>\n                    '+t.localize("Apply")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button cancel">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+i.path+"#"+i.name+'-ic-cancel" class="normal"/>\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-cancel" class="active"/>\n                </svg>\n                <label>\n                    '+t.localize("Cancel")+"\n                </label>\n            </div>\n        </li>\n    </ul>\n"}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li id="tie-draw-line-select-button">\n            <div class="tui-image-editor-button free">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-draw-free" class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-draw-free" class="active"/>\n                    </svg>\n                </div>\n                <label>\n                    '+t.localize("Free")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button line">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-draw-line" class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-draw-line" class="active"/>\n                    </svg>\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 id="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 id="tie-draw-range"></div>\n            <input id="tie-draw-range-value" class="tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},function(e,t){"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                    <input type="checkbox" id="tie-grayscale">\n                    <label for="tie-grayscale">'+t.localize("Grayscale")+'</label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-invert">\n                    <label for="tie-invert">'+t.localize("Invert")+'</label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-sepia">\n                    <label for="tie-sepia">'+t.localize("Sepia")+'</label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-sepia2">\n                    <label for="tie-sepia2">'+t.localize("Sepia2")+'</label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-blur">\n                    <label for="tie-blur">'+t.localize("Blur")+'</label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-sharpen">\n                    <label for="tie-sharpen">'+t.localize("Sharpen")+'</label>\n                </div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-emboss">\n                    <label for="tie-emboss">'+t.localize("Emboss")+'</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                        <input type="checkbox" id="tie-remove-white">\n                        <label for="tie-remove-white">'+t.localize("Remove White")+'</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 id="tie-removewhite-threshold-range"></div>\n                </div>\n                <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n                    <label>'+t.localize("Distance")+'</label>\n                    <div id="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-newline tui-image-editor-checkbox-wrap">\n                    <div class="tui-image-editor-checkbox">\n                        <input type="checkbox" id="tie-gradient-transparency">\n                        <label for="tie-gradient-transparency">'+t.localize("Gradient transparency")+'</label>\n                    </div>\n                </div>\n                <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n                    <label>'+t.localize("Value")+'</label>\n                    <div id="tie-gradient-transparency-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                    <input type="checkbox" id="tie-brightness">\n                    <label for="tie-brightness">'+t.localize("Brightness")+'</label>\n                </div>\n                <div class="tui-image-editor-range-wrap short">\n                    <div id="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                    <input type="checkbox" id="tie-noise">\n                    <label for="tie-noise">'+t.localize("Noise")+'</label>\n                </div>\n                <div class="tui-image-editor-range-wrap short">\n                    <div id="tie-noise-range"></div>\n                </div>\n            </div>\n\n            <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-pixelate">\n                    <label for="tie-pixelate">'+t.localize("Pixelate")+'</label>\n                </div>\n                <div class="tui-image-editor-range-wrap short">\n                    <div id="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                        <input type="checkbox" id="tie-color-filter">\n                        <label for="tie-color-filter">'+t.localize("Color Filter")+'</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 id="tie-colorfilter-threshole-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 id="tie-filter-tint-color" title="'+t.localize("Tint")+'"></div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-tint">\n                    <label for="tie-tint"></label>\n                </div>\n            </div>\n            <div class="filter-color-item">\n                <div id="tie-filter-multiply-color" title="'+t.localize("Multiply")+'"></div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-multiply">\n                    <label for="tie-multiply"></label>\n                </div>\n            </div>\n            <div class="filter-color-item">\n                <div id="tie-filter-blend-color" title="'+t.localize("Blend")+'"></div>\n                <div class="tui-image-editor-checkbox">\n                    <input type="checkbox" id="tie-blend">\n                    <label for="tie-blend"></label>\n                </div>\n            </div>\n        </li>\n    </ul>\n';
}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;return'\n    <ul id="tie-flip-button" class="tui-image-editor-submenu-item">\n        <li>\n            <div class="tui-image-editor-button flipX">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-flip-x" class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-flip-x" class="active"/>\n                    </svg>\n                </div>\n                <label>\n                    '+t.localize("Flip X")+'\n                </label>\n            </div>\n            <div class="tui-image-editor-button flipY">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-flip-y" class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-flip-y" class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-flip-reset"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-flip-reset"\n                            class="active"/>\n                    </svg>\n                </div>\n                <label>\n                    '+t.localize("Reset")+"\n                </label>\n            </div>\n        </li>\n    </ul>\n"}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li id="tie-icon-add-button">\n            <div class="tui-image-editor-button" data-icontype="icon-arrow">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-arrow"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-arrow"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-arrow-2"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-arrow-2"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-arrow-3"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-arrow-3"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-star" class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-star" class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-star-2"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-star-2"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-polygon"\n                            class="normal"/>\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-polygon"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-location"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-location"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-heart"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-heart"\n                            class="active"/>\n                    </svg>\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                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-bubble"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-bubble"\n                            class="active"/>\n                    </svg>\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 id="tie-icon-add-button">\n            <div class="tui-image-editor-button" style="margin:0">\n                <div>\n                    <input type="file" accept="image/*" id="tie-icon-image-file">\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-icon-load" class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-icon-load" class="active"/>\n                    </svg>\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 id="tie-icon-color" title="'+t.localize("Color")+'"></div>\n        </li>\n    </ul>\n'}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;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/*" id="tie-mask-image-file">\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-mask-load" class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-mask-load" class="active"/>\n                    </svg>\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 id="tie-mask-apply" class="tui-image-editor-newline apply" style="margin-top: 22px;margin-bottom: 5px">\n            <div class="tui-image-editor-button apply">\n                <svg class="svg_ic-menu">\n                    <use xlink:href="'+i.path+"#"+i.name+'-ic-apply" class="normal"/>\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-apply" class="active"/>\n                </svg>\n                <label>\n                    '+t.localize("Apply")+"\n                </label>\n            </div>\n        </li>\n    </ul>\n"}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li id="tie-retate-button">\n            <div class="tui-image-editor-button clockwise">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-rotate-clockwise"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-rotate-clockwise"\n                            class="active"/>\n                    </svg>\n                </div>\n                <label> 30 </label>\n            </div>\n            <div class="tui-image-editor-button counterclockwise">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-rotate-counterclockwise"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-rotate-counterclockwise"\n                            class="active"/>\n                    </svg>\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 id="tie-rotate-range"></div>\n            <input id="tie-ratate-range-value" class="tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li id="tie-shape-button">\n            <div class="tui-image-editor-button rect">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-shape-rectangle"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-shape-rectangle"\n                            class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Rectangle")+' </label>\n            </div>\n            <div class="tui-image-editor-button circle">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-shape-circle"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-shape-circle"\n                            class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Circle")+' </label>\n            </div>\n            <div class="tui-image-editor-button triangle">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-shape-triangle"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-shape-triangle"\n                            class="active"/>\n                    </svg>\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 id="tie-shape-color-button">\n            <div id="tie-color-fill" title="'+t.localize("Fill")+'"></div>\n            <div id="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 id="tie-stroke-range"></div>\n            <input id="tie-stroke-range-value" class="tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.iconStyle,i=n.normal,o=n.active;return'\n    <ul class="tui-image-editor-submenu-item">\n        <li id="tie-text-effect-button">\n            <div class="tui-image-editor-button bold">\n                <div>\n                    <svg class="svg_ic-submenu">\n                    <use xlink:href="'+i.path+"#"+i.name+'-ic-text-bold" class="normal"/>\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-text-bold" class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Bold")+' </label>\n            </div>\n            <div class="tui-image-editor-button italic">\n                <div>\n                    <svg class="svg_ic-submenu">\n                    <use xlink:href="'+i.path+"#"+i.name+'-ic-text-italic" class="normal"/>\n                    <use xlink:href="'+o.path+"#"+o.name+'-ic-text-italic" class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Italic")+' </label>\n            </div>\n            <div class="tui-image-editor-button underline">\n                <div>\n                    <svg class="svg_ic-submenu">\n                        <use xlink:href="'+i.path+"#"+i.name+'-ic-text-underline"\n                            class="normal"/>\n                        <use xlink:href="'+o.path+"#"+o.name+'-ic-text-underline"\n                            class="active"/>\n                    </svg>\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 id="tie-text-align-button">\n            <div class="tui-image-editor-button left">\n                <div>\n                    <svg class="svg_ic-submenu">\n                     <use xlink:href="'+i.path+"#"+i.name+'-ic-text-align-left"\n                        class="normal"/>\n                     <use xlink:href="'+o.path+"#"+o.name+'-ic-text-align-left"\n                        class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Left")+' </label>\n            </div>\n            <div class="tui-image-editor-button center">\n                <div>\n                    <svg class="svg_ic-submenu">\n                     <use xlink:href="'+i.path+"#"+i.name+'-ic-text-align-center"\n                        class="normal"/>\n                     <use xlink:href="'+o.path+"#"+o.name+'-ic-text-align-center"\n                        class="active"/>\n                    </svg>\n                </div>\n                <label> '+t.localize("Center")+' </label>\n            </div>\n            <div class="tui-image-editor-button right">\n                <div>\n                    <svg class="svg_ic-submenu">\n                     <use xlink:href="'+i.path+"#"+i.name+'-ic-text-align-right"\n                        class="normal"/>\n                     <use xlink:href="'+o.path+"#"+o.name+'-ic-text-align-right"\n                        class="active"/>\n                    </svg>\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 id="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 id="tie-text-range"></div>\n            <input id="tie-text-range-value" class="tui-image-editor-range-value" value="0" />\n        </li>\n    </ul>\n'}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function r(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=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}}(),l=n(15),c=i(l),u=n(14),d=i(u),h=n(10),f=i(h),p=n(113),g=i(p),v=n(5),m=n(1),b=function(e){function t(e,n){var i=n.locale,r=n.iconStyle,s=n.menuBarPosition;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:i,name:"text",iconStyle:r,menuBarPosition:s,templateHtml:g.default}));return l.effect={bold:!1,italic:!1,underline:!1},l.align="left",l._els={textEffectButton:l.selector("#tie-text-effect-button"),textAlignButton:l.selector("#tie-text-align-button"),textColorpicker:new d.default(l.selector("#tie-text-color"),"#ffbb3b",l.toggleDirection),textRange:new c.default(l.selector("#tie-text-range"),m.defaultTextRangeValus),textRangeValue:l.selector("#tie-text-range-value")},l}return r(t,e),s(t,[{key:"addEvent",value:function(e){this.actions=e,this._els.textEffectButton.addEventListener("click",this._setTextEffectHandler.bind(this)),this._els.textAlignButton.addEventListener("click",this._setTextAlignHandler.bind(this)),this._els.textRange.on("change",this._changeTextRnageHandler.bind(this)),this._els.textRangeValue.value=this._els.textRange.value,this._els.textRangeValue.setAttribute("readonly",!0),this._els.textColorpicker.on("change",this._changeColorHandler.bind(this))}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStartMode",value:function(){this.actions.modeChange("text")}},{key:"_setTextEffectHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button"),n=t.className.match(/(bold|italic|underline)/),i=n[0],o={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[i];this.effect[i]=!this.effect[i],t.classList.toggle("active"),this.actions.changeTextStyle(o)}},{key:"_setTextAlignHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=this.getButtonType(t,["left","center","right"]);e.currentTarget.classList.remove(this.align),this.align!==n&&e.currentTarget.classList.add(n),this.actions.changeTextStyle({textAlign:n}),this.align=n}}},{key:"_changeTextRnageHandler",value:function(e){e=(0,v.toInteger)(e),(0,v.toInteger)(this._els.textRangeValue.value)!==e&&(this.actions.changeTextStyle({fontSize:e}),this._els.textRangeValue.value=e)}},{key:"_changeColorHandler",value:function(e){e=e||"transparent",this.actions.changeTextStyle({fill:e})}},{key:"textColor",get:function(){return this._els.textColorpicker.color}},{key:"fontSize",get:function(){return this._els.textRange.value},set:function(e){this._els.textRange.value=e,this._els.textRangeValue.value=e}}]),t}(f.default);t.default=b},function(e,t){"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.path":"icon-d.svg","menu.normalIcon.name":"icon-d","menu.activeIcon.path":"icon-b.svg","menu.activeIcon.name":"icon-b","menu.disabledIcon.path":"icon-a.svg","menu.disabledIcon.name":"icon-a","menu.hoverIcon.path":"icon-c.svg","menu.hoverIcon.name":"icon-c","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalIcon.path":"icon-d.svg","submenu.normalIcon.name":"icon-d","submenu.activeIcon.path":"icon-c.svg","submenu.activeIcon.name":"icon-c","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","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"}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=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(3),s=n(5),l=n(104),c=i(l),u=n(115),d=i(u),h=function(){function e(t){o(this,e),this.styles=this._changeToObject((0,r.extend)(d.default,t)),(0,s.styleLoad)(this._styleMaker())}return a(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":case"submenu.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.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,c.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")})}},{key:"_changeToObject",value:function(e){var t={};return(0,r.forEach)(e,function(e,n){var i=n.match(/^(.+)\.([a-z]+)$/i),o=i[1],a=i[2];t[o]||(t[o]={}),t[o][a]=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()})}}]),e}();t.default=h},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var i=n(30),o=n(42),a=n(140);e.exports=function(e){return function(t,n,r){var s,l=i(t),c=o(l.length),u=a(r,c);if(e&&n!=n){for(;c>u;)if(s=l[u++],s!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var i=n(20),o=n(125),a=n(124),r=n(11),s=n(42),l=n(143),c={},u={},t=e.exports=function(e,t,n,d,h){var f,p,g,v,m=h?function(){return e}:l(e),b=i(n,d,t?2:1),y=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(a(m)){for(f=s(e.length);f>y;y++)if(v=t?b(r(p=e[y])[0],p[1]):b(e[y]),v===c||v===u)return v}else for(g=m.call(e);!(p=g.next()).done;)if(v=o(g,b,p.value,t),v===c||v===u)return v};t.BREAK=c,t.RETURN=u},function(e,t,n){e.exports=!n(17)&&!n(35)(function(){return 7!=Object.defineProperty(n(26)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var i=n(19);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(18),o=n(7)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},function(e,t,n){var i=n(11);e.exports=function(e,t,n,o){try{return o?t(i(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&i(a.call(e)),t}}},function(e,t,n){"use strict";var i=n(130),o=n(39),a=n(27),r={};n(12)(r,n(7)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(r,{next:o(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var i=n(7)("iterator"),o=!1;try{var a=[7][i]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var a=[7],r=a[i]();r.next=function(){return{done:n=!0}},a[i]=function(){return r},e(a)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var i=n(9),o=n(41).set,a=i.MutationObserver||i.WebKitMutationObserver,r=i.process,s=i.Promise,l="process"==n(19)(r);e.exports=function(){var e,t,n,c=function(){var i,o;for(l&&(i=r.domain)&&i.exit();e;){o=e.fn,e=e.next;try{o()}catch(i){throw e?n():t=void 0,i}}t=void 0,i&&i.enter()};if(l)n=function(){r.nextTick(c)};else if(a){var u=!0,d=document.createTextNode("");new a(c).observe(d,{characterData:!0}),n=function(){d.data=u=!u}}else if(s&&s.resolve){var h=s.resolve();n=function(){h.then(c)}}else n=function(){o.call(i,c)};return function(i){var o={fn:i,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var i=n(11),o=n(131),a=n(33),r=n(28)("IE_PROTO"),s=function(){},l="prototype",c=function(){var e,t=n(26)("iframe"),i=a.length,o="<",r=">";for(t.style.display="none",n(36).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+r+"document.F=Object"+o+"/script"+r),e.close(),c=e.F;i--;)delete c[l][a[i]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[l]=i(e),n=new s,s[l]=null,n[r]=e):n=c(),void 0===t?n:o(n,t)}},function(e,t,n){var i=n(23),o=n(11),a=n(134);e.exports=n(17)?Object.defineProperties:function(e,t){o(e);for(var n,r=a(t),s=r.length,l=0;s>l;)i.f(e,n=r[l++],t[n]);return e}},function(e,t,n){var i=n(21),o=n(141),a=n(28)("IE_PROTO"),r=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),i(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?r:null}},function(e,t,n){var i=n(21),o=n(30),a=n(119)(!1),r=n(28)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),l=0,c=[];for(n in s)n!=r&&i(s,n)&&c.push(n);for(;t.length>l;)i(s,n=t[l++])&&(~a(c,n)||c.push(n));return c}},function(e,t,n){var i=n(133),o=n(33);e.exports=Object.keys||function(e){return i(e,o)}},function(e,t,n){var i=n(12);e.exports=function(e,t,n){for(var o in t)n&&e[o]?e[o]=t[o]:i(e,o,t[o]);return e}},function(e,t,n){e.exports=n(12)},function(e,t,n){"use strict";var i=n(9),o=n(16),a=n(23),r=n(17),s=n(7)("species");e.exports=function(e){var t="function"==typeof o[e]?o[e]:i[e];r&&t&&!t[s]&&a.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var i=n(11),o=n(24),a=n(7)("species");e.exports=function(e,t){var n,r=i(e).constructor;return void 0===r||void 0==(n=i(r)[a])?t:o(n)}},function(e,t,n){var i=n(29),o=n(25);e.exports=function(e){return function(t,n){var a,r,s=String(o(t)),l=i(n),c=s.length;return l<0||l>=c?e?"":void 0:(a=s.charCodeAt(l),a<55296||a>56319||l+1===c||(r=s.charCodeAt(l+1))<56320||r>57343?e?s.charAt(l):a:e?s.slice(l,l+2):(a-55296<<10)+(r-56320)+65536)}}},function(e,t,n){var i=n(29),o=Math.max,a=Math.min;e.exports=function(e,t){return e=i(e),e<0?o(e+t,0):a(e,t)}},function(e,t,n){var i=n(25);e.exports=function(e){return Object(i(e))}},function(e,t,n){var i=n(22);e.exports=function(e,t){if(!i(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!i(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;
throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var i=n(32),o=n(7)("iterator"),a=n(18);e.exports=n(16).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||a[i(e)]}},function(e,t,n){"use strict";var i=n(117),o=n(128),a=n(18),r=n(30);e.exports=n(37)(Array,"Array",function(e,t){this._t=r(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):"keys"==t?o(0,n):"values"==t?o(0,e[n]):o(0,[n,e[n]])},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(e,t){},function(e,t,n){"use strict";var i,o,a,r=n(38),s=n(9),l=n(20),c=n(32),u=n(34),d=n(22),h=n(24),f=n(118),p=n(120),g=n(138),v=n(41).set,m=n(129)(),b="Promise",y=s.TypeError,_=s.process,k=s[b],_=s.process,w="process"==c(_),x=function(){},E=!!function(){try{var e=k.resolve(1),t=(e.constructor={})[n(7)("species")]=function(e){e(x,x)};return(w||"function"==typeof PromiseRejectionEvent)&&e.then(x)instanceof t}catch(e){}}(),C=function(e,t){return e===t||e===k&&t===a},O=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},S=function(e){return C(k,e)?new M(e):new o(e)},M=o=function(e){var t,n;this.promise=new e(function(e,i){if(void 0!==t||void 0!==n)throw y("Bad Promise constructor");t=e,n=i}),this.resolve=h(t),this.reject=h(n)},j=function(e){try{e()}catch(e){return{error:e}}},T=function(e,t){if(!e._n){e._n=!0;var n=e._c;m(function(){for(var i=e._v,o=1==e._s,a=0,r=function(t){var n,a,r=o?t.ok:t.fail,s=t.resolve,l=t.reject,c=t.domain;try{r?(o||(2==e._h&&I(e),e._h=1),r===!0?n=i:(c&&c.enter(),n=r(i),c&&c.exit()),n===t.promise?l(y("Promise-chain cycle")):(a=O(n))?a.call(n,s,l):s(n)):l(i)}catch(e){l(e)}};n.length>a;)r(n[a++]);e._c=[],e._n=!1,t&&!e._h&&P(e)})}},P=function(e){v.call(s,function(){var t,n,i,o=e._v;if(A(e)&&(t=j(function(){w?_.emit("unhandledRejection",o,e):(n=s.onunhandledrejection)?n({promise:e,reason:o}):(i=s.console)&&i.error&&i.error("Unhandled promise rejection",o)}),e._h=w||A(e)?2:1),e._a=void 0,t)throw t.error})},A=function(e){if(1==e._h)return!1;for(var t,n=e._a||e._c,i=0;n.length>i;)if(t=n[i++],t.fail||!A(t.promise))return!1;return!0},I=function(e){v.call(s,function(){var t;w?_.emit("rejectionHandled",e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},R=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),T(t,!0))},D=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw y("Promise can't be resolved itself");(t=O(e))?m(function(){var i={_w:n,_d:!1};try{t.call(e,l(D,i,1),l(R,i,1))}catch(e){R.call(i,e)}}):(n._v=e,n._s=1,T(n,!1))}catch(e){R.call({_w:n,_d:!1},e)}}};E||(k=function(e){f(this,k,b,"_h"),h(e),i.call(this);try{e(l(D,this,1),l(R,this,1))}catch(e){R.call(this,e)}},i=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=n(135)(k.prototype,{then:function(e,t){var n=S(g(this,k));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=w?_.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&T(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),M=function(){var e=new i;this.promise=e,this.resolve=l(D,e,1),this.reject=l(R,e,1)}),u(u.G+u.W+u.F*!E,{Promise:k}),n(27)(k,b),n(137)(b),a=n(16)[b],u(u.S+u.F*!E,b,{reject:function(e){var t=S(this),n=t.reject;return n(e),t.promise}}),u(u.S+u.F*(r||!E),b,{resolve:function(e){if(e instanceof k&&C(e.constructor,this))return e;var t=S(this),n=t.resolve;return n(e),t.promise}}),u(u.S+u.F*!(E&&n(127)(function(e){k.all(e).catch(x)})),b,{all:function(e){var t=this,n=S(t),i=n.resolve,o=n.reject,a=j(function(){var n=[],a=0,r=1;p(e,!1,function(e){var s=a++,l=!1;n.push(void 0),r++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--r||i(n))},o)}),--r||i(n)});return a&&o(a.error),n.promise},race:function(e){var t=this,n=S(t),i=n.reject,o=j(function(){p(e,!1,function(e){t.resolve(e).then(n.resolve,i)})});return o&&i(o.error),n.promise}})},function(e,t,n){"use strict";var i=n(139)(!0);n(37)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(144);for(var i=n(9),o=n(12),a=n(18),r=n(7)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],l=0;l<5;l++){var c=s[l],u=i[c],d=u&&u.prototype;d&&!d[r]&&o(d,r,c),a[c]=a.Array}},function(e,t){},function(e,t){e.exports=n}])});
For more information send a message to info at phpclasses dot org.