(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e3f79dec"],{"0b25":function(t,e,i){var n=i("a691"),r=i("50c4");t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=r(e);if(e!==i)throw RangeError("Wrong length or index");return i}},"145e":function(t,e,i){"use strict";var n=i("7b0b"),r=i("23cb"),o=i("50c4"),a=Math.min;t.exports=[].copyWithin||function(t,e){var i=n(this),s=o(i.length),c=r(t,s),l=r(e,s),u=arguments.length>2?arguments[2]:void 0,h=a((void 0===u?s:r(u,s))-l,s-c),f=1;l0)l in i?i[c]=i[l]:delete i[c],c+=f,l+=f;return i}},"170b":function(t,e,i){"use strict";var n=i("ebb5"),r=i("50c4"),o=i("23cb"),a=i("4840"),s=n.aTypedArray,c=n.exportTypedArrayMethod;c("subarray",(function(t,e){var i=s(this),n=i.length,c=o(t,n);return new(a(i,i.constructor))(i.buffer,i.byteOffset+c*i.BYTES_PER_ELEMENT,r((void 0===e?n:o(e,n))-c))}))},"182d":function(t,e,i){var n=i("f8cd");t.exports=function(t,e){var i=n(t);if(i%e)throw RangeError("Wrong offset");return i}},1836:function(t,e,i){"use strict";var n=i("4f0c"),r=i.n(n);r.a},2113:function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"back"},[n("div",{staticClass:"photo"},[n("van-uploader",{attrs:{multiple:"","after-read":t.fileImage,"preview-size":"27vw","preview-full-image":!1},on:{"click-preview":t.preview},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1),n("div",{staticClass:"record"},[t._l(t.recordList,(function(e,r){return n("div",{key:r,staticClass:"play"},[n("audio",{ref:"audios"+r,refInFor:!0,staticStyle:{display:"none"},attrs:{controls:""}},[n("source",{attrs:{src:e.src,type:"audio/ogg"}})]),n("van-icon",{staticStyle:{position:"absolute",left:"-.25rem",top:".12rem"},attrs:{name:"clear",color:"red"},on:{click:function(e){return t.delRecord(r)}}}),n("p",{directives:[{name:"show",rawName:"v-show",value:e.player,expression:"item.player"}]}),n("img",{attrs:{src:i("619a"),alt:""},on:{click:function(e){return t.transmit(r)}}}),n("span",[t._v(t._s(e.duration)+'"')])],1)})),n("i",{staticStyle:{display:"block",width:"100%",height:".8rem"}}),n("button",{staticStyle:{"margin-bottom":".1rem"},on:{click:t.start}},[t._v(" 点击录音 ")])],2)]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isEditor,expression:"isEditor"}],staticClass:"drawing-container"},[n("div",{attrs:{id:"tui-image-editor"}}),n("van-button",{staticClass:"closes",attrs:{plain:"",type:"info"},on:{click:t.close}},[t._v("取消")]),n("van-button",{staticClass:"save",attrs:{type:"info"},on:{click:t.save}},[t._v("保存")])],1),n("van-overlay",{attrs:{show:t.loading}},[n("div",{staticClass:"wrapper",on:{click:function(t){t.stopPropagation()}}},[n("van-loading",{attrs:{size:"24px",color:"#0094ff",vertical:""}},[t._v("上传中,请稍等...")])],1)])],1)},r=[],o=(i("4160"),i("a434"),i("d3b7"),i("3ca3"),i("159b"),i("ddb0"),i("96cf"),i("1da1")),a=i("c761"),s=(i("741a"),i("5ff5"),i("abe2")),c=i.n(s),l={ZoomIn:"放大",ZoomOut:"缩小",Hand:"手掌",History:"历史",Resize:"调整宽高",Crop:"裁剪",DeleteAll:"全部删除",Delete:"删除",Undo:"撤销",Redo:"反撤销",Reset:"重置",Flip:"镜像",Rotate:"旋转",Draw:"画",Shape:"形状标注",Icon:"图标标注",Text:"文字标注",Mask:"遮罩",Filter:"滤镜",Bold:"加粗",Italic:"斜体",Underline:"下划线",Left:"左对齐",Center:"居中",Right:"右对齐",Color:"颜色","Text size":"字体大小",Custom:"自定义",Square:"正方形",Apply:"应用",Cancel:"取消","Flip X":"X 轴","Flip Y":"Y 轴",Range:"区间",Stroke:"描边",Fill:"填充",Circle:"圆",Triangle:"三角",Rectangle:"矩形",Free:"曲线",Straight:"直线",Arrow:"箭头","Arrow-2":"箭头2","Arrow-3":"箭头3","Star-1":"星星1","Star-2":"星星2",Polygon:"多边形",Location:"定位",Heart:"心形",Bubble:"气泡","Custom icon":"自定义图标","Load Mask Image":"加载蒙层图片",Grayscale:"灰度",Blur:"模糊",Sharpen:"锐化",Emboss:"浮雕","Remove White":"除去白色",Distance:"距离",Brightness:"亮度",Noise:"噪音","Color Filter":"彩色滤镜",Sepia:"棕色",Sepia2:"棕色2",Invert:"负片",Pixelate:"像素化",Threshold:"阈值",Tint:"色调",Multiply:"正片叠底",Blend:"混合色",Width:"宽度",Height:"高度","Lock Aspect Ratio":"锁定宽高比例"},u={"common.bi.image":"","common.bisize.width":"0px","common.bisize.height":"0px","common.backgroundImage":"none","common.backgroundColor":"#f3f4f6","common.border":"1px solid #333","header.backgroundImage":"none","header.backgroundColor":"#fff","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"NotoSans, sans-serif","loadButton.fontSize":"12px","loadButton.display":"none","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"NotoSans, sans-serif","downloadButton.fontSize":"12px","downloadButton.display":"none","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#ccc","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#858585","submenu.normalLabel.color":"#858585","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"1px solid #ccc","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"},h={name:"VueCli4VantAbnormal",data:function(){return{loading:!1,isEditor:!1,fileList:[],loop:"",btRecoding:!1,blackBoxSpeak:!1,startY:"",recorder:"",duration:"1",player:!1,reasonValue:"",voiceUrl:"",chartUrl:"",index:null,src:"",recordList:[],show:!1,url:""}},created:function(){},mounted:function(){},methods:{delRecord:function(t){var e=this;this.$dialog({message:"您将删除本条语音,删除后无法恢复,确认删除吗?",showCancelButton:!0}).then((function(){console.log("111"),e.recordList.splice(t,1)})).catch((function(){}))},countAudioTime:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var i,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=t.$refs["audios".concat(t.recordList.length-1)][0];case 1:if(!isNaN(i.duration)&&i.duration!==1/0){e.next=7;break}return e.next=4,new Promise((function(t){return setTimeout(t,200)}));case 4:i.currentTime=1e7*Math.random(),e.next=1;break;case 7:t.$notify({type:"success",message:"音频的总时长:".concat(i.duration)}),n=Math.ceil(i.duration),console.log("音频的总时长:",i.duration),t.$set(t.recordList[t.recordList.length-1],"duration",n),t.$notify({type:"success",message:"测试成功!"});case 12:case"end":return e.stop()}}),e)})))()},preview:function(t,e){console.log(t,e),this.index=e.index,this.init(t.content),this.isEditor=!0},fileImage:function(){console.log(this.fileList)},close:function(){this.isEditor=!1},start:function(){var t=this;window.suplink.record().then((function(e){t.recordList.push({src:e.data.voiceUrl,duration:null,player:!1}),t.$nextTick((function(){t.$refs["audios".concat(t.recordList.length-1)][0].load(),t.countAudioTime()}))}))},recordItem:function(){var t=this;this.voiceUrl="";var e=[];this.recordList.forEach((function(t){e.push(Object(a["p"])({src:t.src}))})),Promise.all(e).then((function(e){e.forEach((function(e){t.voiceUrl+=e.data.data})),t.$emit("recordItem",{voiceUrl:t.voiceUrl,fileList:t.fileList})}))},transmit:function(t){var e=this;console.log(t),this.$refs["audios".concat(t)][0].play(),this.recordList[t].player=!0;var i=1*this.recordList[t].duration,n=setInterval((function(){e.recordList[t].duration=1*e.recordList[t].duration-1}),1e3);setTimeout((function(){clearInterval(n),e.recordList[t].duration=i,e.recordList[t].player=!1}),1e3*i)},init:function(t){this.instance=new c.a(document.querySelector("#tui-image-editor"),{includeUI:{loadImage:{path:t,name:"image"},menu:["resize","crop","rotate","draw","shape","icon","text"],initMenu:"draw",menuBarPosition:"bottom",locale:l,theme:u},cssMaxWidth:350,cssMaxHeight:700}),document.getElementsByClassName("tui-image-editor-main")[0].style.top="45px",document.getElementsByClassName("tie-btn-reset tui-image-editor-item help")[0].style.display="none"},save:function(){var t=this.instance.toDataURL();console.log(t),this.fileList[this.index].content=t,this.isEditor=!1,this.$notify({type:"success",message:"编辑成功!"})}}},f=h,d=(i("1836"),i("2877")),g=Object(d["a"])(f,n,r,!1,null,"e337ef94",null);e["a"]=g.exports},"219c":function(t,e,i){"use strict";var n=i("ebb5"),r=n.aTypedArray,o=n.exportTypedArrayMethod,a=[].sort;o("sort",(function(t){return a.call(r(this),t)}))},"25a1":function(t,e,i){"use strict";var n=i("ebb5"),r=i("d58f").right,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("reduceRight",(function(t){return r(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}))},2954:function(t,e,i){"use strict";var n=i("ebb5"),r=i("4840"),o=i("d039"),a=n.aTypedArray,s=n.aTypedArrayConstructor,c=n.exportTypedArrayMethod,l=[].slice,u=o((function(){new Int8Array(1).slice()}));c("slice",(function(t,e){var i=l.call(a(this),t,e),n=r(this,this.constructor),o=0,c=i.length,u=new(s(n))(c);while(c>o)u[o]=i[o++];return u}),u)},3280:function(t,e,i){"use strict";var n=i("ebb5"),r=i("e58c"),o=n.aTypedArray,a=n.exportTypedArrayMethod;a("lastIndexOf",(function(t){return r.apply(o(this),arguments)}))},"3a7b":function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").findIndex,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("findIndex",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"3c5d":function(t,e,i){"use strict";var n=i("ebb5"),r=i("50c4"),o=i("182d"),a=i("7b0b"),s=i("d039"),c=n.aTypedArray,l=n.exportTypedArrayMethod,u=s((function(){new Int8Array(1).set({})}));l("set",(function(t){c(this);var e=o(arguments.length>1?arguments[1]:void 0,1),i=this.length,n=a(t),s=r(n.length),l=0;if(s+e>i)throw RangeError("Wrong length");while(l1?arguments[1]:void 0,(function(t,e){return new(s(o(t,t.constructor)))(e)}))}))},"4f0c":function(t,e,i){},"5cc6":function(t,e,i){var n=i("74e8");n("Uint8",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},"5f96":function(t,e,i){"use strict";var n=i("ebb5"),r=n.aTypedArray,o=n.exportTypedArrayMethod,a=[].join;o("join",(function(t){return a.apply(r(this),arguments)}))},"5ff5":function(t,e,i){},"60bd":function(t,e,i){"use strict";var n=i("da84"),r=i("ebb5"),o=i("e260"),a=i("b622"),s=a("iterator"),c=n.Uint8Array,l=o.values,u=o.keys,h=o.entries,f=r.aTypedArray,d=r.exportTypedArrayMethod,g=c&&c.prototype[s],p=!!g&&("values"==g.name||void 0==g.name),v=function(){return l.call(f(this))};d("entries",(function(){return h.call(f(this))})),d("keys",(function(){return u.call(f(this))})),d("values",v,!p),d(s,v,!p)},"619a":function(t,e,i){t.exports=i.p+"assets/img/3.1311c53e.png"},"621a":function(t,e,i){"use strict";var n=i("da84"),r=i("83ab"),o=i("a981"),a=i("9112"),s=i("e2cc"),c=i("d039"),l=i("19aa"),u=i("a691"),h=i("50c4"),f=i("0b25"),d=i("77a7"),g=i("e163"),p=i("d2bb"),v=i("241c").f,m=i("9bf2").f,y=i("81d5"),b=i("d44e"),_=i("69f3"),x=_.get,C=_.set,I="ArrayBuffer",M="DataView",S="prototype",w="Wrong length",T="Wrong index",A=n[I],D=A,E=n[M],k=E&&E[S],O=Object.prototype,j=n.RangeError,L=d.pack,N=d.unpack,P=function(t){return[255&t]},z=function(t){return[255&t,t>>8&255]},R=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},B=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},F=function(t){return L(t,23,4)},Y=function(t){return L(t,52,8)},H=function(t,e){m(t[S],e,{get:function(){return x(this)[e]}})},U=function(t,e,i,n){var r=f(i),o=x(t);if(r+e>o.byteLength)throw j(T);var a=x(o.buffer).bytes,s=r+o.byteOffset,c=a.slice(s,s+e);return n?c:c.reverse()},W=function(t,e,i,n,r,o){var a=f(i),s=x(t);if(a+e>s.byteLength)throw j(T);for(var c=x(s.buffer).bytes,l=a+s.byteOffset,u=n(+r),h=0;hV;)(G=Z[V++])in D||a(D,G,A[G]);X.constructor=D}p&&g(k)!==O&&p(k,O);var J=new E(new D(2)),Q=k.setInt8;J.setInt8(0,2147483648),J.setInt8(1,2147483649),!J.getInt8(0)&&J.getInt8(1)||s(k,{setInt8:function(t,e){Q.call(this,t,e<<24>>24)},setUint8:function(t,e){Q.call(this,t,e<<24>>24)}},{unsafe:!0})}else D=function(t){l(this,D,I);var e=f(t);C(this,{bytes:y.call(new Array(e),0),byteLength:e}),r||(this.byteLength=e)},E=function(t,e,i){l(this,E,M),l(t,D,M);var n=x(t).byteLength,o=u(e);if(o<0||o>n)throw j("Wrong offset");if(i=void 0===i?n-o:h(i),o+i>n)throw j(w);C(this,{buffer:t,byteLength:i,byteOffset:o}),r||(this.buffer=t,this.byteLength=i,this.byteOffset=o)},r&&(H(D,"byteLength"),H(E,"buffer"),H(E,"byteLength"),H(E,"byteOffset")),s(E[S],{getInt8:function(t){return U(this,1,t)[0]<<24>>24},getUint8:function(t){return U(this,1,t)[0]},getInt16:function(t){var e=U(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=U(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return B(U(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return B(U(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return N(U(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return N(U(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){W(this,1,t,P,e)},setUint8:function(t,e){W(this,1,t,P,e)},setInt16:function(t,e){W(this,2,t,z,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){W(this,2,t,z,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){W(this,4,t,R,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){W(this,4,t,R,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){W(this,4,t,F,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){W(this,8,t,Y,e,arguments.length>2?arguments[2]:void 0)}});b(D,I),b(E,M),t.exports={ArrayBuffer:D,DataView:E}},"649e":function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").some,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("some",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"72f7":function(t,e,i){"use strict";var n=i("ebb5").exportTypedArrayMethod,r=i("d039"),o=i("da84"),a=o.Uint8Array,s=a&&a.prototype||{},c=[].toString,l=[].join;r((function(){c.call({})}))&&(c=function(){return l.call(this)});var u=s.toString!=c;n("toString",c,u)},"735e":function(t,e,i){"use strict";var n=i("ebb5"),r=i("81d5"),o=n.aTypedArray,a=n.exportTypedArrayMethod;a("fill",(function(t){return r.apply(o(this),arguments)}))},"741a":function(t,e,i){},"74e8":function(t,e,i){"use strict";var n=i("23e7"),r=i("da84"),o=i("83ab"),a=i("8aa7"),s=i("ebb5"),c=i("621a"),l=i("19aa"),u=i("5c6c"),h=i("9112"),f=i("50c4"),d=i("0b25"),g=i("182d"),p=i("c04e"),v=i("5135"),m=i("f5df"),y=i("861d"),b=i("7c73"),_=i("d2bb"),x=i("241c").f,C=i("a078"),I=i("b727").forEach,M=i("2626"),S=i("9bf2"),w=i("06cf"),T=i("69f3"),A=i("7156"),D=T.get,E=T.set,k=S.f,O=w.f,j=Math.round,L=r.RangeError,N=c.ArrayBuffer,P=c.DataView,z=s.NATIVE_ARRAY_BUFFER_VIEWS,R=s.TYPED_ARRAY_TAG,B=s.TypedArray,F=s.TypedArrayPrototype,Y=s.aTypedArrayConstructor,H=s.isTypedArray,U="BYTES_PER_ELEMENT",W="Wrong length",G=function(t,e){var i=0,n=e.length,r=new(Y(t))(n);while(n>i)r[i]=e[i++];return r},X=function(t,e){k(t,e,{get:function(){return D(this)[e]}})},Z=function(t){var e;return t instanceof N||"ArrayBuffer"==(e=m(t))||"SharedArrayBuffer"==e},V=function(t,e){return H(t)&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},J=function(t,e){return V(t,e=p(e,!0))?u(2,t[e]):O(t,e)},Q=function(t,e,i){return!(V(t,e=p(e,!0))&&y(i)&&v(i,"value"))||v(i,"get")||v(i,"set")||i.configurable||v(i,"writable")&&!i.writable||v(i,"enumerable")&&!i.enumerable?k(t,e,i):(t[e]=i.value,t)};o?(z||(w.f=J,S.f=Q,X(F,"buffer"),X(F,"byteOffset"),X(F,"byteLength"),X(F,"length")),n({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:J,defineProperty:Q}),t.exports=function(t,e,i){var o=t.match(/\d+$/)[0]/8,s=t+(i?"Clamped":"")+"Array",c="get"+t,u="set"+t,p=r[s],v=p,m=v&&v.prototype,S={},w=function(t,e){var i=D(t);return i.view[c](e*o+i.byteOffset,!0)},T=function(t,e,n){var r=D(t);i&&(n=(n=j(n))<0?0:n>255?255:255&n),r.view[u](e*o+r.byteOffset,n,!0)},O=function(t,e){k(t,e,{get:function(){return w(this,e)},set:function(t){return T(this,e,t)},enumerable:!0})};z?a&&(v=e((function(t,e,i,n){return l(t,v,s),A(function(){return y(e)?Z(e)?void 0!==n?new p(e,g(i,o),n):void 0!==i?new p(e,g(i,o)):new p(e):H(e)?G(v,e):C.call(v,e):new p(d(e))}(),t,v)})),_&&_(v,B),I(x(p),(function(t){t in v||h(v,t,p[t])})),v.prototype=m):(v=e((function(t,e,i,n){l(t,v,s);var r,a,c,u=0,h=0;if(y(e)){if(!Z(e))return H(e)?G(v,e):C.call(v,e);r=e,h=g(i,o);var p=e.byteLength;if(void 0===n){if(p%o)throw L(W);if(a=p-h,a<0)throw L(W)}else if(a=f(n)*o,a+h>p)throw L(W);c=a/o}else c=d(e),a=c*o,r=new N(a);E(t,{buffer:r,byteOffset:h,byteLength:a,length:c,view:new P(r)});while(u>1,v=23===e?r(2,-24)-r(2,-77):0,m=t<0||0===t&&1/t<0?1:0,y=0;for(t=n(t),t!=t||t===i?(u=t!=t?1:0,l=g):(l=o(a(t)/s),t*(h=r(2,-l))<1&&(l--,h*=2),t+=l+p>=1?v/h:v*r(2,1-p),t*h>=2&&(l++,h/=2),l+p>=g?(u=0,l=g):l+p>=1?(u=(t*h-1)*r(2,e),l+=p):(u=t*r(2,p-1)*r(2,e),l=0));e>=8;f[y++]=255&u,u/=256,e-=8);for(l=l<0;f[y++]=255&l,l/=256,d-=8);return f[--y]|=128*m,f},l=function(t,e){var n,o=t.length,a=8*o-e-1,s=(1<>1,l=a-7,u=o-1,h=t[u--],f=127&h;for(h>>=7;l>0;f=256*f+t[u],u--,l-=8);for(n=f&(1<<-l)-1,f>>=-l,l+=e;l>0;n=256*n+t[u],u--,l-=8);if(0===f)f=1-c;else{if(f===s)return n?NaN:h?-i:i;n+=r(2,e),f-=c}return(h?-1:1)*n*r(2,f-e)};t.exports={pack:c,unpack:l}},"81d5":function(t,e,i){"use strict";var n=i("7b0b"),r=i("23cb"),o=i("50c4");t.exports=function(t){var e=n(this),i=o(e.length),a=arguments.length,s=r(a>1?arguments[1]:void 0,i),c=a>2?arguments[2]:void 0,l=void 0===c?i:r(c,i);while(l>s)e[s++]=t;return e}},"82f8":function(t,e,i){"use strict";var n=i("ebb5"),r=i("4d64").includes,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("includes",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"8aa7":function(t,e,i){var n=i("da84"),r=i("d039"),o=i("1c7e"),a=i("ebb5").NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;t.exports=!a||!r((function(){c(1)}))||!r((function(){new c(-1)}))||!o((function(t){new c,new c(null),new c(1.5),new c(t)}),!0)||r((function(){return 1!==new c(new s(2),1,void 0).length}))},"9a8c":function(t,e,i){"use strict";var n=i("ebb5"),r=i("145e"),o=n.aTypedArray,a=n.exportTypedArrayMethod;a("copyWithin",(function(t,e){return r.call(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},a078:function(t,e,i){var n=i("7b0b"),r=i("50c4"),o=i("35a1"),a=i("e95a"),s=i("0366"),c=i("ebb5").aTypedArrayConstructor;t.exports=function(t){var e,i,l,u,h,f,d=n(t),g=arguments.length,p=g>1?arguments[1]:void 0,v=void 0!==p,m=o(d);if(void 0!=m&&!a(m)){h=m.call(d),f=h.next,d=[];while(!(u=f.call(h)).done)d.push(u.value)}for(v&&g>2&&(p=s(p,arguments[2],2)),i=r(d.length),l=new(c(this))(i),e=0;i>e;e++)l[e]=v?p(d[e],e):d[e];return l}},a434:function(t,e,i){"use strict";var n=i("23e7"),r=i("23cb"),o=i("a691"),a=i("50c4"),s=i("7b0b"),c=i("65f0"),l=i("8418"),u=i("1dde"),h=i("ae40"),f=u("splice"),d=h("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,p=Math.min,v=9007199254740991,m="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!f||!d},{splice:function(t,e){var i,n,u,h,f,d,y=s(this),b=a(y.length),_=r(t,b),x=arguments.length;if(0===x?i=n=0:1===x?(i=0,n=b-_):(i=x-2,n=p(g(o(e),0),b-_)),b+i-n>v)throw TypeError(m);for(u=c(y,n),h=0;hb-n+i;h--)delete y[h-1]}else if(i>n)for(h=b-n;h>_;h--)f=h+n-1,d=h+i-1,f in y?y[d]=y[f]:delete y[d];for(h=0;h1?arguments[1]:void 0)}))},a981:function(t,e){t.exports="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView},abe2:function(t,e,i){(function(e){ /*! * TOAST UI ImageEditor * @version 3.15.3 * @license MIT */ (function(e,n){t.exports=n(i("fec2"))})(self,(function(t){return function(){var i={2777:function(t,i,n){ /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */ var r=r||{version:"4.6.0"};if(i.fabric=r,"undefined"!==typeof document&&"undefined"!==typeof window)document instanceof("undefined"!==typeof HTMLDocument?HTMLDocument:Document)?r.document=document:r.document=document.implementation.createHTMLDocument(""),r.window=window;else{var o=n(4960),a=new o.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;r.document=a.document,r.jsdomImplForWrapper=n(6759).implForWrapper,r.nodeCanvas=n(6272).Canvas,r.window=a,DOMParser=r.window.DOMParser}function s(t){var e=t.targetCanvas,i=e.width,n=e.height,r=t.destinationWidth,o=t.destinationHeight;i===r&&n===o||(e.width=r,e.height=o)}function c(t,e){var i=t.canvas,n=e.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var o=i.height-n.height;r.drawImage(i,0,o,n.width,n.height,0,0,n.width,n.height)}function l(t,e){var i=e.targetCanvas,n=i.getContext("2d"),r=e.destinationWidth,o=e.destinationHeight,a=r*o*4,s=new Uint8Array(this.imageBuffer,0,a),c=new Uint8ClampedArray(this.imageBuffer,0,a);t.readPixels(0,0,r,o,t.RGBA,t.UNSIGNED_BYTE,s);var l=new ImageData(c,r,o);n.putImageData(l,0,0)}r.isTouchSupported="ontouchstart"in r.window||"ontouchstart"in r.document||r.window&&r.window.navigator&&r.window.navigator.maxTouchPoints>0,r.isLikelyNode="undefined"!==typeof e&&"undefined"===typeof window,r.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],r.DPI=96,r.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",r.commaWsp="(?:\\s+,?\\s*|,\\s*)",r.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,r.reNonWord=/[ \n\.,;!\?\-]/,r.fontPaths={},r.iMatrix=[1,0,0,1,0,0],r.svgNS="http://www.w3.org/2000/svg",r.perfLimitSizeTotal=2097152,r.maxCacheSideLimit=4096,r.minCacheSideLimit=256,r.charWidthsCache={},r.textureSize=2048,r.disableStyleCopyPaste=!1,r.enableGLFiltering=!0,r.devicePixelRatio=r.window.devicePixelRatio||r.window.webkitDevicePixelRatio||r.window.mozDevicePixelRatio||1,r.browserShadowBlurConstant=1,r.arcToSegmentsCache={},r.boundsOfCurveCache={},r.cachesBoundsOfCurve=!0,r.forceGLPutImageData=!1,r.initFilterBackend=function(){return r.enableGLFiltering&&r.isWebglSupported&&r.isWebglSupported(r.textureSize)?(console.log("max texture size: "+r.maxTextureSize),new r.WebglFilterBackend({tileSize:r.textureSize})):r.Canvas2dFilterBackend?new r.Canvas2dFilterBackend:void 0},"undefined"!==typeof document&&"undefined"!==typeof window&&(window.fabric=r),function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:r.util.array.fill(i,!1)}}function e(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in t)this.on(i,t[i]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this}function i(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);this.on(t,i)}function n(t,e){if(1===arguments.length)for(var n in t)i.call(this,n,t[n]);else i.call(this,t,e);return this}function o(e,i){if(!this.__eventListeners)return this;if(0===arguments.length)for(e in this.__eventListeners)t.call(this,e);else if(1===arguments.length&&"object"===typeof arguments[0])for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this}function a(t,e){if(!this.__eventListeners)return this;var i=this.__eventListeners[t];if(!i)return this;for(var n=0,r=i.length;n-1||!!e&&this._objects.some((function(e){return"function"===typeof e.contains&&e.contains(t,!0)}))},complexity:function(){return this._objects.reduce((function(t,e){return t+=e.complexity?e.complexity():0,t}),0)}},r.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof r.Gradient||this.set(e,new r.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof r.Pattern?i&&i():this.set(e,new r.Pattern(t,i))},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"===typeof t?this._setObject(t):this._set(t,e),this},_set:function(t,e){this[t]=e},toggle:function(t){var e=this.get(t);return"boolean"===typeof e&&this.set(t,!e),this},get:function(t){return this[t]}},function(t){var e=Math.sqrt,i=Math.atan2,n=Math.pow,o=Math.PI/180,a=Math.PI/2;r.util={cos:function(t){if(0===t)return 1;t<0&&(t=-t);var e=t/a;switch(e){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=t/a,i=1;switch(t<0&&(i=-1),e){case 1:return i;case 2:return 0;case 3:return-i}return Math.sin(t)},removeFromArray:function(t,e){var i=t.indexOf(e);return-1!==i&&t.splice(i,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*o},radiansToDegrees:function(t){return t/o},rotatePoint:function(t,e,i){var n=new r.Point(t.x-e.x,t.y-e.y),o=r.util.rotateVector(n,i);return new r.Point(o.x,o.y).addEquals(e)},rotateVector:function(t,e){var i=r.util.sin(e),n=r.util.cos(e),o=t.x*n-t.y*i,a=t.x*i+t.y*n;return{x:o,y:a}},transformPoint:function(t,e,i){return i?new r.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new r.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var i=0;in)n+=s[d++%f],n>u&&(n=u),t[g?"lineTo":"moveTo"](n,0),g=!g;t.restore()},createCanvasElement:function(){return r.document.createElement("canvas")},copyCanvasElement:function(t){var e=r.util.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,i){return t.toDataURL("image/"+e,i)},createImage:function(){return r.document.createElement("img")},multiplyTransformMatrices:function(t,e,i){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],i?0:t[0]*e[4]+t[2]*e[5]+t[4],i?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var r=i(t[1],t[0]),a=n(t[0],2)+n(t[1],2),s=e(a),c=(t[0]*t[3]-t[2]*t[1])/s,l=i(t[0]*t[2]+t[1]*t[3],a);return{angle:r/o,scaleX:s,scaleY:c,skewX:l/o,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return r.iMatrix.concat();var e=r.util.degreesToRadians(t.angle),i=r.util.cos(e),n=r.util.sin(e);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(t){var e="undefined"===typeof t.scaleX?1:t.scaleX,i="undefined"===typeof t.scaleY?1:t.scaleY,n=[t.flipX?-e:e,0,0,t.flipY?-i:i,0,0],o=r.util.multiplyTransformMatrices,a=r.util.degreesToRadians;return t.skewX&&(n=o(n,[1,0,Math.tan(a(t.skewX)),1],!0)),t.skewY&&(n=o(n,[1,Math.tan(a(t.skewY)),0,1],!0)),n},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],i=r.util.multiplyTransformMatrices;return t.angle&&(e=i(e,r.util.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=i(e,r.util.calcDimensionsMatrix(t))),e},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,e,i,n){n>0&&(e>n?e-=n:e=0,i>n?i-=n:i=0);var r,o,a=!0,s=t.getImageData(e,i,2*n||1,2*n||1),c=s.data.length;for(r=3;r0?E-=2*u:1===c&&E<0&&(E+=2*u);for(var k=Math.ceil(Math.abs(E/u*2)),O=[],j=E/k,L=8/3*Math.sin(j/4)*Math.sin(j/4)/Math.sin(j/2),N=D+j,P=0;P=r?o-r:2*Math.PI-(r-o)}function s(e,i,n,o,a,s,c,l){var u;if(r.cachesBoundsOfCurve&&(u=t.call(arguments),r.boundsOfCurveCache[u]))return r.boundsOfCurveCache[u];var h,f,d,g,p,v,m,y,b=Math.sqrt,_=Math.min,x=Math.max,C=Math.abs,I=[],M=[[],[]];f=6*e-12*n+6*a,h=-3*e+9*n-9*a+3*c,d=3*n-3*e;for(var S=0;S<2;++S)if(S>0&&(f=6*i-12*o+6*s,h=-3*i+9*o-9*s+3*l,d=3*o-3*i),C(h)<1e-12){if(C(f)<1e-12)continue;g=-d/f,01e-4)i=s(o),r=o,n=u(c.x,c.y,i.x,i.y),n+a>e?(l/=2,o-=l):(c=i,o+=l,a+=n);return i.angle=h(r),i}function M(t){for(var e,i,n,r,o=0,a=t.length,s=0,c=0,l=0,h=0,f=[],d=0;d0&&nM)for(var w=1,T=m.length;w2;for(e=e||0,u&&(c=t[2].xt[i-2].x?1:o.x===t[i-2].x?0:-1,l=o.y>t[i-2].y?1:o.y===t[i-2].y?0:-1),n.push(["L",o.x+c*e,o.y+l*e]),n}function A(t,e,i){return i&&(e=r.util.multiplyTransformMatrices(e,[1,0,0,1,-i.x,-i.y])),t.map((function(t){for(var i=t.slice(0),n={},o=1;o=e}))}function n(t,e){return a(t,e,(function(t,e){return t/g,">")}function n(t){var e,i=0,n=[];for(i=0,e;i57343)return t.charAt(e);if(55296<=i&&i<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var n=t.charCodeAt(e+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";var r=t.charCodeAt(e-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}r.util.string={camelize:t,capitalize:e,escapeXml:i,graphemeSplit:n}}(),function(){var t=Array.prototype.slice,e=function(){},i=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),n=function(t,e,n){for(var r in e)r in t.prototype&&"function"===typeof t.prototype[r]&&(e[r]+"").indexOf("callSuper")>-1?t.prototype[r]=function(t){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=e[t].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==t)return r}}(r):t.prototype[r]=e[r],i&&(e.toString!==Object.prototype.toString&&(t.prototype.toString=e.toString),e.valueOf!==Object.prototype.valueOf&&(t.prototype.valueOf=e.valueOf))};function o(){}function a(e){var i=null,n=this;while(n.constructor.superclass){var r=n.constructor.superclass.prototype[e];if(n[e]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,t.call(arguments,1)):i.call(this):console.log("tried to callSuper "+e+", method not found in prototype chain",this)}function s(){var i=null,r=t.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"===typeof r[0]&&(i=r.shift()),s.superclass=i,s.subclasses=[],i&&(o.prototype=i.prototype,s.prototype=new o,i.subclasses.push(s));for(var c=0,l=r.length;c-1||"touch"===t.pointerType}}(),function(){function t(t,e){var i=t.style;if(!i)return t;if("string"===typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?a(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var n in e)if("opacity"===n)a(t,e[n]);else{var r="float"===n||"cssFloat"===n?"undefined"===typeof i.styleFloat?"cssFloat":"styleFloat":n;i[r]=e[n]}return t}var e=r.document.createElement("div"),i="string"===typeof e.style.opacity,n="string"===typeof e.style.filter,o=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,a=function(t){return t};i?a=function(t,e){return t.style.opacity=e,t}:n&&(a=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),o.test(i.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",i.filter=i.filter.replace(o,e)):i.filter+=" alpha(opacity="+100*e+")",t}),r.util.setStyle=t}(),function(){var t=Array.prototype.slice;function e(t){return"string"===typeof t?r.document.getElementById(t):t}var i,n,o=function(e){return t.call(e,0)};try{i=o(r.document.childNodes)instanceof Array}catch(g){}function a(t,e){var i=r.document.createElement(t);for(var n in e)"class"===n?i.className=e[n]:"for"===n?i.htmlFor=e[n]:i.setAttribute(n,e[n]);return i}function s(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)}function c(t,e,i){return"string"===typeof e&&(e=a(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e}function l(t){var e=0,i=0,n=r.document.documentElement,o=r.document.body||{scrollLeft:0,scrollTop:0};while(t&&(t.parentNode||t.host))if(t=t.parentNode||t.host,t===r.document?(e=o.scrollLeft||n.scrollLeft||0,i=o.scrollTop||n.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1===t.nodeType&&"fixed"===t.style.position)break;return{left:e,top:i}}function u(t){var e,i,r=t&&t.ownerDocument,o={left:0,top:0},a={left:0,top:0},s={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return a;for(var c in s)a[s[c]]+=parseInt(n(t,c),10)||0;return e=r.documentElement,"undefined"!==typeof t.getBoundingClientRect&&(o=t.getBoundingClientRect()),i=l(t),{left:o.left+i.left-(e.clientLeft||0)+a.left,top:o.top+i.top-(e.clientTop||0)+a.top}}function h(t){var e=r.jsdomImplForWrapper(t);return e._canvas||e._image}function f(t){if(r.isLikelyNode){var e=r.jsdomImplForWrapper(t);e&&(e._image=null,e._canvas=null,e._currentSrc=null,e._attributes=null,e._classList=null)}}function d(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e}i||(o=function(t){var e=new Array(t.length),i=t.length;while(i--)e[i]=t[i];return e}),n=r.document.defaultView&&r.document.defaultView.getComputedStyle?function(t,e){var i=r.document.defaultView.getComputedStyle(t,null);return i?i[e]:void 0}:function(t,e){var i=t.style[e];return!i&&t.currentStyle&&(i=t.currentStyle[e]),i},function(){var t=r.document.documentElement.style,e="userSelect"in t?"userSelect":"MozUserSelect"in t?"MozUserSelect":"WebkitUserSelect"in t?"WebkitUserSelect":"KhtmlUserSelect"in t?"KhtmlUserSelect":"";function i(t){return"undefined"!==typeof t.onselectstart&&(t.onselectstart=r.util.falseFunction),e?t.style[e]="none":"string"===typeof t.unselectable&&(t.unselectable="on"),t}function n(t){return"undefined"!==typeof t.onselectstart&&(t.onselectstart=null),e?t.style[e]="":"string"===typeof t.unselectable&&(t.unselectable=""),t}r.util.makeElementUnselectable=i,r.util.makeElementSelectable=n}(),r.util.setImageSmoothing=d,r.util.getById=e,r.util.toArray=o,r.util.addClass=s,r.util.makeElement=a,r.util.wrapElement=c,r.util.getScrollLeftTop=l,r.util.getElementOffset=u,r.util.getNodeCanvas=h,r.util.cleanUpJsdomNode=f}(),function(){function t(t,e){return t+(/\?/.test(t)?"&":"?")+e}function e(){}function i(i,n){n||(n={});var o=n.method?n.method.toUpperCase():"GET",a=n.onComplete||function(){},s=new r.window.XMLHttpRequest,c=n.body||n.parameters;return s.onreadystatechange=function(){4===s.readyState&&(a(s),s.onreadystatechange=e)},"GET"===o&&(c=null,"string"===typeof n.parameters&&(i=t(i,n.parameters))),s.open(o,i,!0),"POST"!==o&&"PUT"!==o||s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(c),s}r.util.request=i}(),r.log=console.log,r.warn=console.warn,function(){function t(){return!1}function e(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e}function i(i){var n=!1;return a((function(r){i||(i={});var o,s=r||+new Date,c=i.duration||500,l=s+c,u=i.onChange||t,h=i.abort||t,f=i.onComplete||t,d=i.easing||e,g="startValue"in i?i.startValue:0,p="endValue"in i?i.endValue:100,v=i.byValue||p-g;i.onStart&&i.onStart(),function t(e){o=e||+new Date;var i=o>l?c:o-s,r=i/c,m=d(i,g,v,c),y=Math.abs((m-g)/v);if(!n){if(!h(m,y,r))return o>l?(u(p,1,1),void f(p,1,1)):(u(m,y,r),void a(t));f(p,1,1)}}(s)})),function(){n=!0}}var n=r.window.requestAnimationFrame||r.window.webkitRequestAnimationFrame||r.window.mozRequestAnimationFrame||r.window.oRequestAnimationFrame||r.window.msRequestAnimationFrame||function(t){return r.window.setTimeout(t,1e3/60)},o=r.window.cancelAnimationFrame||r.window.clearTimeout;function a(){return n.apply(r.window,arguments)}function s(){return o.apply(r.window,arguments)}r.util.animate=i,r.util.requestAnimFrame=a,r.util.cancelAnimFrame=s}(),function(){function t(t,e,i){var n="rgba("+parseInt(t[0]+i*(e[0]-t[0]),10)+","+parseInt(t[1]+i*(e[1]-t[1]),10)+","+parseInt(t[2]+i*(e[2]-t[2]),10);return n+=","+(t&&e?parseFloat(t[3]+i*(e[3]-t[3])):1),n+=")",n}function e(e,i,n,o){var a=new r.Color(e).getSource(),s=new r.Color(i).getSource(),c=o.onComplete,l=o.onChange;return o=o||{},r.util.animate(r.util.object.extend(o,{duration:n||500,startValue:a,endValue:s,byValue:s,easing:function(e,i,n,r){var a=o.colorEasing?o.colorEasing(e,r):1-Math.cos(e/r*(Math.PI/2));return t(i,n,a)},onComplete:function(e,i,n){if(c)return c(t(s,s,0),i,n)},onChange:function(e,i,n){if(l){if(Array.isArray(e))return l(t(e,e,0),i,n);l(e,i,n)}}}))}r.util.animateColor=e}(),function(){function t(t,e,i,n){return t-1&&u>-1&&u-1)&&(i="stroke")}else{if("href"===t||"xlink:href"===t||"font"===t)return i;if("imageSmoothing"===t)return"optimizeQuality"===i;s=c?i.map(o):o(i,r)}}else i="";return!c&&isNaN(s)?i:s}function m(t){return new RegExp("^("+t.join("|")+")\\b","i")}function y(t){for(var i in f)if("undefined"!==typeof t[f[i]]&&""!==t[i]){if("undefined"===typeof t[i]){if(!e.Object.prototype[i])continue;t[i]=e.Object.prototype[i]}if(0!==t[i].indexOf("url(")){var n=new e.Color(t[i]);t[i]=n.setAlpha(r(n.getAlpha()*t[f[i]],2)).toRgba()}}return t}function b(t,e){var i,n,r,o,a=[];for(r=0,o=e.length;r1)c.shift(),l=e.util.multiplyTransformMatrices(l,c[0]);return l}}();var A=new RegExp("^\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*$");function D(t){if(!e.svgViewBoxElementsRegEx.test(t.nodeName))return{};var i,n,r,a,s=t.getAttribute("viewBox"),c=1,l=1,u=0,h=0,f=t.getAttribute("width"),d=t.getAttribute("height"),g=t.getAttribute("x")||0,p=t.getAttribute("y")||0,v=t.getAttribute("preserveAspectRatio")||"",m=!s||!(s=s.match(A)),y=!f||!d||"100%"===f||"100%"===d,b=m&&y,_={},x="",C=0,I=0;if(_.width=0,_.height=0,_.toBeParsed=b,m&&(g||p)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(x=" translate("+o(g)+" "+o(p)+") ",r=(t.getAttribute("transform")||"")+x,t.setAttribute("transform",r),t.removeAttribute("x"),t.removeAttribute("y")),b)return _;if(m)return _.width=o(f),_.height=o(d),_;if(u=-parseFloat(s[1]),h=-parseFloat(s[2]),i=parseFloat(s[3]),n=parseFloat(s[4]),_.minX=u,_.minY=h,_.viewBoxWidth=i,_.viewBoxHeight=n,y?(_.width=i,_.height=n):(_.width=o(f),_.height=o(d),c=_.width/i,l=_.height/n),v=e.util.parsePreserveAspectRatioAttribute(v),"none"!==v.alignX&&("meet"===v.meetOrSlice&&(l=c=c>l?l:c),"slice"===v.meetOrSlice&&(l=c=c>l?c:l),C=_.width-i*c,I=_.height-n*c,"Mid"===v.alignX&&(C/=2),"Mid"===v.alignY&&(I/=2),"Min"===v.alignX&&(C=0),"Min"===v.alignY&&(I=0)),1===c&&1===l&&0===u&&0===h&&0===g&&0===p)return _;if((g||p)&&"#document"!==t.parentNode.nodeName&&(x=" translate("+o(g)+" "+o(p)+") "),r=x+" matrix("+c+" 0 0 "+l+" "+(u*c+C)+" "+(h*l+I)+") ","svg"===t.nodeName){a=t.ownerDocument.createElementNS(e.svgNS,"g");while(t.firstChild)a.appendChild(t.firstChild);t.appendChild(a)}else a=t,a.removeAttribute("x"),a.removeAttribute("y"),r=a.getAttribute("transform")+r;return a.setAttribute("transform",r),_}function E(t,e){while(t&&(t=t.parentNode))if(t.nodeName&&e.test(t.nodeName.replace("svg:",""))&&!t.getAttribute("instantiated_by_use"))return!0;return!1}function k(t,e){var i=["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"],n="xlink:href",r=e.getAttribute(n).substr(1),o=w(t,r);if(o&&o.getAttribute(n)&&k(t,o),i.forEach((function(t){o&&!e.hasAttribute(t)&&o.hasAttribute(t)&&e.setAttribute(t,o.getAttribute(t))})),!e.children.length){var a=o.cloneNode(!0);while(a.firstChild)e.appendChild(a.firstChild)}e.removeAttribute(n)}e.parseSVGDocument=function(t,i,r,o){if(t){T(t);var a,s,c=e.Object.__uid++,l=D(t),u=e.util.toArray(t.getElementsByTagName("*"));if(l.crossOrigin=o&&o.crossOrigin,l.svgUid=c,0===u.length&&e.isLikelyNode){u=t.selectNodes('//*[name(.)!="svg"]');var h=[];for(a=0,s=u.length;at.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return"undefined"===typeof e&&(e=.5),e=Math.max(Math.min(1,e),0),new i(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},distanceFrom:function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},midPointFrom:function(t){return this.lerp(t)},min:function(t){return new i(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new i(Math.max(this.x,t.x),Math.max(this.y,t.y))},toString:function(){return this.x+","+this.y},setXY:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setFromPoint:function(t){return this.x=t.x,this.y=t.y,this},swap:function(t){var e=this.x,i=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=i},clone:function(){return new i(this.x,this.y)}})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){this.status=t,this.points=[]}e.Intersection?e.warn("fabric.Intersection is already defined"):(e.Intersection=i,e.Intersection.prototype={constructor:i,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},e.Intersection.intersectLineLine=function(t,n,r,o){var a,s=(o.x-r.x)*(t.y-r.y)-(o.y-r.y)*(t.x-r.x),c=(n.x-t.x)*(t.y-r.y)-(n.y-t.y)*(t.x-r.x),l=(o.y-r.y)*(n.x-t.x)-(o.x-r.x)*(n.y-t.y);if(0!==l){var u=s/l,h=c/l;0<=u&&u<=1&&0<=h&&h<=1?(a=new i("Intersection"),a.appendPoint(new e.Point(t.x+u*(n.x-t.x),t.y+u*(n.y-t.y)))):a=new i}else a=new i(0===s||0===c?"Coincident":"Parallel");return a},e.Intersection.intersectLinePolygon=function(t,e,n){var r,o,a,s,c=new i,l=n.length;for(s=0;s0&&(c.status="Intersection"),c},e.Intersection.intersectPolygonPolygon=function(t,e){var n,r=new i,o=t.length;for(n=0;n0&&(r.status="Intersection"),r},e.Intersection.intersectPolygonRectangle=function(t,n,r){var o=n.min(r),a=n.max(r),s=new e.Point(a.x,o.y),c=new e.Point(o.x,a.y),l=i.intersectLinePolygon(o,s,t),u=i.intersectLinePolygon(s,a,t),h=i.intersectLinePolygon(a,c,t),f=i.intersectLinePolygon(c,o,t),d=new i;return d.appendPoints(l.points),d.appendPoints(u.points),d.appendPoints(h.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}function n(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}e.Color?e.warn("fabric.Color is already defined."):(e.Color=i,e.Color.prototype={_tryParsingColor:function(t){var e;t in i.colorNameMap&&(t=i.colorNameMap[t]),"transparent"===t&&(e=[255,255,255,0]),e||(e=i.sourceFromHex(t)),e||(e=i.sourceFromRgb(t)),e||(e=i.sourceFromHsl(t)),e||(e=[0,0,0,1]),e&&this.setSource(e)},_rgbToHsl:function(t,i,n){t/=255,i/=255,n/=255;var r,o,a,s=e.util.array.max([t,i,n]),c=e.util.array.min([t,i,n]);if(a=(s+c)/2,s===c)r=o=0;else{var l=s-c;switch(o=a>.5?l/(2-s-c):l/(s+c),s){case t:r=(i-n)/l+(i0)-(t<0)||+t};function d(t,e){var i=t.angle+h(Math.atan2(e.y,e.x))+360;return Math.round(i%360/45)}function g(t,i){var n=i.transform.target,r=n.canvas,o=e.util.object.clone(i);o.target=n,r&&r.fire("object:"+t,o),n.fire(t,i)}function p(t,e){var i=e.canvas,n=i.uniScaleKey,r=t[n];return i.uniformScaling&&!r||!i.uniformScaling&&r}function v(t){return t.originX===l&&t.originY===l}function m(t,e,i){var n=t.lockScalingX,r=t.lockScalingY;return!(!n||!r)||(!(e||!n&&!r||!i)||(!(!n||"x"!==e)||!(!r||"y"!==e)))}function y(t,e,n){var r="not-allowed",o=p(t,n),a="";if(0!==e.x&&0===e.y?a="x":0===e.x&&0!==e.y&&(a="y"),m(n,a,o))return r;var s=d(n,e);return i[s]+"-resize"}function b(t,e,i){var r="not-allowed";if(0!==e.x&&i.lockSkewingY)return r;if(0!==e.y&&i.lockSkewingX)return r;var o=d(i,e)%4;return n[o]+"-resize"}function _(t,e,i){return t[i.canvas.altActionKey]?r.skewCursorStyleHandler(t,e,i):r.scaleCursorStyleHandler(t,e,i)}function x(t,e,i){var n=t[i.canvas.altActionKey];return 0===e.x?n?"skewX":"scaleY":0===e.y?n?"skewY":"scaleX":void 0}function C(t,e,i){return i.lockRotation?"not-allowed":e.cursorStyle}function I(t,e,i,n){return{e:t,transform:e,pointer:{x:i,y:n}}}function M(t){return function(e,i,n,r){var o=i.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,i.originX,i.originY),c=t(e,i,n,r);return o.setPositionByOrigin(s,i.originX,i.originY),c}}function S(t,e){return function(i,n,r,o){var a=e(i,n,r,o);return a&&g(t,I(i,n,r,o)),a}}function w(t,i,n,r,o){var a=t.target,s=a.controls[t.corner],c=a.canvas.getZoom(),l=a.padding/c,u=a.toLocalPoint(new e.Point(r,o),i,n);return u.x>=l&&(u.x-=l),u.x<=-l&&(u.x+=l),u.y>=l&&(u.y-=l),u.y<=l&&(u.y+=l),u.x-=s.offsetX,u.y-=s.offsetY,u}function T(t){return t.flipX!==t.flipY}function A(t,e,i,n,r){if(0!==t[e]){var o=t._getTransformedDimensions()[n],a=r/o*t[i];t.set(i,a)}}function D(t,e,i,n){var r,l=e.target,u=l._getTransformedDimensions(0,l.skewY),f=w(e,e.originX,e.originY,i,n),d=Math.abs(2*f.x)-u.x,g=l.skewX;d<2?r=0:(r=h(Math.atan2(d/l.scaleX,u.y/l.scaleY)),e.originX===o&&e.originY===c&&(r=-r),e.originX===s&&e.originY===a&&(r=-r),T(l)&&(r=-r));var p=g!==r;if(p){var v=l._getTransformedDimensions().y;l.set("skewX",r),A(l,"skewY","scaleY","y",v)}return p}function E(t,e,i,n){var r,l=e.target,u=l._getTransformedDimensions(l.skewX,0),f=w(e,e.originX,e.originY,i,n),d=Math.abs(2*f.y)-u.y,g=l.skewY;d<2?r=0:(r=h(Math.atan2(d/l.scaleY,u.x/l.scaleX)),e.originX===o&&e.originY===c&&(r=-r),e.originX===s&&e.originY===a&&(r=-r),T(l)&&(r=-r));var p=g!==r;if(p){var v=l._getTransformedDimensions().x;l.set("skewY",r),A(l,"skewX","scaleX","x",v)}return p}function k(t,e,i,n){var r,c=e.target,u=c.skewX,h=e.originY;if(c.lockSkewingX)return!1;if(0===u){var f=w(e,l,l,i,n);r=f.x>0?o:s}else u>0&&(r=h===a?o:s),u<0&&(r=h===a?s:o),T(c)&&(r=r===o?s:o);e.originX=r;var d=S("skewing",M(D));return d(t,e,i,n)}function O(t,e,i,n){var r,s=e.target,u=s.skewY,h=e.originX;if(s.lockSkewingY)return!1;if(0===u){var f=w(e,l,l,i,n);r=f.y>0?a:c}else u>0&&(r=h===o?a:c),u<0&&(r=h===o?c:a),T(s)&&(r=r===a?c:a);e.originY=r;var d=S("skewing",M(E));return d(t,e,i,n)}function j(t,e,i,n){var r=e,o=r.target,a=o.translateToOriginPoint(o.getCenterPoint(),r.originX,r.originY);if(o.lockRotation)return!1;var s=Math.atan2(r.ey-a.y,r.ex-a.x),c=Math.atan2(n-a.y,i-a.x),l=h(c-s+r.theta),u=!0;if(o.snapAngle>0){var f=o.snapAngle,d=o.snapThreshold||f,g=Math.ceil(l/f)*f,p=Math.floor(l/f)*f;Math.abs(l-p)s?(o=a,t.scale(1,s/a),f=i*a/s):s>a?(o=s,t.scale(a/s,1),h=e*s/a):o=a,t.lineWidth=1,t.beginPath(),t.arc(h,f,o/2,0,2*Math.PI,!1),t[l](),u&&t.stroke(),t.restore()}function o(t,e,n,r,o){r=r||{};var a=this.sizeX||r.cornerSize||o.cornerSize,s=this.sizeY||r.cornerSize||o.cornerSize,c="undefined"!==typeof r.transparentCorners?r.transparentCorners:o.transparentCorners,l=c?"stroke":"fill",u=!c&&(r.cornerStrokeColor||o.cornerStrokeColor),h=a/2,f=s/2;t.save(),t.fillStyle=r.cornerColor||o.cornerColor,t.strokeStyle=r.cornerStrokeColor||o.cornerStrokeColor,t.lineWidth=1,t.translate(e,n),t.rotate(i(o.angle)),t[l+"Rect"](-h,-f,a,s),u&&t.strokeRect(-h,-f,a,s),t.restore()}n.renderCircleControl=r,n.renderSquareControl=o}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){for(var e in t)this[e]=t[e]}e.Control=i,e.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(t,e){return e.cursorStyle},getActionName:function(t,e){return e.actionName},getVisibility:function(t,e){var i=t._controlsVisibility;return i&&"undefined"!==typeof i[e]?i[e]:this.visible},setVisibility:function(t){this.visible=t},positionHandler:function(t,i){var n=e.util.transformPoint({x:this.x*t.x+this.offsetX,y:this.y*t.y+this.offsetY},i);return n},calcCornerCoords:function(t,i,n,r,o){var a,s,c,l,u=o?this.touchSizeX:this.sizeX,h=o?this.touchSizeY:this.sizeY;if(u&&h&&u!==h){var f=Math.atan2(h,u),d=Math.sqrt(u*u+h*h)/2,g=f-e.util.degreesToRadians(t),p=Math.PI/2-f-e.util.degreesToRadians(t);a=d*e.util.cos(g),s=d*e.util.sin(g),c=d*e.util.cos(p),l=d*e.util.sin(p)}else{var v=u&&h?u:i;d=.7071067812*v;g=e.util.degreesToRadians(45-t);a=c=d*e.util.cos(g),s=l=d*e.util.sin(g)}return{tl:{x:n-l,y:r-c},tr:{x:n+a,y:r-s},bl:{x:n-a,y:r+s},br:{x:n+l,y:r+c}}},render:function(t,i,n,r,o){switch(r=r||{},r.cornerStyle||o.cornerStyle){case"circle":e.controlsUtils.renderCircleControl.call(this,t,i,n,r,o);break;default:e.controlsUtils.renderSquareControl.call(this,t,i,n,r,o)}}}}(i),function(){function t(t,e){var i,n,o,a,s=t.getAttribute("style"),c=t.getAttribute("offset")||0;if(c=parseFloat(c)/(/%$/.test(c)?100:1),c=c<0?0:c>1?1:c,s){var l=s.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),a=l.length;a--;){var u=l[a].split(/\s*:\s*/),h=u[0].trim(),f=u[1].trim();"stop-color"===h?i=f:"stop-opacity"===h&&(o=f)}}return i||(i=t.getAttribute("stop-color")||"rgb(0,0,0)"),o||(o=t.getAttribute("stop-opacity")),i=new r.Color(i),n=i.getAlpha(),o=isNaN(parseFloat(o))?1:parseFloat(o),o*=n*e,{offset:c,color:i.toRgb(),opacity:o}}function e(t){return{x1:t.getAttribute("x1")||0,y1:t.getAttribute("y1")||0,x2:t.getAttribute("x2")||"100%",y2:t.getAttribute("y2")||0}}function i(t){return{x1:t.getAttribute("fx")||t.getAttribute("cx")||"50%",y1:t.getAttribute("fy")||t.getAttribute("cy")||"50%",r1:0,x2:t.getAttribute("cx")||"50%",y2:t.getAttribute("cy")||"50%",r2:t.getAttribute("r")||"50%"}}var n=r.util.object.clone;function o(t,e,i,n){var r,o;Object.keys(e).forEach((function(t){r=e[t],"Infinity"===r?o=1:"-Infinity"===r?o=0:(o=parseFloat(e[t],10),"string"===typeof r&&/^(\d+\.\d+)%|(\d+)%$/.test(r)&&(o*=.01,"pixels"===n&&("x1"!==t&&"x2"!==t&&"r2"!==t||(o*=i.viewBoxWidth||i.width),"y1"!==t&&"y2"!==t||(o*=i.viewBoxHeight||i.height)))),e[t]=o}))}r.Gradient=r.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(t){t||(t={}),t.coords||(t.coords={});var e,i=this;Object.keys(t).forEach((function(e){i[e]=t[e]})),this.id?this.id+="_"+r.Object.__uid++:this.id=r.Object.__uid++,e={x1:t.coords.x1||0,y1:t.coords.y1||0,x2:t.coords.x2||0,y2:t.coords.y2||0},"radial"===this.type&&(e.r1=t.coords.r1||0,e.r2=t.coords.r2||0),this.coords=e,this.colorStops=t.colorStops.slice()},addColorStop:function(t){for(var e in t){var i=new r.Color(t[e]);this.colorStops.push({offset:parseFloat(e),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(t){var e={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return r.util.populateWithProperties(this,e,t),e},toSVG:function(t,e){var i,o,a,s,c=n(this.coords,!0),l=(e=e||{},n(this.colorStops,!0)),u=c.r1>c.r2,h=this.gradientTransform?this.gradientTransform.concat():r.iMatrix.concat(),f=-this.offsetX,d=-this.offsetY,g=!!e.additionalTransform,p="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort((function(t,e){return t.offset-e.offset})),"objectBoundingBox"===p?(f/=t.width,d/=t.height):(f+=t.width/2,d+=t.height/2),"path"===t.type&&"percentage"!==this.gradientUnits&&(f-=t.pathOffset.x,d-=t.pathOffset.y),h[4]-=f,h[5]-=d,s='id="SVGID_'+this.id+'" gradientUnits="'+p+'"',s+=' gradientTransform="'+(g?e.additionalTransform+" ":"")+r.util.matrixToSVG(h)+'" ',"linear"===this.type?a=["\n']:"radial"===this.type&&(a=["\n']),"radial"===this.type){if(u)for(l=l.concat(),l.reverse(),i=0,o=l.length;i0){var m=Math.max(c.r1,c.r2),y=v/m;for(i=0,o=l.length;i\n')}return a.push("linear"===this.type?"\n":"\n"),a.join("")},toLive:function(t){var e,i,n,o=r.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(e=t.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),i=0,n=this.colorStops.length;i1?1:l,isNaN(l)&&(l=1);var u,h,f,d,g=n.getElementsByTagName("stop"),p="userSpaceOnUse"===n.getAttribute("gradientUnits")?"pixels":"percentage",v=n.getAttribute("gradientTransform")||"",m=[],y=0,b=0;for("linearGradient"===n.nodeName||"LINEARGRADIENT"===n.nodeName?(u="linear",h=e(n)):(u="radial",h=i(n)),f=g.length;f--;)m.push(t(g[f],l));d=r.parseTransformAttribute(v),o(a,h,c,p),"pixels"===p&&(y=-a.left,b=-a.top);var _=new r.Gradient({id:n.getAttribute("id"),type:u,coords:h,colorStops:m,gradientUnits:p,gradientTransform:d,offsetX:y,offsetY:b});return _}})}(),function(){"use strict";var t=r.util.toFixed;r.Pattern=r.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,e){if(t||(t={}),this.id=r.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!==typeof t.source)e&&e(this);else{var i=this;this.source=r.util.createImage(),r.util.loadImage(t.source,(function(t,n){i.source=t,e&&e(i,n)}),null,this.crossOrigin)}},toObject:function(e){var i,n,o=r.Object.NUM_FRACTION_DIGITS;return"string"===typeof this.source.src?i=this.source.src:"object"===typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),n={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:t(this.offsetX,o),offsetY:t(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},r.util.populateWithProperties(this,n,e),n},toSVG:function(t){var e="function"===typeof this.source?this.source():this.source,i=e.width/t.width,n=e.height/t.height,r=this.offsetX/t.width,o=this.offsetY/t.height,a="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,o&&(n+=Math.abs(o))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,r&&(i+=Math.abs(r))),e.src?a=e.src:e.toDataURL&&(a=e.toDataURL()),'\n\n\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;if(!e)return"";if("undefined"!==typeof e.src){if(!e.complete)return"";if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.toFixed;e.Shadow?e.warn("fabric.Shadow is already defined."):(e.Shadow=e.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(t){for(var i in"string"===typeof t&&(t=this._parseShadow(t)),t)this[i]=t[i];this.id=e.Object.__uid++},_parseShadow:function(t){var i=t.trim(),n=e.Shadow.reOffsetsAndBlur.exec(i)||[],r=i.replace(e.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:r.trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var n=40,r=40,o=e.Object.NUM_FRACTION_DIGITS,a=e.util.rotateVector({x:this.offsetX,y:this.offsetY},e.util.degreesToRadians(-t.angle)),s=20,c=new e.Color(this.color);return t.width&&t.height&&(n=100*i((Math.abs(a.x)+this.blur)/t.width,o)+s,r=100*i((Math.abs(a.y)+this.blur)/t.height,o)+s),t.flipX&&(a.x*=-1),t.flipY&&(a.y*=-1),'\n\t\n\t\n\t\n\t\n\t\n\t\t\n\t\t\n\t\n\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var t={},i=e.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(e){this[e]!==i[e]&&(t[e]=this[e])}),this),t}}),e.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(i),function(){"use strict";if(r.StaticCanvas)r.warn("fabric.StaticCanvas is already defined.");else{var t=r.util.object.extend,e=r.util.getElementOffset,i=r.util.removeFromArray,n=r.util.toFixed,o=r.util.transformPoint,a=r.util.invertTransform,s=r.util.getNodeCanvas,c=r.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");r.StaticCanvas=r.util.createClass(r.CommonMethods,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:r.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,i),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,i),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,i),e.overlayColor&&this.setOverlayColor(e.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1!==r.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?r.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var t=r.devicePixelRatio;this.__initRetinaScaling(t,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(t,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(t,e,i){e.setAttribute("width",this.width*t),e.setAttribute("height",this.height*t),i.scale(t,t)},calcOffset:function(){return this._offset=e(this.lowerCanvasEl),this},setOverlayImage:function(t,e,i){return this.__setBgOverlayImage("overlayImage",t,e,i)},setBackgroundImage:function(t,e,i){return this.__setBgOverlayImage("backgroundImage",t,e,i)},setOverlayColor:function(t,e){return this.__setBgOverlayColor("overlayColor",t,e)},setBackgroundColor:function(t,e){return this.__setBgOverlayColor("backgroundColor",t,e)},__setBgOverlayImage:function(t,e,i,n){return"string"===typeof e?r.util.loadImage(e,(function(e,o){if(e){var a=new r.Image(e,n);this[t]=a,a.canvas=this}i&&i(e,o)}),this,n&&n.crossOrigin):(n&&e.setOptions(n),this[t]=e,e&&(e.canvas=this),i&&i(e,!1)),this},__setBgOverlayColor:function(t,e,i){return this[t]=e,this._initGradient(e,t),this._initPattern(e,t,i),this},_createCanvasElement:function(){var t=c();if(!t)throw l;if(t.style||(t.style={}),"undefined"===typeof t.getContext)throw l;return t},_initOptions:function(t){var e=this.lowerCanvasEl;this._setOptions(t),this.width=this.width||parseInt(e.width,10)||0,this.height=this.height||parseInt(e.height,10)||0,this.lowerCanvasEl.style&&(e.width=this.width,e.height=this.height,e.style.width=this.width+"px",e.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=r.util.getById(t)||this._createCanvasElement(),r.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(t,e){return this.setDimensions({width:t},e)},setHeight:function(t,e){return this.setDimensions({height:t},e)},setDimensions:function(t,e){var i;for(var n in e=e||{},t)i=t[n],e.cssOnly||(this._setBackstoreDimension(n,t[n]),i+="px",this.hasLostContext=!0),e.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),e.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(t,e){return this.lowerCanvasEl[t]=e,this.upperCanvasEl&&(this.upperCanvasEl[t]=e),this.cacheCanvasEl&&(this.cacheCanvasEl[t]=e),this[t]=e,this},_setCssDimension:function(t,e){return this.lowerCanvasEl.style[t]=e,this.upperCanvasEl&&(this.upperCanvasEl.style[t]=e),this.wrapperEl&&(this.wrapperEl.style[t]=e),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(t){var e,i,n,r=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=t,i=0,n=this._objects.length;i\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push(""),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('\n','\n')},_setSVGHeader:function(t,e){var i,o=e.width||this.width,a=e.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',c=r.Object.NUM_FRACTION_DIGITS;e.viewBox?s='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,s='viewBox="'+n(-i[4]/i[0],c)+" "+n(-i[5]/i[3],c)+" "+n(this.width/i[0],c)+" "+n(this.height/i[3],c)+'" '),t.push("\n',"Created with Fabric.js ",r.version,"\n","\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+r.Object.__uid++,'\n'+this.clipPath.toClipPathSVG(t.reviver)+"\n"):""},createSVGRefElementsMarkup:function(){var t=this,e=["background","overlay"].map((function(e){var i=t[e+"Color"];if(i&&i.toLive){var n=t[e+"Vpt"],o=t.viewportTransform,a={width:t.width/(n?o[0]:1),height:t.height/(n?o[3]:1)};return i.toSVG(a,{additionalTransform:n?r.util.matrixToSVG(o):""})}}));return e.join("")},createSVGFontFacesMarkup:function(){var t,e,i,n,o,a,s,c,l,u="",h={},f=r.fontPaths,d=[];for(this._objects.forEach((function t(e){d.push(e),e._objects&&e._objects.forEach(t)})),c=0,l=d.length;c',"\n",u,"","\n"].join("")),u},_setSVGObjects:function(t,e){var i,n,r,o=this._objects;for(n=0,r=o.length;n\n")}else t.push('\n")},sendToBack:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(r=o._objects,e=r.length;e--;)n=r[e],i(this._objects,n),this._objects.unshift(n);else i(this._objects,t),this._objects.unshift(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(r=o._objects,e=0;e0+l&&(a=o-1,i(this._objects,r),this._objects.splice(a,0,r)),l++;else o=this._objects.indexOf(t),0!==o&&(a=this._findNewLowerIndex(t,o,e),i(this._objects,t),this._objects.splice(a,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(t,e,i){var n,r;if(i)for(n=e,r=e-1;r>=0;--r){var o=t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t);if(o){n=r;break}}else n=e-1;return n},bringForward:function(t,e){if(!t)return this;var n,r,o,a,s,c=this._activeObject,l=0;if(t===c&&"activeSelection"===t.type)for(s=c._objects,n=s.length;n--;)r=s[n],o=this._objects.indexOf(r),o"}}),t(r.StaticCanvas.prototype,r.Observable),t(r.StaticCanvas.prototype,r.Collection),t(r.StaticCanvas.prototype,r.DataURLExporter),t(r.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=c();if(!e||!e.getContext)return null;var i=e.getContext("2d");if(!i)return null;switch(t){case"setLineDash":return"undefined"!==typeof i.setLineDash;default:return null}}}),r.StaticCanvas.prototype.toJSON=r.StaticCanvas.prototype.toObject,r.isLikelyNode&&(r.StaticCanvas.prototype.createPNGStream=function(){var t=s(this.lowerCanvasEl);return t&&t.createPNGStream()},r.StaticCanvas.prototype.createJPEGStream=function(t){var e=s(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}}(),r.BaseBrush=r.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var t=this.canvas.contextTop;t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(t){var e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},_setShadow:function(){if(this.shadow){var t=this.canvas,e=this.shadow,i=t.contextTop,n=t.getZoom();t&&t._isRetinaScaling()&&(n*=r.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*n,i.shadowOffsetX=e.offsetX*n,i.shadowOffsetY=e.offsetY*n}},needsFullRender:function(){var t=new r.Color(this.color);return t.getAlpha()<1||!!this.shadow},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0},_isOutSideCanvas:function(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}}),function(){r.PencilBrush=r.util.createClass(r.BaseBrush,{decimate:.4,initialize:function(t){this.canvas=t,this._points=[]},_drawSegment:function(t,e,i){var n=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,n.x,n.y),n},onMouseDown:function(t,e){this.canvas._isMainEvent(e.e)&&(this._prepareForDrawing(t),this._captureDrawingPath(t),this._render())},onMouseMove:function(t,e){if(this.canvas._isMainEvent(e.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._captureDrawingPath(t)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,n=i.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,i[n-2],i[n-1],!0),r.stroke(),r.restore()}},onMouseUp:function(t){return!this.canvas._isMainEvent(t.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(t){var e=new r.Point(t.x,t.y);this._reset(),this._addPoint(e),this.canvas.contextTop.moveTo(e.x,e.y)},_addPoint:function(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1]))&&(this._points.push(t),!0)},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(t){var e=new r.Point(t.x,t.y);return this._addPoint(e)},_render:function(){var t,e,i=this.canvas.contextTop,n=this._points[0],o=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&n.x===o.x&&n.y===o.y){var a=this.width/1e3;n=new r.Point(n.x,n.y),o=new r.Point(o.x,o.y),n.x-=a,o.x+=a}for(i.moveTo(n.x,n.y),t=1,e=this._points.length;t=o&&(s=t[i],c.push(s));return c.push(t[a]),c},_finalizeAndAddPath:function(){var t=this.canvas.contextTop;t.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var i=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:i}),this.canvas.add(i),this.canvas.requestRenderAll(),i.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:i})}}})}(),r.CircleBrush=r.util.createClass(r.BaseBrush,{width:10,initialize:function(t){this.canvas=t,this.points=[]},drawDot:function(t){var e=this.addPoint(t),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,e),i.restore()},dot:function(t,e){t.fillStyle=e.fill,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!1),t.closePath(),t.fill()},onMouseDown:function(t){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(t)},_render:function(){var t,e,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),t=0,e=n.length;t0&&!this.preserveObjectStacking){e=[],i=[];for(var r=0,o=this._objects.length;r1&&(this._activeObject._objects=i),e.push.apply(e,i)}else e=this._objects;return e},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this},_normalizePointer:function(t,e){var i=t.calcTransformMatrix(),n=r.util.invertTransform(i),o=this.restorePointerVpt(e);return r.util.transformPoint(o,n)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject){var n=this._normalizePointer(t,{x:e,y:i}),o=Math.max(t.cacheTranslationX+n.x*t.zoomX,0),a=Math.max(t.cacheTranslationY+n.y*t.zoomY,0),s=r.util.isTransparent(t._cacheContext,Math.round(o),Math.round(a),this.targetFindTolerance);return s}var c=this.contextCache,l=t.selectionBackgroundColor,u=this.viewportTransform;t.selectionBackgroundColor="",this.clearContext(c),c.save(),c.transform(u[0],u[1],u[2],u[3],u[4],u[5]),t.render(c),c.restore(),t.selectionBackgroundColor=l;s=r.util.isTransparent(c,e,i,this.targetFindTolerance);return s},_isSelectionKeyPressed:function(t){var e=!1;return e="[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(e){return!0===t[e]})):t[this.selectionKey],e},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),n=this._activeObject;return!e||e&&n&&i.length>1&&-1===i.indexOf(e)&&n!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&n&&n!==e},_shouldCenterTransform:function(t,e,i){var n;if(t)return"scale"===e||"scaleX"===e||"scaleY"===e||"resizing"===e?n=this.centeredScaling||t.centeredScaling:"rotate"===e&&(n=this.centeredRotation||t.centeredRotation),n?!i:i},_getOriginFromCorner:function(t,e){var i={x:t.originX,y:t.originY};return"ml"===e||"tl"===e||"bl"===e?i.x="right":"mr"!==e&&"tr"!==e&&"br"!==e||(i.x="left"),"tl"===e||"mt"===e||"tr"===e?i.y="bottom":"bl"!==e&&"mb"!==e&&"br"!==e||(i.y="top"),i},_getActionFromCorner:function(t,e,i,n){if(!e||!t)return"drag";var r=n.controls[e];return r.getActionName(i,r,n)},_setupCurrentTransform:function(t,i,n){if(i){var o=this.getPointer(t),a=i.__corner,s=i.controls[a],c=n&&a?s.getActionHandler(t,i,s):r.controlsUtils.dragHandler,l=this._getActionFromCorner(n,a,t,i),u=this._getOriginFromCorner(i,a),h=t[this.centeredKey],f={target:i,action:l,actionHandler:c,corner:a,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:o.x-i.left,offsetY:o.y-i.top,originX:u.x,originY:u.y,ex:o.x,ey:o.y,lastX:o.x,lastY:o.y,theta:e(i.angle),width:i.width*i.scaleX,shiftKey:t.shiftKey,altKey:h,original:r.util.saveObjectTransform(i)};this._shouldCenterTransform(i,l,h)&&(f.originX="center",f.originY="center"),f.original.originX=u.x,f.original.originY=u.y,this._currentTransform=f,this._beforeTransform(t)}},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new r.Point(e.ex,e.ey),n=r.util.transformPoint(i,this.viewportTransform),o=new r.Point(e.ex+e.left,e.ey+e.top),a=r.util.transformPoint(o,this.viewportTransform),s=Math.min(n.x,a.x),c=Math.min(n.y,a.y),l=Math.max(n.x,a.x),u=Math.max(n.y,a.y),h=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(s,c,l-s,u-c)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,s+=h,c+=h,l-=h,u-=h,r.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(s,c,l-s,u-c))},findTarget:function(t,e){if(!this.skipTargetFind){var n,r,o=!0,a=this.getPointer(t,o),s=this._activeObject,c=this.getActiveObjects(),l=i(t),u=c.length>1&&!e||1===c.length;if(this.targets=[],u&&s._findTargetCorner(a,l))return s;if(c.length>1&&!e&&s===this._searchPossibleTargets([s],a))return s;if(1===c.length&&s===this._searchPossibleTargets([s],a)){if(!this.preserveObjectStacking)return s;n=s,r=this.targets,this.targets=[]}var h=this._searchPossibleTargets(this._objects,a);return t[this.altSelectionKey]&&h&&n&&h!==n&&(h=n,this.targets=r),h}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t)){if(!this.perPixelTargetFind&&!e.perPixelTargetFind||e.isEditing)return!0;var n=this.isTargetTransparent(e,i.x,i.y);if(!n)return!0}},_searchPossibleTargets:function(t,e){var i,n,o=t.length;while(o--){var a=t[o],s=a.group?this._normalizePointer(a.group,e):e;if(this._checkTarget(s,a,e)){i=t[o],i.subTargetCheck&&i instanceof r.Group&&(n=this._searchPossibleTargets(i._objects,e),n&&this.targets.push(n));break}}return i},restorePointerVpt:function(t){return r.util.transformPoint(t,r.util.invertTransform(this.viewportTransform))},getPointer:function(e,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=t(e),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,c=a.height||0;s&&c||("top"in a&&"bottom"in a&&(c=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var l=this.getRetinaScaling();return 1!==l&&(r.x/=l,r.y/=l),n=0===s||0===c?{width:1,height:1}:{width:o.width/s,height:o.height/c},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),e=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),r.util.addClass(i,"upper-canvas "+t),this.wrapperEl.appendChild(i),this._copyCanvasStyle(e,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=r.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),r.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),r.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;r.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,r.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var t=this._activeObject;return t?"activeSelection"===t.type&&t._objects?t._objects.slice(0):[t]:[]},_onObjectRemoved:function(t){t===this._activeObject&&(this.fire("before:selection:cleared",{target:t}),this._discardActiveObject(),this.fire("selection:cleared",{target:t}),t.fire("deselected")),t===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(t,e){var i=!1,n=this.getActiveObjects(),r=[],o=[];t.forEach((function(t){-1===n.indexOf(t)&&(i=!0,t.fire("deselected",{e:e,target:t}),o.push(t))})),n.forEach((function(n){-1===t.indexOf(n)&&(i=!0,n.fire("selected",{e:e,target:n}),r.push(n))})),t.length>0&&n.length>0?i&&this.fire("selection:updated",{e:e,selected:r,deselected:o,updated:r[0]||o[0],target:this._activeObject}):n.length>0?this.fire("selection:created",{e:e,selected:r,target:this._activeObject}):t.length>0&&this.fire("selection:cleared",{e:e,deselected:o})},setActiveObject:function(t,e){var i=this.getActiveObjects();return this._setActiveObject(t,e),this._fireSelectionEvents(i,e),this},_setActiveObject:function(t,e){return this._activeObject!==t&&(!!this._discardActiveObject(e,t)&&(!t.onSelect({e:e})&&(this._activeObject=t,!0)))},_discardActiveObject:function(t,e){var i=this._activeObject;if(i){if(i.onDeselect({e:t,object:e}))return!1;this._activeObject=null}return!0},discardActiveObject:function(t){var e=this.getActiveObjects(),i=this.getActiveObject();return e.length&&this.fire("before:selection:cleared",{target:i,e:t}),this._discardActiveObject(t),this._fireSelectionEvents(e,t),this},dispose:function(){var t=this.wrapperEl;return this.removeListeners(),t.removeChild(this.upperCanvasEl),t.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(t){r.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,r.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(t){var e=this._activeObject;e&&e._renderControls(t)},_toObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(t),r=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,n),r},_realizeGroupTransformOnObject:function(t){if(t.group&&"activeSelection"===t.group.type&&this._activeObject===t.group){var e=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],i={};return e.forEach((function(e){i[e]=t[e]})),r.util.addTransformToObject(t,this._activeObject.calcOwnMatrix()),i}return null},_unwindGroupTransformOnObject:function(t,e){e&&t.set(e)},_setSVGObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(e);this.callSuper("_setSVGObject",t,e,i),this._unwindGroupTransformOnObject(e,n)},setViewportTransform:function(t){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),r.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),r.StaticCanvas)"prototype"!==n&&(r.Canvas[n]=r.StaticCanvas[n])}(),function(){var t=r.util.addListener,e=r.util.removeListener,i=3,n=2,o=1,a={passive:!1};function s(t,e){return t.button&&t.button===e-1}r.util.object.extend(r.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(t,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(t,e){var i=this.upperCanvasEl,n=this._getEventPrefix();t(r.window,"resize",this._onResize),t(i,n+"down",this._onMouseDown),t(i,n+"move",this._onMouseMove,a),t(i,n+"out",this._onMouseOut),t(i,n+"enter",this._onMouseEnter),t(i,"wheel",this._onMouseWheel),t(i,"contextmenu",this._onContextMenu),t(i,"dblclick",this._onDoubleClick),t(i,"dragover",this._onDragOver),t(i,"dragenter",this._onDragEnter),t(i,"dragleave",this._onDragLeave),t(i,"drop",this._onDrop),this.enablePointerEvents||t(i,"touchstart",this._onTouchStart,a),"undefined"!==typeof eventjs&&e in eventjs&&(eventjs[e](i,"gesture",this._onGesture),eventjs[e](i,"drag",this._onDrag),eventjs[e](i,"orientation",this._onOrientationChange),eventjs[e](i,"shake",this._onShake),eventjs[e](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(e,"remove");var t=this._getEventPrefix();e(r.document,t+"up",this._onMouseUp),e(r.document,"touchend",this._onTouchEnd,a),e(r.document,t+"move",this._onMouseMove,a),e(r.document,"touchmove",this._onMouseMove,a)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(t,e){this.__onTransformGesture&&this.__onTransformGesture(t,e)},_onDrag:function(t,e){this.__onDrag&&this.__onDrag(t,e)},_onMouseWheel:function(t){this.__onMouseWheel(t)},_onMouseOut:function(t){var e=this._hoveredTarget;this.fire("mouse:out",{target:e,e:t}),this._hoveredTarget=null,e&&e.fire("mouseout",{e:t});var i=this;this._hoveredTargets.forEach((function(n){i.fire("mouse:out",{target:e,e:t}),n&&e.fire("mouseout",{e:t})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(t){t.isEditing&&t.hiddenTextarea.focus()}))},_onMouseEnter:function(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",{target:null,e:t}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(t,e){this.__onOrientationChange&&this.__onOrientationChange(t,e)},_onShake:function(t,e){this.__onShake&&this.__onShake(t,e)},_onLongPress:function(t,e){this.__onLongPress&&this.__onLongPress(t,e)},_onDragOver:function(t){t.preventDefault();var e=this._simpleEventHandler("dragover",t);this._fireEnterLeaveEvents(e,t)},_onContextMenu:function(t){return this.stopContextMenu&&(t.stopPropagation(),t.preventDefault()),!1},_onDoubleClick:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"dblclick"),this._resetTransformEventData(t)},getPointerId:function(t){var e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1},_isMainEvent:function(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||(!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(i){i.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var n=this.upperCanvasEl,o=this._getEventPrefix();t(r.document,"touchend",this._onTouchEnd,a),t(r.document,"touchmove",this._onMouseMove,a),e(n,o+"down",this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var n=this.upperCanvasEl,o=this._getEventPrefix();e(n,o+"move",this._onMouseMove,a),t(r.document,o+"up",this._onMouseUp),t(r.document,o+"move",this._onMouseMove,a)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var n=this._getEventPrefix();e(r.document,"touchend",this._onTouchEnd,a),e(r.document,"touchmove",this._onMouseMove,a);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){t(o.upperCanvasEl,n+"down",o._onMouseDown),o._willAddMouseDown=0}),400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var n=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(i)&&(e(r.document,o+"up",this._onMouseUp),e(r.document,o+"move",this._onMouseMove,a),t(n,o+"move",this._onMouseMove,a))},_onMouseMove:function(t){!this.allowTouchScrolling&&t.preventDefault&&t.preventDefault(),this.__onMouseMove(t)},_onResize:function(){this.calcOffset()},_shouldRender:function(t){var e=this._activeObject;return!!(!!e!==!!t||e&&t&&e!==t)||(e&&e.isEditing,!1)},__onMouseUp:function(t){var e,a=this._currentTransform,c=this._groupSelector,l=!1,u=!c||0===c.left&&0===c.top;if(this._cacheTransformEventData(t),e=this._target,this._handleEvent(t,"up:before"),s(t,i))this.fireRightClick&&this._handleEvent(t,"up",i,u);else{if(s(t,n))return this.fireMiddleClick&&this._handleEvent(t,"up",n,u),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(t);else if(this._isMainEvent(t)){if(a&&(this._finalizeCurrentTransform(t),l=a.actionPerformed),!u){var h=e===this._activeObject;this._maybeGroupObjects(t),l||(l=this._shouldRender(e)||!h&&e===this._activeObject)}if(e){if(e.selectable&&e!==this._activeObject&&"up"===e.activeOn)this.setActiveObject(e,t),l=!0;else{var f=e._findTargetCorner(this.getPointer(t,!0),r.util.isTouchEvent(t)),d=e.controls[f],g=d&&d.getMouseUpHandler(t,e,d);if(g){var p=this.getPointer(t);g(t,a,p.x,p.y)}}e.isMoving=!1}this._setCursorFromEvent(t,e),this._handleEvent(t,"up",o,u),this._groupSelector=null,this._currentTransform=null,e&&(e.__corner=0),l?this.requestRenderAll():u||this.renderTop()}}},_simpleEventHandler:function(t,e){var i=this.findTarget(e),n=this.targets,r={e:e,target:i,subTargets:n};if(this.fire(t,r),i&&i.fire(t,r),!n)return i;for(var o=0;o1&&(e=new r.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(i){for(var n,o=[],a=this._groupSelector.ex,s=this._groupSelector.ey,c=a+this._groupSelector.left,l=s+this._groupSelector.top,u=new r.Point(t(a,c),t(s,l)),h=new r.Point(e(a,c),e(s,l)),f=!this.selectionFullyContained,d=a===c&&s===l,g=this._objects.length;g--;)if(n=this._objects[g],n&&n.selectable&&n.visible&&(f&&n.intersectsWithRect(u,h,!0)||n.isContainedWithinRect(u,h,!0)||f&&n.containsPoint(u,null,!0)||f&&n.containsPoint(h,null,!0))&&(o.push(n),d))break;return o.length>1&&(o=o.filter((function(t){return!t.onSelect({e:i})}))),o},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){r.util.object.extend(r.StaticCanvas.prototype,{toDataURL:function(t){t||(t={});var e=t.format||"png",i=t.quality||1,n=(t.multiplier||1)*(t.enableRetinaScaling?this.getRetinaScaling():1),o=this.toCanvasElement(n,t);return r.util.toDataURL(o,e,i)},toCanvasElement:function(t,e){t=t||1,e=e||{};var i=(e.width||this.width)*t,n=(e.height||this.height)*t,o=this.getZoom(),a=this.width,s=this.height,c=o*t,l=this.viewportTransform,u=(l[4]-(e.left||0))*t,h=(l[5]-(e.top||0))*t,f=this.interactive,d=[c,0,0,c,u,h],g=this.enableRetinaScaling,p=r.util.createCanvasElement(),v=this.contextTop;return p.width=i,p.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=d,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(p.getContext("2d"),this._objects),this.viewportTransform=l,this.width=a,this.height=s,this.calcViewportBoundaries(),this.interactive=f,this.enableRetinaScaling=g,this.contextTop=v,p}})}(),r.util.object.extend(r.StaticCanvas.prototype,{loadFromJSON:function(t,e,i){if(t){var n="string"===typeof t?JSON.parse(t):r.util.object.clone(t),o=this,a=n.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,(function(t){o.clear(),o._setBgOverlay(n,(function(){a?o._enlivenObjects([a],(function(i){o.clipPath=i[0],o.__setupCanvas.call(o,n,t,s,e)})):o.__setupCanvas.call(o,n,t,s,e)}))}),i),this}},__setupCanvas:function(t,e,i,n){var r=this;e.forEach((function(t,e){r.insertAt(t,e)})),this.renderOnAddRemove=i,delete t.objects,delete t.backgroundImage,delete t.overlayImage,delete t.background,delete t.overlay,this._setOptions(t),this.renderAll(),n&&n()},_setBgOverlay:function(t,e){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(t.backgroundImage||t.overlayImage||t.background||t.overlay){var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&e&&e()};this.__setBgOverlay("backgroundImage",t.backgroundImage,i,n),this.__setBgOverlay("overlayImage",t.overlayImage,i,n),this.__setBgOverlay("backgroundColor",t.background,i,n),this.__setBgOverlay("overlayColor",t.overlay,i,n)}else e&&e()},__setBgOverlay:function(t,e,i,n){var o=this;if(!e)return i[t]=!0,void(n&&n());"backgroundImage"===t||"overlayImage"===t?r.util.enlivenObjects([e],(function(e){o[t]=e[0],i[t]=!0,n&&n()})):this["set"+r.util.string.capitalize(t,!0)](e,(function(){i[t]=!0,n&&n()}))},_enlivenObjects:function(t,e,i){t&&0!==t.length?r.util.enlivenObjects(t,(function(t){e&&e(t)}),null,i):e&&e([])},_toDataURL:function(t,e){this.clone((function(i){e(i.toDataURL(t))}))},_toDataURLWithMultiplier:function(t,e,i){this.clone((function(n){i(n.toDataURLWithMultiplier(t,e))}))},clone:function(t,e){var i=JSON.stringify(this.toJSON(e));this.cloneWithoutData((function(e){e.loadFromJSON(i,(function(){t&&t(e)}))}))},cloneWithoutData:function(t){var e=r.util.createCanvasElement();e.width=this.width,e.height=this.height;var i=new r.Canvas(e);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,(function(){i.renderAll(),t&&t(i)})),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):t&&t(i)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.string.capitalize,a=e.util.degreesToRadians,s=!e.isLikelyNode,c=2;e.Object||(e.Object=e.util.createClass(e.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(t){t&&this.setOptions(t)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=e.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(t){var i=e.perfLimitSizeTotal,n=t.width,r=t.height,o=e.maxCacheSideLimit,a=e.minCacheSideLimit;if(n<=o&&r<=o&&n*r<=i)return nu&&(t.zoomX/=n/u,t.width=u,t.capped=!0),r>h&&(t.zoomY/=r/h,t.height=h,t.capped=!0),t},_getCacheCanvasDimensions:function(){var t=this.getTotalObjectScaling(),e=this._getTransformedDimensions(0,0),i=e.x*t.scaleX/this.scaleX,n=e.y*t.scaleY/this.scaleY;return{width:i+c,height:n+c,zoomX:t.scaleX,zoomY:t.scaleY,x:i,y:n}},_updateCacheCanvas:function(){var t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){var i=t._currentTransform.target,n=t._currentTransform.action;if(this===i&&n.slice&&"scale"===n.slice(0,5))return!1}var r,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),c=e.minCacheSideLimit,l=s.width,u=s.height,h=s.zoomX,f=s.zoomY,d=l!==this.cacheWidth||u!==this.cacheHeight,g=this.zoomX!==h||this.zoomY!==f,p=d||g,v=0,m=0,y=!1;if(d){var b=this._cacheCanvas.width,_=this._cacheCanvas.height,x=l>b||u>_,C=(l<.9*b||u<.9*_)&&b>c&&_>c;y=x||C,x&&!s.capped&&(l>c||u>c)&&(v=.1*l,m=.1*u)}return this instanceof e.Text&&this.path&&(p=!0,y=!0,v+=this.getHeightOfLine(0)*this.zoomX,m+=this.getHeightOfLine(0)*this.zoomY),!!p&&(y?(a.width=Math.ceil(l+v),a.height=Math.ceil(u+m)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),r=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-r)+r,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=l,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(h,f),this.zoomX=h,this.zoomY=f,!0)},setOptions:function(t){this._setOptions(t),this._initGradient(t.fill,"fill"),this._initGradient(t.stroke,"stroke"),this._initPattern(t.fill,"fill"),this._initPattern(t.stroke,"stroke")},transform:function(t){var e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,i=this.calcTransformMatrix(!e);t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(t){var i=e.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:e.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,i),skewY:r(this.skewY,i)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(t),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),e.util.populateWithProperties(this,n,t),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(t){return this.toObject(t)},_removeDefaultValues:function(t){var i=e.util.getKlass(t.type).prototype,n=i.stateProperties;return n.forEach((function(e){if("left"!==e&&"top"!==e){t[e]===i[e]&&delete t[e];var n="[object Array]"===Object.prototype.toString.call(t[e])&&"[object Array]"===Object.prototype.toString.call(i[e]);n&&0===t[e].length&&0===i[e].length&&delete t[e]}})),t},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var t=e.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(t.scaleX),scaleY:Math.abs(t.scaleY)}},getTotalObjectScaling:function(){var t=this.getObjectScaling(),e=t.scaleX,i=t.scaleY;if(this.canvas){var n=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();e*=n*r,i*=n*r}return{scaleX:e,scaleY:i}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,i){var n="scaleX"===t||"scaleY"===t,r=this[t]!==i,o=!1;return n&&(i=this._constrainScale(i)),"scaleX"===t&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===t&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==t||!i||i instanceof e.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",i):i=new e.Shadow(i),this[t]=i,r&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(t)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(t)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:e.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(t){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(t.save(),this._setupCompositeOperation(t),this.drawSelectionBackground(t),this.transform(t),this._setOpacity(t),this._setShadow(t,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(t)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(t),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),t.restore())},renderCache:function(t){t=t||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,t.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!==typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(t){var i=this.clipPath;if(t.save(),i.inverted?t.globalCompositeOperation="destination-out":t.globalCompositeOperation="destination-in",i.absolutePositioned){var n=e.util.invertTransform(this.calcTransformMatrix());t.transform(n[0],n[1],n[2],n[3],n[4],n[5])}i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},drawObject:function(t,e){var i=this.fill,n=this.stroke;e?(this.fill="black",this.stroke="",this._setClippingProperties(t)):this._renderBackground(t),this._render(t),this._drawClipPath(t),this.fill=i,this.stroke=n},_drawClipPath:function(t){var e=this.clipPath;e&&(e.canvas=this.canvas,e.shouldCache(),e._transformDone=!0,e.renderCache({forClipping:!0}),this.drawClipPathOnCache(t))},drawCacheOnCanvas:function(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(t){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!t&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!t){var e=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-e/2,-i/2,e,i)}return!0}return!1},_renderBackground:function(t){if(this.backgroundColor){var e=this._getNonTransformedDimensions();t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t)}},_setOpacity:function(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity},_setStrokeStyles:function(t,e){var i=e.stroke;i&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(t,i):(t.strokeStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):t.strokeStyle=e.stroke)},_setFillStyles:function(t,e){var i=e.fill;i&&(i.toLive?(t.fillStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,e.fill)):t.fillStyle=i)},_setClippingProperties:function(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"},_setLineDash:function(t,e){e&&0!==e.length&&(1&e.length&&e.push.apply(e,e),t.setLineDash(e))},_renderControls:function(t,i){var n,r,o,s=this.getViewportTransform(),c=this.calcTransformMatrix();i=i||{},r="undefined"!==typeof i.hasBorders?i.hasBorders:this.hasBorders,o="undefined"!==typeof i.hasControls?i.hasControls:this.hasControls,c=e.util.multiplyTransformMatrices(s,c),n=e.util.qrDecompose(c),t.save(),t.translate(n.translateX,n.translateY),t.lineWidth=1*this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),t.rotate(a(n.angle)),i.forActiveSelection||this.group?r&&this.drawBordersInGroup(t,n,i):r&&this.drawBorders(t,i),o&&this.drawControls(t,i),t.restore()},_setShadow:function(t){if(this.shadow){var i,n=this.shadow,r=this.canvas,o=r&&r.viewportTransform[0]||1,a=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(o*=e.devicePixelRatio,a*=e.devicePixelRatio),t.shadowColor=n.color,t.shadowBlur=n.blur*e.browserShadowBlurConstant*(o+a)*(i.scaleX+i.scaleY)/4,t.shadowOffsetX=n.offsetX*o*i.scaleX,t.shadowOffsetY=n.offsetY*a*i.scaleY}},_removeShadow:function(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)},_applyPatternGradientTransform:function(t,e){if(!e||!e.toLive)return{offsetX:0,offsetY:0};var i=e.gradientTransform||e.patternTransform,n=-this.width/2+e.offsetX||0,r=-this.height/2+e.offsetY||0;return"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,n,r):t.transform(1,0,0,1,n,r),i&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(t){"stroke"===this.paintFirst?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))},_render:function(){},_renderFill:function(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())},_renderStroke:function(t){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform&&this.group){var e=this.getObjectScaling();t.scale(1/e.scaleX,1/e.scaleY)}else this.strokeUniform&&t.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore()}},_applyPatternForTransformedGradient:function(t,i){var n,r=this._limitCacheSize(this._getCacheCanvasDimensions()),o=e.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=r.x/this.scaleX/a,c=r.y/this.scaleY/a;o.width=s,o.height=c,n=o.getContext("2d"),n.beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,c),n.lineTo(0,c),n.closePath(),n.translate(s/2,c/2),n.scale(r.zoomX/this.scaleX/a,r.zoomY/this.scaleY/a),this._applyPatternGradientTransform(n,i),n.fillStyle=i.toLive(t),n.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(a*this.scaleX/r.zoomX,a*this.scaleY/r.zoomY),t.strokeStyle=n.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var t=e.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",t.scaleX),this.set("scaleY",t.scaleY),this.angle=t.angle,this.skewX=t.skewX,this.skewY=0}},_removeTransformMatrix:function(t){var i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=e.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,t&&(this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this.cropX=t.cropX,this.cropY=t.cropY,i.x+=t.offsetLeft,i.y+=t.offsetTop,this.width=t.width,this.height=t.height),this.setPositionByOrigin(i,"center","center")},clone:function(t,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,t):e.Object._fromObject("Object",n,t)},cloneAsImage:function(t,i){var n=this.toCanvasElement(i);return t&&t(new e.Image(n)),this},toCanvasElement:function(t){t||(t={});var i=e.util,n=i.saveObjectTransform(this),r=this.group,o=this.shadow,a=Math.abs,s=(t.multiplier||1)*(t.enableRetinaScaling?e.devicePixelRatio:1);delete this.group,t.withoutTransform&&i.resetObjectTransform(this),t.withoutShadow&&(this.shadow=null);var c,l,u,h,f=e.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),g=this.shadow,p={x:0,y:0};g&&(l=g.blur,c=g.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),p.x=2*Math.round(a(g.offsetX)+l)*a(c.scaleX),p.y=2*Math.round(a(g.offsetY)+l)*a(c.scaleY)),u=d.width+p.x,h=d.height+p.y,f.width=Math.ceil(u),f.height=Math.ceil(h);var v=new e.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===t.format&&(v.backgroundColor="#fff"),this.setPositionByOrigin(new e.Point(v.width/2,v.height/2),"center","center");var m=this.canvas;v.add(this);var y=v.toCanvasElement(s||1,t);return this.shadow=o,this.set("canvas",m),r&&(this.group=r),this.set(n).setCoords(),v._objects=[],v.dispose(),v=null,y},toDataURL:function(t){return t||(t={}),e.util.toDataURL(this.toCanvasElement(t),t.format||"png",t.quality||1)},isType:function(t){return this.type===t},complexity:function(){return 1},toJSON:function(t){return this.toObject(t)},rotate:function(t){var e=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return e&&this._setOriginToCenter(),this.set("angle",t),e&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(t,i){i=i||this.canvas.getPointer(t);var n=new e.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=e.util.rotatePoint(n,r,a(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(t){this.globalCompositeOperation&&(t.globalCompositeOperation=this.globalCompositeOperation)}}),e.util.createAccessors&&e.util.createAccessors(e.Object),i(e.Object.prototype,e.Observable),e.Object.NUM_FRACTION_DIGITS=2,e.Object._fromObject=function(t,i,r,o){var a=e[t];i=n(i,!0),e.util.enlivenPatterns([i.fill,i.stroke],(function(t){"undefined"!==typeof t[0]&&(i.fill=t[0]),"undefined"!==typeof t[1]&&(i.stroke=t[1]),e.util.enlivenObjects([i.clipPath],(function(t){i.clipPath=t[0];var e=o?new a(i[o],i):new a(i);r&&r(e)}))}))},e.Object.__uid=0)}(i),function(){var t=r.util.degreesToRadians,e={left:-.5,center:0,right:.5},i={top:-.5,center:0,bottom:.5};r.util.object.extend(r.Object.prototype,{translateToGivenOrigin:function(t,n,o,a,s){var c,l,u,h=t.x,f=t.y;return"string"===typeof n?n=e[n]:n-=.5,"string"===typeof a?a=e[a]:a-=.5,c=a-n,"string"===typeof o?o=i[o]:o-=.5,"string"===typeof s?s=i[s]:s-=.5,l=s-o,(c||l)&&(u=this._getTransformedDimensions(),h=t.x+c*u.x,f=t.y+l*u.y),new r.Point(h,f)},translateToCenterPoint:function(e,i,n){var o=this.translateToGivenOrigin(e,i,n,"center","center");return this.angle?r.util.rotatePoint(o,e,t(this.angle)):o},translateToOriginPoint:function(e,i,n){var o=this.translateToGivenOrigin(e,"center","center",i,n);return this.angle?r.util.rotatePoint(o,e,t(this.angle)):o},getCenterPoint:function(){var t=new r.Point(this.left,this.top);return this.translateToCenterPoint(t,this.originX,this.originY)},getPointByOrigin:function(t,e){var i=this.getCenterPoint();return this.translateToOriginPoint(i,t,e)},toLocalPoint:function(e,i,n){var o,a,s=this.getCenterPoint();return o="undefined"!==typeof i&&"undefined"!==typeof n?this.translateToGivenOrigin(s,"center","center",i,n):new r.Point(this.left,this.top),a=new r.Point(e.x,e.y),this.angle&&(a=r.util.rotatePoint(a,s,-t(this.angle))),a.subtractEquals(o)},setPositionByOrigin:function(t,e,i){var n=this.translateToCenterPoint(t,e,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(i){var n,o,a=t(this.angle),s=this.getScaledWidth(),c=r.util.cos(a)*s,l=r.util.sin(a)*s;n="string"===typeof this.originX?e[this.originX]:this.originX-.5,o="string"===typeof i?e[i]:i-.5,this.left+=c*(o-n),this.top+=l*(o-n),this.setCoords(),this.originX=i},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var t=this.getCenterPoint();this.originX="center",this.originY="center",this.left=t.x,this.top=t.y},_resetOrigin:function(){var t=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=t.x,this.top=t.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function t(t){return[new r.Point(t.tl.x,t.tl.y),new r.Point(t.tr.x,t.tr.y),new r.Point(t.br.x,t.br.y),new r.Point(t.bl.x,t.bl.y)]}var e=r.util,i=e.degreesToRadians,n=e.multiplyTransformMatrices,o=e.transformPoint;e.object.extend(r.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(t,e){return e?t?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),t?this.aCoords:this.lineCoords)},getCoords:function(e,i){return t(this._getCoords(e,i))},intersectsWithRect:function(t,e,i,n){var o=this.getCoords(i,n),a=r.Intersection.intersectPolygonRectangle(o,t,e);return"Intersection"===a.status},intersectsWithObject:function(t,e,i){var n=r.Intersection.intersectPolygonPolygon(this.getCoords(e,i),t.getCoords(e,i));return"Intersection"===n.status||t.isContainedWithinObject(this,e,i)||this.isContainedWithinObject(t,e,i)},isContainedWithinObject:function(t,e,i){for(var n=this.getCoords(e,i),r=e?t.aCoords:t.lineCoords,o=0,a=t._getImageLines(r);o<4;o++)if(!t.containsPoint(n[o],a))return!1;return!0},isContainedWithinRect:function(t,e,i,n){var r=this.getBoundingRect(i,n);return r.left>=t.x&&r.left+r.width<=e.x&&r.top>=t.y&&r.top+r.height<=e.y},containsPoint:function(t,e,i,n){var r=this._getCoords(i,n),o=(e=e||this._getImageLines(r),this._findCrossPoints(t,e));return 0!==o&&o%2===1},isOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br,n=this.getCoords(!0,t);return!!n.some((function(t){return t.x<=i.x&&t.x>=e.x&&t.y<=i.y&&t.y>=e.y}))||(!!this.intersectsWithRect(e,i,!0,t)||this._containsCenterOfCanvas(e,i,t))},_containsCenterOfCanvas:function(t,e,i){var n={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;if(this.intersectsWithRect(e,i,!0,t))return!0;var n=this.getCoords(!0,t).every((function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)}));return n&&this._containsCenterOfCanvas(e,i,t)},_getImageLines:function(t){var e={topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}};return e},_findCrossPoints:function(t,e){var i,n,r,o,a,s,c=0;for(var l in e)if(s=e[l],!(s.o.y=t.y&&s.d.y>=t.y)&&(s.o.x===s.d.x&&s.o.x>=t.x?a=s.o.x:(i=0,n=(s.d.y-s.o.y)/(s.d.x-s.o.x),r=t.y-i*t.x,o=s.o.y-n*s.o.x,a=-(r-o)/(i-n)),a>=t.x&&(c+=1),2===c))break;return c},getBoundingRect:function(t,i){var n=this.getCoords(t,i);return e.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){return Math.abs(t)\n')}},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})},toClipPathSVG:function(t){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})},_createBaseClipPathSVGMarkup:function(t,e){e=e||{};var i=e.reviver,n=e.additionalTransform||"",r=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),o=t.indexOf("COMMON_PARTS");return t[o]=r,i?i(t.join("")):t.join("")},_createBaseSVGMarkup:function(t,e){e=e||{};var i,n,o=e.noStyle,a=e.reviver,s=o?"":'style="'+this.getSvgStyles()+'" ',c=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,u=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",h=l&&l.absolutePositioned,f=this.stroke,d=this.fill,g=this.shadow,p=[],v=t.indexOf("COMMON_PARTS"),m=e.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+r.Object.__uid++,n='\n'+l.toClipPathSVG(a)+"\n"),h&&p.push("\n"),p.push("\n"),i=[s,u,o?"":this.addPaintOrder()," ",m?'transform="'+m+'" ':""].join(""),t[v]=i,d&&d.toLive&&p.push(d.toSVG(this)),f&&f.toLive&&p.push(f.toSVG(this)),g&&p.push(g.toSVG(this)),l&&p.push(n),p.push(t.join("")),p.push("\n"),h&&p.push("\n"),a?a(p.join("")):p.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var t=r.util.object.extend,e="stateProperties";function i(e,i,n){var r={},o=!0;n.forEach((function(t){r[t]=e[t]})),t(e[i],r,o)}function n(t,e,i){if(t===e)return!0;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0,o=t.length;r=0;c--)if(r=s[c],this.isControlVisible(r)&&(n=this._getImageLines(e?this.oCoords[r].touchCorner:this.oCoords[r].corner),i=this._findCrossPoints({x:o,y:a},n),0!==i&&i%2===1))return this.__corner=r,r;return!1},forEachControl:function(t){for(var e in this.controls)t(this.controls[e],e,this)},_setCornerCoords:function(){var t=this.oCoords;for(var e in t){var i=this.controls[e];t[e].corner=i.calcCornerCoords(this.angle,this.cornerSize,t[e].x,t[e].y,!1),t[e].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,t[e].x,t[e].y,!0)}},drawSelectionBackground:function(e){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;e.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return e.translate(i.x,i.y),e.scale(1/r[0],1/r[3]),e.rotate(t(this.angle)),e.fillStyle=this.selectionBackgroundColor,e.fillRect(-n.x/2,-n.y/2,n.x,n.y),e.restore(),this},drawBorders:function(t,e){e=e||{};var i=this._calculateCurrentDimensions(),n=this.borderScaleFactor,r=i.x+n,o=i.y+n,a="undefined"!==typeof e.hasControls?e.hasControls:this.hasControls,s=!1;return t.save(),t.strokeStyle=e.borderColor||this.borderColor,this._setLineDash(t,e.borderDashArray||this.borderDashArray),t.strokeRect(-r/2,-o/2,r,o),a&&(t.beginPath(),this.forEachControl((function(e,i,n){e.withConnection&&e.getVisibility(n,i)&&(s=!0,t.moveTo(e.x*r,e.y*o),t.lineTo(e.x*r+e.offsetX,e.y*o+e.offsetY))})),s&&t.stroke()),t.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var n=r.util.sizeAfterTransform(this.width,this.height,e),o=this.strokeWidth,a=this.strokeUniform,s=this.borderScaleFactor,c=n.x+o*(a?this.canvas.getZoom():e.scaleX)+s,l=n.y+o*(a?this.canvas.getZoom():e.scaleY)+s;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-c/2,-l/2,c,l),t.restore(),this},drawControls:function(t,e){e=e||{},t.save();var i,n,o=this.canvas.getRetinaScaling();return t.setTransform(o,0,0,o,0,0),t.strokeStyle=t.fillStyle=e.cornerColor||this.cornerColor,this.transparentCorners||(t.strokeStyle=e.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(t,e.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl((function(o,a,s){n=s.oCoords[a],o.getVisibility(s,a)&&(i&&(n=r.util.transformPoint(n,i)),o.render(t,n.x,n.y,e,s))})),t.restore(),this},isControlVisible:function(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)},setControlVisible:function(t,e){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e,this},setControlsVisibility:function(t){for(var e in t||(t={}),t)this.setControlVisible(e,t[e]);return this},onDeselect:function(){},onSelect:function(){}})}(),r.util.object.extend(r.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,o=e.onChange||i,a=this;return r.util.animate({startValue:t.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(e){t.set("left",e),a.requestRenderAll(),o()},onComplete:function(){t.setCoords(),n()}}),this},fxCenterObjectV:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,o=e.onChange||i,a=this;return r.util.animate({startValue:t.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(e){t.set("top",e),a.requestRenderAll(),o()},onComplete:function(){t.setCoords(),n()}}),this},fxRemove:function(t,e){e=e||{};var i=function(){},n=e.onComplete||i,o=e.onChange||i,a=this;return r.util.animate({startValue:t.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(e){t.set("opacity",e),a.requestRenderAll(),o()},onComplete:function(){a.remove(t),n()}}),this}}),r.util.object.extend(r.Object.prototype,{animate:function(){if(arguments[0]&&"object"===typeof arguments[0]){var t,e,i=[];for(t in arguments[0])i.push(t);for(var n=0,r=i.length;n-1||o&&a.colorProperties.indexOf(o[1])>-1,c=o?this.get(o[0])[o[1]]:this.get(t);"from"in i||(i.from=c),s||(e=~e.indexOf("=")?c+parseFloat(e.replace("=","")):parseFloat(e));var l={startValue:i.from,endValue:e,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(t,e,n){return i.abort.call(a,t,e,n)},onChange:function(e,r,s){o?a[o[0]][o[1]]=e:a.set(t,e),n||i.onChange&&i.onChange(e,r,s)},onComplete:function(t,e,r){n||(a.setCoords(),i.onComplete&&i.onComplete(t,e,r))}};return s?r.util.animateColor(l.startValue,l.endValue,l.duration,l):r.util.animate(l)}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};function o(t,e){var i=t.origin,n=t.axis1,r=t.axis2,o=t.dimension,a=e.nearest,s=e.center,c=e.farthest;return function(){switch(this.get(i)){case a:return Math.min(this.get(n),this.get(r));case s:return Math.min(this.get(n),this.get(r))+.5*this.get(o);case c:return Math.max(this.get(n),this.get(r))}}}e.Line?e.warn("fabric.Line is already defined"):(e.Line=e.util.createClass(e.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:e.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,e){t||(t=[0,0,0,0]),this.callSuper("initialize",e),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(e)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,e){return this.callSuper("_set",t,e),"undefined"!==typeof r[t]&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var e=this.calcLinePoints();t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineWidth=this.strokeWidth;var i=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return i(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,e=this.y1<=this.y2?-1:1,i=t*this.width*.5,n=e*this.height*.5,r=t*this.width*-.5,o=e*this.height*-.5;return{x1:i,x2:r,y1:n,y2:o}},_toSVG:function(){var t=this.calcLinePoints();return["\n']}}),e.Line.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),e.Line.fromElement=function(t,n,r){r=r||{};var o=e.parseAttributes(t,e.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];n(new e.Line(a,i(o,r)))},e.Line.fromObject=function(t,i){function r(t){delete t.points,i&&i(t)}var o=n(t,!0);o.points=[t.x1,t.y1,t.x2,t.y2],e.Object._fromObject("Line",o,r,"points")})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=Math.PI;function n(t){return"radius"in t&&t.radius>=0}e.Circle?e.warn("fabric.Circle is already defined."):(e.Circle=e.util.createClass(e.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*i,cacheProperties:e.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),"radius"===t&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,n=0,r=0,o=(this.endAngle-this.startAngle)%(2*i);if(0===o)t=["\n'];else{var a=e.util.cos(this.startAngle)*this.radius,s=e.util.sin(this.startAngle)*this.radius,c=e.util.cos(this.endAngle)*this.radius,l=e.util.sin(this.endAngle)*this.radius,u=o>i?"1":"0";t=['\n"]}return t},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",2*t).set("height",2*t)}}),e.Circle.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),e.Circle.fromElement=function(t,i){var r=e.parseAttributes(t,e.Circle.ATTRIBUTE_NAMES);if(!n(r))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,i(new e.Circle(r))},e.Circle.fromObject=function(t,i){e.Object._fromObject("Circle",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Triangle?e.warn("fabric.Triangle is already defined"):(e.Triangle=e.util.createClass(e.Object,{type:"triangle",width:100,height:100,_render:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,i),t.lineTo(0,-i),t.lineTo(e,i),t.closePath(),this._renderPaintInOrder(t)},_toSVG:function(){var t=this.width/2,e=this.height/2,i=[-t+" "+e,"0 "+-e,t+" "+e].join(",");return["']}}),e.Triangle.fromObject=function(t,i){return e.Object._fromObject("Triangle",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=2*Math.PI;e.Ellipse?e.warn("fabric.Ellipse is already defined."):(e.Ellipse=e.util.createClass(e.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this.set("rx",t&&t.rx||0),this.set("ry",t&&t.ry||0)},_set:function(t,e){switch(this.callSuper("_set",t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["\n']},_render:function(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,i,!1),t.restore(),this._renderPaintInOrder(t)}}),e.Ellipse.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),e.Ellipse.fromElement=function(t,i){var n=e.parseAttributes(t,e.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new e.Ellipse(n))},e.Ellipse.fromObject=function(t,i){e.Object._fromObject("Ellipse",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend;e.Rect?e.warn("fabric.Rect is already defined"):(e.Rect=e.util.createClass(e.Object,{stateProperties:e.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:e.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(t){var e=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,r=this.height,o=-this.width/2,a=-this.height/2,s=0!==e||0!==i,c=.4477152502;t.beginPath(),t.moveTo(o+e,a),t.lineTo(o+n-e,a),s&&t.bezierCurveTo(o+n-c*e,a,o+n,a+c*i,o+n,a+i),t.lineTo(o+n,a+r-i),s&&t.bezierCurveTo(o+n,a+r-c*i,o+n-c*e,a+r,o+n-e,a+r),t.lineTo(o+e,a+r),s&&t.bezierCurveTo(o+c*e,a+r,o,a+r-c*i,o,a+r-i),t.lineTo(o,a+i),s&&t.bezierCurveTo(o,a+c*i,o+c*e,a,o+e,a),t.closePath(),this._renderPaintInOrder(t)},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){var t=-this.width/2,e=-this.height/2;return["\n']}}),e.Rect.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),e.Rect.fromElement=function(t,n,r){if(!t)return n(null);r=r||{};var o=e.parseAttributes(t,e.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new e.Rect(i(r?e.util.object.clone(r):{},o));a.visible=a.visible&&a.width>0&&a.height>0,n(a)},e.Rect.fromObject=function(t,i){return e.Object._fromObject("Rect",t,i)})}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.array.min,r=e.util.array.max,o=e.util.toFixed;e.Polyline?e.warn("fabric.Polyline is already defined"):(e.Polyline=e.util.createClass(e.Object,{type:"polyline",points:null,cacheProperties:e.Object.prototype.cacheProperties.concat("points"),initialize:function(t,e){e=e||{},this.points=t||[],this.callSuper("initialize",e),this._setPositionDimensions(e)},_setPositionDimensions:function(t){var e,i=this._calcDimensions(t);this.width=i.width,this.height=i.height,t.fromSVG||(e=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2,y:i.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),"undefined"===typeof t.left&&(this.left=t.fromSVG?i.left:e.x),"undefined"===typeof t.top&&(this.top=t.fromSVG?i.top:e.y),this.pathOffset={x:i.left+this.width/2,y:i.top+this.height/2}},_calcDimensions:function(){var t=this.points,e=n(t,"x")||0,i=n(t,"y")||0,o=r(t,"x")||0,a=r(t,"y")||0,s=o-e,c=a-i;return{left:e,top:i,width:s,height:c}},toObject:function(t){return i(this.callSuper("toObject",t),{points:this.points.concat()})},_toSVG:function(){for(var t=[],i=this.pathOffset.x,n=this.pathOffset.y,r=e.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a\n']},commonRender:function(t){var e,i=this.points.length,n=this.pathOffset.x,r=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;t.beginPath(),t.moveTo(this.points[0].x-n,this.points[0].y-r);for(var o=0;o"},toObject:function(t){return r(this.callSuper("toObject",t),{path:this.path.map((function(t){return t.slice()}))})},toDatalessObject:function(t){var e=this.toObject(["sourcePath"].concat(t));return e.sourcePath&&delete e.path,e},_toSVG:function(){var t=e.util.joinPath(this.path);return["\n"]},_getOffsetTransform:function(){var t=e.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,t)+", "+a(-this.pathOffset.y,t)+")"},toClipPathSVG:function(t){var e=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},toSVG:function(t){var e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var t,r,o=[],a=[],s=0,c=0,l=0,u=0,h=0,f=this.path.length;h"},addWithUpdate:function(t){var i=!!this.group;return this._restoreObjectsState(),e.util.resetObjectTransform(this),t&&(i&&e.util.removeTransformFromObject(t,this.group.calcTransformMatrix()),this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,i?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),e.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,i){var n=this._objects.length;if(this.useSetOnGroup)while(n--)this._objects[n].setOnGroup(t,i);if("canvas"===t)while(n--)this._objects[n]._set(t,i);e.Object.prototype._set.call(this,t,i)},toObject:function(t){var i=this.includeDefaultValues,n=this._objects.filter((function(t){return!t.excludeFromExport})).map((function(e){var n=e.includeDefaultValues;e.includeDefaultValues=i;var r=e.toObject(t);return e.includeDefaultValues=n,r})),r=e.Object.prototype.toObject.call(this,t);return r.objects=n,r},toDatalessObject:function(t){var i,n=this.sourcePath;if(n)i=n;else{var r=this.includeDefaultValues;i=this._objects.map((function(e){var i=e.includeDefaultValues;e.includeDefaultValues=r;var n=e.toDatalessObject(t);return e.includeDefaultValues=i,n}))}var o=e.Object.prototype.toDatalessObject.call(this,t);return o.objects=i,o},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=e.Object.prototype.shouldCache.call(this);if(t)for(var i=0,n=this._objects.length;i\n"],i=0,n=this._objects.length;i\n"),e},getSvgStyles:function(){var t="undefined"!==typeof this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,n=this._objects.length;i"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(t,e,i){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",t,e),i=i||{},"undefined"===typeof i.hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n\n','\t\n',"\n"),s=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(c='" image-rendering="optimizeSpeed'),i.push("\t\n"),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,t=["\t\n'],this.fill=u}return e="fill"!==this.paintFirst?e.concat(t,i):e.concat(i,t),e},getSrc:function(t){var e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():this.srcFromAttribute?e.getAttribute("src"):e.src:this.src||""},setSrc:function(t,e,i){return r.util.loadImage(t,(function(t,n){this.setElement(t,i),this._setWidthHeight(),e&&e(this,n)}),this,i&&i.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,o=i.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||n>e&&o>e)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,void(this._lastScaleY=o);r.filterBackend||(r.filterBackend=r.initFilterBackend());var s=r.util.createCanvasElement(),c=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=a.width,u=a.height;s.width=l,s.height=u,this._element=s,this._lastScaleX=t.scaleX=n,this._lastScaleY=t.scaleY=o,r.filterBackend.applyFilters([t],a,l,u,this._element,c),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(t){if(t=t||this.filters||[],t=t.filter((function(t){return t&&!t.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===t.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var e=this._originalElement,i=e.naturalWidth||e.width,n=e.naturalHeight||e.height;if(this._element===this._originalElement){var o=r.util.createCanvasElement();o.width=i,o.height=n,this._element=o,this._filteredEl=o}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return r.filterBackend||(r.filterBackend=r.initFilterBackend()),r.filterBackend.applyFilters(t,this._originalElement,i,n,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(t){r.util.setImageSmoothing(t,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)},drawCacheOnCanvas:function(t){r.util.setImageSmoothing(t,this.imageSmoothing),r.Object.prototype.drawCacheOnCanvas.call(this,t)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(t){var e=this._element;if(e){var i=this._filterScalingX,n=this._filterScalingY,r=this.width,o=this.height,a=Math.min,s=Math.max,c=s(this.cropX,0),l=s(this.cropY,0),u=e.naturalWidth||e.width,h=e.naturalHeight||e.height,f=c*i,d=l*n,g=a(r*i,u-f),p=a(o*n,h-d),v=-r/2,m=-o/2,y=a(r,u/i-c),b=a(o,h/n-l);e&&t.drawImage(e,f,d,g,p,v,m,y,b)}},_needsResize:function(){var t=this.getTotalObjectScaling();return t.scaleX!==this._lastScaleX||t.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(t,e){this.setElement(r.util.getById(t),e),r.util.addClass(this.getElement(),r.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t)},_initFilters:function(t,e){t&&t.length?r.util.enlivenObjects(t,(function(t){e&&e(t)}),"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){t||(t={});var e=this.getElement();this.width=t.width||e.naturalWidth||e.width||0,this.height=t.height||e.naturalHeight||e.height||0},parsePreserveAspectRatioAttribute:function(){var t,e=r.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,o=1,a=1,s=0,c=0,l=0,u=0,h=this.width,f=this.height,d={width:h,height:f};return!e||"none"===e.alignX&&"none"===e.alignY?(o=h/i,a=f/n):("meet"===e.meetOrSlice&&(o=a=r.util.findScaleToFit(this._element,d),t=(h-i*o)/2,"Min"===e.alignX&&(s=-t),"Max"===e.alignX&&(s=t),t=(f-n*a)/2,"Min"===e.alignY&&(c=-t),"Max"===e.alignY&&(c=t)),"slice"===e.meetOrSlice&&(o=a=r.util.findScaleToCover(this._element,d),t=i-h/o,"Mid"===e.alignX&&(l=t/2),"Max"===e.alignX&&(l=t),t=n-f/a,"Mid"===e.alignY&&(u=t/2),"Max"===e.alignY&&(u=t),i=h/o,n=f/a)),{width:i,height:n,scaleX:o,scaleY:a,offsetLeft:s,offsetTop:c,cropX:l,cropY:u}}}),r.Image.CSS_CANVAS="canvas-img",r.Image.prototype.getSvgSrc=r.Image.prototype.getSrc,r.Image.fromObject=function(t,e){var i=r.util.object.clone(t);r.util.loadImage(i.src,(function(t,n){n?e&&e(null,!0):r.Image.prototype._initFilters.call(i,i.filters,(function(n){i.filters=n||[],r.Image.prototype._initFilters.call(i,[i.resizeFilter],(function(n){i.resizeFilter=n[0],r.util.enlivenObjects([i.clipPath],(function(n){i.clipPath=n[0];var o=new r.Image(t,i);e(o,!1)}))}))}))}),null,i.crossOrigin)},r.Image.fromURL=function(t,e,i){r.util.loadImage(t,(function(t,n){e&&e(new r.Image(t,i),n)}),null,i&&i.crossOrigin)},r.Image.ATTRIBUTE_NAMES=r.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),r.Image.fromElement=function(t,i,n){var o=r.parseAttributes(t,r.Image.ATTRIBUTE_NAMES);r.Image.fromURL(o["xlink:href"],i,e(n?r.util.object.clone(n):{},o))})}(i),r.util.object.extend(r.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.angle%360;return t>0?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(t){t=t||{};var e=function(){},i=t.onComplete||e,n=t.onChange||e,o=this;return r.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){o.rotate(t),n()},onComplete:function(){o.setCoords(),i()}}),this}}),r.util.object.extend(r.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function t(t,e){var i="precision "+e+" float;\nvoid main(){}",n=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,i),t.compileShader(n),!!t.getShaderParameter(n,t.COMPILE_STATUS)}function e(t){t&&t.tileSize&&(this.tileSize=t.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}r.isWebglSupported=function(e){if(r.isLikelyNode)return!1;e=e||r.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),n=i.getContext("webgl")||i.getContext("experimental-webgl"),o=!1;if(n){r.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),o=r.maxTextureSize>=e;for(var a=["highp","mediump","lowp"],s=0;s<3;s++)if(t(n,a[s])){r.webGlPrecision=a[s];break}}return this.isSupported=o,o},r.WebglFilterBackend=e,e.prototype={tileSize:2048,resources:{},setupGLContext:function(t,e){this.dispose(),this.createWebGLCanvas(t,e),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(t,e)},chooseFastestCopyGLTo2DMethod:function(t,e){var i,n="undefined"!==typeof window.performance;try{new ImageData(1,1),i=!0}catch(p){i=!1}var o="undefined"!==typeof ArrayBuffer,a="undefined"!==typeof Uint8ClampedArray;if(n&&i&&o&&a){var s=r.util.createCanvasElement(),u=new ArrayBuffer(t*e*4);if(r.forceGLPutImageData)return this.imageBuffer=u,void(this.copyGLTo2D=l);var h,f,d,g={imageBuffer:u,destinationWidth:t,destinationHeight:e,targetCanvas:s};s.width=t,s.height=e,h=window.performance.now(),c.call(g,this.gl,g),f=window.performance.now()-h,h=window.performance.now(),l.call(g,this.gl,g),d=window.performance.now()-h,f>d?(this.imageBuffer=u,this.copyGLTo2D=l):this.copyGLTo2D=c}},createWebGLCanvas:function(t,e){var i=r.util.createCanvasElement();i.width=t,i.height=e;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=i.getContext("webgl",n);o||(o=i.getContext("experimental-webgl",n)),o&&(o.clearColor(0,0,0,0),this.canvas=i,this.gl=o)},applyFilters:function(t,e,i,n,r,o){var a,c=this.gl;o&&(a=this.getCachedTexture(o,e));var l={originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:c,sourceTexture:this.createTexture(c,i,n,!a&&e),targetTexture:this.createTexture(c,i,n),originalTexture:a||this.createTexture(c,i,n,!a&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},u=c.createFramebuffer();return c.bindFramebuffer(c.FRAMEBUFFER,u),t.forEach((function(t){t&&t.applyTo(l)})),s(l),this.copyGLTo2D(c,l),c.bindTexture(c.TEXTURE_2D,null),c.deleteTexture(l.sourceTexture),c.deleteTexture(l.targetTexture),c.deleteFramebuffer(u),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(t,e,i,n){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),r},getCachedTexture:function(t,e){if(this.textureCache[t])return this.textureCache[t];var i=this.createTexture(this.gl,e.width,e.height,e);return this.textureCache[t]=i,i},evictCachesForKey:function(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])},copyGLTo2D:c,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var t=this.gl,e={renderer:"",vendor:""};if(!t)return e;var i=t.getExtension("WEBGL_debug_renderer_info");if(i){var n=t.getParameter(i.UNMASKED_RENDERER_WEBGL),r=t.getParameter(i.UNMASKED_VENDOR_WEBGL);n&&(e.renderer=n.toLowerCase()),r&&(e.vendor=r.toLowerCase())}return this.gpuInfo=e,e}}}(),function(){"use strict";var t=function(){};function e(){}r.Canvas2dFilterBackend=e,e.prototype={evictCachesForKey:t,dispose:t,clearWebGLCaches:t,resources:{},applyFilters:function(t,e,i,n,r){var o=r.getContext("2d");o.drawImage(e,0,0,i,n);var a=o.getImageData(0,0,i,n),s=o.getImageData(0,0,i,n),c={sourceWidth:i,sourceHeight:n,imageData:a,originalEl:e,originalImageData:s,canvasEl:r,ctx:o,filterBackend:this};return t.forEach((function(t){t.applyTo(c)})),c.imageData.width===i&&c.imageData.height===n||(r.width=c.imageData.width,r.height=c.imageData.height),o.putImageData(c.imageData,0,0),c}}}(),r.Image=r.Image||{},r.Image.filters=r.Image.filters||{},r.Image.filters.BaseFilter=r.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(t){t&&this.setOptions(t)},setOptions:function(t){for(var e in t)this[e]=t[e]},createProgram:function(t,e,i){e=e||this.fragmentSource,i=i||this.vertexSource,"highp"!==r.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+r.webGlPrecision+" float"));var n=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(n,i),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+t.getShaderInfoLog(n));var o=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(o,e),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(o));var a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,o),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(a));var s=this.getAttributeLocations(t,a),c=this.getUniformLocations(t,a)||{};return c.uStepW=t.getUniformLocation(a,"uStepW"),c.uStepH=t.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:s,uniformLocations:c}},getAttributeLocations:function(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(t,e,i){var n=e.aPosition,r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW)},_setupFrameBuffer:function(t){var e,i,n=t.context;t.passes>1?(e=t.destinationWidth,i=t.destinationHeight,t.sourceWidth===e&&t.sourceHeight===i||(n.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(n,e,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(t){t.passes--,t.pass++;var e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e},isNeutralState:function(){var t=this.mainParameter,e=r.Image.filters[this.type].prototype;if(t){if(Array.isArray(e[t])){for(var i=e[t].length;i--;)if(this[t][i]!==e[t][i])return!1;return!0}return e[t]===this[t]}return!1},applyTo:function(t){t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},retrieveShader:function(t){return t.programCache.hasOwnProperty(this.type)||(t.programCache[this.type]=this.createProgram(t.context)),t.programCache[this.type]},applyToWebGL:function(t){var e=t.context,i=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(i.program),this.sendAttributeData(e,i.attributeLocations,t.aPosition),e.uniform1f(i.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(i.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,i.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(t,e,i){t.activeTexture(i),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)},unbindAdditionalTexture:function(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(t){this[this.mainParameter]=t},sendUniformData:function(){},createHelpLayer:function(t){if(!t.helpLayer){var e=document.createElement("canvas");e.width=t.sourceWidth,e.height=t.sourceHeight,t.helpLayer=e}},toObject:function(){var t={type:this.type},e=this.mainParameter;return e&&(t[e]=this[e]),t},toJSON:function(){return this.toObject()}}),r.Image.filters.BaseFilter.fromObject=function(t,e){var i=new r.Image.filters[t.type](t);return e&&e(i),i},function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.ColorMatrix=n(i.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(t){this.callSuper("initialize",t),this.matrix=this.matrix.slice(0)},applyTo2d:function(t){var e,i,n,r,o,a=t.imageData,s=a.data,c=s.length,l=this.matrix,u=this.colorsOnly;for(o=0;o=_||a<0||a>=b||(c=4*(s*b+a),l=v[d*m+f],e+=p[c]*l,i+=p[c+1]*l,n+=p[c+2]*l,I||(r+=p[c+3]*l));C[o]=e,C[o+1]=i,C[o+2]=n,C[o+3]=I?p[o+3]:r}t.imageData=x},getUniformLocations:function(t,e){return{uMatrix:t.getUniformLocation(e,"uMatrix"),uOpaque:t.getUniformLocation(e,"uOpaque"),uHalfSize:t.getUniformLocation(e,"uHalfSize"),uSize:t.getUniformLocation(e,"uSize")}},sendUniformData:function(t,e){t.uniform1fv(e.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),e.Image.filters.Convolute.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Grayscale=n(i.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(t){var e,i,n=t.imageData,r=n.data,o=r.length,a=this.mode;for(e=0;eu[0]&&r>u[1]&&o>u[2]&&n 0.0) {\n"+this.fragmentSource[t]+"}\n}"},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.buildSource(this.mode),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},applyTo2d:function(t){var i,n,r,o,a,s,c,l=t.imageData,u=l.data,h=u.length,f=1-this.alpha;c=new e.Color(this.color).getSource(),i=c[0]*this.alpha,n=c[1]*this.alpha,r=c[2]*this.alpha;for(var d=0;d=t||e<=-t)return 0;if(e<1.1920929e-7&&e>-1.1920929e-7)return 1;e*=Math.PI;var i=e/t;return s(e)/e*s(i)/i}},applyTo2d:function(t){var e=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,o=e.width,s=e.height,c=a(o*i),l=a(s*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(t,o,s,c,l):"hermite"===this.resizeType?r=this.hermiteFastResize(t,o,s,c,l):"bilinear"===this.resizeType?r=this.bilinearFiltering(t,o,s,c,l):"lanczos"===this.resizeType&&(r=this.lanczosResize(t,o,s,c,l)),t.imageData=r},sliceByTwo:function(t,i,r,o,a){var s,c,l=t.imageData,u=.5,h=!1,f=!1,d=i*u,g=r*u,p=e.filterBackend.resources,v=0,m=0,y=i,b=0;p.sliceByTwo||(p.sliceByTwo=document.createElement("canvas")),s=p.sliceByTwo,(s.width<1.5*i||s.height=e)){O=n(1e3*o(M-C.x)),x[O]||(x[O]={});for(var L=I.y-_;L<=I.y+_;L++)L<0||L>=a||(j=n(1e3*o(L-C.y)),x[O][j]||(x[O][j]=g(r(i(O*m,2)+i(j*y,2))/1e3)),S=x[O][j],S>0&&(w=4*(L*e+M),T+=S,A+=S*h[w],D+=S*h[w+1],E+=S*h[w+2],k+=S*h[w+3]))}w=4*(c*s+t),d[w]=A/T,d[w+1]=D/T,d[w+2]=E/T,d[w+3]=k/T}return++t1&&L<-1||(_=2*L*L*L-3*L*L+1,_>0&&(j=4*(O+A*e),w+=_*g[j+3],C+=_,g[j+3]<255&&(_=_*g[j+3]/250),I+=_*g[j],M+=_*g[j+1],S+=_*g[j+2],x+=_))}v[b]=I/x,v[b+1]=M/x,v[b+2]=S/x,v[b+3]=w/C}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),e.Image.filters.Resize.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Contrast=n(i.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(t){if(0!==this.contrast){var e,i=t.imageData,n=i.data,r=n.length,o=Math.floor(255*this.contrast),a=259*(o+255)/(255*(259-o));for(e=0;e1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?i[0]=t:i[1]=t,i}}),i.Blur.fromObject=e.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Gamma=n(i.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(t){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e,i=t.imageData,n=i.data,r=this.gamma,o=n.length,a=1/r[0],s=1/r[1],c=1/r[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,o=256;e'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){var e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){"stroke"===this.paintFirst?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){t.textBaseline="alphabetic",t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;et&&(t=n)}return t},_renderTextLine:function(t,e,i,n,r,o){this._renderChars(t,e,i,n,r,o)},_renderTextLinesBackground:function(t){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var e,i,n,r,o,a,s,c=t.fillStyle,l=this._getLeftOffset(),u=this._getTopOffset(),h=0,f=0,d=this.path,g=0,p=this._textLines.length;g=0:is?f%=s:f<0&&(f+=s),this._setGraphemeOnPath(f,o,a),f+=o.kernedWidth}return{width:c,numOfSpaces:u}},_setGraphemeOnPath:function(t,i,n){var r=t+i.kernedWidth/2,o=this.path,a=e.util.getPointOnPath(o.path,r,o.segmentsInfo);i.renderLeft=a.x-n.x,i.renderTop=a.y-n.y,i.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(t,e,i,n,r){var o,a=this.getCompleteStyleDeclaration(e,i),s=n?this.getCompleteStyleDeclaration(e,i-1):{},c=this._measureChar(t,a,n,s),l=c.kernedWidth,u=c.width;0!==this.charSpacing&&(o=this._getWidthOfCharSpacing(),u+=o,l+=o);var h={width:u,left:0,height:a.fontSize,kernedWidth:l,deltaY:a.deltaY};if(i>0&&!r){var f=this.__charBounds[e][i-1];h.left=f.left+f.width+c.kernedWidth-c.width}return h},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),n=1,r=e.length;n0){var T=y+o+h;"rtl"===this.direction&&(T=this.width-T-f),l&&m&&(t.fillStyle=m,t.fillRect(T,u+C*n+a,f,this.fontSize/15)),h=d.left,f=d.width,l=g,m=v,n=r,a=s}else f+=d.kernedWidth;T=y+o+h;"rtl"===this.direction&&(T=this.width-T-f),t.fillStyle=v,g&&v&&t.fillRect(T,u+C*n+a,f-x,this.fontSize/15),b+=i}else b+=i;this._removeShadow(t)}},_getFontDeclaration:function(t,i){var n=t||this,r=this.fontFamily,o=e.Text.genericFonts.indexOf(r.toLowerCase())>-1,a=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||o?n.fontFamily:'"'+n.fontFamily+'"';return[e.isLikelyNode?n.fontWeight:n.fontStyle,e.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",a].join(" ")},render:function(t){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",t)))},_splitTextIntoLines:function(t){for(var i=t.split(this._reNewline),n=new Array(i.length),r=["\n"],o=[],a=0;a-1&&(t.underline=!0),t.textDecoration.indexOf("line-through")>-1&&(t.linethrough=!0),t.textDecoration.indexOf("overline")>-1&&(t.overline=!0),delete t.textDecoration)}r.IText=r.util.createClass(r.Text,r.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(t,e){this.callSuper("initialize",t,e),this.initBehavior()},setSelectionStart:function(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)},setSelectionEnd:function(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)},_updateAndFire:function(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(t){this.clearContextTop(),this.callSuper("render",t),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(t){this.callSuper("_render",t)},clearContextTop:function(t){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this.canvas.contextTop,i=this.canvas.viewportTransform;e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(e),this._clearTextArea(e),t||e.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this._getCursorBoundaries(),e=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(t,e):this.renderSelection(t,e),e.restore()}},_clearTextArea:function(t){var e=this.width+4,i=this.height+4;t.clearRect(-e/2,-i/2,e,i)},_getCursorBoundaries:function(t){"undefined"===typeof t&&(t=this.selectionStart);var e=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(t);return{left:e,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(t){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var e,i,n,r,o=0,a=0,s=this.get2DCursorLocation(t);n=s.charIndex,i=s.lineIndex;for(var c=0;c0?a:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(t,e){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,o=this.getValueOfPropertyAt(n,r,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,c=t.topOffset,l=this.getValueOfPropertyAt(n,r,"deltaY");c+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(t,e),e.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,r,"fill"),e.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,e.fillRect(t.left+t.leftOffset-s/2,c+t.top+l,s,o)},renderSelection:function(t,e){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(i),a=this.get2DCursorLocation(n),s=o.lineIndex,c=a.lineIndex,l=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex,h=s;h<=c;h++){var f=this._getLineLeftOffset(h)||0,d=this.getHeightOfLine(h),g=0,p=0,v=0;if(h===s&&(p=this.__charBounds[s][l].left),h>=s&&h1)&&(d/=this.lineHeight);var y=t.left+f+p,b=v-p,_=d,x=0;this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",_=1,x=d):e.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),e.fillRect(y,t.top+t.topOffset+x,b,_),t.topOffset+=g}},getCurrentCharFontSize:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")},getCurrentCharColor:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fill")},_getCurrentCharIndex:function(){var t=this.get2DCursorLocation(this.selectionStart,!0),e=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}}),r.IText.fromObject=function(e,i){if(t(e),e.styles)for(var n in e.styles)for(var o in e.styles[n])t(e.styles[n][o]);r.Object._fromObject("IText",e,i,"text")}}(),function(){var t=r.util.object.clone;r.util.object.extend(r.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var t=this;this.on("added",(function(){var e=t.canvas;e&&(e._hasITextHandlers||(e._hasITextHandlers=!0,t._initCanvasHandlers(e)),e._iTextInstances=e._iTextInstances||[],e._iTextInstances.push(t))}))},initRemovedHandler:function(){var t=this;this.on("removed",(function(){var e=t.canvas;e&&(e._iTextInstances=e._iTextInstances||[],r.util.removeFromArray(e._iTextInstances,t),0===e._iTextInstances.length&&(e._hasITextHandlers=!1,t._removeCanvasHandlers(e)))}))},_initCanvasHandlers:function(t){t._mouseUpITextHandler=function(){t._iTextInstances&&t._iTextInstances.forEach((function(t){t.__isMousedown=!1}))},t.on("mouse:up",t._mouseUpITextHandler)},_removeCanvasHandlers:function(t){t.off("mouse:up",t._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(t,e,i,n){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},t.animate("_currentCursorOpacity",e,{duration:i,onComplete:function(){r.isAborted||t[n]()},onChange:function(){t.canvas&&t.selectionStart===t.selectionEnd&&t.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var t=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){t._currentTickCompleteState=t._animateCursor(t,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(t){var e=this,i=t?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){e._tick()}),i)},abortCursorAnimation:function(){var t=this._currentTickState||this._currentTickCompleteState,e=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,t&&e&&e.clearContext(e.contextTop||e.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(t){var e=0,i=t-1;if(this._reSpace.test(this._text[i]))while(this._reSpace.test(this._text[i]))e++,i--;while(/\S/.test(this._text[i])&&i>-1)e++,i--;return t-e},findWordBoundaryRight:function(t){var e=0,i=t;if(this._reSpace.test(this._text[i]))while(this._reSpace.test(this._text[i]))e++,i++;while(/\S/.test(this._text[i])&&i-1)e++,i--;return t-e},findLineBoundaryRight:function(t){var e=0,i=t;while(!/\n/.test(this._text[i])&&i0&&nthis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=e):(this.selectionStart=e,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(t,e,i){var n=i.slice(0,t),o=r.util.string.graphemeSplit(n).length;if(t===e)return{selectionStart:o,selectionEnd:o};var a=i.slice(t,e),s=r.util.string.graphemeSplit(a).length;return{selectionStart:o,selectionEnd:o+s}},fromGraphemeToStringSelection:function(t,e,i){var n=i.slice(0,t),r=n.join("").length;if(t===e)return{selectionStart:r,selectionEnd:r};var o=i.slice(t,e),a=o.join("").length;return{selectionStart:r,selectionEnd:r+a}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var t=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=t.selectionEnd,this.inCompositionMode||(this.selectionStart=t.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),i=this.get2DCursorLocation(t),n=i.lineIndex,o=i.charIndex,a=this.getValueOfPropertyAt(n,o,"fontSize")*this.lineHeight,s=e.leftOffset,c=this.calcTransformMatrix(),l={x:e.left+s,y:e.top+e.topOffset+a},u=this.canvas.getRetinaScaling(),h=this.canvas.upperCanvasEl,f=h.width/u,d=h.height/u,g=f-a,p=d-a,v=h.clientWidth/f,m=h.clientHeight/d;return l=r.util.transformPoint(l,c),l=r.util.transformPoint(l,this.canvas.viewportTransform),l.x*=v,l.y*=m,l.x<0&&(l.x=0),l.x>g&&(l.x=g),l.y<0&&(l.y=0),l.y>p&&(l.y=p),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var t=this._textBeforeEdit!==this.text,e=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,e&&(e.blur&&e.blur(),e.parentNode&&e.parentNode.removeChild(e)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),t&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var t in this.styles)this._textLines[t]||delete this.styles[t]},removeStyleFromTo:function(t,e){var i,n,r=this.get2DCursorLocation(t,!0),o=this.get2DCursorLocation(e,!0),a=r.lineIndex,s=r.charIndex,c=o.lineIndex,l=o.charIndex;if(a!==c){if(this.styles[a])for(i=s;i=l&&(n[u-f]=n[h],delete n[h])}},shiftLineStyles:function(e,i){var n=t(this.styles);for(var r in this.styles){var o=parseInt(r,10);o>e&&(this.styles[o+i]=n[o],n[o-i]||delete this.styles[o])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(e,i,n,r){var o,a={},s=!1,c=this._unwrappedTextLines[e].length===i;for(var l in n||(n=1),this.shiftLineStyles(e,n),this.styles[e]&&(o=this.styles[e][0===i?i:i-1]),this.styles[e]){var u=parseInt(l,10);u>=i&&(s=!0,a[u-i]=this.styles[e][l],c&&0===i||delete this.styles[e][l])}var h=!1;s&&!c&&(this.styles[e+n]=a,h=!0),h&&n--;while(n>0)r&&r[n-1]?this.styles[e+n]={0:t(r[n-1])}:o?this.styles[e+n]={0:t(o)}:delete this.styles[e+n],n--;this._forceClearCache=!0},insertCharStyleObject:function(e,i,n,r){this.styles||(this.styles={});var o=this.styles[e],a=o?t(o):{};for(var s in n||(n=1),a){var c=parseInt(s,10);c>=i&&(o[c+n]=a[c],a[c-n]||delete o[c])}if(this._forceClearCache=!0,r)while(n--)Object.keys(r[n]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][i+n]=t(r[n]));else if(o){var l=o[i?i-1:1];while(l&&n--)this.styles[e][i+n]=t(l)}},insertNewStyleBlock:function(t,e,i){for(var n=this.get2DCursorLocation(e,!0),r=[0],o=0,a=0;a0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),o&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],o);for(a=1;a0?this.insertCharStyleObject(n.lineIndex+a,0,r[a],i):i&&(this.styles[n.lineIndex+a][0]=i[0]),i=i&&i.slice(r[a]+1);r[a]>0&&this.insertCharStyleObject(n.lineIndex+a,0,r[a],i)},setSelectionStartEndWithShift:function(t,e,i){i<=t?(e===t?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=t),this.selectionStart=i):i>t&&it?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),r.util.object.extend(r.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){if(this.canvas){this.__newClickTime=+new Date;var e=t.pointer;this.isTripleClick(e)&&(this.fire("tripleclick",t),this._stopEvent(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y},_stopEvent:function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))},tripleClickHandler:function(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(t.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(t){if(this.__isMousedown=!1,!(!this.editable||this.group||t.transform&&t.transform.actionPerformed||t.e.button&&1!==t.e.button)){if(this.canvas){var e=this.canvas._activeObject;if(e&&e!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(t.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(t){var e=this.getSelectionStartFromPointer(t),i=this.selectionStart,n=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(i,n,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(t){for(var e,i,n=this.getLocalPointer(t),r=0,o=0,a=0,s=0,c=0,l=0,u=this._textLines.length;l0&&(s+=this._textLines[l-1].length+this.missingNewlineOffset(l-1))}e=this._getLineLeftOffset(c),o=e*this.scaleX,i=this._textLines[c],"rtl"===this.direction&&(n.x=this.width*this.scaleX-n.x+o);for(var h=0,f=i.length;ho||a<0?0:1,c=n+s;return this.flipX&&(c=r-c),c>this._text.length&&(c=this._text.length),c}}),r.util.object.extend(r.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=r.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var t=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+t.top+"; left: "+t.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+t.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):r.document.body.appendChild(this.hiddenTextarea),r.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),r.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),r.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),r.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),r.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),r.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),r.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(r.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(t){if(this.isEditing){var e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),t.keyCode>=33&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(t){var e=this.fromPaste;if(this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing){var i,n,o,a,s,c=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,u=c.length,h=u-l,f=this.selectionStart,d=this.selectionEnd,g=f!==d;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),v=f>p.selectionStart;g?(i=this._text.slice(f,d),h+=d-f):u0&&(i=this.__charBounds[t][e-1],n+=i.left+i.width),n},getDownCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-i;var o=n.charIndex,a=this._getWidthBeforeCursor(r,o),s=this._getIndexOnLine(r+1,a),c=this._textLines[r].slice(o);return c.length+s+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||t.metaKey||33===t.keyCode)return-i;var o=n.charIndex,a=this._getWidthBeforeCursor(r,o),s=this._getIndexOnLine(r-1,a),c=this._textLines[r].slice(0,o),l=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+s-c.length+(1-l)},_getIndexOnLine:function(t,e){for(var i,n,r=this._textLines[t],o=this._getLineLeftOffset(t),a=o,s=0,c=0,l=r.length;ce){n=!0;var u=a-i,h=a,f=Math.abs(u-e),d=Math.abs(h-e);s=d=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)},moveCursorUp:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)},_moveCursorUpOrDown:function(t,e){var i="get"+t+"CursorOffset",n=this[i](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),0!==n&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(t){var e="left"===this._selectionDirection?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t},moveCursorWithoutShift:function(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t},moveCursorLeft:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)},_move:function(t,e,i){var n;if(t.altKey)n=this["findWordBoundary"+i](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[e])}if(void 0!==typeof n&&this[e]!==n)return this[e]=n,!0},_moveLeft:function(t,e){return this._move(t,e,"Left")},_moveRight:function(t,e){return this._move(t,e,"Right")},moveCursorLeftWithoutShift:function(t){var e=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e},moveCursorLeftWithShift:function(t){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(t,"selectionStart")):void 0},moveCursorRight:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)},_moveCursorLeftOrRight:function(t,e){var i="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?i+="Shift":i+="outShift",this[i](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(t){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(t,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(t){var e=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e},removeChars:function(t,e){"undefined"===typeof e&&(e=t+1),this.removeStyleFromTo(t,e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(t,e,i,n){"undefined"===typeof n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var o=r.util.string.graphemeSplit(t);this.insertNewStyleBlock(o,i,e),this._text=[].concat(this._text.slice(0,i),o,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var t=r.util.toFixed,e=/ +/g;r.util.object.extend(r.Text.prototype,{_toSVG:function(){var t=this._getSVGLeftTopOffsets(),e=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(e)},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(t){var e=!0,i=this.getSvgTextDecoration(this);return[t.textBgRects.join(""),'\t\t",t.textSpans.join(""),"\n"]},_getSVGTextAndBg:function(t,e){var i,n=[],r=[],o=t;this._setSVGBg(r);for(var a=0,s=this._textLines.length;a",r.util.string.escapeXml(i),""].join("")},_setSVGTextLineText:function(t,e,i,n){var r,o,a,s,c,l=this.getHeightOfLine(e),u=-1!==this.textAlign.indexOf("justify"),h="",f=0,d=this._textLines[e];n+=l*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,p=d.length-1;g<=p;g++)c=g===p||this.charSpacing,h+=d[g],a=this.__charBounds[e][g],0===f?(i+=a.kernedWidth-a.width,f+=a.width):f+=a.kernedWidth,u&&!c&&this._reSpaceAndTab.test(d[g])&&(c=!0),c||(r=r||this.getCompleteStyleDeclaration(e,g),o=this.getCompleteStyleDeclaration(e,g+1),c=this._hasStyleChangedForSvg(r,o)),c&&(s=this._getStyleDeclaration(e,g)||{},t.push(this._createTextCharSpan(h,s,i,n)),h="",r=o,i+=f,f=0)},_pushTextBgRect:function(e,i,n,o,a,s){var c=r.Object.NUM_FRACTION_DIGITS;e.push("\t\t\n')},_setSVGTextLineBg:function(t,e,i,n){for(var r,o,a=this._textLines[e],s=this.getHeightOfLine(e)/this.lineHeight,c=0,l=0,u=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),h=0,f=a.length;hthis.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,n=0,r={},o=0;o0?(i=0,n++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[n])&&o>0&&(i++,n++),r[o]={line:e,offset:i},n+=t.graphemeLines[o].length,i+=t.graphemeLines[o].length;return r},styleHas:function(t,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return e.Text.prototype.styleHas.call(this,t,i)},isEmptyStyles:function(t){if(!this.styles)return!0;var e,i,n=0,r=t+1,o=!1,a=this._styleMap[t],s=this._styleMap[t+1];for(var c in a&&(t=a.line,n=a.offset),s&&(r=s.line,o=r===t,e=s.offset),i="undefined"===typeof t?this.styles:{line:this.styles[t]},i)for(var l in i[c])if(l>=n&&(!o||ln&&!v?(s.push(c),c=[],o=d,v=!0):o+=m,v||a||c.push(f),c=c.concat(u),g=a?0:this._measureWord([f],i,h),h++,v=!1,d>p&&(p=d);return y&&s.push(c),p+r>this.dynamicMinWidth&&(this.dynamicMinWidth=p-m+r),s},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},missingNewlineOffset:function(t){return this.splitByGrapheme?this.isEndOfWrapping(t)?1:0:1},_splitTextIntoLines:function(t){for(var i=e.Text.prototype._splitTextIntoLines.call(this,t),n=this._wrapText(i.lines,this.width),r=new Array(n.length),o=0;o=0&&r-1?e[i][1]+=1:e.push([t,1]))},h.prototype._forgetContext=function(t){var e,i;r(t)&&(e=this._safeContext(),i=this._indexOfContext(t),i>-1&&(e[i][1]-=1,e[i][1]<=0&&e.splice(i,1)))},h.prototype._bindEvent=function(t,e,i){var n=this._safeEvent(t);this._memorizeContext(i),n.push(this._getHandlerItem(e,i))},h.prototype.on=function(t,e,i){var n=this;o(t)?(t=t.split(u),l(t,(function(t){n._bindEvent(t,e,i)}))):a(t)&&(i=e,l(t,(function(t,e){n.on(e,t,i)})))},h.prototype.once=function(t,e,i){var n=this;if(a(t))return i=e,void l(t,(function(t,e){n.once(e,t,i)}));function r(){e.apply(i,arguments),n.off(t,r,i)}this.on(t,r,i)},h.prototype._spliceMatches=function(t,e){var i,n=0;if(s(t))for(i=t.length;n0},h.prototype.getListenerLength=function(t){var e=this._safeEvent(t);return e.length},t.exports=h},961:function(t){"use strict";function e(t,e){var i,n,r,o,a=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;ro}function s(t,e){var i="https://www.google-analytics.com/collect",o=location.hostname,s="event",c="use",l="TOAST UI "+t+" for "+o+": Statistics",u=window.localStorage.getItem(l);(n(window.tui)||!1!==window.tui.usageStatistics)&&(u&&!a(u)||(window.localStorage.setItem(l,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r(i,{v:1,t:s,tid:e,cid:o,dp:o,dh:t,el:t,ec:c})}),1e3)))}t.exports=s},602:function(t){"use strict";function e(t){return t instanceof Array}t.exports=e},9886:function(t,e,i){"use strict";var n=i(5695),r=i(3778);function o(t){return!n(t)&&!r(t)}t.exports=o},5183:function(t){"use strict";function e(t){return t instanceof Function}t.exports=e},3778:function(t){"use strict";function e(t){return null===t}t.exports=e},5393:function(t){"use strict";function e(t){return t===Object(t)}t.exports=e},2560:function(t){"use strict";function e(t){return"string"===typeof t||t instanceof String}t.exports=e},5695:function(t){"use strict";function e(t){return void 0===t}t.exports=e},4426:function(t,e,i){t.exports=i(4486)},9406:function(t,e,i){t.exports=i(4877)},789:function(t,e,i){t.exports=i(7178)},381:function(t,e,i){t.exports=i(5603)},7636:function(t,e,i){t.exports=i(1206)},1899:function(t,e,i){t.exports=i(6174)},899:function(t,e,i){t.exports=i(57)},8005:function(t,e,i){t.exports=i(4741)},6562:function(t,e,i){t.exports=i(8368)},9131:function(t,e,i){t.exports=i(3739)},4383:function(t,e,i){t.exports=i(172)},6065:function(t,e,i){t.exports=i(4963)},1734:function(t,e,i){t.exports=i(7820)},2461:function(t,e,i){t.exports=i(5636)},5214:function(t,e,i){t.exports=i(5059)},6397:function(t,e,i){t.exports=i(3969)},8189:function(t,e,i){t.exports=i(6618)},9146:function(t,e,i){t.exports=i(5279)},4496:function(t,e,i){t.exports=i(9562)},3972:function(t,e,i){t.exports=i(652)},7172:function(t,e,i){t.exports=i(2813)},1845:function(t,e,i){t.exports=i(8664)},662:function(t,e,i){t.exports=i(1457)},711:function(t,e,i){t.exports=i(2937)},6623:function(t,e,i){t.exports=i(9297)},7077:function(t,e,i){t.exports=i(8026)},9856:function(t,e,i){t.exports=i(2044)},4230:function(t,e,i){t.exports=i(2214)},184:function(t,e,i){t.exports=i(9256)},3742:function(t,e,i){t.exports=i(5659)},1801:function(t){var e={rect:1,circle:2,triangle:1},i={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};function n(t){var e=t.originX,i=t.originY,n=e.substring(0,1)+i.substring(0,1);t.startPoint=t.origins[n]}function r(t,e,i){var n=t.x,r=t.y,o=e.x,a=e.y,s=i*Math.PI/180,c=(o-n)*Math.cos(s)-(a-r)*Math.sin(s)+n,l=(o-n)*Math.sin(s)+(a-r)*Math.cos(s)+r;return{originX:n>c?"right":"left",originY:r>l?"bottom":"top"}}function o(t){return"center"===t.originX&&"center"===t.originY}function a(t,e){var i=e.getPointByOrigin("center","center"),n=-e.angle,o=r(i,t,n),a=o.originX,s=o.originY,c=e.getPointByOrigin(a,s),l=e.left-(i.x-c.x),u=e.top-(i.y-c.y);e.set({originX:a,originY:s,left:l,top:u}),e.setCoords()}function s(t,e){var i=e.startPoint,n=-e.angle,o=r(i,t,n),a=o.originX,s=o.originY;e.setPositionByOrigin(i,a,s),e.setCoords()}function c(t){var e=t.type,n=t.scaleX,r=t.scaleY,o=i[e],a=t[o.w]*n,s=t[o.h]*r;if(t.isRegular){var c=Math.max(n,r);a=t[o.w]*c,s=t[o.h]*c}var l={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};l[o.w]=a,l[o.h]=s,t.set(l)}function l(t,n){var r=n.type,o=n.strokeWidth,a=n.startPoint,s=e[r],c=i[r],l=!("triangle"!==n.type),u={},h=Math.abs(a.x-t.x)/s,f=Math.abs(a.y-t.y)/s;h>o&&(h-=o/s),f>o&&(f-=o/s),n.isRegular&&(h=f=Math.max(h,f),l&&(f=Math.sqrt(3)/2*h)),u[c.w]=h,u[c.h]=f,n.set(u)}t.exports={setOrigins:function(t){var e=t.getPointByOrigin("left","top"),i=t.getPointByOrigin("right","top"),n=t.getPointByOrigin("right","bottom"),r=t.getPointByOrigin("left","bottom");t.origins={lt:e,rt:i,rb:n,lb:r}},resize:function(t,e,i){o(t)&&(a(e,t),n(t)),i?c(t,e):l(e,t),s(e,t)},adjustOriginToCenter:function(t){var e=t.getPointByOrigin("center","center"),i=t.originX,n=t.originY,r=t.getPointByOrigin(i,n),o=t.left+(e.x-r.x),a=t.top+(e.y-r.y);t.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:o,top:a}),t.setCoords()}}},2221:function(t,e,i){i(5454),i(9173);var n=i(7545);t.exports=n.Array.from},5078:function(t,e,i){i(8118);var n=i(7545);t.exports=n.Array.isArray},6135:function(t,e,i){i(9106);var n=i(5607);t.exports=n("Array").concat},9510:function(t,e,i){i(1710);var n=i(5607);t.exports=n("Array").fill},3971:function(t,e,i){i(3436);var n=i(5607);t.exports=n("Array").filter},98:function(t,e,i){i(9823);var n=i(5607);t.exports=n("Array").forEach},2089:function(t,e,i){i(2276);var n=i(5607);t.exports=n("Array").indexOf},6209:function(t,e,i){i(3838);var n=i(5607);t.exports=n("Array").map},2671:function(t,e,i){i(5818);var n=i(5607);t.exports=n("Array").slice},1375:function(t,e,i){i(2178);var n=i(5607);t.exports=n("Array").splice},3528:function(t,e,i){i(665);var n=i(5607);t.exports=n("Function").bind},5739:function(t,e,i){i(8939),i(5454);var n=i(8703);t.exports=n},278:function(t,e,i){var n=i(3528),r=Function.prototype;t.exports=function(t){var e=t.bind;return t===r||t instanceof Function&&e===r.bind?n:e}},1484:function(t,e,i){var n=i(6135),r=Array.prototype;t.exports=function(t){var e=t.concat;return t===r||t instanceof Array&&e===r.concat?n:e}},7731:function(t,e,i){var n=i(9510),r=Array.prototype;t.exports=function(t){var e=t.fill;return t===r||t instanceof Array&&e===r.fill?n:e}},3669:function(t,e,i){var n=i(3971),r=Array.prototype;t.exports=function(t){var e=t.filter;return t===r||t instanceof Array&&e===r.filter?n:e}},2604:function(t,e,i){var n=i(2089),r=Array.prototype;t.exports=function(t){var e=t.indexOf;return t===r||t instanceof Array&&e===r.indexOf?n:e}},263:function(t,e,i){var n=i(6209),r=Array.prototype;t.exports=function(t){var e=t.map;return t===r||t instanceof Array&&e===r.map?n:e}},7663:function(t,e,i){var n=i(2671),r=Array.prototype;t.exports=function(t){var e=t.slice;return t===r||t instanceof Array&&e===r.slice?n:e}},5063:function(t,e,i){var n=i(1375),r=Array.prototype;t.exports=function(t){var e=t.splice;return t===r||t instanceof Array&&e===r.splice?n:e}},6813:function(t,e,i){var n=i(3842),r=String.prototype;t.exports=function(t){var e=t.trim;return"string"===typeof t||t===r||t instanceof String&&e===r.trim?n:e}},6285:function(t,e,i){i(2666);var n=i(7545);t.exports=n.Number.parseInt},3213:function(t,e,i){i(3113);var n=i(7545),r=n.Object;t.exports=function(t,e){return r.create(t,e)}},3512:function(t,e,i){i(297);var n=i(7545),r=n.Object,o=t.exports=function(t,e,i){return r.defineProperty(t,e,i)};r.defineProperty.sham&&(o.sham=!0)},8168:function(t,e,i){i(9234);var n=i(7545);t.exports=n.Object.getPrototypeOf},8651:function(t,e,i){i(2647);var n=i(7545);t.exports=n.Object.keys},3083:function(t,e,i){i(3222);var n=i(7545);t.exports=n.Object.setPrototypeOf},2987:function(t,e,i){i(4859);var n=i(7545);t.exports=n.parseFloat},2239:function(t,e,i){i(5706);var n=i(7545);t.exports=n.parseInt},3154:function(t,e,i){i(4242),i(8939),i(6663),i(9021),i(7884),i(8885),i(1868),i(5454);var n=i(7545);t.exports=n.Promise},6577:function(t,e,i){i(5397);var n=i(7545);t.exports=n.Reflect.construct},3842:function(t,e,i){i(957);var n=i(5607);t.exports=n("String").trim},5008:function(t,e,i){i(9106),i(6663),i(6187),i(9781),i(492),i(6681),i(9594),i(3665),i(9017),i(1250),i(9786),i(503),i(6565),i(9322),i(3610),i(6886),i(3514),i(8671),i(8556),i(1367);var n=i(7545);t.exports=n.Symbol},994:function(t,e,i){i(8939),i(6663),i(5454),i(3665);var n=i(9207);t.exports=n.f("iterator")},2813:function(t,e,i){var n=i(3822);t.exports=n},8664:function(t,e,i){var n=i(1434);t.exports=n},1457:function(t,e,i){var n=i(7710);t.exports=n},2937:function(t,e,i){var n=i(4741);t.exports=n},9297:function(t,e,i){var n=i(4963);t.exports=n},8026:function(t,e,i){var n=i(7820);t.exports=n},2044:function(t,e,i){var n=i(8980);t.exports=n},2214:function(t,e,i){var n=i(6672);t.exports=n},9256:function(t,e,i){var n=i(2285);i(177),i(9031),i(6658),i(1875),i(8658),i(4592),i(6680),t.exports=n},5659:function(t,e,i){var n=i(8535);t.exports=n},6235:function(t,e,i){var n=i(6447),r=i(9288);t.exports=function(t){if(n(t))return t;throw TypeError(r(t)+" is not a function")}},1404:function(t,e,i){var n=i(2091),r=i(9288);t.exports=function(t){if(n(t))return t;throw TypeError(r(t)+" is not a constructor")}},7757:function(t,e,i){var n=i(6447);t.exports=function(t){if("object"===typeof t||n(t))return t;throw TypeError("Can't set "+String(t)+" as a prototype")}},7423:function(t){t.exports=function(){}},6961:function(t){t.exports=function(t,e,i){if(t instanceof e)return t;throw TypeError("Incorrect "+(i?i+" ":"")+"invocation")}},1138:function(t,e,i){var n=i(5744);t.exports=function(t){if(n(t))return t;throw TypeError(String(t)+" is not an object")}},2724:function(t,e,i){"use strict";var n=i(1795),r=i(7739),o=i(4104);t.exports=function(t){var e=n(this),i=o(e),a=arguments.length,s=r(a>1?arguments[1]:void 0,i),c=a>2?arguments[2]:void 0,l=void 0===c?i:r(c,i);while(l>s)e[s++]=t;return e}},7397:function(t,e,i){"use strict";var n=i(454).forEach,r=i(424),o=r("forEach");t.exports=o?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},841:function(t,e,i){"use strict";var n=i(8043),r=i(1795),o=i(1635),a=i(6109),s=i(2091),c=i(4104),l=i(9361),u=i(1669),h=i(8703);t.exports=function(t){var e=r(t),i=s(this),f=arguments.length,d=f>1?arguments[1]:void 0,g=void 0!==d;g&&(d=n(d,f>2?arguments[2]:void 0,2));var p,v,m,y,b,_,x=h(e),C=0;if(!x||this==Array&&a(x))for(p=c(e),v=i?new this(p):Array(p);p>C;C++)_=g?d(e[C],C):e[C],l(v,C,_);else for(y=u(e,x),b=y.next,v=i?new this:[];!(m=b.call(y)).done;C++)_=g?o(y,d,[m.value,C],!0):m.value,l(v,C,_);return v.length=C,v}},8180:function(t,e,i){var n=i(101),r=i(7739),o=i(4104),a=function(t){return function(e,i,a){var s,c=n(e),l=o(c),u=r(a,l);if(t&&i!=i){while(l>u)if(s=c[u++],s!=s)return!0}else for(;l>u;u++)if((t||u in c)&&c[u]===i)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},454:function(t,e,i){var n=i(8043),r=i(2202),o=i(1795),a=i(4104),s=i(1321),c=[].push,l=function(t){var e=1==t,i=2==t,l=3==t,u=4==t,h=6==t,f=7==t,d=5==t||h;return function(g,p,v,m){for(var y,b,_=o(g),x=r(_),C=n(p,v,3),I=a(x),M=0,S=m||s,w=e?S(g,I):i||f?S(g,0):void 0;I>M;M++)if((d||M in x)&&(y=x[M],b=C(y,M,_),t))if(e)w[M]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return M;case 2:c.call(w,y)}else switch(t){case 4:return!1;case 7:c.call(w,y)}return h?-1:l||u?u:w}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},242:function(t,e,i){var n=i(6192),r=i(8182),o=i(4218),a=r("species");t.exports=function(t){return o>=51||!n((function(){var e=[],i=e.constructor={};return i[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},424:function(t,e,i){"use strict";var n=i(6192);t.exports=function(t,e){var i=[][t];return!!i&&n((function(){i.call(null,e||function(){throw 1},1)}))}},3712:function(t,e,i){var n=i(4770),r=i(2091),o=i(5744),a=i(8182),s=a("species");t.exports=function(t){var e;return n(t)&&(e=t.constructor,r(e)&&(e===Array||n(e.prototype))?e=void 0:o(e)&&(e=e[s],null===e&&(e=void 0))),void 0===e?Array:e}},1321:function(t,e,i){var n=i(3712);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},1635:function(t,e,i){var n=i(1138),r=i(6639);t.exports=function(t,e,i,o){try{return o?e(n(i)[0],i[1]):e(i)}catch(a){r(t,"throw",a)}}},9770:function(t,e,i){var n=i(8182),r=n("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[r]=function(){return this},Array.from(s,(function(){throw 2}))}catch(c){}t.exports=function(t,e){if(!e&&!o)return!1;var i=!1;try{var n={};n[r]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(c){}return i}},9272:function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},4696:function(t,e,i){var n=i(3471),r=i(6447),o=i(9272),a=i(8182),s=a("toStringTag"),c="Arguments"==o(function(){return arguments}()),l=function(t,e){try{return t[e]}catch(i){}};t.exports=n?o:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=l(e=Object(t),s))?i:c?o(e):"Object"==(n=o(e))&&r(e.callee)?"Arguments":n}},4635:function(t,e,i){var n=i(6192);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},5148:function(t,e,i){"use strict";var n=i(4413).IteratorPrototype,r=i(2853),o=i(774),a=i(1284),s=i(7771),c=function(){return this};t.exports=function(t,e,i){var l=e+" Iterator";return t.prototype=r(n,{next:o(1,i)}),a(t,l,!1,!0),s[l]=c,t}},8711:function(t,e,i){var n=i(69),r=i(2760),o=i(774);t.exports=n?function(t,e,i){return r.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},774:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},9361:function(t,e,i){"use strict";var n=i(77),r=i(2760),o=i(774);t.exports=function(t,e,i){var a=n(e);a in t?r.f(t,a,o(0,i)):t[a]=i}},7218:function(t,e,i){"use strict";var n=i(3085),r=i(5546),o=i(2282),a=i(6447),s=i(5148),c=i(9341),l=i(4469),u=i(1284),h=i(8711),f=i(9482),d=i(8182),g=i(7771),p=i(4413),v=o.PROPER,m=o.CONFIGURABLE,y=p.IteratorPrototype,b=p.BUGGY_SAFARI_ITERATORS,_=d("iterator"),x="keys",C="values",I="entries",M=function(){return this};t.exports=function(t,e,i,o,d,p,S){s(i,e,o);var w,T,A,D=function(t){if(t===d&&L)return L;if(!b&&t in O)return O[t];switch(t){case x:return function(){return new i(this,t)};case C:return function(){return new i(this,t)};case I:return function(){return new i(this,t)}}return function(){return new i(this)}},E=e+" Iterator",k=!1,O=t.prototype,j=O[_]||O["@@iterator"]||d&&O[d],L=!b&&j||D(d),N="Array"==e&&O.entries||j;if(N&&(w=c(N.call(new t)),w!==Object.prototype&&w.next&&(r||c(w)===y||(l?l(w,y):a(w[_])||f(w,_,M)),u(w,E,!0,!0),r&&(g[E]=M))),v&&d==C&&j&&j.name!==C&&(!r&&m?h(O,"name",C):(k=!0,L=function(){return j.call(this)})),d)if(T={values:D(C),keys:p?L:D(x),entries:D(I)},S)for(A in T)(b||k||!(A in O))&&f(O,A,T[A]);else n({target:e,proto:!0,forced:b||k},T);return r&&!S||O[_]===L||f(O,_,L,{name:d}),g[e]=L,T}},1488:function(t,e,i){var n=i(7545),r=i(4500),o=i(9207),a=i(2760).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});r(e,t)||a(e,t,{value:o.f(t)})}},69:function(t,e,i){var n=i(6192);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},7449:function(t,e,i){var n=i(8576),r=i(5744),o=n.document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},7365:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},2957:function(t){t.exports="object"==typeof window},9347:function(t,e,i){var n=i(8989),r=i(8576);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==r.Pebble},9536:function(t,e,i){var n=i(8989);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},224:function(t,e,i){var n=i(9272),r=i(8576);t.exports="process"==n(r.process)},5914:function(t,e,i){var n=i(8989);t.exports=/web0s(?!.*chrome)/i.test(n)},8989:function(t,e,i){var n=i(150);t.exports=n("navigator","userAgent")||""},4218:function(t,e,i){var n,r,o=i(8576),a=i(8989),s=o.process,c=o.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u?(n=u.split("."),r=n[0]<4?1:n[0]+n[1]):a&&(n=a.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/),n&&(r=n[1]))),t.exports=r&&+r},5607:function(t,e,i){var n=i(7545);t.exports=function(t){return n[t+"Prototype"]}},2952:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3085:function(t,e,i){"use strict";var n=i(8576),r=i(6447),o=i(5141).f,a=i(9245),s=i(7545),c=i(8043),l=i(8711),u=i(4500),h=function(t){var e=function(e,i,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var i,f,d,g,p,v,m,y,b,_=t.target,x=t.global,C=t.stat,I=t.proto,M=x?n:C?n[_]:(n[_]||{}).prototype,S=x?s:s[_]||l(s,_,{})[_],w=S.prototype;for(g in e)i=a(x?g:_+(C?".":"#")+g,t.forced),f=!i&&M&&u(M,g),v=S[g],f&&(t.noTargetGet?(b=o(M,g),m=b&&b.value):m=M[g]),p=f&&m?m:e[g],f&&typeof v===typeof p||(y=t.bind&&f?c(p,n):t.wrap&&f?h(p):I&&r(p)?c(Function.call,p):p,(t.sham||p&&p.sham||v&&v.sham)&&l(y,"sham",!0),l(S,g,y),I&&(d=_+"Prototype",u(s,d)||l(s,d,{}),l(s[d],g,p),t.real&&w&&!w[g]&&l(w,g,p)))}},6192:function(t){t.exports=function(t){try{return!!t()}catch(e){return!0}}},8043:function(t,e,i){var n=i(6235);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,r){return t.call(e,i,n,r)}}return function(){return t.apply(e,arguments)}}},6782:function(t,e,i){"use strict";var n=i(6235),r=i(5744),o=[].slice,a={},s=function(t,e,i){if(!(e in a)){for(var n=[],r=0;rd;d++)if(p=M(t[d]),p&&p instanceof u)return p;return new u(!1)}h=s(t,f)}v=h.next;while(!(m=v.call(h)).done){try{p=M(m.value)}catch(S){l(h,"throw",S)}if("object"==typeof p&&p&&p instanceof u)return p}return new u(!1)}},6639:function(t,e,i){var n=i(1138),r=i(5037);t.exports=function(t,e,i){var o,a;n(t);try{if(o=r(t,"return"),!o){if("throw"===e)throw i;return i}o=o.call(t)}catch(s){a=!0,o=s}if("throw"===e)throw i;if(a)throw o;return n(o),i}},4413:function(t,e,i){"use strict";var n,r,o,a=i(6192),s=i(6447),c=i(2853),l=i(9341),u=i(9482),h=i(8182),f=i(5546),d=h("iterator"),g=!1;[].keys&&(o=[].keys(),"next"in o?(r=l(l(o)),r!==Object.prototype&&(n=r)):g=!0);var p=void 0==n||a((function(){var t={};return n[d].call(t)!==t}));p?n={}:f&&(n=c(n)),s(n[d])||u(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},7771:function(t){t.exports={}},4104:function(t,e,i){var n=i(8445);t.exports=function(t){return n(t.length)}},2950:function(t,e,i){var n,r,o,a,s,c,l,u,h=i(8576),f=i(5141).f,d=i(7160).set,g=i(9536),p=i(9347),v=i(5914),m=i(224),y=h.MutationObserver||h.WebKitMutationObserver,b=h.document,_=h.process,x=h.Promise,C=f(h,"queueMicrotask"),I=C&&C.value;I||(n=function(){var t,e;m&&(t=_.domain)&&t.exit();while(r){e=r.fn,r=r.next;try{e()}catch(i){throw r?a():o=void 0,i}}o=void 0,t&&t.enter()},g||m||v||!y||!b?!p&&x&&x.resolve?(l=x.resolve(void 0),l.constructor=x,u=l.then,a=function(){u.call(l,n)}):a=m?function(){_.nextTick(n)}:function(){d.call(h,n)}:(s=!0,c=b.createTextNode(""),new y(n).observe(c,{characterData:!0}),a=function(){c.data=s=!s})),t.exports=I||function(t){var e={fn:t,next:void 0};o&&(o.next=e),r||(r=e,a()),o=e}},4471:function(t,e,i){var n=i(8576);t.exports=n.Promise},3045:function(t,e,i){var n=i(4218),r=i(6192);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4551:function(t,e,i){var n=i(6192),r=i(8182),o=i(5546),a=r("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,i="";return t.pathname="c%20d",e.forEach((function(t,n){e["delete"]("b"),i+=n+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},8921:function(t,e,i){var n=i(8576),r=i(6447),o=i(9516),a=n.WeakMap;t.exports=r(a)&&/native code/.test(o(a))},9438:function(t,e,i){"use strict";var n=i(6235),r=function(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw TypeError("Bad Promise constructor");e=t,i=n})),this.resolve=n(e),this.reject=n(i)};t.exports.f=function(t){return new r(t)}},15:function(t,e,i){var n=i(8576),r=i(6192),o=i(4845),a=i(4277).trim,s=i(1450),c=n.parseFloat,l=n.Symbol,u=l&&l.iterator,h=1/c(s+"-0")!==-1/0||u&&!r((function(){c(Object(u))}));t.exports=h?function(t){var e=a(o(t)),i=c(e);return 0===i&&"-"==e.charAt(0)?-0:i}:c},2558:function(t,e,i){var n=i(8576),r=i(6192),o=i(4845),a=i(4277).trim,s=i(1450),c=n.parseInt,l=n.Symbol,u=l&&l.iterator,h=/^[+-]?0[Xx]/,f=8!==c(s+"08")||22!==c(s+"0x16")||u&&!r((function(){c(Object(u))}));t.exports=f?function(t,e){var i=a(o(t));return c(i,e>>>0||(h.test(i)?16:10))}:c},2503:function(t,e,i){"use strict";var n=i(69),r=i(6192),o=i(7653),a=i(4750),s=i(6007),c=i(1795),l=i(2202),u=Object.assign,h=Object.defineProperty;t.exports=!u||r((function(){if(n&&1!==u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol(),r="abcdefghijklmnopqrst";return t[i]=7,r.split("").forEach((function(t){e[t]=t})),7!=u({},t)[i]||o(u({},e)).join("")!=r}))?function(t,e){var i=c(t),r=arguments.length,u=1,h=a.f,f=s.f;while(r>u){var d,g=l(arguments[u++]),p=h?o(g).concat(h(g)):o(g),v=p.length,m=0;while(v>m)d=p[m++],n&&!f.call(g,d)||(i[d]=g[d])}return i}:u},2853:function(t,e,i){var n,r=i(1138),o=i(1187),a=i(2952),s=i(4535),c=i(7403),l=i(7449),u=i(9766),h=">",f="<",d="prototype",g="script",p=u("IE_PROTO"),v=function(){},m=function(t){return f+g+h+t+f+"/"+g+h},y=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=l("iframe"),i="java"+g+":";return e.style.display="none",c.appendChild(e),e.src=String(i),t=e.contentWindow.document,t.open(),t.write(m("document.F=Object")),t.close(),t.F},_=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}_="undefined"!=typeof document?document.domain&&n?y(n):b():y(n);var t=a.length;while(t--)delete _[d][a[t]];return _()};s[p]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(v[d]=r(t),i=new v,v[d]=null,i[p]=t):i=_(),void 0===e?i:o(i,e)}},1187:function(t,e,i){var n=i(69),r=i(2760),o=i(1138),a=i(7653);t.exports=n?Object.defineProperties:function(t,e){o(t);var i,n=a(e),s=n.length,c=0;while(s>c)r.f(t,i=n[c++],e[i]);return t}},2760:function(t,e,i){var n=i(69),r=i(188),o=i(1138),a=i(77),s=Object.defineProperty;e.f=n?s:function(t,e,i){if(o(t),e=a(e),o(i),r)try{return s(t,e,i)}catch(n){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},5141:function(t,e,i){var n=i(69),r=i(6007),o=i(774),a=i(101),s=i(77),c=i(4500),l=i(188),u=Object.getOwnPropertyDescriptor;e.f=n?u:function(t,e){if(t=a(t),e=s(e),l)try{return u(t,e)}catch(i){}if(c(t,e))return o(!r.f.call(t,e),t[e])}},4052:function(t,e,i){var n=i(101),r=i(2092).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return r(t)}catch(e){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):r(n(t))}},2092:function(t,e,i){var n=i(7934),r=i(2952),o=r.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},4750:function(t,e){e.f=Object.getOwnPropertySymbols},9341:function(t,e,i){var n=i(4500),r=i(6447),o=i(1795),a=i(9766),s=i(4635),c=a("IE_PROTO"),l=Object.prototype;t.exports=s?Object.getPrototypeOf:function(t){var e=o(t);if(n(e,c))return e[c];var i=e.constructor;return r(i)&&e instanceof i?i.prototype:e instanceof Object?l:null}},7934:function(t,e,i){var n=i(4500),r=i(101),o=i(8180).indexOf,a=i(4535);t.exports=function(t,e){var i,s=r(t),c=0,l=[];for(i in s)!n(a,i)&&n(s,i)&&l.push(i);while(e.length>c)n(s,i=e[c++])&&(~o(l,i)||l.push(i));return l}},7653:function(t,e,i){var n=i(7934),r=i(2952);t.exports=Object.keys||function(t){return n(t,r)}},6007:function(t,e){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);e.f=r?function(t){var e=n(this,t);return!!e&&e.enumerable}:i},4469:function(t,e,i){var n=i(1138),r=i(7757);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(i,[]),e=i instanceof Array}catch(o){}return function(i,o){return n(i),r(o),e?t.call(i,o):i.__proto__=o,i}}():void 0)},158:function(t,e,i){"use strict";var n=i(3471),r=i(4696);t.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}},380:function(t,e,i){var n=i(6447),r=i(5744);t.exports=function(t,e){var i,o;if("string"===e&&n(i=t.toString)&&!r(o=i.call(t)))return o;if(n(i=t.valueOf)&&!r(o=i.call(t)))return o;if("string"!==e&&n(i=t.toString)&&!r(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},7545:function(t){t.exports={}},892:function(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},9126:function(t,e,i){var n=i(1138),r=i(5744),o=i(9438);t.exports=function(t,e){if(n(t),r(e)&&e.constructor===t)return e;var i=o.f(t),a=i.resolve;return a(e),i.promise}},533:function(t,e,i){var n=i(9482);t.exports=function(t,e,i){for(var r in e)i&&i.unsafe&&t[r]?t[r]=e[r]:n(t,r,e[r],i);return t}},9482:function(t,e,i){var n=i(8711);t.exports=function(t,e,i,r){r&&r.enumerable?t[e]=i:n(t,e,i)}},3209:function(t){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},7613:function(t,e,i){var n=i(8576);t.exports=function(t,e){try{Object.defineProperty(n,t,{value:e,configurable:!0,writable:!0})}catch(i){n[t]=e}return e}},3656:function(t,e,i){"use strict";var n=i(150),r=i(2760),o=i(8182),a=i(69),s=o("species");t.exports=function(t){var e=n(t),i=r.f;a&&e&&!e[s]&&i(e,s,{configurable:!0,get:function(){return this}})}},1284:function(t,e,i){var n=i(3471),r=i(2760).f,o=i(8711),a=i(4500),s=i(158),c=i(8182),l=c("toStringTag");t.exports=function(t,e,i,c){if(t){var u=i?t:t.prototype;a(u,l)||r(u,l,{configurable:!0,value:e}),c&&!n&&o(u,"toString",s)}}},9766:function(t,e,i){var n=i(8717),r=i(2759),o=n("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},6434:function(t,e,i){var n=i(8576),r=i(7613),o="__core-js_shared__",a=n[o]||r(o,{});t.exports=a},8717:function(t,e,i){var n=i(5546),r=i(6434);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.18.2",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},4743:function(t,e,i){var n=i(1138),r=i(1404),o=i(8182),a=o("species");t.exports=function(t,e){var i,o=n(t).constructor;return void 0===o||void 0==(i=n(o)[a])?e:r(i)}},863:function(t,e,i){var n=i(1941),r=i(4845),o=i(3209),a=function(t){return function(e,i){var a,s,c=r(o(e)),l=n(i),u=c.length;return l<0||l>=u?t?"":void 0:(a=c.charCodeAt(l),a<55296||a>56319||l+1===u||(s=c.charCodeAt(l+1))<56320||s>57343?t?c.charAt(l):a:t?c.slice(l,l+2):s-56320+(a-55296<<10)+65536)}};t.exports={codeAt:a(!1),charAt:a(!0)}},7977:function(t){"use strict";var e=2147483647,i=36,n=1,r=26,o=38,a=700,s=72,c=128,l="-",u=/[^\0-\u007E]/,h=/[.\u3002\uFF0E\uFF61]/g,f="Overflow: input needs wider integers to process",d=i-n,g=Math.floor,p=String.fromCharCode,v=function(t){var e=[],i=0,n=t.length;while(i=55296&&r<=56319&&i>1,t+=g(t/e);t>d*r>>1;s+=i)t=g(t/d);return g(s+(d+1)*t/(t+o))},b=function(t){var o=[];t=v(t);var a,u,h=t.length,d=c,b=0,_=s;for(a=0;a=d&&ug((e-b)/M))throw RangeError(f);for(b+=(I-d)*M,d=I,a=0;ae)throw RangeError(f);if(u==d){for(var S=b,w=i;;w+=i){var T=w<=_?n:w>=_+r?r:w-_;if(Sn)e.push(arguments[n++]);return x[++_]=function(){(c(t)?t:Function(t)).apply(void 0,e)},r(_),_},v=function(t){delete x[t]},g?r=function(t){m.nextTick(M(t))}:b&&b.now?r=function(t){b.now(M(t))}:y&&!d?(o=new y,a=o.port2,o.port1.onmessage=S,r=u(a.postMessage,a,1)):s.addEventListener&&c(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!l(w)?(r=w,s.addEventListener("message",S,!1)):r=C in f("script")?function(t){h.appendChild(f("script"))[C]=function(){h.removeChild(this),I(t)}}:function(t){setTimeout(M(t),0)}),t.exports={set:p,clear:v}},7739:function(t,e,i){var n=i(1941),r=Math.max,o=Math.min;t.exports=function(t,e){var i=n(t);return i<0?r(i+e,0):o(i,e)}},101:function(t,e,i){var n=i(2202),r=i(3209);t.exports=function(t){return n(r(t))}},1941:function(t){var e=Math.ceil,i=Math.floor;t.exports=function(t){var n=+t;return n!==n||0===n?0:(n>0?i:e)(n)}},8445:function(t,e,i){var n=i(1941),r=Math.min;t.exports=function(t){return t>0?r(n(t),9007199254740991):0}},1795:function(t,e,i){var n=i(3209);t.exports=function(t){return Object(n(t))}},7888:function(t,e,i){var n=i(5744),r=i(3236),o=i(5037),a=i(380),s=i(8182),c=s("toPrimitive");t.exports=function(t,e){if(!n(t)||r(t))return t;var i,s=o(t,c);if(s){if(void 0===e&&(e="default"),i=s.call(t,e),!n(i)||r(i))return i;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},77:function(t,e,i){var n=i(7888),r=i(3236);t.exports=function(t){var e=n(t,"string");return r(e)?e:String(e)}},3471:function(t,e,i){var n=i(8182),r=n("toStringTag"),o={};o[r]="z",t.exports="[object z]"===String(o)},4845:function(t,e,i){var n=i(4696);t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)}},9288:function(t){t.exports=function(t){try{return String(t)}catch(e){return"Object"}}},2759:function(t){var e=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+i).toString(36)}},615:function(t,e,i){var n=i(3045);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9207:function(t,e,i){var n=i(8182);e.f=n},8182:function(t,e,i){var n=i(8576),r=i(8717),o=i(4500),a=i(2759),s=i(3045),c=i(615),l=r("wks"),u=n.Symbol,h=c?u:u&&u.withoutSetter||a;t.exports=function(t){return o(l,t)&&(s||"string"==typeof l[t])||(s&&o(u,t)?l[t]=u[t]:l[t]=h("Symbol."+t)),l[t]}},1450:function(t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},4242:function(t,e,i){"use strict";var n=i(3085),r=i(9341),o=i(4469),a=i(2853),s=i(8711),c=i(774),l=i(273),u=i(3442),h=i(4845),f=function(t,e){var i=this,n=arguments.length>2?arguments[2]:void 0;if(!(i instanceof f))return new f(t,e,n);o&&(i=o(new Error(void 0),r(i))),void 0!==e&&s(i,"message",h(e)),l(i,n);var a=[];return u(t,a.push,{that:a}),s(i,"errors",a),i};f.prototype=a(Error.prototype,{constructor:c(5,f),message:c(5,""),name:c(5,"AggregateError")}),n({global:!0},{AggregateError:f})},9106:function(t,e,i){"use strict";var n=i(3085),r=i(6192),o=i(4770),a=i(5744),s=i(1795),c=i(4104),l=i(9361),u=i(1321),h=i(242),f=i(8182),d=i(4218),g=f("isConcatSpreadable"),p=9007199254740991,v="Maximum allowed index exceeded",m=d>=51||!r((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),y=h("concat"),b=function(t){if(!a(t))return!1;var e=t[g];return void 0!==e?!!e:o(t)},_=!m||!y;n({target:"Array",proto:!0,forced:_},{concat:function(t){var e,i,n,r,o,a=s(this),h=u(a,0),f=0;for(e=-1,n=arguments.length;ep)throw TypeError(v);for(i=0;i=p)throw TypeError(v);l(h,f++,o)}return h.length=f,h}})},1710:function(t,e,i){var n=i(3085),r=i(2724),o=i(7423);n({target:"Array",proto:!0},{fill:r}),o("fill")},3436:function(t,e,i){"use strict";var n=i(3085),r=i(454).filter,o=i(242),a=o("filter");n({target:"Array",proto:!0,forced:!a},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},9823:function(t,e,i){"use strict";var n=i(3085),r=i(7397);n({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},9173:function(t,e,i){var n=i(3085),r=i(841),o=i(9770),a=!o((function(t){Array.from(t)}));n({target:"Array",stat:!0,forced:a},{from:r})},2276:function(t,e,i){"use strict";var n=i(3085),r=i(8180).indexOf,o=i(424),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0,c=o("indexOf");n({target:"Array",proto:!0,forced:s||!c},{indexOf:function(t){return s?a.apply(this,arguments)||0:r(this,t,arguments.length>1?arguments[1]:void 0)}})},8118:function(t,e,i){var n=i(3085),r=i(4770);n({target:"Array",stat:!0},{isArray:r})},8939:function(t,e,i){"use strict";var n=i(101),r=i(7423),o=i(7771),a=i(3326),s=i(7218),c="Array Iterator",l=a.set,u=a.getterFor(c);t.exports=s(Array,"Array",(function(t,e){l(this,{type:c,target:n(t),index:0,kind:e})}),(function(){var t=u(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},3838:function(t,e,i){"use strict";var n=i(3085),r=i(454).map,o=i(242),a=o("map");n({target:"Array",proto:!0,forced:!a},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},5818:function(t,e,i){"use strict";var n=i(3085),r=i(4770),o=i(2091),a=i(5744),s=i(7739),c=i(4104),l=i(101),u=i(9361),h=i(8182),f=i(242),d=f("slice"),g=h("species"),p=[].slice,v=Math.max;n({target:"Array",proto:!0,forced:!d},{slice:function(t,e){var i,n,h,f=l(this),d=c(f),m=s(t,d),y=s(void 0===e?d:e,d);if(r(f)&&(i=f.constructor,o(i)&&(i===Array||r(i.prototype))?i=void 0:a(i)&&(i=i[g],null===i&&(i=void 0)),i===Array||void 0===i))return p.call(f,m,y);for(n=new(void 0===i?Array:i)(v(y-m,0)),h=0;mg)throw TypeError(p);for(u=c(y,n),h=0;hb-n+i;h--)delete y[h-1]}else if(i>n)for(h=b-n;h>_;h--)v=h+n-1,m=h+i-1,v in y?y[m]=y[v]:delete y[m];for(h=0;h=51&&/native code/.test(t))return!1;var i=new U((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))},r=i.constructor={};return r[z]=n,ot=i.then((function(){}))instanceof n,!ot||!e&&L&&!K})),st=at||!I((function(t){U.all(t)["catch"]((function(){}))})),ct=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},lt=function(t,e){if(!t.notified){t.notified=!0;var i=t.reactions;w((function(){var n=t.value,r=t.state==et,o=0;while(i.length>o){var a,s,c,l=i[o++],u=r?l.ok:l.fail,h=l.resolve,f=l.reject,d=l.domain;try{u?(r||(t.rejection===rt&&dt(t),t.rejection=nt),!0===u?a=n:(d&&d.enter(),a=u(n),d&&(d.exit(),c=!0)),a===l.promise?f(G("Promise-chain cycle")):(s=ct(a))?s.call(a,h,f):h(a)):f(n)}catch(g){d&&!c&&d.exit(),f(g)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&ht(t)}))}},ut=function(t,e,i){var n,r;Q?(n=X.createEvent("Event"),n.promise=e,n.reason=i,n.initEvent(t,!1,!0),l.dispatchEvent(n)):n={promise:e,reason:i},!K&&(r=l["on"+t])?r(n):t===q&&A("Unhandled promise rejection",i)},ht=function(t){S.call(l,(function(){var e,i=t.facade,n=t.value,r=ft(t);if(r&&(e=E((function(){N?Z.emit("unhandledRejection",n,i):ut(q,i,n)})),t.rejection=N||ft(t)?rt:nt,e.error))throw e.value}))},ft=function(t){return t.rejection!==nt&&!t.parent},dt=function(t){S.call(l,(function(){var e=t.facade;N?Z.emit("rejectionHandled",e):ut($,e,t.value)}))},gt=function(t,e,i){return function(n){t(e,n,i)}},pt=function(t,e,i){t.done||(t.done=!0,i&&(t=i),t.value=e,t.state=it,lt(t,!0))},vt=function(t,e,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===e)throw G("Promise can't be resolved itself");var n=ct(e);n?w((function(){var i={done:!1};try{n.call(e,gt(vt,i,t),gt(pt,i,t))}catch(r){pt(i,r,t)}})):(t.value=e,t.state=et,lt(t,!1))}catch(r){pt({done:!1},r,t)}}};if(at&&(U=function(t){_(this,U,R),m(t),n.call(this);var e=B(this);try{t(gt(vt,e),gt(pt,e))}catch(i){pt(e,i)}},W=U.prototype,n=function(t){F(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:tt,value:void 0})},n.prototype=d(W,{then:function(t,e){var i=Y(this),n=V(M(this,U));return n.ok=!y(t)||t,n.fail=y(e)&&e,n.domain=N?Z.domain:void 0,i.parent=!0,i.reactions.push(n),i.state!=tt&<(i,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new n,e=B(t);this.promise=t,this.resolve=gt(vt,e),this.reject=gt(pt,e)},D.f=V=function(t){return t===U||t===o?new r(t):J(t)},!c&&y(h)&&H!==Object.prototype)){a=H.then,ot||(f(H,"then",(function(t,e){var i=this;return new U((function(t,e){a.call(i,t,e)})).then(t,e)}),{unsafe:!0}),f(H,"catch",W["catch"],{unsafe:!0}));try{delete H.constructor}catch(mt){}g&&g(H,W)}s({global:!0,wrap:!0,forced:at},{Promise:U}),p(U,R,!1,!0),v(R),o=u(R),s({target:R,stat:!0,forced:at},{reject:function(t){var e=V(this);return e.reject.call(void 0,t),e.promise}}),s({target:R,stat:!0,forced:c||at},{resolve:function(t){return T(c&&this===o?U:this,t)}}),s({target:R,stat:!0,forced:st},{all:function(t){var e=this,i=V(e),n=i.resolve,r=i.reject,o=E((function(){var i=m(e.resolve),o=[],a=0,s=1;C(t,(function(t){var c=a++,l=!1;o.push(void 0),s++,i.call(e,t).then((function(t){l||(l=!0,o[c]=t,--s||n(o))}),r)})),--s||n(o)}));return o.error&&r(o.value),i.promise},race:function(t){var e=this,i=V(e),n=i.reject,r=E((function(){var r=m(e.resolve);C(t,(function(t){r.call(e,t).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}})},5397:function(t,e,i){var n=i(3085),r=i(150),o=i(1404),a=i(1138),s=i(5744),c=i(2853),l=i(6782),u=i(6192),h=r("Reflect","construct"),f=u((function(){function t(){}return!(h((function(){}),[],t)instanceof t)})),d=!u((function(){h((function(){}))})),g=f||d;n({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function(t,e){o(t),a(e);var i=arguments.length<3?t:o(arguments[2]);if(d&&!f)return h(t,e,i);if(t==i){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(l.apply(t,n))}var r=i.prototype,u=c(s(r)?r:Object.prototype),g=Function.apply.call(t,u,e);return s(g)?g:u}})},1367:function(){},5454:function(t,e,i){"use strict";var n=i(863).charAt,r=i(4845),o=i(3326),a=i(7218),s="String Iterator",c=o.set,l=o.getterFor(s);a(String,"String",(function(t){c(this,{type:s,string:r(t),index:0})}),(function(){var t,e=l(this),i=e.string,r=e.index;return r>=i.length?{value:void 0,done:!0}:(t=n(i,r),e.index+=t.length,{value:t,done:!1})}))},957:function(t,e,i){"use strict";var n=i(3085),r=i(4277).trim,o=i(6815);n({target:"String",proto:!0,forced:o("trim")},{trim:function(){return r(this)}})},9781:function(t,e,i){var n=i(1488);n("asyncIterator")},492:function(){},6681:function(t,e,i){var n=i(1488);n("hasInstance")},9594:function(t,e,i){var n=i(1488);n("isConcatSpreadable")},3665:function(t,e,i){var n=i(1488);n("iterator")},6187:function(t,e,i){"use strict";var n=i(3085),r=i(8576),o=i(150),a=i(5546),s=i(69),c=i(3045),l=i(6192),u=i(4500),h=i(4770),f=i(6447),d=i(5744),g=i(3236),p=i(1138),v=i(1795),m=i(101),y=i(77),b=i(4845),_=i(774),x=i(2853),C=i(7653),I=i(2092),M=i(4052),S=i(4750),w=i(5141),T=i(2760),A=i(6007),D=i(9482),E=i(8717),k=i(9766),O=i(4535),j=i(2759),L=i(8182),N=i(9207),P=i(1488),z=i(1284),R=i(3326),B=i(454).forEach,F=k("hidden"),Y="Symbol",H="prototype",U=L("toPrimitive"),W=R.set,G=R.getterFor(Y),X=Object[H],Z=r.Symbol,V=o("JSON","stringify"),J=w.f,Q=T.f,K=M.f,q=A.f,$=E("symbols"),tt=E("op-symbols"),et=E("string-to-symbol-registry"),it=E("symbol-to-string-registry"),nt=E("wks"),rt=r.QObject,ot=!rt||!rt[H]||!rt[H].findChild,at=s&&l((function(){return 7!=x(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?function(t,e,i){var n=J(X,e);n&&delete X[e],Q(t,e,i),n&&t!==X&&Q(X,e,n)}:Q,st=function(t,e){var i=$[t]=x(Z[H]);return W(i,{type:Y,tag:t,description:e}),s||(i.description=e),i},ct=function(t,e,i){t===X&&ct(tt,e,i),p(t);var n=y(e);return p(i),u($,n)?(i.enumerable?(u(t,F)&&t[F][n]&&(t[F][n]=!1),i=x(i,{enumerable:_(0,!1)})):(u(t,F)||Q(t,F,_(1,{})),t[F][n]=!0),at(t,n,i)):Q(t,n,i)},lt=function(t,e){p(t);var i=m(e),n=C(i).concat(gt(i));return B(n,(function(e){s&&!ht.call(i,e)||ct(t,e,i[e])})),t},ut=function(t,e){return void 0===e?x(t):lt(x(t),e)},ht=function(t){var e=y(t),i=q.call(this,e);return!(this===X&&u($,e)&&!u(tt,e))&&(!(i||!u(this,e)||!u($,e)||u(this,F)&&this[F][e])||i)},ft=function(t,e){var i=m(t),n=y(e);if(i!==X||!u($,n)||u(tt,n)){var r=J(i,n);return!r||!u($,n)||u(i,F)&&i[F][n]||(r.enumerable=!0),r}},dt=function(t){var e=K(m(t)),i=[];return B(e,(function(t){u($,t)||u(O,t)||i.push(t)})),i},gt=function(t){var e=t===X,i=K(e?tt:m(t)),n=[];return B(i,(function(t){!u($,t)||e&&!u(X,t)||n.push($[t])})),n};if(c||(Z=function(){if(this instanceof Z)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?b(arguments[0]):void 0,e=j(t),i=function(t){this===X&&i.call(tt,t),u(this,F)&&u(this[F],e)&&(this[F][e]=!1),at(this,e,_(1,t))};return s&&ot&&at(X,e,{configurable:!0,set:i}),st(e,t)},D(Z[H],"toString",(function(){return G(this).tag})),D(Z,"withoutSetter",(function(t){return st(j(t),t)})),A.f=ht,T.f=ct,w.f=ft,I.f=M.f=dt,S.f=gt,N.f=function(t){return st(L(t),t)},s&&(Q(Z[H],"description",{configurable:!0,get:function(){return G(this).description}}),a||D(X,"propertyIsEnumerable",ht,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:Z}),B(C(nt),(function(t){P(t)})),n({target:Y,stat:!0,forced:!c},{for:function(t){var e=b(t);if(u(et,e))return et[e];var i=Z(e);return et[e]=i,it[i]=e,i},keyFor:function(t){if(!g(t))throw TypeError(t+" is not a symbol");if(u(it,t))return it[t]},useSetter:function(){ot=!0},useSimple:function(){ot=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!s},{create:ut,defineProperty:ct,defineProperties:lt,getOwnPropertyDescriptor:ft}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:dt,getOwnPropertySymbols:gt}),n({target:"Object",stat:!0,forced:l((function(){S.f(1)}))},{getOwnPropertySymbols:function(t){return S.f(v(t))}}),V){var pt=!c||l((function(){var t=Z();return"[null]"!=V([t])||"{}"!=V({a:t})||"{}"!=V(Object(t))}));n({target:"JSON",stat:!0,forced:pt},{stringify:function(t,e,i){var n,r=[t],o=1;while(arguments.length>o)r.push(arguments[o++]);if(n=e,(d(e)||void 0!==t)&&!g(t))return h(e)||(e=function(t,e){if(f(n)&&(e=n.call(this,t,e)),!g(e))return e}),r[1]=e,V.apply(null,r)}})}if(!Z[H][U]){var vt=Z[H].valueOf;D(Z[H],U,(function(){return vt.apply(this,arguments)}))}z(Z,Y),O[F]=!0},1250:function(t,e,i){var n=i(1488);n("matchAll")},9017:function(t,e,i){var n=i(1488);n("match")},9786:function(t,e,i){var n=i(1488);n("replace")},503:function(t,e,i){var n=i(1488);n("search")},6565:function(t,e,i){var n=i(1488);n("species")},9322:function(t,e,i){var n=i(1488);n("split")},3610:function(t,e,i){var n=i(1488);n("toPrimitive")},6886:function(t,e,i){var n=i(1488);n("toStringTag")},3514:function(t,e,i){var n=i(1488);n("unscopables")},177:function(t,e,i){var n=i(1488);n("asyncDispose")},9031:function(t,e,i){var n=i(1488);n("dispose")},6658:function(t,e,i){var n=i(1488);n("matcher")},1875:function(t,e,i){var n=i(1488);n("metadata")},8658:function(t,e,i){var n=i(1488);n("observable")},4592:function(t,e,i){var n=i(1488);n("patternMatch")},6680:function(t,e,i){var n=i(1488);n("replaceAll")},162:function(t,e,i){i(8939);var n=i(7365),r=i(8576),o=i(4696),a=i(8711),s=i(7771),c=i(8182),l=c("toStringTag");for(var u in n){var h=r[u],f=h&&h.prototype;f&&o(f)!==l&&a(f,l,u),s[u]=s.Array}},2906:function(t,e,i){var n=i(3085),r=i(8576),o=i(6447),a=i(8989),s=[].slice,c=/MSIE .\./.test(a),l=function(t){return function(e,i){var n=arguments.length>2,r=n?s.call(arguments,2):void 0;return t(n?function(){(o(e)?e:Function(e)).apply(this,r)}:e,i)}};n({global:!0,bind:!0,forced:c},{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},9336:function(t,e,i){"use strict";i(8939);var n=i(3085),r=i(150),o=i(4551),a=i(9482),s=i(533),c=i(1284),l=i(5148),u=i(3326),h=i(6961),f=i(6447),d=i(4500),g=i(8043),p=i(4696),v=i(1138),m=i(5744),y=i(4845),b=i(2853),_=i(774),x=i(1669),C=i(8703),I=i(8182),M=r("fetch"),S=r("Request"),w=S&&S.prototype,T=r("Headers"),A=I("iterator"),D="URLSearchParams",E=D+"Iterator",k=u.set,O=u.getterFor(D),j=u.getterFor(E),L=/\+/g,N=Array(4),P=function(t){return N[t-1]||(N[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},z=function(t){try{return decodeURIComponent(t)}catch(e){return t}},R=function(t){var e=t.replace(L," "),i=4;try{return decodeURIComponent(e)}catch(n){while(i)e=e.replace(P(i--),z);return e}},B=/[!'()~]|%20/g,F={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Y=function(t){return F[t]},H=function(t){return encodeURIComponent(t).replace(B,Y)},U=function(t,e){if(e){var i,n,r=e.split("&"),o=0;while(o0?arguments[0]:void 0,u=this,f=[];if(k(u,{type:D,entries:f,updateURL:function(){},updateSearchParams:W}),void 0!==l)if(m(l))if(t=C(l),t){e=x(l,t),i=e.next;while(!(n=i.call(e)).done){if(r=x(v(n.value)),o=r.next,(a=o.call(r)).done||(s=o.call(r)).done||!o.call(r).done)throw TypeError("Expected sequence with length 2");f.push({key:y(a.value),value:y(s.value)})}}else for(c in l)d(l,c)&&f.push({key:c,value:y(l[c])});else U(f,"string"===typeof l?"?"===l.charAt(0)?l.slice(1):l:y(l))},V=Z.prototype;if(s(V,{append:function(t,e){G(arguments.length,2);var i=O(this);i.entries.push({key:y(t),value:y(e)}),i.updateURL()},delete:function(t){G(arguments.length,1);var e=O(this),i=e.entries,n=y(t),r=0;while(rt.key){r.splice(e,0,t);break}e===i&&r.push(t)}n.updateURL()},forEach:function(t){var e,i=O(this).entries,n=g(t,arguments.length>1?arguments[1]:void 0,3),r=0;while(r1?J(arguments[1]):{})}}),f(S)){var Q=function(t){return h(this,Q,"Request"),new S(t,arguments.length>1?J(arguments[1]):{})};w.constructor=Q,Q.prototype=w,n({global:!0,forced:!0},{Request:Q})}}t.exports={URLSearchParams:Z,getState:O}},4948:function(t,e,i){"use strict";i(5454);var n,r=i(3085),o=i(69),a=i(4551),s=i(8576),c=i(1187),l=i(9482),u=i(6961),h=i(4500),f=i(2503),d=i(841),g=i(863).codeAt,p=i(7977),v=i(4845),m=i(1284),y=i(9336),b=i(3326),_=s.URL,x=y.URLSearchParams,C=y.getState,I=b.set,M=b.getterFor("URL"),S=Math.floor,w=Math.pow,T="Invalid authority",A="Invalid scheme",D="Invalid host",E="Invalid port",k=/[A-Za-z]/,O=/[\d+-.A-Za-z]/,j=/\d/,L=/^0x/i,N=/^[0-7]+$/,P=/^\d+$/,z=/^[\dA-Fa-f]+$/,R=/[\0\t\n\r #%/:<>?@[\\\]^|]/,B=/[\0\t\n\r #/:<>?@[\\\]^|]/,F=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Y=/[\t\n\r]/g,H=function(t,e){var i,n,r;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return D;if(i=W(e.slice(1,-1)),!i)return D;t.host=i}else if($(t)){if(e=p(e),R.test(e))return D;if(i=U(e),null===i)return D;t.host=i}else{if(B.test(e))return D;for(i="",n=d(e),r=0;r4)return t;for(i=[],n=0;n1&&"0"==r.charAt(0)&&(o=L.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)a=0;else{if(!(10==o?P:8==o?N:z).test(r))return t;a=parseInt(r,o)}i.push(a)}for(n=0;n=w(256,5-e))return null}else if(a>255)return null;for(s=i.pop(),n=0;n6)return;n=0;while(f()){if(r=null,n>0){if(!("."==f()&&n<4))return;h++}if(!j.test(f()))return;while(j.test(f())){if(o=parseInt(f(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;h++}c[l]=256*c[l]+r,n++,2!=n&&4!=n||l++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;c[l++]=e}else{if(null!==u)return;h++,l++,u=l}}if(null!==u){a=l-u,l=7;while(0!=l&&a>0)s=c[l],c[l--]=c[u+a-1],c[u+--a]=s}else if(8!=l)return;return c},G=function(t){for(var e=null,i=1,n=null,r=0,o=0;o<8;o++)0!==t[o]?(r>i&&(e=n,i=r),n=null,r=0):(null===n&&(n=o),++r);return r>i&&(e=n,i=r),e},X=function(t){var e,i,n,r;if("number"==typeof t){for(e=[],i=0;i<4;i++)e.unshift(t%256),t=S(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=G(t),i=0;i<8;i++)r&&0===t[i]||(r&&(r=!1),n===i?(e+=i?":":"::",r=!0):(e+=t[i].toString(16),i<7&&(e+=":")));return"["+e+"]"}return t},Z={},V=f({},Z,{" ":1,'"':1,"<":1,">":1,"`":1}),J=f({},V,{"#":1,"?":1,"{":1,"}":1}),Q=f({},J,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),K=function(t,e){var i=g(t,0);return i>32&&i<127&&!h(e,t)?t:encodeURIComponent(t)},q={ftp:21,file:null,http:80,https:443,ws:80,wss:443},$=function(t){return h(q,t.scheme)},tt=function(t){return""!=t.username||""!=t.password},et=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},it=function(t,e){var i;return 2==t.length&&k.test(t.charAt(0))&&(":"==(i=t.charAt(1))||!e&&"|"==i)},nt=function(t){var e;return t.length>1&&it(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},rt=function(t){var e=t.path,i=e.length;!i||"file"==t.scheme&&1==i&&it(e[0],!0)||e.pop()},ot=function(t){return"."===t||"%2e"===t.toLowerCase()},at=function(t){return t=t.toLowerCase(),".."===t||"%2e."===t||".%2e"===t||"%2e%2e"===t},st={},ct={},lt={},ut={},ht={},ft={},dt={},gt={},pt={},vt={},mt={},yt={},bt={},_t={},xt={},Ct={},It={},Mt={},St={},wt={},Tt={},At=function(t,e,i,r){var o,a,s,c,l=i||st,u=0,f="",g=!1,p=!1,v=!1;i||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(F,"")),e=e.replace(Y,""),o=d(e);while(u<=o.length){switch(a=o[u],l){case st:if(!a||!k.test(a)){if(i)return A;l=lt;continue}f+=a.toLowerCase(),l=ct;break;case ct:if(a&&(O.test(a)||"+"==a||"-"==a||"."==a))f+=a.toLowerCase();else{if(":"!=a){if(i)return A;f="",l=lt,u=0;continue}if(i&&($(t)!=h(q,f)||"file"==f&&(tt(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=f,i)return void($(t)&&q[t.scheme]==t.port&&(t.port=null));f="","file"==t.scheme?l=_t:$(t)&&r&&r.scheme==t.scheme?l=ut:$(t)?l=gt:"/"==o[u+1]?(l=ht,u++):(t.cannotBeABaseURL=!0,t.path.push(""),l=St)}break;case lt:if(!r||r.cannotBeABaseURL&&"#"!=a)return A;if(r.cannotBeABaseURL&&"#"==a){t.scheme=r.scheme,t.path=r.path.slice(),t.query=r.query,t.fragment="",t.cannotBeABaseURL=!0,l=Tt;break}l="file"==r.scheme?_t:ft;continue;case ut:if("/"!=a||"/"!=o[u+1]){l=ft;continue}l=pt,u++;break;case ht:if("/"==a){l=vt;break}l=Mt;continue;case ft:if(t.scheme=r.scheme,a==n)t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query=r.query;else if("/"==a||"\\"==a&&$(t))l=dt;else if("?"==a)t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query="",l=wt;else{if("#"!=a){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.path.pop(),l=Mt;continue}t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query=r.query,t.fragment="",l=Tt}break;case dt:if(!$(t)||"/"!=a&&"\\"!=a){if("/"!=a){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,l=Mt;continue}l=vt}else l=pt;break;case gt:if(l=pt,"/"!=a||"/"!=f.charAt(u+1))continue;u++;break;case pt:if("/"!=a&&"\\"!=a){l=vt;continue}break;case vt:if("@"==a){g&&(f="%40"+f),g=!0,s=d(f);for(var m=0;m65535)return E;t.port=$(t)&&_===q[t.scheme]?null:_,f=""}if(i)return;l=It;continue}return E}f+=a;break;case _t:if(t.scheme="file","/"==a||"\\"==a)l=xt;else{if(!r||"file"!=r.scheme){l=Mt;continue}if(a==n)t.host=r.host,t.path=r.path.slice(),t.query=r.query;else if("?"==a)t.host=r.host,t.path=r.path.slice(),t.query="",l=wt;else{if("#"!=a){nt(o.slice(u).join(""))||(t.host=r.host,t.path=r.path.slice(),rt(t)),l=Mt;continue}t.host=r.host,t.path=r.path.slice(),t.query=r.query,t.fragment="",l=Tt}}break;case xt:if("/"==a||"\\"==a){l=Ct;break}r&&"file"==r.scheme&&!nt(o.slice(u).join(""))&&(it(r.path[0],!0)?t.path.push(r.path[0]):t.host=r.host),l=Mt;continue;case Ct:if(a==n||"/"==a||"\\"==a||"?"==a||"#"==a){if(!i&&it(f))l=Mt;else if(""==f){if(t.host="",i)return;l=It}else{if(c=H(t,f),c)return c;if("localhost"==t.host&&(t.host=""),i)return;f="",l=It}continue}f+=a;break;case It:if($(t)){if(l=Mt,"/"!=a&&"\\"!=a)continue}else if(i||"?"!=a)if(i||"#"!=a){if(a!=n&&(l=Mt,"/"!=a))continue}else t.fragment="",l=Tt;else t.query="",l=wt;break;case Mt:if(a==n||"/"==a||"\\"==a&&$(t)||!i&&("?"==a||"#"==a)){if(at(f)?(rt(t),"/"==a||"\\"==a&&$(t)||t.path.push("")):ot(f)?"/"==a||"\\"==a&&$(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&it(f)&&(t.host&&(t.host=""),f=f.charAt(0)+":"),t.path.push(f)),f="","file"==t.scheme&&(a==n||"?"==a||"#"==a))while(t.path.length>1&&""===t.path[0])t.path.shift();"?"==a?(t.query="",l=wt):"#"==a&&(t.fragment="",l=Tt)}else f+=K(a,J);break;case St:"?"==a?(t.query="",l=wt):"#"==a?(t.fragment="",l=Tt):a!=n&&(t.path[0]+=K(a,Z));break;case wt:i||"#"!=a?a!=n&&("'"==a&&$(t)?t.query+="%27":t.query+="#"==a?"%23":K(a,Z)):(t.fragment="",l=Tt);break;case Tt:a!=n&&(t.fragment+=K(a,V));break}u++}},Dt=function(t){var e,i,n=u(this,Dt,"URL"),r=arguments.length>1?arguments[1]:void 0,a=v(t),s=I(n,{type:"URL"});if(void 0!==r)if(r instanceof Dt)e=M(r);else if(i=At(e={},v(r)),i)throw TypeError(i);if(i=At(s,a,null,e),i)throw TypeError(i);var c=s.searchParams=new x,l=C(c);l.updateSearchParams(s.query),l.updateURL=function(){s.query=String(c)||null},o||(n.href=kt.call(n),n.origin=Ot.call(n),n.protocol=jt.call(n),n.username=Lt.call(n),n.password=Nt.call(n),n.host=Pt.call(n),n.hostname=zt.call(n),n.port=Rt.call(n),n.pathname=Bt.call(n),n.search=Ft.call(n),n.searchParams=Yt.call(n),n.hash=Ht.call(n))},Et=Dt.prototype,kt=function(){var t=M(this),e=t.scheme,i=t.username,n=t.password,r=t.host,o=t.port,a=t.path,s=t.query,c=t.fragment,l=e+":";return null!==r?(l+="//",tt(t)&&(l+=i+(n?":"+n:"")+"@"),l+=X(r),null!==o&&(l+=":"+o)):"file"==e&&(l+="//"),l+=t.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(l+="?"+s),null!==c&&(l+="#"+c),l},Ot=function(){var t=M(this),e=t.scheme,i=t.port;if("blob"==e)try{return new Dt(e.path[0]).origin}catch(n){return"null"}return"file"!=e&&$(t)?e+"://"+X(t.host)+(null!==i?":"+i:""):"null"},jt=function(){return M(this).scheme+":"},Lt=function(){return M(this).username},Nt=function(){return M(this).password},Pt=function(){var t=M(this),e=t.host,i=t.port;return null===e?"":null===i?X(e):X(e)+":"+i},zt=function(){var t=M(this).host;return null===t?"":X(t)},Rt=function(){var t=M(this).port;return null===t?"":String(t)},Bt=function(){var t=M(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},Ft=function(){var t=M(this).query;return t?"?"+t:""},Yt=function(){return M(this).searchParams},Ht=function(){var t=M(this).fragment;return t?"#"+t:""},Ut=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(o&&c(Et,{href:Ut(kt,(function(t){var e=M(this),i=v(t),n=At(e,i);if(n)throw TypeError(n);C(e.searchParams).updateSearchParams(e.query)})),origin:Ut(Ot),protocol:Ut(jt,(function(t){var e=M(this);At(e,v(t)+":",st)})),username:Ut(Lt,(function(t){var e=M(this),i=d(v(t));if(!et(e)){e.username="";for(var n=0;nt.length)&&(e=t.length);for(var i=0,n=new Array(e);ii){var n=[i,e];e=n[0],i=n[1]}return Vt(e,Zt(t,i))}function te(){for(var t={},e=arguments.length,i=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."===i.charAt(0)?N()(e=".".concat(Xt).concat(n)).call(e,h()(i).call(i,1)):N()(t="".concat(Xt).concat(n)).call(t,i)}function de(t,e){var i=e.originX,n=e.originY,r=t.getPointByOrigin(i,n),o=r.x,a=r.y;t.set({left:o,top:a,originX:i,originY:n}),t.setCoords()}function ge(t){var e,i={};return st()(e=q()(t)).call(e,(function(e){i[t[e]]=e})),i}function pe(t,e){t.customProps=t.customProps||{},H()(t.customProps,e)}function ve(t,e){var i={};return Q()(e)&&(e=[e]),X()(e,(function(e){i[e]=t.customProps[e]})),i}function me(t){return t.charAt(0).toUpperCase()+h()(t).call(t,1)}function ye(t,e){return n()(t).call(t,e)>=0}function be(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return dt()(t,"type")||_t.COLOR}function _e(t){var e=lt()(t),i=void 0===e?{}:e;return i.source?_t.FILTER:_t.COLOR}function xe(t){return pt()(t.get("type"),xt)>=0}function Ce(t){if(ye(xt,t))return"Shape";switch(t){case"i-text":return"Text";case"path":case"line":return"Draw";case"activeSelection":return"Group";default:return Te(t)}}function Ie(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.useAlpha,r=void 0===n||n,o=i.mode,a=It.VINTAGE,s=It.REMOVE_COLOR,c=It.BLEND_COLOR,l=It.SEPIA2,u=It.COLOR_FILTER,h=It.REMOVE_WHITE,f=It.BLEND;switch(t){case a:e=l;break;case s:e=r?u:h;break;case c:e="add"===o?f:o;break;default:e=t}return Te(e)}function Me(t){var e=Tt.LOAD_IMAGE;return"string"===typeof t?e===t:e===t.name}function Se(t){var e,i,n,r=Tt.FLIP_IMAGE,o=Tt.ROTATE_IMAGE,a=Tt.ADD_TEXT,s=Tt.APPLY_FILTER,c=Tt.REMOVE_FILTER,l=Tt.CHANGE_SHAPE,u=Tt.CHANGE_ICON_COLOR,f=Tt.CHANGE_TEXT_STYLE,d=Tt.CLEAR_OBJECTS,g=Tt.ADD_IMAGE_OBJECT,p=Tt.REMOVE_OBJECT,v=Tt.RESIZE_IMAGE,m=t.name,y=t.args;switch(m){case r:n={name:m,detail:"reset"===y[1]?y[1]:h()(e=y[1]).call(e,4)};break;case o:n={name:m,detail:y[2]};break;case s:n={name:Et.APPLY_FILTER,detail:Ie(y[1],y[2])};break;case c:n={name:Et.REMOVE_FILTER,detail:"Remove"};break;case l:n={name:Et.CHANGE_SHAPE,detail:"Change"};break;case u:n={name:Et.CHANGE_ICON_COLOR,detail:"Change"};break;case f:n={name:Et.CHANGE_TEXT_STYLE,detail:"Change"};break;case p:n={name:Et.REMOVE_OBJECT,detail:y[2]};break;case d:n={name:Et.CLEAR_OBJECTS,detail:"All"};break;case g:n={name:Et.ADD_IMAGE_OBJECT,detail:"Add"};break;case a:n={name:Et.ADD_TEXT};break;case v:n={name:Et.RESIZE,detail:N()(i="".concat(~~y[1].width,"x")).call(i,~~y[1].height)};break;default:n={name:m};break}return"mask"===y[1]&&(n={name:Et.LOAD_MASK_IMAGE,detail:"Apply"}),n}function we(t){return"top"===t?"bottom":"left"===t?"right":"right"===t?"left":"top"}function Te(t){return t.replace(/[a-z]/,(function(t){return t.toUpperCase()}))}function Ae(t){var e=t.left,i=t.top,n=t.width,r=t.height,o=Ut.LEFT,a=Ut.TOP,s=Ut.WIDTH,c=Ut.HEIGHT;return e===o&&i===a&&n===s&&r===c}var De=te("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),Ee={UN_IMPLEMENTATION:"Should implement a method: ",NO_COMPONENT_NAME:"Should set a component name"},ke={UN_IMPLEMENTATION:function(t){return Ee.UN_IMPLEMENTATION+t},NO_COMPONENT_NAME:function(){return Ee.NO_COMPONENT_NAME}},Oe={types:H()({},De),create:function(t){t=t.toLowerCase();for(var e=ke[t],i=arguments.length,n=new Array(i>1?i-1:0),r=1;r0}},{key:"setUndoData",value:function(t,e,i){return e&&(t=e),i?e||(e=t):(H()(this.undoData,t),e=null),e}},{key:"setExecuteCallback",value:function(t){return this.executeCallback=t,this}},{key:"setUndoCallback",value:function(t){return this.undoCallback=t,this}}]),t}(),Pe=Ne,ze={};function Re(t){var e=ze[t];if(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r1&&void 0!==arguments[1]&&arguments[1];this.lock();var n=t.args;return n||(n=[]),t.execute.apply(t,w(n)).then((function(n){return e._isSilent||(e.pushUndoStack(t),e.fire(i?At.AFTER_REDO:At.EXECUTE_COMMAND,t)),e.unlock(),qt(t.executeCallback)&&t.executeCallback(n),n}))["catch"]((function(t){return e.unlock(),z().reject(t)}))}},{key:"_invokeUndo",value:function(t){var e=this;this.lock();var i=t.args;return i||(i=[]),t.undo.apply(t,w(i)).then((function(i){return e.pushRedoStack(t),e.fire(At.AFTER_UNDO,t),e.unlock(),qt(t.undoCallback)&&t.undoCallback(i),i}))["catch"]((function(t){return e.unlock(),z().reject(t)}))}},{key:"_fireRedoStackChanged",value:function(){this.fire(At.REDO_STACK_CHANGED,this._redoStack.length)}},{key:"_fireUndoStackChanged",value:function(){this.fire(At.UNDO_STACK_CHANGED,this._undoStack.length)}},{key:"lock",value:function(){this._isLocked=!0}},{key:"unlock",value:function(){this._isLocked=!1}},{key:"executeSilent",value:function(){var t=this;this._isSilent=!0;for(var e=arguments.length,i=new Array(e),n=0;n\n
\n \n
\n
\n ')).call(r,c.localize("Load"),'\n \n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n')},Xe=function(t){var e,i,n,r,o,a=t.locale,s=t.biImage,c=t.loadButtonStyle,l=t.downloadButtonStyle,u=t.menuBarPosition;return N()(e=N()(i=N()(n=N()(r=N()(o='\n
    \n
    \n \n
      \n\n
      \n
      \n ')).call(n,a.localize("Load"),'\n \n
      \n \n
      \n
      \n")},Ze=r(899),Ve=r.n(Ze),Je=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y,b,_,x,C,I,M,S,w,T,A,D,E=t.subMenuLabelActive,k=t.subMenuLabelNormal,O=t.subMenuRangeTitle,j=t.submenuPartitionVertical,L=t.submenuPartitionHorizontal,P=t.submenuCheckbox,z=t.submenuRangePointer,R=t.submenuRangeValue,B=t.submenuColorpickerTitle,F=t.submenuColorpickerButton,Y=t.submenuRangeBar,H=t.submenuRangeSubbar,U=t.submenuDisabledRangePointer,W=t.submenuDisabledRangeBar,G=t.submenuDisabledRangeSubbar,X=t.submenuIconSize,Z=t.menuIconSize,V=t.biSize,J=t.menuIconStyle,Q=t.submenuIconStyle;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v=N()(m=N()(y=N()(b=N()(_=N()(x=N()(C=N()(I=N()(M=N()(S=N()(w=N()(T=N()(A=N()(D='\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-resize-button .tui-image-editor-button.apply.active label,\n .tie-resize-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.tie-text-align-left .tui-image-editor-button.left label,\n .tie-text-align-button.tie-text-align-center .tui-image-editor-button.center label,\n .tie-text-align-button.tie-text-align-right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n '.concat(E,"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n ")).call(D,k,"\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n ")).call(A,O,"\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n ")).call(T,j,"\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 ")).call(w,L,"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n ")).call(S,P,"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n ")).call(M,z,"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n ")).call(I,Y,"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n ")).call(C,H,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n ")).call(x,U,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n ")).call(_,G,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n ")).call(b,W,"\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n ")).call(y,R,"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n ")).call(m,B,"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n ")).call(v,F,"\n }\n .tui-image-editor-container .svg_ic-menu {\n ")).call(p,Z,"\n }\n .tui-image-editor-container .svg_ic-submenu {\n ")).call(g,X,"\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n ")).call(d,V,"\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: ")).call(f,J.normal.color,";\n stroke: ")).call(h,J.normal.color,";\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: ")).call(u,J.active.color,";\n stroke: ")).call(l,J.active.color,";\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: ")).call(c,J.hover.color,";\n stroke: ")).call(s,J.hover.color,";\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: ")).call(a,J.disabled.color,";\n stroke: ")).call(o,J.disabled.color,";\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: ")).call(r,Q.normal.color,";\n stroke: ")).call(n,Q.normal.color,";\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: ")).call(i,Q.active.color,";\n stroke: ")).call(e,Q.active.color,";\n }\n")},Qe={"common.bi.image":"https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png","common.bisize.width":"251px","common.bisize.height":"21px","common.backgroundImage":"none","common.backgroundColor":"#1e1e1e","common.border":"0px","header.backgroundImage":"none","header.backgroundColor":"transparent","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"'Noto Sans', sans-serif","loadButton.fontSize":"12px","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"'Noto Sans', sans-serif","downloadButton.fontSize":"12px","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#434343","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalLabel.color":"#8a8a8a","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"0px","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"},Ke=r(2534),qe=function(){function t(e){D(this,t),this.styles=this._changeToObject(H()({},Qe,e)),se(this._styleMaker()),this._loadDefaultSvgIcon()}return k(t,[{key:"getStyle",value:function(t){var e=null,i=t.replace(/\..+$/,""),n=this.styles[t];switch(t){case"common.bi":e=this.styles[t].image;break;case"menu.icon":e={active:this.styles["".concat(i,".activeIcon")],normal:this.styles["".concat(i,".normalIcon")],hover:this.styles["".concat(i,".hoverIcon")],disabled:this.styles["".concat(i,".disabledIcon")]};break;case"submenu.icon":e={active:this.styles["".concat(i,".activeIcon")],normal:this.styles["".concat(i,".normalIcon")]};break;case"submenu.label":e={active:this._makeCssText(this.styles["".concat(i,".activeLabel")]),normal:this._makeCssText(this.styles["".concat(i,".normalLabel")])};break;case"submenu.partition":e={vertical:this._makeCssText(H()({},n,{borderLeft:"1px solid ".concat(n.color)})),horizontal:this._makeCssText(H()({},n,{borderBottom:"1px solid ".concat(n.color)}))};break;case"range.disabledPointer":case"range.disabledBar":case"range.disabledSubbar":case"range.pointer":case"range.bar":case"range.subbar":n.backgroundColor=n.color,e=this._makeCssText(n);break;default:e=this._makeCssText(n);break}return e}},{key:"_styleMaker",value:function(){var t=this.getStyle("submenu.label"),e=this.getStyle("submenu.partition");return Je({subMenuLabelActive:t.active,subMenuLabelNormal:t.normal,submenuPartitionVertical:e.vertical,submenuPartitionHorizontal:e.horizontal,biSize:this.getStyle("common.bisize"),subMenuRangeTitle:this.getStyle("range.title"),submenuRangePointer:this.getStyle("range.pointer"),submenuRangeBar:this.getStyle("range.bar"),submenuRangeSubbar:this.getStyle("range.subbar"),submenuDisabledRangePointer:this.getStyle("range.disabledPointer"),submenuDisabledRangeBar:this.getStyle("range.disabledBar"),submenuDisabledRangeSubbar:this.getStyle("range.disabledSubbar"),submenuRangeValue:this.getStyle("range.value"),submenuColorpickerTitle:this.getStyle("colorpicker.title"),submenuColorpickerButton:this.getStyle("colorpicker.button"),submenuCheckbox:this.getStyle("checkbox"),menuIconSize:this.getStyle("menu.iconSize"),submenuIconSize:this.getStyle("submenu.iconSize"),menuIconStyle:this.getStyle("menu.icon"),submenuIconStyle:this.getStyle("submenu.icon")})}},{key:"_changeToObject",value:function(t){var e={};return X()(t,(function(t,i){var n=i.match(/^(.+)\.([a-z]+)$/i),r=it(n,3),o=r[1],a=r[2];e[o]||(e[o]={}),e[o][a]=t})),e}},{key:"_makeCssText",value:function(t){var e=this,i=[];return X()(t,(function(t,r){var o,a;n()(o=["backgroundImage"]).call(o,r)>-1&&"none"!==t&&(t="url(".concat(t,")")),i.push(N()(a="".concat(e._toUnderScore(r),": ")).call(a,t))})),i.join(";")}},{key:"_toUnderScore",value:function(t){return t.replace(/([A-Z])/g,(function(t,e){return"-".concat(e.toLowerCase())}))}},{key:"_loadDefaultSvgIcon",value:function(){if(!document.getElementById("tui-image-editor-svg-default-icons")){var t=new DOMParser,e=Ke.replace(/data:image\/svg\+xml;base64,/,""),i=t.parseFromString(atob(e),"text/xml");document.body.appendChild(i.documentElement)}}},{key:"_makeIconClassName",value:function(t,e){var i=e?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),n=i[t],r=n.path,o=n.name;return r&&o?t:"".concat(t," use-default")}},{key:"_makeSvgIconPrefix",value:function(t,e){var i,n=e?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),r=n[t],o=r.path,a=r.name;return o&&a?N()(i="".concat(o,"#")).call(i,a,"-"):"#"}},{key:"_makeSvgItem",value:function(t,e,i){var n=this;return Ve()(t).call(t,(function(t){var r,o,a=n._makeSvgIconPrefix(t,i),s=n._toUnderScore(e),c=n._makeIconClassName(t,i);return N()(r=N()(o='')})).join("")}},{key:"makeMenSvgIconSet",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return N()(i='')).call(i,this._makeSvgItem(t,e,n),"")}}]),t}(),$e=qe,ti=r(9146),ei=r.n(ti),ii=r(6623),ni=r(4230);function ri(t,e){return ri=ni||function(t,e){return t.__proto__=e,t},ri(t,e)}function oi(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=ii(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ri(t,e)}var ai=r(3742);function si(t){return si="function"===typeof b&&"symbol"===typeof ai?function(t){return typeof t}:function(t){return t&&"function"===typeof b&&t.constructor===b&&t!==b.prototype?"symbol":typeof t},si(t)}function ci(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function li(t,e){if(e&&("object"===si(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ci(t)}var ui=r(9856);function hi(t){return hi=ni?ui:function(t){return t.__proto__||ui(t)},hi(t)}var fi=r(6092),di=r.n(fi),gi=r(4858),pi=r.n(gi),vi=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],mi=function(){function t(e,i){var n=i.defaultColor,r=void 0===n?"#7e7e7e":n,o=i.toggleDirection,a=void 0===o?"up":o,s=i.usageStatistics;D(this,t),this.colorpickerElement=e,this.usageStatistics=s,this._show=!1,this._colorpickerElement=e,this._toggleDirection=a,this._makePickerButtonElement(r),this._makePickerLayerElement(e,e.getAttribute("title")),this._color=r,this.picker=pi().create({container:this.pickerElement,preset:vi,color:r,usageStatistics:this.usageStatistics}),this._addEvent()}return k(t,[{key:"destroy",value:function(){var t=this;this._removeEvent(),this.picker.destroy(),this.colorpickerElement.innerHTML="",X()(this,(function(e,i){t[i]=null}))}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this._changeColorElement(t)}},{key:"_changeColorElement",value:function(t){t?(this.colorElement.classList.remove("transparent"),this.colorElement.style.backgroundColor=t):(this.colorElement.style.backgroundColor="#fff",this.colorElement.classList.add("transparent"))}},{key:"_makePickerButtonElement",value:function(t){this.colorpickerElement.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(t,e){var i=document.createElement("label"),n=document.createElement("div");this.pickerControl=document.createElement("div"),this.pickerControl.className="color-picker-control",this.pickerElement=document.createElement("div"),this.pickerElement.className="color-picker",i.innerHTML=e,n.className="triangle",this.pickerControl.appendChild(this.pickerElement),this.pickerControl.appendChild(n),t.appendChild(this.pickerControl),t.appendChild(this.colorElement),t.appendChild(i)}},{key:"_addEvent",value:function(){var t,e=this;this.picker.on("selectColor",(function(t){e._changeColorElement(t.color),e._color=t.color,e.fire("change",t.color)})),this.eventHandler={pickerToggle:j()(t=this._pickerToggleEventHandler).call(t,this),pickerHide:function(){return e.hide()}},this.colorpickerElement.addEventListener("click",this.eventHandler.pickerToggle),document.body.addEventListener("click",this.eventHandler.pickerHide)}},{key:"_removeEvent",value:function(){this.colorpickerElement.removeEventListener("click",this.eventHandler.pickerToggle),document.body.removeEventListener("click",this.eventHandler.pickerHide),this.picker.off()}},{key:"_pickerToggleEventHandler",value:function(t){var e=t.target,i=e&&this._isElementInColorPickerControl(e);(!i||i&&this._isPaletteButton(e))&&(this._show=!this._show,this.pickerControl.style.display=this._show?"block":"none",this._setPickerControlPosition(),this.fire("changeShow",this)),t.stopPropagation()}},{key:"_isPaletteButton",value:function(t){return"tui-colorpicker-palette-button"===t.className}},{key:"_isElementInColorPickerControl",value:function(t){var e=t;while(e!==document.body){if(!e)break;if(e===this.pickerControl)return!0;e=e.parentNode}return!1}},{key:"hide",value:function(){this._show=!1,this.pickerControl.style.display="none"}},{key:"_setPickerControlPosition",value:function(){var t=this.pickerControl.style,e=this._colorpickerElement.clientWidth/2+2,i=this.pickerControl.offsetWidth/2-e,n=-1*(this.pickerControl.offsetHeight+10);"down"===this._toggleDirection&&(n=30),t.top="".concat(n,"px"),t.left="-".concat(i,"px")}}]),t}();V().mixin(mi);var yi=mi,bi=/(-?)([0-9]*)[^0-9]*([0-9]*)/g,_i=function(){function t(e){var i,n,r,o,a,s,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};D(this,t),this._value=l.value||0,this.rangeElement=e.slider,this.rangeInputElement=e.input,this._drawRangeElement(),this.rangeWidth=this._getRangeWidth(),this._min=l.min||0,this._max=l.max||100,this._useDecimal=l.useDecimal,this._absMax=-1*this._min+this._max,this.realTimeEvent=l.realTimeEvent||!1,this._userInputTimer=null,this.eventHandler={startChangingSlide:j()(i=this._startChangingSlide).call(i,this),stopChangingSlide:j()(n=this._stopChangingSlide).call(n,this),changeSlide:j()(r=this._changeSlide).call(r,this),changeSlideFinally:j()(o=this._changeSlideFinally).call(o,this),changeInput:j()(a=this._changeInput).call(a,this),changeInputFinally:j()(s=this._changeValueWithInput).call(s,this,!0),changeInputWithArrow:j()(c=this._changeValueWithInputKeyEvent).call(c,this)},this._addClickEvent(),this._addDragEvent(),this._addInputEvent(),this.value=l.value,this.trigger("change")}return k(t,[{key:"destroy",value:function(){var t=this;this._removeClickEvent(),this._removeDragEvent(),this._removeInputEvent(),this.rangeElement.innerHTML="",X()(this,(function(e,i){t[i]=null}))}},{key:"max",get:function(){return this._max},set:function(t){this._max=t,this._absMax=-1*this._min+this._max,this.value=this._value}},{key:"min",get:function(){return this._min},set:function(t){this._min=t,this.max=this._max}},{key:"value",get:function(){return this._value},set:function(t){t=this._useDecimal?t:ie(t);var e=t-this._min,i=e*this.rangeWidth/this._absMax;this.rangeWidththis._max;if(!a){var s=$t(o,this._min,this.max);this.value=s,this.fire("change",s,!1)}}}},{key:"_valueUpDownForKeyEvent",value:function(t,e){var i=this._useDecimal?.1:1;return e===Lt.ARROW_UP?t+=i:e===Lt.ARROW_DOWN&&(t-=i),t}},{key:"_changeInput",value:function(t){var e=this;clearTimeout(this._userInputTimer);var i=t.keyCode;iLt.DIGIT_9?t.preventDefault():this._userInputTimer=p()((function(){e._inputSetValue(t.target.value)}),350)}},{key:"_inputSetValue",value:function(t){var e=this._useDecimal?Number(t):ie(t);e=$t(e,this._min,this.max),this.value=e,this.fire("change",e,!0)}},{key:"_changeValueWithInput",value:function(t,e){var i,r=e.keyCode,o=e.target;if(!(n()(i=[Lt.ARROW_UP,Lt.ARROW_DOWN]).call(i,r)>=0)){var a=this._filterForInputText(o.value),s=!a||isNaN(a);o.value=a,s||this._inputSetValue(a)}}},{key:"_addClickEvent",value:function(){this.rangeElement.addEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_removeClickEvent",value:function(){this.rangeElement.removeEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_addDragEvent",value:function(){this.pointer.addEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_removeDragEvent",value:function(){this.pointer.removeEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_changeSlide",value:function(t){var e=t.screenX,i=e-this.firstPosition,n=this.firstLeft+i;n=n>this.rangeWidth?this.rangeWidth:n,n=n<0?0:n,this.pointer.style.left="".concat(n,"px"),this.subbar.style.right="".concat(this.rangeWidth-n,"px");var r=n/this.rangeWidth,o=this._absMax*r+this._min,a=this._useDecimal?o:ie(o),s=this.value!==a;s&&(this.value=a,this.realTimeEvent&&this.fire("change",this._value,!1))}},{key:"_changeSlideFinally",value:function(t){if(t.stopPropagation(),"tui-image-editor-range"===t.target.className){var e=t.offsetX,i=e/this.rangeWidth,n=this._absMax*i+this._min;this.pointer.style.left="".concat(i*this.rangeWidth,"px"),this.subbar.style.right="".concat((1-i)*this.rangeWidth,"px"),this.value=n,this.fire("change",n,!0)}}},{key:"_startChangingSlide",value:function(t){this.firstPosition=t.screenX,this.firstLeft=ie(this.pointer.style.left)||0,document.addEventListener("mousemove",this.eventHandler.changeSlide),document.addEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_stopChangingSlide",value:function(){this.fire("change",this._value,!0),document.removeEventListener("mousemove",this.eventHandler.changeSlide),document.removeEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_filterForInputText",value:function(t){return t.replace(bi,"$1$2$3")}}]),t}();V().mixin(_i);var xi=_i,Ci=function(){function t(e,i){var n=i.locale,r=i.name,o=i.makeSvgIcon,a=i.menuBarPosition,s=i.templateHtml,c=i.usageStatistics;D(this,t),this.subMenuElement=e,this.menuBarPosition=a,this.toggleDirection="top"===a?"down":"up",this.colorPickerControls=[],this.usageStatistics=c,this.eventHandler={},this._makeSubMenuElement({locale:n,name:r,makeSvgIcon:o,templateHtml:s})}return k(t,[{key:"selector",value:function(t){return this.subMenuElement.querySelector(t)}},{key:"colorPickerChangeShow",value:function(t){var e;st()(e=this.colorPickerControls).call(e,(function(e){t!==e&&e.hide()}))}},{key:"getButtonType",value:function(t,e){return t.className.match(RegExp("(".concat(e.join("|"),")")))[0]}},{key:"changeClass",value:function(t,e,i){t.classList.remove(e),t.classList.add(i)}},{key:"changeStandbyMode",value:function(){}},{key:"changeStartMode",value:function(){}},{key:"_makeSubMenuElement",value:function(t){var e=t.locale,i=t.name,n=t.iconStyle,r=t.makeSvgIcon,o=t.templateHtml,a=document.createElement("div");a.className="tui-image-editor-menu-".concat(i),a.innerHTML=o({locale:e,iconStyle:n,makeSvgIcon:r}),this.subMenuElement.appendChild(a)}},{key:"_onStartEditingInputBox",value:function(){this.fire(At.INPUT_BOX_EDITING_STARTED)}},{key:"_onStopEditingInputBox",value:function(){this.fire(At.INPUT_BOX_EDITING_STOPPED)}}]),t}();V().mixin(Ci);var Ii=Ci,Mi=function(t){var e,i,n,r,o,a,s,c,l=t.locale,u=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c='\n
        \n
      • \n
        \n
        \n '.concat(u(["normal","active"],"shape-rectangle",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(s,u(["normal","active"],"shape-circle",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(o,u(["normal","active"],"shape-triangle",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n')};function Si(t){var e=wi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function wi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Ti={stroke:"#ffbb3b",fill:"",strokeWidth:3},Ai=function(t){oi(i,t);var e=Si(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"shape",makeSvgIcon:a,menuBarPosition:s,templateHtml:Mi,usageStatistics:c}),r.type=null,r.options=Ti,r._els={shapeSelectButton:r.selector(".tie-shape-button"),shapeColorButton:r.selector(".tie-shape-color-button"),strokeRange:new xi({slider:r.selector(".tie-stroke-range"),input:r.selector(".tie-stroke-range-value")},Ft),fillColorpicker:new yi(r.selector(".tie-color-fill"),{defaultColor:"",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),strokeColorpicker:new yi(r.selector(".tie-color-stroke"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics})},r.colorPickerControls.push(r._els.fillColorpicker),r.colorPickerControls.push(r._els.strokeColorpicker),r.colorPickerInputBoxes=[],r.colorPickerInputBoxes.push(r._els.fillColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),r.colorPickerInputBoxes.push(r._els.strokeColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,a,s=this;this.eventHandler.shapeTypeSelected=j()(e=this._changeShapeHandler).call(e,this),this.actions=t,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",j()(i=this._changeStrokeRangeHandler).call(i,this)),this._els.fillColorpicker.on("change",j()(n=this._changeFillColorHandler).call(n,this)),this._els.strokeColorpicker.on("change",j()(r=this._changeStrokeColorHandler).call(r,this)),this._els.fillColorpicker.on("changeShow",j()(o=this.colorPickerChangeShow).call(o,this)),this._els.strokeColorpicker.on("changeShow",j()(a=this.colorPickerChangeShow).call(a,this)),di()(this.colorPickerInputBoxes,(function(t){var e,i;t.addEventListener(At.FOCUS,j()(e=s._onStartEditingInputBox).call(e,s)),t.addEventListener(At.BLUR,j()(i=s._onStopEditingInputBox).call(i,s))}),this)}},{key:"_removeEvent",value:function(){var t=this;this._els.shapeSelectButton.removeEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.off(),this._els.fillColorpicker.off(),this._els.strokeColorpicker.off(),di()(this.colorPickerInputBoxes,(function(e){var i,n;e.removeEventListener(At.FOCUS,j()(i=t._onStartEditingInputBox).call(i,t)),e.removeEventListener(At.BLUR,j()(n=t._onStopEditingInputBox).call(n,t))}),this)}},{key:"setShapeStatus",value:function(t){var e=t.strokeWidth,i=t.strokeColor,n=t.fillColor;this._els.strokeRange.value=e,this._els.strokeColorpicker.color=i,this._els.fillColorpicker.color=n,this.options.stroke=i,this.options.fill=n,this.options.strokeWidth=e,this.actions.setDrawingShape(this.type,{strokeWidth:e})}},{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(t){var e=t;e<=0&&(e=Ft.max),this._els.strokeRange.max=e}},{key:"setStrokeValue",value:function(t){this._els.strokeRange.value=t,this._els.strokeRange.trigger("change")}},{key:"getStrokeValue",value:function(){return this._els.strokeRange.value}},{key:"_changeShapeHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){this.actions.stopDrawingMode(),this.actions.discardSelection();var i=this.getButtonType(e,["circle","triangle","rect"]);if(this.type===i)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=i,t.currentTarget.classList.add(i),this.actions.changeSelectableAll(!1),this.actions.modeChange("shape")}}},{key:"_changeStrokeRangeHandler",value:function(t,e){this.options.strokeWidth=ie(t),this.actions.changeShape({strokeWidth:t},!e),this.actions.setDrawingShape(this.type,this.options)}},{key:"_changeFillColorHandler",value:function(t){t=t||"transparent",this.options.fill=t,this.actions.changeShape({fill:t})}},{key:"_changeStrokeColorHandler",value:function(t){t=t||"transparent",this.options.stroke=t,this.actions.changeShape({stroke:t})}}]),i}(Ii),Di=Ai,Ei=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y=t.locale,b=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v=N()(m='\n
        \n
      • \n
        \n
        \n '.concat(b(["normal","active"],"shape-rectangle",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(v,b(["normal","active"],"crop",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(g,b(["normal","active"],"crop",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(f,b(["normal","active"],"crop",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(u,b(["normal","active"],"crop",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(c,b(["normal","active"],"crop",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(a,b(["normal","active"],"crop",!0),"\n
        \n \n
        \n
      • \n
      • \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n ')).call(r,b(["normal","active"],"apply"),"\n \n
        \n
        \n ')).call(i,b(["normal","active"],"cancel"),"\n \n
        \n
      • \n
      \n")};function ki(t){var e=Oi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Oi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ji=function(t){oi(i,t);var e=ki(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"crop",makeSvgIcon:a,menuBarPosition:s,templateHtml:Ei,usageStatistics:c}),r.status="active",r._els={apply:r.selector(".tie-crop-button .apply"),cancel:r.selector(".tie-crop-button .cancel"),preset:r.selector(".tie-crop-preset-button")},r.defaultPresetButton=r._els.preset.querySelector(".preset-none"),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r=j()(e=this._applyEventHandler).call(e,this),o=j()(i=this._cancelEventHandler).call(i,this),a=j()(n=this._cropzonePresetEventHandler).call(n,this);this.eventHandler={apply:r,cancel:o,cropzonePreset:a},this.actions=t,this._els.apply.addEventListener("click",r),this._els.cancel.addEventListener("click",o),this._els.preset.addEventListener("click",a)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel),this._els.preset.removeEventListener("click",this.eventHandler.cropzonePreset)}},{key:"_applyEventHandler",value:function(){this.actions.crop(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.cancel(),this._els.apply.classList.remove("active")}},{key:"_cropzonePresetEventHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button.preset");if(e){var i=e.className.match(/preset-[^\s]+/),n=it(i,1),r=n[0];this._setPresetButtonActive(e),this.actions.preset(r)}}},{key:"changeStartMode",value:function(){this.actions.modeChange("crop")}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this._setPresetButtonActive()}},{key:"changeApplyButtonStatus",value:function(t){t?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}},{key:"_setPresetButtonActive",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultPresetButton;X()(this._els.preset.querySelectorAll(".preset"),(function(t){t.classList.remove("active")})),t&&t.classList.add("active")}}]),i}(Ii),Li=ji,Ni=function(t){var e,i,n,r,o,a,s=t.locale,c=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a='\n
        \n
      • \n
        \n \n
        \n \n
        \n \n
        \n \n
        \n
      • \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n \n
        \n
        \n
      • \n
      • \n
      • \n
        \n
      • \n
      • \n
      • \n
        \n ')).call(r,c(["normal","active"],"apply"),"\n \n
        \n
        \n ')).call(i,c(["normal","active"],"cancel"),"\n \n
        \n
      • \n
      \n")};function Pi(t){var e=zi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function zi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Ri=function(t){oi(i,t);var e=Pi(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"resize",makeSvgIcon:a,menuBarPosition:s,templateHtml:Ni,usageStatistics:c}),r.status="active",r._lockState=!1,r._originalDimensions=null,r._els={widthRange:new xi({slider:r.selector(".tie-width-range"),input:r.selector(".tie-width-range-value")},Wt),heightRange:new xi({slider:r.selector(".tie-height-range"),input:r.selector(".tie-height-range-value")},Wt),lockAspectRatio:r.selector(".tie-lock-aspect-ratio"),apply:r.selector(".tie-resize-button .apply"),cancel:r.selector(".tie-resize-button .cancel")},r}return k(i,[{key:"changeStartMode",value:function(){this.actions.modeChange("resize");var t=this.actions.getCurrentDimensions();this._originalDimensions=t,this.setWidthValue(t.width),this.setHeightValue(t.height)}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this.actions.reset(!0)}},{key:"setLimit",value:function(t){this._els.widthRange.min=this.calcMinValue(t.minWidth),this._els.heightRange.min=this.calcMinValue(t.minHeight),this._els.widthRange.max=this.calcMaxValue(t.maxWidth),this._els.heightRange.max=this.calcMaxValue(t.maxHeight)}},{key:"calcMaxValue",value:function(t){return t<=0&&(t=Wt.max),t}},{key:"calcMinValue",value:function(t){return t<=0&&(t=Wt.min),t}},{key:"setWidthValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._els.widthRange.value=t,e&&this._els.widthRange.trigger("change")}},{key:"setHeightValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._els.heightRange.value=t,e&&this._els.heightRange.trigger("change")}},{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o;this._els.widthRange.on("change",j()(e=this._changeWidthRangeHandler).call(e,this)),this._els.heightRange.on("change",j()(i=this._changeHeightRangeHandler).call(i,this)),this._els.lockAspectRatio.addEventListener("change",j()(n=this._changeLockAspectRatio).call(n,this));var a=j()(r=this._applyEventHandler).call(r,this),s=j()(o=this._cancelEventHandler).call(o,this);this.eventHandler={apply:a,cancel:s},this.actions=t,this._els.apply.addEventListener("click",a),this._els.cancel.addEventListener("click",s)}},{key:"_changeWidthRangeHandler",value:function(t){this.actions.preview("width",ie(t),this._lockState)}},{key:"_changeHeightRangeHandler",value:function(t){this.actions.preview("height",ie(t),this._lockState)}},{key:"_changeLockAspectRatio",value:function(t){this._lockState=t.target.checked,this.actions.lockAspectRatio(this._lockState,Wt.min,Wt.max)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel)}},{key:"_applyEventHandler",value:function(){this.actions.resize(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.reset(),this._els.cancel.classList.remove("active")}},{key:"changeApplyButtonStatus",value:function(t){t?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}}]),i}(Ii),Bi=Ri,Fi=function(t){var e,i,n,r,o,a=t.locale,s=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o='\n
        \n
      • \n
        \n
        \n '.concat(s(["normal","active"],"flip-x",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(r,s(["normal","active"],"flip-y",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n ')).call(i,s(["normal","active"],"flip-reset",!0),"\n
        \n \n
        \n
      • \n
      \n")};function Yi(t){var e=Hi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Hi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Ui=function(t){oi(i,t);var e=Yi(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"flip",makeSvgIcon:a,menuBarPosition:s,templateHtml:Fi,usageStatistics:c}),r.flipStatus=!1,r._els={flipButton:r.selector(".tie-flip-button")},r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e;this.eventHandler.changeFlip=j()(e=this._changeFlip).call(e,this),this._actions=t,this._els.flipButton.addEventListener("click",this.eventHandler.changeFlip)}},{key:"_removeEvent",value:function(){this._els.flipButton.removeEventListener("click",this.eventHandler.changeFlip)}},{key:"_changeFlip",value:function(t){var e=this,i=t.target.closest(".tui-image-editor-button");if(i){var n=this.getButtonType(i,["flipX","flipY","resetFlip"]);if(!this.flipStatus&&"resetFlip"===n)return;this._actions.flip(n).then((function(t){var i=e._els.flipButton.classList;e.flipStatus=!1,i.remove("resetFlip"),X()(["flipX","flipY"],(function(n){i.remove(n),t[n]&&(i.add(n),i.add("resetFlip"),e.flipStatus=!0)}))}))}}}]),i}(Ii),Wi=Ui,Gi=function(t){var e,i,n=t.locale,r=t.makeSvgIcon;return N()(e=N()(i='\n
        \n
      • \n
        \n
        \n '.concat(r(["normal","active"],"rotate-clockwise",!0),'\n
        \n \n
        \n
        \n
        \n ')).call(i,r(["normal","active"],"rotate-counterclockwise",!0),'\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n')};function Xi(t){var e=Zi();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Zi(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Vi=30,Ji=-30,Qi=function(t){oi(i,t);var e=Xi(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"rotate",makeSvgIcon:a,menuBarPosition:s,templateHtml:Gi,usageStatistics:c}),r._value=0,r._els={rotateButton:r.selector(".tie-rotate-button"),rotateRange:new xi({slider:r.selector(".tie-rotate-range"),input:r.selector(".tie-rotate-range-value")},Rt)},r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.rotateRange.destroy(),he(this)}},{key:"setRangeBarAngle",value:function(t,e){var i=e;"rotate"===t&&(i=ot()(this._els.rotateRange.value,10)+e),this._setRangeBarRatio(i)}},{key:"_setRangeBarRatio",value:function(t){this._els.rotateRange.value=t}},{key:"addEvent",value:function(t){var e,i;this.eventHandler.rotationAngleChanged=j()(e=this._changeRotateForButton).call(e,this),this.actions=t,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",j()(i=this._changeRotateForRange).call(i,this))}},{key:"_removeEvent",value:function(){this._els.rotateButton.removeEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.off()}},{key:"_changeRotateForRange",value:function(t,e){var i=ie(t);this.actions.setAngle(i,!e),this._value=i}},{key:"_changeRotateForButton",value:function(t){var e=t.target.closest(".tui-image-editor-button"),i=this._els.rotateRange.value;if(e){var n=this.getButtonType(e,["counterclockwise","clockwise"]),r={clockwise:Vi,counterclockwise:Ji}[n],o=ot()(i,10)+r,a=o>=-360&&o<=360;a&&this.actions.rotate(r)}}}]),i}(Ii),Ki=Qi,qi=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g=t.locale,p=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d='\n
        \n
      • \n
        \n
        \n '.concat(p(["normal","active"],"text-bold",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(f,p(["normal","active"],"text-italic",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(u,p(["normal","active"],"text-underline",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n ')).call(c,p(["normal","active"],"text-align-left",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(a,p(["normal","active"],"text-align-center",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(r,p(["normal","active"],"text-align-right",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n')};function $i(t){var e=tn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function tn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var en=function(t){oi(i,t);var e=$i(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"text",makeSvgIcon:a,menuBarPosition:s,templateHtml:qi,usageStatistics:c}),r.effect={bold:!1,italic:!1,underline:!1},r.align="tie-text-align-left",r._els={textEffectButton:r.selector(".tie-text-effect-button"),textAlignButton:r.selector(".tie-text-align-button"),textColorpicker:new yi(r.selector(".tie-text-color"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),textRange:new xi({slider:r.selector(".tie-text-range"),input:r.selector(".tie-text-range-value")},Yt)},r.colorPickerInputBox=r._els.textColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,a,s=j()(e=this._setTextEffectHandler).call(e,this),c=j()(i=this._setTextAlignHandler).call(i,this);this.eventHandler={setTextEffect:s,setTextAlign:c},this.actions=t,this._els.textEffectButton.addEventListener("click",s),this._els.textAlignButton.addEventListener("click",c),this._els.textRange.on("change",j()(n=this._changeTextRnageHandler).call(n,this)),this._els.textColorpicker.on("change",j()(r=this._changeColorHandler).call(r,this)),this.colorPickerInputBox.addEventListener(At.FOCUS,j()(o=this._onStartEditingInputBox).call(o,this)),this.colorPickerInputBox.addEventListener(At.BLUR,j()(a=this._onStopEditingInputBox).call(a,this))}},{key:"_removeEvent",value:function(){var t,e,i=this.eventHandler,n=i.setTextEffect,r=i.setTextAlign;this._els.textEffectButton.removeEventListener("click",n),this._els.textAlignButton.removeEventListener("click",r),this._els.textRange.off(),this._els.textColorpicker.off(),this.colorPickerInputBox.removeEventListener(At.FOCUS,j()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(At.BLUR,j()(e=this._onStopEditingInputBox).call(e,this))}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStartMode",value:function(){this.actions.modeChange("text")}},{key:"textColor",get:function(){return this._els.textColorpicker.color},set:function(t){this._els.textColorpicker.color=t}},{key:"fontSize",get:function(){return this._els.textRange.value},set:function(t){this._els.textRange.value=t}},{key:"fontStyle",get:function(){return this.effect.italic?"italic":"normal"}},{key:"fontWeight",get:function(){return this.effect.bold?"bold":"normal"}},{key:"underline",get:function(){return this.effect.underline}},{key:"setTextStyleStateOnAction",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=lt()(t),i=t.fontSize,n=t.fontStyle,r=t.fontWeight,o=t.textDecoration,a=t.textAlign;this.textColor=e,this.fontSize=i,this.setEffectState("italic",n),this.setEffectState("bold",r),this.setEffectState("underline",o),this.setAlignState("tie-text-align-".concat(a))}},{key:"setEffectState",value:function(t,e){var i="italic"===e||"bold"===e||"underline"===e,n=this._els.textEffectButton.querySelector(".tui-image-editor-button.".concat(t));this.effect[t]=i,n.classList[i?"add":"remove"]("active")}},{key:"setAlignState",value:function(t){var e=this._els.textAlignButton;e.classList.remove(this.align),e.classList.add(t),this.align=t}},{key:"_setTextEffectHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=e.className.match(/(bold|italic|underline)/),n=it(i,1),r=n[0],o={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[r];this.effect[r]=!this.effect[r],e.classList.toggle("active"),this.actions.changeTextStyle(o)}}},{key:"_setTextAlignHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=this.getButtonType(e,["left","center","right"]),n="tie-text-align-".concat(i);t.currentTarget.classList.remove(this.align),this.align!==n&&t.currentTarget.classList.add(n),this.actions.changeTextStyle({textAlign:i}),this.align=n}}},{key:"_changeTextRnageHandler",value:function(t,e){this.actions.changeTextStyle({fontSize:t},!e)}},{key:"_changeColorHandler",value:function(t){t=t||"transparent",this.actions.changeTextStyle({fill:t})}}]),i}(Ii),nn=en,rn=function(t){var e,i,n,r=t.locale,o=t.makeSvgIcon;return N()(e=N()(i=N()(n='\n
        \n
      • \n
        \n
        \n \n '.concat(o(["normal","active"],"mask-load",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n ')).call(i,o(["normal","active"],"apply"),"\n \n
        \n
      • \n
      \n")};function on(t){var e=an();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function an(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var sn=function(t){oi(i,t);var e=on(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"mask",makeSvgIcon:a,menuBarPosition:s,templateHtml:rn,usageStatistics:c}),r._els={applyButton:r.selector(".tie-mask-apply"),maskImageButton:r.selector(".tie-mask-image-file")},r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),he(this)}},{key:"addEvent",value:function(t){var e,i,n=j()(e=this._loadMaskFile).call(e,this),r=j()(i=this._applyMask).call(i,this);this.eventHandler={loadMaskFile:n,applyMask:r},this.actions=t,this._els.maskImageButton.addEventListener("change",n),this._els.applyButton.addEventListener("click",r)}},{key:"_removeEvent",value:function(){this._els.maskImageButton.removeEventListener("change",this.eventHandler.loadMaskFile),this._els.applyButton.removeEventListener("click",this.eventHandler.applyMask)}},{key:"_applyMask",value:function(){this.actions.applyFilter(),this._els.applyButton.classList.remove("active")}},{key:"_loadMaskFile",value:function(t){var e;re()||alert("This browser does not support file-api");var i=it(t.target.files,1),n=i[0];n&&(e=B().createObjectURL(n),this.actions.loadImageFromURL(e,n),this._els.applyButton.classList.add("active"))}}]),i}(Ii),cn=sn,ln=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y,b,_,x=t.locale,C=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v=N()(m=N()(y=N()(b=N()(_='\n
        \n
      • \n
        \n
        \n '.concat(C(["normal","active"],"icon-arrow",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(b,C(["normal","active"],"icon-arrow-2",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(m,C(["normal","active"],"icon-arrow-3",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(p,C(["normal","active"],"icon-star",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(d,C(["normal","active"],"icon-star-2",!0),"\n
        \n \n
        \n\n
        \n
        \n ')).call(h,C(["normal","active"],"icon-polygon",!0),"\n
        \n \n
        \n\n
        \n
        \n ')).call(l,C(["normal","active"],"icon-location",!0),"\n
        \n \n
        \n\n
        \n
        \n ')).call(s,C(["normal","active"],"icon-heart",!0),"\n
        \n \n
        \n\n
        \n
        \n ')).call(o,C(["normal","active"],"icon-bubble",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n \n ')).call(n,C(["normal","active"],"icon-load",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      \n')};function un(t){var e=hn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function hn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var fn=function(t){oi(i,t);var e=un(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"icon",makeSvgIcon:a,menuBarPosition:s,templateHtml:ln,usageStatistics:c}),r.iconType=null,r._iconMap={},r._els={registerIconButton:r.selector(".tie-icon-image-file"),addIconButton:r.selector(".tie-icon-add-button"),iconColorpicker:new yi(r.selector(".tie-icon-color"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics})},r.colorPickerInputBox=r._els.iconColorpicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.iconColorpicker.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,a=j()(e=this._registerIconHandler).call(e,this),s=j()(i=this._addIconHandler).call(i,this);this.eventHandler={registerIcon:a,addIcon:s},this.actions=t,this._els.iconColorpicker.on("change",j()(n=this._changeColorHandler).call(n,this)),this._els.registerIconButton.addEventListener("change",a),this._els.addIconButton.addEventListener("click",s),this.colorPickerInputBox.addEventListener(At.FOCUS,j()(r=this._onStartEditingInputBox).call(r,this)),this.colorPickerInputBox.addEventListener(At.BLUR,j()(o=this._onStopEditingInputBox).call(o,this))}},{key:"_removeEvent",value:function(){var t,e;this._els.iconColorpicker.off(),this._els.registerIconButton.removeEventListener("change",this.eventHandler.registerIcon),this._els.addIconButton.removeEventListener("click",this.eventHandler.addIcon),this.colorPickerInputBox.removeEventListener(At.FOCUS,j()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(At.BLUR,j()(e=this._onStopEditingInputBox).call(e,this))}},{key:"clearIconType",value:function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null}},{key:"registerDefaultIcon",value:function(){var t=this;X()(zt,(function(e,i){t.actions.registerDefaultIcons(i,e)}))}},{key:"setIconPickerColor",value:function(t){this._els.iconColorpicker.color=t}},{key:"changeStandbyMode",value:function(){this.clearIconType(),this.actions.cancelAddIcon()}},{key:"_changeColorHandler",value:function(t){t=t||"transparent",this.actions.changeColor(t)}},{key:"_addIconHandler",value:function(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=e.getAttribute("data-icontype"),n=this._els.iconColorpicker.color;this.actions.discardSelection(),this.actions.changeSelectableAll(!1),this._els.addIconButton.classList.remove(this.iconType),this._els.addIconButton.classList.add(i),this.iconType===i?this.changeStandbyMode():(this.actions.addIcon(i,n),this.iconType=i)}}},{key:"_registerIconHandler",value:function(t){var e;re||alert("This browser does not support file-api");var i=it(t.target.files,1),n=i[0];n&&(e=B().createObjectURL(n),this.actions.registerCustomIcon(e,n))}}]),i}(Ii),dn=fn,gn=function(t){var e,i,n,r,o,a=t.locale,s=t.makeSvgIcon;return N()(e=N()(i=N()(n=N()(r=N()(o='\n
        \n
      • \n
        \n
        \n '.concat(s(["normal","active"],"draw-free",!0),"\n
        \n \n
        \n
        \n
        \n ')).call(r,s(["normal","active"],"draw-line",!0),"\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n')};function pn(t){var e=vn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function vn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var mn=.7,yn=function(t){oi(i,t);var e=pn(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon,s=n.menuBarPosition,c=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"draw",makeSvgIcon:a,menuBarPosition:s,templateHtml:gn,usageStatistics:c}),r._els={lineSelectButton:r.selector(".tie-draw-line-select-button"),drawColorPicker:new yi(r.selector(".tie-draw-color"),{defaultColor:"#00a9ff",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),drawRange:new xi({slider:r.selector(".tie-draw-range"),input:r.selector(".tie-draw-range-value")},Bt)},r.type=null,r.color=r._els.drawColorPicker.color,r.width=r._els.drawRange.value,r.colorPickerInputBox=r._els.drawColorPicker.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),he(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o;this.eventHandler.changeDrawType=j()(e=this._changeDrawType).call(e,this),this.actions=t,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",j()(i=this._changeDrawColor).call(i,this)),this._els.drawRange.on("change",j()(n=this._changeDrawRange).call(n,this)),this.colorPickerInputBox.addEventListener(At.FOCUS,j()(r=this._onStartEditingInputBox).call(r,this)),this.colorPickerInputBox.addEventListener(At.BLUR,j()(o=this._onStopEditingInputBox).call(o,this))}},{key:"_removeEvent",value:function(){var t,e;this._els.lineSelectButton.removeEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.off(),this._els.drawRange.off(),this.colorPickerInputBox.removeEventListener(At.FOCUS,j()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(At.BLUR,j()(e=this._onStopEditingInputBox).call(e,this))}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:oe(this.color,mn)})}},{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(t){var e=t.target.closest(".tui-image-editor-button");if(e){var i=this.getButtonType(e,["free","line"]);if(this.actions.discardSelection(),this.type===i)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=i,this._els.lineSelectButton.classList.add(i),this.setDrawMode()}}},{key:"_changeDrawColor",value:function(t){this.color=t||"transparent",this.type?this.setDrawMode():this.changeStartMode()}},{key:"_changeDrawRange",value:function(t){this.width=t,this.type?this.setDrawMode():this.changeStartMode()}}]),i}(Ii),bn=yn,_n=r(9886),xn=r.n(_n),Cn=function(t){var e,i,n,r,o,a,s,c,l,u,h,f,d,g,p,v,m=t.locale;return N()(e=N()(i=N()(n=N()(r=N()(o=N()(a=N()(s=N()(c=N()(l=N()(u=N()(h=N()(f=N()(d=N()(g=N()(p=N()(v='\n
        \n
      • \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
      • \n
      \n')};function In(t){var e=Mn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Mn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Sn="130px",wn=["add","diff","subtract","multiply","screen","lighten","darken"],Tn=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],An={grayscale:"grayscale",invert:"invert",sepia:"sepia",blur:"blur",sharpen:"sharpen",emboss:"emboss",removeWhite:"removeColor",brightness:"brightness",contrast:"contrast",saturation:"saturation",vintage:"vintage",polaroid:"polaroid",noise:"noise",pixelate:"pixelate",colorFilter:"removeColor",tint:"blendColor",multiply:"blendColor",blend:"blendColor",hue:"hue",gamma:"gamma"},Dn=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],En=["filterBlendColor","filterMultiplyColor","filterTintColor"],kn=function(t){oi(i,t);var e=In(i);function i(t,n){var r,o=n.locale,a=n.menuBarPosition,s=n.usageStatistics;return D(this,i),r=e.call(this,t,{locale:o,name:"filter",menuBarPosition:a,templateHtml:Cn,usageStatistics:s}),r.selectBoxShow=!1,r.checkedMap={},r._makeControlElement(),r}return k(i,[{key:"destroy",value:function(){this._removeEvent(),this._destroyToolInstance(),he(this)}},{key:"_removeEvent",value:function(){var t,e=this;X()(Tn,(function(t){var i=e.selector(".tie-".concat(t)),n=ne(t);i.removeEventListener("change",e.eventHandler[n])})),X()(N()(t=[]).call(t,Dn,En),(function(t){e._els[t].off()})),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),di()(this.colorPickerInputBoxes,(function(t){var i,n;t.removeEventListener(At.FOCUS,j()(i=e._onStartEditingInputBox).call(i,e)),t.removeEventListener(At.BLUR,j()(n=e._onStopEditingInputBox).call(n,e))}),this)}},{key:"_destroyToolInstance",value:function(){var t,e=this;X()(N()(t=[]).call(t,Dn,En),(function(t){e._els[t].destroy()}))}},{key:"addEvent",value:function(t){var e,i,n,r=this,o=t.applyFilter,a=function(t){var e;return j()(e=r._changeFilterState).call(e,r,o,t)},s=function(t){return function(e,i){return r._changeFilterState(o,t,i)}};this.eventHandler={changeBlendFilter:a("blend"),blandTypeClick:function(t){return t.stopPropagation()}},X()(Tn,(function(t){var e=r.selector(".tie-".concat(t)),i=ne(t);r.checkedMap[i]=e,r.eventHandler[i]=a(i),e.addEventListener("change",r.eventHandler[i])})),this._els.removewhiteDistanceRange.on("change",s("removeWhite")),this._els.colorfilterThresholdRange.on("change",s("colorFilter")),this._els.pixelateRange.on("change",s("pixelate")),this._els.noiseRange.on("change",s("noise")),this._els.brightnessRange.on("change",s("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",a("multiply")),this._els.filterTintColor.on("change",a("tint")),this._els.tintOpacity.on("change",s("tint")),this._els.filterMultiplyColor.on("changeShow",j()(e=this.colorPickerChangeShow).call(e,this)),this._els.filterTintColor.on("changeShow",j()(i=this.colorPickerChangeShow).call(i,this)),this._els.filterBlendColor.on("changeShow",j()(n=this.colorPickerChangeShow).call(n,this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),di()(this.colorPickerInputBoxes,(function(t){var e,i;t.addEventListener(At.FOCUS,j()(e=r._onStartEditingInputBox).call(e,r)),t.addEventListener(At.BLUR,j()(i=r._onStopEditingInputBox).call(i,r))}),this)}},{key:"setFilterState",value:function(t){var e=t.type,i=t.options,n=t.action,r=this._getFilterNameFromOptions(e,i),o="remove"===n;o||this._setFilterState(r,i),this.checkedMap[r].checked=!o}},{key:"initFilterCheckBoxState",value:function(){X()(this.checkedMap,(function(t){t.checked=!1}),this)}},{key:"_setFilterState",value:function(t,e){"colorFilter"===t?this._els.colorfilterThresholdRange.value=e.distance:"removeWhite"===t?this._els.removewhiteDistanceRange.value=e.distance:"pixelate"===t?this._els.pixelateRange.value=e.blocksize:"brightness"===t?this._els.brightnessRange.value=e.brightness:"noise"===t?this._els.noiseRange.value=e.noise:"tint"===t?(this._els.tintOpacity.value=e.alpha,this._els.filterTintColor.color=e.color):"blend"===t?this._els.filterBlendColor.color=e.color:"multiply"===t&&(this._els.filterMultiplyColor.color=e.color)}},{key:"_getFilterNameFromOptions",value:function(t,e){var i=t;return"removeColor"===t?i=xn()(e.useAlpha)?"removeWhite":"colorFilter":"blendColor"===t&&(i={add:"blend",multiply:"multiply",tint:"tint"}[e.mode]),i}},{key:"_changeFilterState",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.checkedMap[e].checked,r=An[e],o=this.checkedMap[e].closest(".tui-image-editor-checkbox-group");o&&(n?o.classList.remove("tui-image-editor-disabled"):o.classList.add("tui-image-editor-disabled")),t(n,r,this._getFilterOption(e),!i)}},{key:"_getFilterOption",value:function(t){var e={};switch(t){case"removeWhite":e.color="#FFFFFF",e.useAlpha=!1,e.distance=We()(this._els.removewhiteDistanceRange.value);break;case"colorFilter":e.color="#FFFFFF",e.distance=We()(this._els.colorfilterThresholdRange.value);break;case"pixelate":e.blocksize=ie(this._els.pixelateRange.value);break;case"noise":e.noise=ie(this._els.noiseRange.value);break;case"brightness":e.brightness=We()(this._els.brightnessRange.value);break;case"blend":e.mode="add",e.color=this._els.filterBlendColor.color,e.mode=this._els.blendType.value;break;case"multiply":e.mode="multiply",e.color=this._els.filterMultiplyColor.color;break;case"tint":e.mode="tint",e.color=this._els.filterTintColor.color,e.alpha=this._els.tintOpacity.value;break;case"blur":e.blur=this._els.blurRange.value;break;default:break}return e}},{key:"_makeControlElement",value:function(){this._els={removewhiteDistanceRange:new xi({slider:this.selector(".tie-removewhite-distance-range")},Ht.removewhiteDistanceRange),brightnessRange:new xi({slider:this.selector(".tie-brightness-range")},Ht.brightnessRange),noiseRange:new xi({slider:this.selector(".tie-noise-range")},Ht.noiseRange),pixelateRange:new xi({slider:this.selector(".tie-pixelate-range")},Ht.pixelateRange),colorfilterThresholdRange:new xi({slider:this.selector(".tie-colorfilter-threshold-range")},Ht.colorfilterThresholdRange),filterTintColor:new yi(this.selector(".tie-filter-tint-color"),{defaultColor:"#03bd9e",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterMultiplyColor:new yi(this.selector(".tie-filter-multiply-color"),{defaultColor:"#515ce6",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterBlendColor:new yi(this.selector(".tie-filter-blend-color"),{defaultColor:"#ffbb3b",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),blurRange:Ht.blurFilterRange},this._els.tintOpacity=this._pickerWithRange(this._els.filterTintColor.pickerControl),this._els.blendType=this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl),this.colorPickerControls.push(this._els.filterTintColor),this.colorPickerControls.push(this._els.filterMultiplyColor),this.colorPickerControls.push(this._els.filterBlendColor),this.colorPickerInputBoxes=[],this.colorPickerInputBoxes.push(this._els.filterTintColor.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterMultiplyColor.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterBlendColor.colorpickerElement.querySelector(Dt.COLOR_PICKER_INPUT_BOX))}},{key:"_pickerWithRange",value:function(t){var e=document.createElement("div"),i=document.createElement("label"),n=document.createElement("div");return n.id="tie-filter-tint-opacity",i.innerHTML="Opacity",e.appendChild(i),e.appendChild(n),t.appendChild(e),t.style.height=Sn,new xi({slider:n},Ht.tintOpacityRange)}},{key:"_pickerWithSelectbox",value:function(t){var e=document.createElement("div"),i=document.createElement("select"),n=document.createElement("ul");return e.className="tui-image-editor-selectlist-wrap",n.className="tui-image-editor-selectlist",e.appendChild(i),e.appendChild(n),this._makeSelectOptionList(i),t.appendChild(e),t.style.height=Sn,this._drawSelectOptionList(i,n),this._pickerWithSelectboxForAddEvent(i,n),i}},{key:"_drawSelectOptionList",value:function(t,e){var i=t.querySelectorAll("option");X()(i,(function(t){var i=document.createElement("li");i.innerHTML=t.innerHTML,i.setAttribute("data-item",t.value),e.appendChild(i)}))}},{key:"_pickerWithSelectboxForAddEvent",value:function(t,e){var i=this;e.addEventListener("click",(function(n){var r=n.target.getAttribute("data-item"),o=document.createEvent("HTMLEvents");t.querySelector('[value="'.concat(r,'"]')).selected=!0,o.initEvent("change",!0,!0),t.dispatchEvent(o),i.selectBoxShow=!1,e.style.display="none"})),t.addEventListener("mousedown",(function(n){n.preventDefault(),i.selectBoxShow=!i.selectBoxShow,e.style.display=i.selectBoxShow?"block":"none",e.setAttribute("data-selectitem",t.value),e.querySelector("[data-item='".concat(t.value,"']")).classList.add("active")}))}},{key:"_makeSelectOptionList",value:function(t){X()(wn,(function(e){var i=document.createElement("option");i.setAttribute("value",e),i.innerHTML=e.replace(/^[a-z]/,(function(t){return t.toUpperCase()})),t.appendChild(i)}))}}]),i}(Ii),On=kn,jn=r(4383),Ln=r.n(jn),Nn=function(){function t(e,i){var n=i.name;D(this,t),this.name=n,this.items=[],this.panelElement=this._makePanelElement(),this.listElement=this._makeListElement(),this.panelElement.appendChild(this.listElement),e.appendChild(this.panelElement)}return k(t,[{key:"_makePanelElement",value:function(){var t=document.createElement("div");return t.className="tie-panel-".concat(this.name),t}},{key:"_makeListElement",value:function(){var t=document.createElement("ol");return t.className="".concat(this.name,"-list"),t}},{key:"makeListItemElement",value:function(t){var e=document.createElement("li");return e.innerHTML=t,e.className="".concat(this.name,"-item"),e.setAttribute("data-index",this.items.length),e}},{key:"pushListItemElement",value:function(t){this.listElement.appendChild(t),this.listElement.scrollTop+=t.offsetHeight,this.items.push(t)}},{key:"deleteListItemElement",value:function(t,e){for(var i=this.items,n=t;n\n
      \n '.concat(o(["normal","active"],"history-".concat(a.toLowerCase()),!0),"\n
      \n \n ")).call(n,r.localize(a),"\n ")).call(i,s?"(".concat(r.localize(s),")"):"",'\n \n
      \n ')).call(e,o(["normal"],"history-check",!0),"\n
      \n \n")};function Rn(t){var e=Bn();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Bn(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Fn="history-item",Yn="selected-item",Hn="disabled-item",Un=function(t){oi(i,t);var e=Rn(i);function i(t,n){var r,o=n.locale,a=n.makeSvgIcon;return D(this,i),r=e.call(this,t,{name:"history"}),t.classList.add("enabled"),r.locale=o,r.makeSvgIcon=a,r._eventHandler={},r._historyIndex=r.getListLength(),r}return k(i,[{key:"add",value:function(t){var e=t.name,i=t.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var n=zn({locale:this.locale,makeSvgIcon:this.makeSvgIcon,name:e,detail:i}),r=this.makeListItemElement(n);this.pushListItemElement(r),this._historyIndex=this.getListLength()-1,this._selectItem(this._historyIndex)}},{key:"init",value:function(){this.deleteListItemElement(1,this.getListLength()),this._historyIndex=0,this._selectItem(this._historyIndex)}},{key:"clear",value:function(){this.deleteListItemElement(0,this.getListLength()),this._historyIndex=-1}},{key:"prev",value:function(){this._historyIndex-=1,this._selectItem(this._historyIndex)}},{key:"next",value:function(){this._historyIndex+=1,this._selectItem(this._historyIndex)}},{key:"_hasDisabledItem",value:function(){return this.getListLength()-1>this._historyIndex}},{key:"_addHistoryEventListener",value:function(){var t=this;this._eventHandler.history=function(e){return t._clickHistoryItem(e)},this.listElement.addEventListener("click",this._eventHandler.history)}},{key:"_removeHistoryEventListener",value:function(){this.listElement.removeEventListener("click",this._eventHandler.history)}},{key:"_clickHistoryItem",value:function(t){var e=t.target,i=e.closest(".".concat(Fn));if(i){var n=Ln()(i.getAttribute("data-index"),10);if(n!==this._historyIndex){var r=Math.abs(n-this._historyIndex);nt&&this.addClass(e,Hn);this.addClass(t,Yn)}},{key:"destroy",value:function(){this.removeEvent(),he(this)}},{key:"addEvent",value:function(t){this._actions=t,this._addHistoryEventListener()}},{key:"removeEvent",value:function(){this._removeHistoryEventListener()}}]),i}(Pn),Wn=Un,Gn=function(){function t(e){D(this,t),this._locale=e}return k(t,[{key:"localize",value:function(t){return this._locale[t]||t}}]),t}(),Xn=Gn,Zn={Shape:Di,Crop:Li,Resize:Bi,Flip:Wi,Rotate:Ki,Text:nn,Mask:cn,Icon:dn,Draw:bn,Filter:On},Vn="1300",Jn="history",Qn="tie-panel-history",Kn="on",qn={ZOOM_IN:"zoomIn",HAND:"hand"},$n=function(){function t(e,i,n){D(this,t),this.options=this._initializeOption(i),this._actions=n,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new Xn(this.options.locale),this.theme=new $e(this.options.theme),this.eventHandler={},this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuBarElement=null,this._subMenuElement=null,this._makeUiElement(e),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}return k(t,[{key:"destroy",value:function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",he(this)}},{key:"setUiDefaultSelectionStyle",value:function(t){return H()({applyCropSelectionStyle:!0,applyGroupSelectionStyle:!0,selectionStyle:{cornerStyle:"circle",cornerSize:16,cornerColor:"#fff",cornerStrokeColor:"#fff",transparentCorners:!1,lineWidth:2,borderColor:"#fff"}},t)}},{key:"resizeEditor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.uiSize,i=t.imageSize,n=void 0===i?this.imageSize:i;n!==this.imageSize&&(this.imageSize=n),e&&this._setUiSize(e);var r=this._getCanvasMaxDimension(),o=r.width,a=r.height,s=this._editorElement.style,c=this.options.menuBarPosition;s.height="".concat(a,"px"),s.width="".concat(o,"px"),this._setEditorPosition(c),this._editorElementWrap.style.bottom="0px",this._editorElementWrap.style.top="0px",this._editorElementWrap.style.left="0px",this._editorElementWrap.style.width="100%";var l=this._selectedElement.classList;"top"===c&&this._selectedElement.offsetWidth0&&void 0!==arguments[0]?arguments[0]:this.options.uiSize,e=this._selectedElement.style;e.width=t.width,e.height=t.height}},{key:"_makeSubMenu",value:function(){var t=this;X()(this.options.menu,(function(e){var i,n=Zn[e.replace(/^[a-z]/,(function(t){return t.toUpperCase()}))];t._makeMenuElement(e),t._buttonElements[e]=t._menuBarElement.querySelector(".tie-btn-".concat(e)),t[e]=new n(t._subMenuElement,{locale:t._locale,makeSvgIcon:j()(i=t.theme.makeMenSvgIconSet).call(i,t.theme),menuBarPosition:t.options.menuBarPosition,usageStatistics:t.options.usageStatistics})}))}},{key:"_attachHistoryEvent",value:function(){var t,e,i;this.on(At.EXECUTE_COMMAND,j()(t=this._addHistory).call(t,this)),this.on(At.AFTER_UNDO,j()(e=this._selectPrevHistory).call(e,this)),this.on(At.AFTER_REDO,j()(i=this._selectNextHistory).call(i,this))}},{key:"_attachZoomEvent",value:function(){var t=this;this.on(At.HAND_STARTED,(function(){t.offZoomInButtonStatus(),t.changeHandButtonStatus(!0)})),this.on(At.HAND_STOPPED,(function(){return t.changeHandButtonStatus(!1)}))}},{key:"_makeUiElement",value:function(t){var e,i;i=t.nodeType?t:document.querySelector(t);var n=ce(i);i.classList.add("tui-image-editor-container"),i.innerHTML=Xe({locale:this._locale,biImage:this.theme.getStyle("common.bi"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),menuBarPosition:this.options.menuBarPosition})+Ge({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=i,this._selectedElement.classList.add(this.options.menuBarPosition),this._mainElement=n(".tui-image-editor-main"),this._editorElementWrap=n(".tui-image-editor-wrap"),this._editorElement=n(".tui-image-editor"),this._helpMenuBarElement=n(".tui-image-editor-help-menu"),this._menuBarElement=n(".tui-image-editor-menu"),this._subMenuElement=n(".tui-image-editor-submenu"),this._buttonElements={download:this._selectedElement.querySelectorAll(".tui-image-editor-download-btn"),load:this._selectedElement.querySelectorAll(".tui-image-editor-load-btn")},this._addHelpMenus(),this._historyMenu=new Wn(this._buttonElements[Jn],{locale:this._locale,makeSvgIcon:j()(e=this.theme.makeMenSvgIconSet).call(e,this.theme)}),this._activateZoomMenus()}},{key:"_activateZoomMenus",value:function(){var t=this;X()(vt,(function(e){t.changeHelpButtonEnabled(e,!0)}))}},{key:"_makeHelpMenuWithPartition",value:function(){var t;return N()(t=[]).call(t,w(vt),[""],w(mt),[""],w(yt))}},{key:"_addHelpMenus",value:function(){var t=this,e=this._makeHelpMenuWithPartition();X()(e,(function(e){e?(t._makeMenuElement(e,["normal","disabled","hover"],"help"),t._buttonElements[e]=t._helpMenuBarElement.querySelector(".tie-btn-".concat(e))):t._makeMenuPartitionElement()}))}},{key:"_makeMenuPartitionElement",value:function(){var t=document.createElement("li"),e=document.createElement("div");t.className=fe("item"),e.className=fe("icpartition"),t.appendChild(e),this._helpMenuBarElement.appendChild(t)}},{key:"_makeMenuElement",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["normal","active","hover"],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",o=document.createElement("li"),a=this.theme.makeMenSvgIconSet(n,t);this._addTooltipAttribute(o,t),o.className=N()(e=N()(i="tie-btn-".concat(t," ")).call(i,fe("item")," ")).call(e,r),o.innerHTML=a,"normal"===r?this._menuBarElement.appendChild(o):this._helpMenuBarElement.appendChild(o)}},{key:"_addHelpActionEvent",value:function(){var t=this;X()(bt,(function(e){t.eventHandler[e]=function(i){return t._actions.main[e](i)},t._buttonElements[e].addEventListener("click",t.eventHandler[e])}))}},{key:"_removeHelpActionEvent",value:function(){var t=this;X()(bt,(function(e){t._buttonElements[e].removeEventListener("click",t.eventHandler[e])}))}},{key:"_addHistory",value:function(t){if(!Me(t)){var e="string"===typeof t?{name:t}:Se(t);this._historyMenu.add(e)}}},{key:"initHistory",value:function(){this._historyMenu.init()}},{key:"clearHistory",value:function(){this._historyMenu.clear()}},{key:"_selectPrevHistory",value:function(){this._historyMenu.prev()}},{key:"_selectNextHistory",value:function(){this._historyMenu.next()}},{key:"toggleHistoryMenu",value:function(t){var e=t.target,i=e.closest(".".concat(Qn));if(!i){var n=this._buttonElements[Jn].classList;n.toggle("opened")}}},{key:"_addTooltipAttribute",value:function(t,e){t.setAttribute("tooltip-content",this._locale.localize(e.replace(/^[a-z]/g,(function(t){return t.toUpperCase()}))))}},{key:"_addDownloadEvent",value:function(){var t=this;this.eventHandler.download=function(){return t._actions.main.download()},X()(this._buttonElements.download,(function(e){e.addEventListener("click",t.eventHandler.download)}))}},{key:"_removeDownloadEvent",value:function(){var t=this;X()(this._buttonElements.download,(function(e){e.removeEventListener("click",t.eventHandler.download)}))}},{key:"_addLoadEvent",value:function(){var t=this;this.eventHandler.loadImage=function(e){return t._actions.main.load(e.target.files[0])},X()(this._buttonElements.load,(function(e){e.addEventListener("change",t.eventHandler.loadImage)}))}},{key:"_removeLoadEvent",value:function(){var t=this;X()(this._buttonElements.load,(function(e){e.removeEventListener("change",t.eventHandler.loadImage)}))}},{key:"_addMainMenuEvent",value:function(t){var e=this;this.eventHandler[t]=function(){return e.changeMenu(t)},this._buttonElements[t].addEventListener("click",this.eventHandler[t])}},{key:"_addSubMenuEvent",value:function(t){var e=this;this[t].addEvent(this._actions[t]),this[t].on(At.INPUT_BOX_EDITING_STARTED,(function(){return e.fire(At.INPUT_BOX_EDITING_STARTED)})),this[t].on(At.INPUT_BOX_EDITING_STOPPED,(function(){return e.fire(At.INPUT_BOX_EDITING_STOPPED)}))}},{key:"_addMenuEvent",value:function(){var t=this;X()(this.options.menu,(function(e){t._addMainMenuEvent(e),t._addSubMenuEvent(e)}))}},{key:"_removeMainMenuEvent",value:function(){var t=this;X()(this.options.menu,(function(e){t._buttonElements[e].removeEventListener("click",t.eventHandler[e]),t[e].off(At.INPUT_BOX_EDITING_STARTED),t[e].off(At.INPUT_BOX_EDITING_STOPPED)}))}},{key:"getEditorArea",value:function(){return this._editorElement}},{key:"activeMenuEvent",value:function(){this._initMenuEvent||(this._addHelpActionEvent(),this._addDownloadEvent(),this._addMenuEvent(),this._initMenu(),this._historyMenu.addEvent(this._actions.history),this._initMenuEvent=!0)}},{key:"_removeUiEvent",value:function(){this._removeHelpActionEvent(),this._removeDownloadEvent(),this._removeLoadEvent(),this._removeMainMenuEvent(),this._historyMenu.removeEvent()}},{key:"_destroyAllMenu",value:function(){var t=this;X()(this.options.menu,(function(e){t[e].destroy()})),this._historyMenu.destroy()}},{key:"initCanvas",value:function(){var t=this,e=this._getLoadImage();e.path&&this._actions.main.initLoadImage(e.path,e.name).then((function(){t.activeMenuEvent()})),this._addLoadEvent();var i=document.createElement("div");i.className=fe("grid-visual");var n='\n \n \n \n
      ';i.innerHTML=n,this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(i)}},{key:"_getLoadImage",value:function(){return this.options.loadImage}},{key:"changeMenu",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._submenuChangeTransection||(this._submenuChangeTransection=!0,this._changeMenu(t,e,i),this._submenuChangeTransection=!1)}},{key:"_changeMenu",value:function(t,e,i){this.submenu&&(this._buttonElements[this.submenu].classList.remove("active"),this._mainElement.classList.remove("tui-image-editor-menu-".concat(this.submenu)),i&&this._actions.main.discardSelection(),this._actions.main.changeSelectableAll(!0),this[this.submenu].changeStandbyMode()),this.submenu===t&&e?this.submenu=null:(this._buttonElements[t].classList.add("active"),this._mainElement.classList.add("tui-image-editor-menu-".concat(t)),this.submenu=t,this[this.submenu].changeStartMode()),this.resizeEditor()}},{key:"_initMenu",value:function(){if(this.options.initMenu){var t=document.createEvent("MouseEvents");t.initEvent("click",!0,!1),this._buttonElements[this.options.initMenu].dispatchEvent(t)}this.icon&&this.icon.registerDefaultIcon()}},{key:"_getCanvasMaxDimension",value:function(){var t=this._editorContainerElement.style,e=t.maxWidth,i=t.maxHeight,n=We()(e),r=We()(i);return{width:n,height:r}}},{key:"_setEditorPosition",value:function(t){var e=this._getCanvasMaxDimension(),i=e.width,n=e.height,r=this._editorElement.style,o=0,a=0;this.submenu&&("bottom"===t?o=n>this._editorElementWrap.scrollHeight-150?(n-this._editorElementWrap.scrollHeight)/2:-75:"top"===t?o=n>this._editorElementWrap.offsetHeight-150?75-(n-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===t?a=i>this._editorElementWrap.offsetWidth-248?124-(i-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===t&&(a=i>this._editorElementWrap.scrollWidth-248?(i-this._editorElementWrap.scrollWidth)/2:-124)),r.top="".concat(o,"px"),r.left="".concat(a,"px")}}]),t}();V().mixin($n);var tr=$n,er=r(381),ir=r.n(er),nr=function(){function t(){D(this,t),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 k(t,[{key:"imageToSVG",value:function(t,e,i){var n=this;i=this.checkoptions(i),this.loadImage(t,(function(t){e(n.imagedataToSVG(n.getImgdata(t),i))}),i)}},{key:"imagedataToSVG",value:function(t,e){e=this.checkoptions(e);var i=this.imagedataToTracedata(t,e);return this.getsvgstring(i,e)}},{key:"imageToTracedata",value:function(t,e,i){var n=this;i=this.checkoptions(i),this.loadImage(t,(function(t){e(n.imagedataToTracedata(n.getImgdata(t),i))}),i)}},{key:"imagedataToTracedata",value:function(t,e){e=this.checkoptions(e);var i,n=this.colorquantization(t,e);if(0===e.layering){i={layers:[],palette:n.palette,width:n.array[0].length-2,height:n.array.length-2};for(var r=0;r0&&(t=this.blur(t,e.blurradius,e.blurdelta)),c=0;c0)for(s=0;s0&&(l[s]={r:Math.floor(f[s].r/f[s].n),g:Math.floor(f[s].g/f[s].n),b:Math.floor(f[s].b/f[s].n),a:Math.floor(f[s].a/f[s].n)}),f[s].n/dn[r].boundingbox[2]&&(n[r].boundingbox[2]=a-1),s-1n[r].boundingbox[3]&&(n[r].boundingbox[3]=s-1),i=this.pathscan_combined_lookup[t[s][a]][u],t[s][a]=i[0],u=i[1],a+=i[2],s+=i[3],a-1===n[r].points[0].x&&s-1===n[r].points[0].y)if(h=!0,n[r].points.lengthe[2]&&t[3]>e[3]}},{key:"batchpathscan",value:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&(i[n]=this.pathscan(t[n],e));return i}},{key:"internodes",value:function(t,e){var i,n,r=[],o=0,a=0,s=0,c=0,l=0;for(i=0;i0&&(r[i].points[r[i].points.length-1].linesegment=this.getdirection(r[i].points[r[i].points.length-1].x,r[i].points[r[i].points.length-1].y,t[i].points[n].x,t[i].points[n].y)),r[i].points.push({x:t[i].points[n].x,y:t[i].points[n].y,linesegment:this.getdirection(t[i].points[n].x,t[i].points[n].y,(t[i].points[n].x+t[i].points[a].x)/2,(t[i].points[n].y+t[i].points[a].y)/2)})),r[i].points.push({x:(t[i].points[n].x+t[i].points[a].x)/2,y:(t[i].points[n].y+t[i].points[a].y)/2,linesegment:this.getdirection((t[i].points[n].x+t[i].points[a].x)/2,(t[i].points[n].y+t[i].points[a].y)/2,(t[i].points[a].x+t[i].points[s].x)/2,(t[i].points[a].y+t[i].points[s].y)/2)});return r}},{key:"testrightangle",value:function(t,e,i,n,r,o){return t.points[n].x===t.points[e].x&&t.points[n].x===t.points[i].x&&t.points[n].y===t.points[r].y&&t.points[n].y===t.points[o].y||t.points[n].y===t.points[e].y&&t.points[n].y===t.points[i].y&&t.points[n].x===t.points[r].x&&t.points[n].x===t.points[o].x}},{key:"getdirection",value:function(t,e,i,n){var r=8;return r=tn?7:0:t>i?en?5:4:en?6:8,r}},{key:"batchinternodes",value:function(t,e){var i=[];for(var n in t)t.hasOwnProperty(n)&&(i[n]=this.internodes(t[n],e));return i}},{key:"tracepath",value:function(t,e,i){var n,r,o,a=0,s={segments:[]};s.boundingbox=t.boundingbox,s.holechildren=t.holechildren,s.isholepath=t.isholepath;while(a0?o:t.points.length}return s}},{key:"fitseq",value:function(t,e,i,n,r){var o;if(r>t.points.length||r<0)return[];var a,s,c,l=n,u=0,h=!0,f=r-n;f<0&&(f+=t.points.length);var d,g=(t.points[r].x-t.points[n].x)/f,p=(t.points[r].y-t.points[n].y)/f,v=(n+1)%t.points.length;while(v!=r)d=v-n,d<0&&(d+=t.points.length),a=t.points[n].x+g*d,s=t.points[n].y+p*d,c=(t.points[v].x-a)*(t.points[v].x-a)+(t.points[v].y-s)*(t.points[v].y-s),c>e&&(h=!1),c>u&&(l=v,u=c),v=(v+1)%t.points.length;if(h)return[{type:"L",x1:t.points[n].x,y1:t.points[n].y,x2:t.points[r].x,y2:t.points[r].y}];var m=l;h=!0,u=0;var y=(m-n)/f,b=(1-y)*(1-y),_=2*(1-y)*y,x=y*y,C=(b*t.points[n].x+x*t.points[r].x-t.points[m].x)/-_,I=(b*t.points[n].y+x*t.points[r].y-t.points[m].y)/-_;v=n+1;while(v!=r)y=(v-n)/f,b=(1-y)*(1-y),_=2*(1-y)*y,x=y*y,a=b*t.points[n].x+_*C+x*t.points[r].x,s=b*t.points[n].y+_*I+x*t.points[r].y,c=(t.points[v].x-a)*(t.points[v].x-a)+(t.points[v].y-s)*(t.points[v].y-s),c>i&&(h=!1),c>u&&(l=v,u=c),v=(v+1)%t.points.length;if(h)return[{type:"Q",x1:t.points[n].x,y1:t.points[n].y,x2:C,y2:I,x3:t.points[r].x,y3:t.points[r].y}];var M=m;return N()(o=this.fitseq(t,e,i,n,M)).call(o,this.fitseq(t,e,i,M,r))}},{key:"batchtracepaths",value:function(t,e,i){var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push(this.tracepath(t[r],e,i));return n}},{key:"batchtracelayers",value:function(t,e,i){var n=[];for(var r in t)t.hasOwnProperty(r)&&(n[r]=this.batchtracepaths(t[r],e,i));return n}},{key:"roundtodec",value:function(t,e){return Number(t.toFixed(e))}},{key:"svgpathstring",value:function(t,e,i,n){var r,o,a,s=t.layers[e],c=s[i],l="";if(n.linefilter&&c.segments.length<3)return l;if(l=N()(r="=0;a--){var C,I;if(l+="".concat(b.segments[a].type," "),b.segments[a].hasOwnProperty("x3"))l+=N()(I="".concat(b.segments[a].x2*n.scale," ")).call(I,b.segments[a].y2*n.scale," ");l+=N()(C="".concat(b.segments[a].x1*n.scale," ")).call(C,b.segments[a].y1*n.scale," ")}}else{var M,S;if(b.segments[b.segments.length-1].hasOwnProperty("x3"))l+=N()(M="M ".concat(this.roundtodec(b.segments[b.segments.length-1].x3*n.scale)," ")).call(M,this.roundtodec(b.segments[b.segments.length-1].y3*n.scale)," ");else l+=N()(S="M ".concat(this.roundtodec(b.segments[b.segments.length-1].x2*n.scale)," ")).call(S,this.roundtodec(b.segments[b.segments.length-1].y2*n.scale)," ");for(a=b.segments.length-1;a>=0;a--){var w,T;if(l+="".concat(b.segments[a].type," "),b.segments[a].hasOwnProperty("x3"))l+=N()(T="".concat(this.roundtodec(b.segments[a].x2*n.scale)," ")).call(T,this.roundtodec(b.segments[a].y2*n.scale)," ");l+=N()(w="".concat(this.roundtodec(b.segments[a].x1*n.scale)," ")).call(w,this.roundtodec(b.segments[a].y1*n.scale)," ")}}l+="Z "}if(l+='" />',n.lcpr||n.qcpr){for(a=0;a'),l+=N()(k=N()(O=N()(j=''),l+=N()(L=N()(P=N()(z=N()(R=''),l+=N()(B=N()(F=N()(Y=N()(H='');if(!c.segments[a].hasOwnProperty("x3")&&n.lcpr)l+=N()(U=N()(W=N()(G='')}for(y=0;y'),l+=N()(J=N()(Q=N()(K=''),l+=N()(q=N()($=N()(tt=N()(et=''),l+=N()(it=N()(nt=N()(rt=N()(ot='');if(!b.segments[a].hasOwnProperty("x3")&&n.lcpr)l+=N()(at=N()(st=N()(ct='')}}}return l}},{key:"getsvgstring",value:function(t,e){var i,n,r;e=this.checkoptions(e);for(var o=t.width*e.scale,a=t.height*e.scale,s=N()(i="'),c=0;c5&&(e=5),i=Math.abs(i),i>1024&&(i=1024);var g=this.gks[e-1];for(r=0;r0&&n+o0&&r+oi&&(d.data[s]=t.data[s],d.data[s+1]=t.data[s+1],d.data[s+2]=t.data[s+2],d.data[s+3]=t.data[s+3]);return d}},{key:"loadImage",value:function(t,e,i){var n=new Image;i&&i.corsenabled&&(n.crossOrigin="Anonymous"),n.src=t,n.onload=function(){var t=document.createElement("canvas");t.width=n.width,t.height=n.height;var i=t.getContext("2d");i.drawImage(n,0,0),e(t)}}},{key:"getImgdata",value:function(t){var e=t.getContext("2d");return e.getImageData(0,0,t.width,t.height)}},{key:"drawLayers",value:function(t,e,i,n){var r,o,a,s,c,l;for(c in i=i||1,n?(l=document.getElementById(n),l||(l=document.createElement("div"),l.id=n,document.body.appendChild(l))):(l=document.createElement("div"),document.body.appendChild(l)),t)if(t.hasOwnProperty(c)){r=t[c][0].length,o=t[c].length;var u=document.createElement("canvas");u.width=r*i,u.height=o*i;var h=u.getContext("2d");for(s=0;s"))},history:function(e){t.ui.toggleHistoryMenu(e)},zoomIn:function(){t.ui.toggleZoomButtonStatus("zoomIn"),t.deactivateAll(),o()},zoomOut:function(){t._graphics.zoomOut()},hand:function(){t.ui.offZoomInButtonStatus(),t.ui.toggleZoomButtonStatus("hand"),t.deactivateAll(),a()}},this._commonAction())},_iconAction:function(){var t=this;return H()({changeColor:function(e){t.activeObjectId&&t.changeIconColor(t.activeObjectId,e)},addIcon:function(e,i){t.startDrawingMode("ICON"),t.setDrawingIcon(e,i)},cancelAddIcon:function(){t.ui.icon.clearIconType(),t.changeSelectableAll(!0),t.changeCursor("default"),t.stopDrawingMode()},registerDefaultIcons:function(e,i){var n={};n[e]=i,t.registerIcons(n)},registerCustomIcon:function(e,i){var n=new nr;n.imageToSVG(e,(function(e){var n=e.match(/path[^>]*d="([^"]*)"/),r=it(n,2),o=r[1],a={};a[i.name]=o,t.registerIcons(a),t.addIcon(i.name,{left:100,top:100})}),nr.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var t=this;return H()({setDrawMode:function(e,i){t.stopDrawingMode(),"free"===e?t.startDrawingMode("FREE_DRAWING",i):t.startDrawingMode("LINE_DRAWING",i)},setColor:function(e){t.setBrush({color:e})}},this._commonAction())},_maskAction:function(){var t=this;return H()({loadImageFromURL:function(e,i){return t.loadImageFromURL(t.toDataURL(),"FilterImage").then((function(){t.addImageObject(e).then((function(){B().revokeObjectURL(i)})),t._invoker.fire(At.EXECUTE_COMMAND,Et.LOAD_MASK_IMAGE)}))},applyFilter:function(){t.applyFilter("mask",{maskObjId:t.activeObjectId})}},this._commonAction())},_textAction:function(){var t=this;return H()({changeTextStyle:function(e,i){t.activeObjectId&&t.changeTextStyle(t.activeObjectId,e,i)}},this._commonAction())},_rotateAction:function(){var t=this;return H()({rotate:function(e,i){t.rotate(e,i),t.ui.resizeEditor(),t.ui.rotate.setRangeBarAngle("rotate",e)},setAngle:function(e,i){t.setAngle(e,i),t.ui.resizeEditor(),t.ui.rotate.setRangeBarAngle("setAngle",e)}},this._commonAction())},_shapeAction:function(){var t=this;return H()({changeShape:function(e,i){t.activeObjectId&&t.changeShape(t.activeObjectId,e,i)},setDrawingShape:function(e){t.setDrawingShape(e)}},this._commonAction())},_cropAction:function(){var t=this;return H()({crop:function(){var e=t.getCropzoneRect();e&&!Ae(e)&&t.crop(e).then((function(){t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("crop"),t._invoker.fire(At.EXECUTE_COMMAND,Et.CROP)}))["catch"]((function(t){return z().reject(t)}))},cancel:function(){t.stopDrawingMode(),t.ui.changeMenu("crop")},preset:function(e){switch(e){case"preset-square":t.setCropzoneRect(1);break;case"preset-3-2":t.setCropzoneRect(1.5);break;case"preset-4-3":t.setCropzoneRect(4/3);break;case"preset-5-4":t.setCropzoneRect(5/4);break;case"preset-7-5":t.setCropzoneRect(1.4);break;case"preset-16-9":t.setCropzoneRect(16/9);break;default:t.setCropzoneRect(),t.ui.crop.changeApplyButtonStatus(!1);break}}},this._commonAction())},_resizeAction:function(){var t=this;return H()({getCurrentDimensions:function(){return t._graphics.getCurrentDimensions()},preview:function(e,i,n){var r=t._graphics.getCurrentDimensions(),o=function(){return r.width/r.height},a={};switch(e){case"width":a.width=i,a.height=n?i/o():r.height;break;case"height":a.height=i,a.width=n?i*o():r.width;break;default:a=r}t._graphics.resize(a).then((function(){t.ui.resizeEditor()})),n&&(t.ui.resize.setWidthValue(a.width),t.ui.resize.setHeightValue(a.height))},lockAspectRatio:function(e,i,n){var r=t._graphics.getCurrentDimensions(),o=r.width,a=r.height,s=o/a;if(e)if(o>a){var c=n/s,l=i*s;t.ui.resize.setLimit({minWidth:l>i?l:i,minHeight:i,maxWidth:n,maxHeight:ci?h:i,maxWidth:u0&&void 0!==arguments[0]?arguments[0]:null;e||(e=t._graphics.getCurrentDimensions()),t.resize(e).then((function(){t._graphics.setOriginalDimensions(e),t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("resize")}))["catch"]((function(t){return z().reject(t)}))},reset:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=t._graphics.getOriginalDimensions();t.ui.resize.setWidthValue(i.width,!0),t.ui.resize.setHeightValue(i.height,!0),t._graphics.resize(i).then((function(){e||(t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("resize"))}))}},this._commonAction())},_flipAction:function(){var t=this;return H()({flip:function(e){return t[e]()}},this._commonAction())},_filterAction:function(){var t=this;return H()({applyFilter:function(e,i,n,r){e?t.applyFilter(i,n,r):t.hasFilter(i)&&t.removeFilter(i)}},this._commonAction())},setReAction:function(){var t=this;this.on({undoStackChanged:function(e){e?(t.ui.changeHelpButtonEnabled("undo",!0),t.ui.changeHelpButtonEnabled("reset",!0)):(t.ui.changeHelpButtonEnabled("undo",!1),t.ui.changeHelpButtonEnabled("reset",!1)),t.ui.resizeEditor()},redoStackChanged:function(e){e?t.ui.changeHelpButtonEnabled("redo",!0):t.ui.changeHelpButtonEnabled("redo",!1),t.ui.resizeEditor()},objectActivated:function(e){var i,r;t.activeObjectId=e.id,t.ui.changeHelpButtonEnabled("delete",!0),t.ui.changeHelpButtonEnabled("deleteAll",!0),"cropzone"===e.type?t.ui.crop.changeApplyButtonStatus(!0):n()(i=["rect","circle","triangle"]).call(i,e.type)>-1?(t.stopDrawingMode(),"shape"!==t.ui.submenu&&t.ui.changeMenu("shape",!1,!1),t.ui.shape.setShapeStatus({strokeColor:e.stroke,strokeWidth:e.strokeWidth,fillColor:lt()(e)}),t.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height))):"path"===e.type||"line"===e.type?"draw"!==t.ui.submenu&&(t.ui.changeMenu("draw",!1,!1),t.ui.draw.changeStandbyMode()):n()(r=["i-text","text"]).call(r,e.type)>-1?("text"!==t.ui.submenu&&t.ui.changeMenu("text",!1,!1),t.ui.text.setTextStyleStateOnAction(e)):"icon"===e.type&&(t.stopDrawingMode(),"icon"!==t.ui.submenu&&t.ui.changeMenu("icon",!1,!1),t.ui.icon.setIconPickerColor(lt()(e)))},addText:function(e){var i=t.ui.text,n=i.textColor,r=i.fontSize,o=i.fontStyle,a=i.fontWeight,s=i.underline,c="Noto Sans";t.addText("Double Click",{position:e.originPosition,styles:{fill:n,fontSize:r,fontFamily:c,fontStyle:o,fontWeight:a,underline:s}}).then((function(){t.changeCursor("default")}))},addObjectAfter:function(e){var i;"icon"===e.type?t.ui.icon.changeStandbyMode():n()(i=["rect","circle","triangle"]).call(i,e.type)>-1&&(t.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height)),t.ui.shape.changeStandbyMode())},objectScaled:function(e){var i,r;if(n()(i=["i-text","text"]).call(i,e.type)>-1)t.ui.text.fontSize=ie(e.fontSize);else if(n()(r=["rect","circle","triangle"]).call(r,e.type)>=0){var o=e.width,a=e.height,s=t.ui.shape.getStrokeValue();o=0}function Tr(t,e){return t>e?"width":"height"}var Ar=F.fabric.util.createClass(F.fabric.Rect,{initialize:function(t,e,i){e=H()(e,i),e.type="cropzone",this.callSuper("initialize",e),this._addEventHandler(),this.canvas=t,this.options=e},canvasEventDelegation:function(t){var e,i="unregistered",r=this.canvasEventTrigger[t]!==Sr;return r?i="registered":n()(e=[At.OBJECT_MOVED,At.OBJECT_SCALED]).call(e,t)<0&&(i="none"),i},canvasEventRegister:function(t,e){this.canvasEventTrigger[t]=e},_addEventHandler:function(){var t,e,i,n,r;this.canvasEventTrigger=(t={},A(t,At.OBJECT_MOVED,Sr),A(t,At.OBJECT_SCALED,Sr),t),this.on({moving:j()(e=this._onMoving).call(e,this),scaling:j()(i=this._onScaling).call(i,this)}),F.fabric.util.addListener(document,"keydown",j()(n=this._onKeyDown).call(n,this)),F.fabric.util.addListener(document,"keyup",j()(r=this._onKeyUp).call(r,this))},_renderCropzone:function(t){var e=7,i=7,n=this.flipX?-1:1,r=this.flipY?-1:1,o=n/this.scaleX,a=r/this.scaleY;t.scale(o,a),this._fillOuterRect(t,"rgba(0, 0, 0, 0.5)"),this.options.lineWidth?(this._fillInnerRect(t),this._strokeBorder(t,"rgb(255, 255, 255)",{lineWidth:this.options.lineWidth})):(this._strokeBorder(t,"rgb(0, 0, 0)",{lineDashWidth:e}),this._strokeBorder(t,"rgb(255, 255, 255)",{lineDashWidth:e,lineDashOffset:i})),t.scale(1/o,1/a)},_render:function(t){this.callSuper("_render",t),this._renderCropzone(t)},_fillOuterRect:function(t,e){var i=this._getCoordinates(),n=i.x,r=i.y;t.save(),t.fillStyle=e,t.beginPath(),t.moveTo(n[0]-1,r[0]-1),t.lineTo(n[3]+1,r[0]-1),t.lineTo(n[3]+1,r[3]+1),t.lineTo(n[0]-1,r[3]+1),t.lineTo(n[0]-1,r[0]-1),t.closePath(),t.moveTo(n[1],r[1]),t.lineTo(n[1],r[2]),t.lineTo(n[2],r[2]),t.lineTo(n[2],r[1]),t.lineTo(n[1],r[1]),t.closePath(),lt()(t).call(t),t.restore()},_fillInnerRect:function(t){var e=this._getCoordinates(),i=e.x,n=e.y,r=this._caculateInnerPosition(i,(i[2]-i[1])/3),o=this._caculateInnerPosition(n,(n[2]-n[1])/3);t.save(),t.strokeStyle="rgba(255, 255, 255, 0.7)",t.lineWidth=this.options.lineWidth,t.beginPath(),t.moveTo(r[0],o[1]),t.lineTo(r[3],o[1]),t.moveTo(r[0],o[2]),t.lineTo(r[3],o[2]),t.moveTo(r[1],o[0]),t.lineTo(r[1],o[3]),t.moveTo(r[2],o[0]),t.lineTo(r[2],o[3]),t.stroke(),t.closePath(),t.restore()},_caculateInnerPosition:function(t,e){var i=[];return i[0]=t[1],i[1]=t[1]+e,i[2]=t[1]+2*e,i[3]=t[2],i},_getCoordinates:function(){var t,e,i=this.canvas,n=this.width,r=this.height,o=this.left,a=this.top,s=n/2,c=r/2,l=i.getHeight(),u=i.getWidth();return{x:Ve()(t=[-(s+o),-s,s,s+(u-o-n)]).call(t,Math.ceil),y:Ve()(e=[-(c+a),-c,c,c+(l-a-r)]).call(e,Math.ceil)}},_strokeBorder:function(t,e,i){var n=i.lineDashWidth,r=i.lineDashOffset,o=i.lineWidth,a=this.width/2,s=this.height/2;t.save(),t.strokeStyle=e,t.setLineDash&&t.setLineDash([n,n]),r&&(t.lineDashOffset=r),o&&(t.lineWidth=o),t.beginPath(),t.moveTo(-a,-s),t.lineTo(a,-s),t.lineTo(a,s),t.lineTo(-a,s),t.lineTo(-a,-s),t.stroke(),t.restore()},_onMoving:function(){var t=this.height,e=this.width,i=this.left,n=this.top,r=this.canvas.getWidth()-e,o=this.canvas.getHeight()-t;this.left=$t(i,0,r),this.top=$t(n,0,o),this.canvasEventTrigger[At.OBJECT_MOVED](this)},_onScaling:function(t){var e=t.transform.corner,i=this.canvas.getPointer(t.e),n=this._calcScalingSizeFromPointer(i,e);this.scale(1).set(n),this.canvasEventTrigger[At.OBJECT_SCALED](this)},_calcScalingSizeFromPointer:function(t,e){var i=wr(e);return i&&this._resizeCropZone(t,e)},adjustRatioCropzoneSize:function(t){var e=t.width,i=t.height,n=t.leftMaker,r=t.topMaker,o=t.maxWidth,a=t.maxHeight,s=t.scaleTo;if(e=o?$t(e,1,o):e,i=a?$t(i,1,a):i,!this.presetRatio)return this._withShiftKey&&(e>i?i=e:i>e&&(e=i)),{width:e,height:i,left:n(e),top:r(i)};"width"===s?i=e/this.presetRatio:e=i*this.presetRatio;var c=Math.min(o/e,a/i);if(c<=1){var l,u=Ve()(l=[e,i]).call(l,(function(t){return t*c})),h=it(u,2);e=h[0],i=h[1]}return{width:e,height:i,left:n(e),top:r(i)}},_getCropzoneRectInfo:function(){var t=this.canvas,e=t.width,i=t.height,n=this.getBoundingRect(!1,!0),r=n.top,o=n.left,a=n.width,s=n.height;return{rectTop:r,rectLeft:o,rectWidth:a,rectHeight:s,rectRight:o+a,rectBottom:r+s,canvasWidth:e,canvasHeight:i}},_resizeCropZone:function(t,e){var i=t.x,n=t.y,r=this._getCropzoneRectInfo(),o=r.rectWidth,a=r.rectHeight,s=r.rectTop,c=r.rectLeft,l=r.rectBottom,u=r.rectRight,h=r.canvasWidth,f=r.canvasHeight,d={tl:{width:u-i,height:l-n,leftMaker:function(t){return u-t},topMaker:function(t){return l-t},maxWidth:u,maxHeight:l,scaleTo:Tr(c-i,s-n)},tr:{width:i-c,height:l-n,leftMaker:function(){return c},topMaker:function(t){return l-t},maxWidth:h-c,maxHeight:l,scaleTo:Tr(i-u,s-n)},mt:{width:o,height:l-n,leftMaker:function(){return c},topMaker:function(t){return l-t},maxWidth:h-c,maxHeight:l,scaleTo:"height"},ml:{width:u-i,height:a,leftMaker:function(t){return u-t},topMaker:function(){return s},maxWidth:u,maxHeight:f-s,scaleTo:"width"},mr:{width:i-c,height:a,leftMaker:function(){return c},topMaker:function(){return s},maxWidth:h-c,maxHeight:f-s,scaleTo:"width"},mb:{width:o,height:n-s,leftMaker:function(){return c},topMaker:function(){return s},maxWidth:h-c,maxHeight:f-s,scaleTo:"height"},bl:{width:u-i,height:n-s,leftMaker:function(t){return u-t},topMaker:function(){return s},maxWidth:u,maxHeight:f-s,scaleTo:Tr(c-i,n-l)},br:{width:i-c,height:n-s,leftMaker:function(){return c},topMaker:function(){return s},maxWidth:h-c,maxHeight:f-s,scaleTo:Tr(i-u,n-l)}};return this.adjustRatioCropzoneSize(d[e])},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0},_onKeyDown:function(t){var e=t.keyCode;e===Lt.SHIFT&&(this._withShiftKey=!0)},_onKeyUp:function(t){var e=t.keyCode;e===Lt.SHIFT&&(this._withShiftKey=!1)}}),Dr=Ar;function Er(t){var e=kr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function kr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Or=10,jr={presetRatio:null,top:-10,left:-10,height:1,width:1},Lr=function(t){oi(i,t);var e=Er(i);function i(t){var n,r,o,a,s,c;return D(this,i),c=e.call(this,Mt.CROPPER,t),c._cropzone=null,c._startX=null,c._startY=null,c._withShiftKey=!1,c._listeners={keydown:j()(n=c._onKeyDown).call(n,ci(c)),keyup:j()(r=c._onKeyUp).call(r,ci(c)),mousedown:j()(o=c._onFabricMouseDown).call(o,ci(c)),mousemove:j()(a=c._onFabricMouseMove).call(a,ci(c)),mouseup:j()(s=c._onFabricMouseUp).call(s,ci(c))},c}return k(i,[{key:"start",value:function(){if(!this._cropzone){var t=this.getCanvas();t.forEachObject((function(t){t.evented=!1})),this._cropzone=new Dr(t,H()({left:0,top:0,width:.5,height:.5,strokeWidth:0,cornerSize:10,cornerColor:"black",fill:"transparent"},wt,this.graphics.cropSelectionStyle)),t.discardActiveObject(),t.add(this._cropzone),t.on("mouse:down",this._listeners.mousedown),t.selection=!1,t.defaultCursor="crosshair",F.fabric.util.addListener(document,"keydown",this._listeners.keydown),F.fabric.util.addListener(document,"keyup",this._listeners.keyup)}}},{key:"end",value:function(){var t=this.getCanvas(),e=this._cropzone;e&&(t.remove(e),t.selection=!0,t.defaultCursor="default",t.off("mouse:down",this._listeners.mousedown),t.forEachObject((function(t){t.evented=!0})),this._cropzone=null,F.fabric.util.removeListener(document,"keydown",this._listeners.keydown),F.fabric.util.removeListener(document,"keyup",this._listeners.keyup))}},{key:"changeVisibility",value:function(t){this._cropzone&&this._cropzone.set({visible:t})}},{key:"_onFabricMouseDown",value:function(t){var e=this.getCanvas();if(!t.target){e.selection=!1;var i=e.getPointer(t.e);this._startX=i.x,this._startY=i.y,e.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}}},{key:"_onFabricMouseMove",value:function(t){var e=this.getCanvas(),i=e.getPointer(t.e),n=i.x,r=i.y,o=this._cropzone;Math.abs(n-this._startX)+Math.abs(r-this._startY)>Or&&(e.remove(o),o.set(this._calcRectDimensionFromPoint(n,r,o.presetRatio)),e.add(o),e.setActiveObject(o))}},{key:"_calcRectDimensionFromPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this.getCanvas(),r=n.getWidth(),o=n.getHeight(),a=this._startX,s=this._startY,c=$t(t,0,a),l=$t(e,0,s),u=$t(t,a,r)-c,h=$t(e,s,o)-l;return this._withShiftKey&&!i?(u>h?h=u:h>u&&(u=h),a>=t&&(c=a-u),s>=e&&(l=s-h)):i&&(h=u/i,a>=t&&(c=$t(a-u,0,r)),s>=e&&(l=$t(s-h,0,o)),l+h>o&&(h=o-l,u=h*i,a>=t&&(c=$t(a-u,0,r)),s>=e&&(l=$t(s-h,0,o)))),{left:c,top:l,width:u,height:h}}},{key:"_onFabricMouseUp",value:function(){var t=this._cropzone,e=this._listeners,i=this.getCanvas();i.setActiveObject(t),i.off({"mouse:move":e.mousemove,"mouse:up":e.mouseup})}},{key:"getCroppedImageData",value:function(t){var e=this.getCanvas(),i=e.contains(this._cropzone);if(!t)return null;i&&e.remove(this._cropzone);var n={imageName:this.getImageName(),url:e.toDataURL(t)};return i&&e.add(this._cropzone),n}},{key:"getCropzoneRect",value:function(){var t=this._cropzone;return t.isValid()?{left:t.left,top:t.top,width:t.width,height:t.height}:null}},{key:"setCropzoneRect",value:function(t){var e=this.getCanvas(),i=this._cropzone;e.discardActiveObject(),e.selection=!1,e.remove(i),i.set(t?this._getPresetPropertiesForCropSize(t):jr),e.add(i),e.selection=!0,t&&e.setActiveObject(i)}},{key:"_getPresetPropertiesForCropSize",value:function(t){var e,i,n=this.getCanvas(),r=n.getWidth(),o=n.getHeight(),a=r>=o?r:o,s=function(t,e){return t>e?e/t:1},c=a*t,l=a,u=s(c,r),h=Ve()(e=[c,l]).call(e,(function(t){return t*u})),f=it(h,2);c=f[0],l=f[1];var d=s(l,o),g=Ve()(i=[c,l]).call(i,(function(t){return ue(t*d)})),p=it(g,2);return c=p[0],l=p[1],{presetRatio:t,top:(o-l)/2,left:(r-c)/2,width:c,height:l}}},{key:"_onKeyDown",value:function(t){t.keyCode===Lt.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(t){t.keyCode===Lt.SHIFT&&(this._withShiftKey=!1)}}]),i}(ur),Nr=Lr;function Pr(t){var e=zr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function zr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Rr=function(t){oi(i,t);var e=Pr(i);function i(t){return D(this,i),e.call(this,Mt.FLIP,t)}return k(i,[{key:"getCurrentSetting",value:function(){var t=this.getCanvasImage();return{flipX:t.flipX,flipY:t.flipY}}},{key:"set",value:function(t){var e=this.getCurrentSetting(),i=e.flipX!==t.flipX,n=e.flipY!==t.flipY;return i||n?(H()(e,t),this.setImageProperties(e,!0),this._invertAngle(i,n),this._flipObjects(i,n),z().resolve({flipX:e.flipX,flipY:e.flipY,angle:this.getCanvasImage().angle})):z().reject(Pt.flip)}},{key:"_invertAngle",value:function(t,e){var i=this.getCanvasImage(),n=i.angle;t&&(n*=-1),e&&(n*=-1),i.rotate(We()(n)).setCoords()}},{key:"_flipObjects",value:function(t,e){var i=this.getCanvas();t&&i.forEachObject((function(t){t.set({angle:We()(-1*t.angle),flipX:!t.flipX,left:i.width-t.left}).setCoords()})),e&&i.forEachObject((function(t){t.set({angle:We()(-1*t.angle),flipY:!t.flipY,top:i.height-t.top}).setCoords()})),i.renderAll()}},{key:"reset",value:function(){return this.set({flipX:!1,flipY:!1})}},{key:"flipX",value:function(){var t=this.getCurrentSetting();return this.set({flipX:!t.flipX,flipY:t.flipY})}},{key:"flipY",value:function(){var t=this.getCurrentSetting();return this.set({flipX:t.flipX,flipY:!t.flipY})}}]),i}(ur),Br=Rr;function Fr(t){var e=Yr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Yr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Hr=function(t){oi(i,t);var e=Fr(i);function i(t){return D(this,i),e.call(this,Mt.ROTATION,t)}return k(i,[{key:"getCurrentAngle",value:function(){return this.getCanvasImage().angle}},{key:"setAngle",value:function(t){var e=this.getCurrentAngle()%360;t%=360;var i=this.getCanvasImage(),n=i.getCenterPoint();i.set({angle:t}).setCoords(),this.adjustCanvasDimension();var r=i.getCenterPoint();return this._rotateForEachObject(n,r,t-e),z().resolve(t)}},{key:"_rotateForEachObject",value:function(t,e,i){var n=this.getCanvas(),r={x:t.x-e.x,y:t.y-e.y};n.forEachObject((function(e){var n=e.getCenterPoint(),o=F.fabric.util.degreesToRadians(i),a=F.fabric.util.rotatePoint(n,t,o);e.set({left:a.x-r.x,top:a.y-r.y,angle:(e.angle+i)%360}),e.setCoords()})),n.renderAll()}},{key:"rotate",value:function(t){var e=this.getCurrentAngle();return this.setAngle(e+t)}}]),i}(ur),Ur=Hr;function Wr(t){var e=Gr();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Gr(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Xr=function(t){oi(i,t);var e=Wr(i);function i(t){var n;return D(this,i),n=e.call(this,Mt.FREE_DRAWING,t),n.width=12,n.oColor=new F.fabric.Color("rgba(0, 0, 0, 0.5)"),n}return k(i,[{key:"start",value:function(t){var e=this.getCanvas();e.isDrawingMode=!0,this.setBrush(t)}},{key:"setBrush",value:function(t){var e=this.getCanvas().freeDrawingBrush;t=t||{},this.width=t.width||this.width,t.color&&(this.oColor=new F.fabric.Color(t.color)),e.width=this.width,e.color=this.oColor.toRgba()}},{key:"end",value:function(){var t=this.getCanvas();t.isDrawingMode=!1}}]),i}(ur),Zr=Xr,Vr=30,Jr=2.7,Qr=1.7,Kr=180,qr=F.fabric.util.createClass(F.fabric.Line,{type:"line",initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.callSuper("initialize",t,e),this.arrowType=e.arrowType},_render:function(t){var e=this.calcLinePoints(),i=e.x1,n=e.y1,r=e.x2,o=e.y2,a={fromX:i,fromY:n,toX:r,toY:o};this.ctx=t,t.lineWidth=this.strokeWidth,this._renderBasicLinePath(a),this._drawDecoratorPath(a),this._renderStroke(t)},_renderBasicLinePath:function(t){var e=t.fromX,i=t.fromY,n=t.toX,r=t.toY;this.ctx.beginPath(),this.ctx.moveTo(e,i),this.ctx.lineTo(n,r)},_drawDecoratorPath:function(t){this._drawDecoratorPathType("head",t),this._drawDecoratorPathType("tail",t)},_drawDecoratorPathType:function(t,e){switch(this.arrowType[t]){case"triangle":this._drawTrianglePath(t,e);break;case"chevron":this._drawChevronPath(t,e);break;default:break}},_drawTrianglePath:function(t,e){var i=this.ctx.lineWidth*Qr;this._drawChevronPath(t,e,i),this.ctx.closePath()},_drawChevronPath:function(t,e,i){var n=this,r=e.fromX,o=e.fromY,a=e.toX,s=e.toY,c=this.ctx;i||(i=this.ctx.lineWidth*Jr);var l="head"===t?[r,o]:[a,s],u=it(l,2),h=u[0],f=u[1],d="head"===t?[a,s]:[r,o],g=it(d,2),p=g[0],v=g[1],m=Math.atan2(v-f,p-h)*Kr/Math.PI,y=function(t){return n.getRotatePosition(i,t,{x:h,y:f})};c.moveTo.apply(c,w(y(m+Vr))),c.lineTo(h,f),c.lineTo.apply(c,w(y(m-Vr)))},getRotatePosition:function(t,e,i){var n=e*Math.PI/Kr,r=i.x,o=i.y;return[t*Math.cos(n)+r,t*Math.sin(n)+o]}}),$r=qr;function to(t){var e=eo();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function eo(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var io=function(t){oi(i,t);var e=to(i);function i(t){var n,r,o,a;return D(this,i),a=e.call(this,Mt.LINE,t),a._width=12,a._oColor=new F.fabric.Color("rgba(0, 0, 0, 0.5)"),a._listeners={mousedown:j()(n=a._onFabricMouseDown).call(n,ci(a)),mousemove:j()(r=a._onFabricMouseMove).call(r,ci(a)),mouseup:j()(o=a._onFabricMouseUp).call(o,ci(a))},a}return k(i,[{key:"setHeadOption",value:function(t){var e=t.arrowType,i=void 0===e?{head:null,tail:null}:e;this._arrowType=i}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getCanvas();e.defaultCursor="crosshair",e.selection=!1,this.setHeadOption(t),this.setBrush(t),e.forEachObject((function(t){t.set({evented:!1})})),e.on({"mouse:down":this._listeners.mousedown})}},{key:"setBrush",value:function(t){var e=this.getCanvas().freeDrawingBrush;t=t||{},this._width=t.width||this._width,t.color&&(this._oColor=new F.fabric.Color(t.color)),e.width=this._width,e.color=this._oColor.toRgba()}},{key:"end",value:function(){var t=this.getCanvas();t.defaultCursor="default",t.selection=!0,t.forEachObject((function(t){t.set({evented:!0})})),t.off("mouse:down",this._listeners.mousedown)}},{key:"_onFabricMouseDown",value:function(t){var e=this.getCanvas(),i=e.getPointer(t.e),n=i.x,r=i.y,o=[n,r,n,r];this._line=new $r(o,{stroke:this._oColor.toRgba(),strokeWidth:this._width,arrowType:this._arrowType,evented:!1}),this._line.set(Nt.SELECTION_STYLE),e.add(this._line),e.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup}),this.fire(At.ADD_OBJECT,this._createLineEventObjectProperties())}},{key:"_onFabricMouseMove",value:function(t){var e=this.getCanvas(),i=e.getPointer(t.e);this._line.set({x2:i.x,y2:i.y}),this._line.setCoords(),e.renderAll()}},{key:"_onFabricMouseUp",value:function(){var t=this.getCanvas();this.fire(At.OBJECT_ADDED,this._createLineEventObjectProperties()),this._line=null,t.off({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}},{key:"_createLineEventObjectProperties",value:function(){var t=this.graphics.createObjectProperties(this._line),e=this._line,i=e.x1,n=e.x2,r=e.y1,o=e.y2;return H()({},t,{startPosition:{x:i,y:r},endPosition:{x:n,y:o}})}}]),i}(ur),no=io;function ro(t){var e=oo();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function oo(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ao={fill:"#000000",left:0,top:0},so={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"tie-text-align-left",underline:!1},co=500,lo=function(t){oi(i,t);var e=ro(i);function i(t){var n,r,o,a,s,c;return D(this,i),c=e.call(this,Mt.TEXT,t),c._defaultStyles=ao,c._isSelected=!1,c._selectedObj={},c._editingObj={},c._listeners={mousedown:j()(n=c._onFabricMouseDown).call(n,ci(c)),select:j()(r=c._onFabricSelect).call(r,ci(c)),selectClear:j()(o=c._onFabricSelectClear).call(o,ci(c)),scaling:j()(a=c._onFabricScaling).call(a,ci(c)),textChanged:j()(s=c._onFabricTextChanged).call(s,ci(c))},c._textarea=null,c._ratio=1,c._lastClickTime=(new Date).getTime(),c._editingObjInfos={},c.isPrevEditing=!1,c}return k(i,[{key:"start",value:function(){var t=this,e=this.getCanvas();e.selection=!1,e.defaultCursor="text",e.on({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged}),e.forEachObject((function(e){"i-text"===e.type&&t.adjustOriginPosition(e,"start")})),this.setCanvasRatio()}},{key:"end",value:function(){var t=this,e=this.getCanvas();e.selection=!0,e.defaultCursor="default",e.forEachObject((function(i){"i-text"===i.type&&(""===i.text?e.remove(i):t.adjustOriginPosition(i,"end"))})),e.off({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:selected":this._listeners.select,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged})}},{key:"adjustOriginPosition",value:function(t,e){var i="center",n="center";"start"===e&&(i="left",n="top");var r=t.getPointByOrigin(i,n),o=r.x,a=r.y;t.set({left:o,top:a,originX:i,originY:n}),t.setCoords()}},{key:"add",value:function(t,e){var i=this;return new(z())((function(n){var r,o=i.getCanvas(),a=null,s=Nt.SELECTION_STYLE,c=i._defaultStyles;i._setInitPos(e.position),e.styles&&(c=H()(c,e.styles)),xn()(e.autofocus)||(e.autofocus=!0),a=new F.fabric.IText(t,c),s=H()({},s,{originX:"left",originY:"top"}),a.set(s),a.on({mouseup:j()(r=i._onFabricMouseUp).call(r,i)}),o.add(a),e.autofocus&&(a.enterEditing(),a.selectAll()),o.getActiveObject()||o.setActiveObject(a),i.isPrevEditing=!0,n(i.graphics.createObjectProperties(a))}))}},{key:"change",value:function(t,e){var i=this;return new(z())((function(n){t.set("text",e),i.getCanvas().renderAll(),n()}))}},{key:"setStyle",value:function(t,e){var i=this;return new(z())((function(n){X()(e,(function(i,n){t[n]===i&&"fontSize"!==n&&(e[n]=so[n]||"")}),i),"textDecoration"in e&&H()(e,i._getTextDecorationAdaptObject(e.textDecoration)),t.set(e),i.getCanvas().renderAll(),n()}))}},{key:"getText",value:function(t){return t.text}},{key:"setSelectedInfo",value:function(t,e){this._selectedObj=t,this._isSelected=e}},{key:"isSelected",value:function(){return this._isSelected}},{key:"getSelectedObj",value:function(){return this._selectedObj}},{key:"setCanvasRatio",value:function(){var t=this.getCanvasElement(),e=ot()(t.style.maxWidth,10),i=t.width;this._ratio=i/e}},{key:"getCanvasRatio",value:function(){return this._ratio}},{key:"_getTextDecorationAdaptObject",value:function(t){return{underline:"underline"===t,linethrough:"line-through"===t,overline:"overline"===t}}},{key:"_setInitPos",value:function(t){t=t||this.getCanvasImage().getCenterPoint(),this._defaultStyles.left=t.x,this._defaultStyles.top=t.y}},{key:"_onInput",value:function(){var t=this.getCanvasRatio(),e=this._editingObj,i=this._textarea.style;i.width="".concat(Math.ceil(e.width/t),"px"),i.height="".concat(Math.ceil(e.height/t),"px")}},{key:"_onKeyDown",value:function(){var t=this,e=this.getCanvasRatio(),i=this._editingObj,n=this._textarea.style;p()((function(){i.text(t._textarea.value),n.width="".concat(Math.ceil(i.width/e),"px"),n.height="".concat(Math.ceil(i.height/e),"px")}),0)}},{key:"_onBlur",value:function(){var t=this.getCanvasRatio(),e=this._editingObj,i=this._editingObjInfos,n=this._textarea.value,r=e.width/t-i.width/t,o=e.height/t-i.height/t;if(1===t&&(r/=2,o/=2),this._textarea.style.display="none",e.set({left:i.left+r,top:i.top+o}),n.length){this.getCanvas().add(e);var a={id:Kt(e),type:e.type,text:n};this.fire(At.TEXT_CHANGED,a)}}},{key:"_onScroll",value:function(){this._textarea.scrollLeft=0,this._textarea.scrollTop=0}},{key:"_onFabricScaling",value:function(t){var e=t.target;e.fontSize=e.fontSize*e.scaleY,e.scaleX=1,e.scaleY=1}},{key:"_onFabricTextChanged",value:function(t){this.fire(At.TEXT_CHANGED,t.target)}},{key:"_onFabricSelectClear",value:function(t){var e=this.getSelectedObj();this.isPrevEditing=!0,this.setSelectedInfo(t.target,!1),e&&""===e.text&&this.getCanvas().remove(e)}},{key:"_onFabricSelect",value:function(t){this.isPrevEditing=!0,this.setSelectedInfo(t.target,!0)}},{key:"_onFabricMouseDown",value:function(t){var e=t.target;e&&!e.isType("text")||(this.isPrevEditing?this.isPrevEditing=!1:this._fireAddText(t))}},{key:"_fireAddText",value:function(t){var e=t.target,i=t.e||{},n=this.getCanvas().getPointer(i);e||this.fire(At.ADD_TEXT,{originPosition:{x:n.x,y:n.y},clientPosition:{x:i.clientX||0,y:i.clientY||0}})}},{key:"_onFabricMouseUp",value:function(t){var e=t.target,i=(new Date).getTime();this._isDoubleClick(i)&&!e.isEditing&&e.enterEditing(),e.isEditing&&this.fire(At.TEXT_EDITING),this._lastClickTime=i}},{key:"_isDoubleClick",value:function(t){return t-this._lastClickTimei},_getColor:function(t,e,i){var n=[0,0,0,0],r=t.data,o=t.width,a=4,s=(o*i+e)*a;return n[0]=r[s],n[1]=r[s+1],n[2]=r[s+2],n[3]=r[s+3],n}}),Mo=Io;function So(t){var e=wo();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function wo(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var To=F.fabric.Image.filters;To.Mask=yo,To.Sharpen=_o,To.Emboss=Co,To.ColorFilter=Mo;var Ao=function(t){oi(i,t);var e=So(i);function i(t){return D(this,i),e.call(this,Mt.FILTER,t)}return k(i,[{key:"add",value:function(t,e){var i=this;return new(z())((function(n,r){var o=i._getSourceImage(),a=i.getCanvas(),s=i._getFilter(o,t);s||(s=i._createFilter(o,t,e)),s||r(Pt.invalidParameters),i._changeFilterValues(s,e),i._apply(o,(function(){a.renderAll(),n({type:t,action:"add",options:e})}))}))}},{key:"remove",value:function(t){var e=this;return new(z())((function(i,n){var r=e._getSourceImage(),o=e.getCanvas(),a=e.getOptions(t);r.filters.length||n(Pt.unsupportedOperation),e._removeFilter(r,t),e._apply(r,(function(){o.renderAll(),i({type:t,action:"remove",options:a})}))}))}},{key:"hasFilter",value:function(t){return!!this._getFilter(this._getSourceImage(),t)}},{key:"getOptions",value:function(t){var e=this._getSourceImage(),i=this._getFilter(e,t);return i?H()({},i.options):null}},{key:"_changeFilterValues",value:function(t,e){X()(e,(function(e,i){W()(t[i])||(t[i]=e)})),X()(t.options,(function(i,n){W()(e[n])||(t.options[n]=e[n])}))}},{key:"_apply",value:function(t,e){t.filters.push();var i=t.applyFilters();i&&e()}},{key:"_getSourceImage",value:function(){return this.getCanvasImage()}},{key:"_createFilter",value:function(t,e,i){var n,r=this._getFabricFilterType(e),o=F.fabric.Image.filters[r];return o&&(n=new o(i),n.options=i,t.filters.push(n)),n}},{key:"_getFilter",value:function(t,e){var i=null;if(t){var n,r,o=this._getFabricFilterType(e),a=t.filters.length;for(r=0;rp&&c>0&&(f=u-Math.abs(a-p)),s>v&&l>0&&(d=h-Math.abs(s-v));var m={x:(r-f)/2,y:(o-d)/2};return X()(["x","y"],(function(e){var r=m[e];if(r>0){var o=t(e,r,i,n),a=it(o,2);i=a[0],n=a[1]}})),[i,n,f,d]}function Yo(t,e){var i=e.left,n=e.top,r=e.width,o=e.height,a=e.cropX,s=e.cropY,c={width:r,height:o};return X()(["x","y"],(function(e){var r="x"===e?a:s,o=c[jo[e]],l=No[jo[e]];if(o>l){var u=(o-l)/2;c[jo[e]]=l;var h=t(e,u,i,n),f=it(h,2);i=f[0],n=f[1]}if(r<0){var d=t(e,r,i,n),g=it(d,2);i=g[0],n=g[1]}})),[i,n,c.width,c.height]}function Ho(t,e,i){var n=Go(t),r=ta(n,t.angle,e);i.add(r);var o={fill:new F.fabric.Pattern({source:i.getElement(),repeat:"no-repeat"})};return pe(o,{patternSourceCanvas:i}),o}function Uo(t){var e=t.getObjects(),i=it(e,1),n=i[0],r=ve(n,"fillImageMaxSize"),o=r.fillImageMaxSize;o=Math.max(1,o),t.setDimensions({width:o,height:o}),t.renderAll()}function Wo(t,e){var i=ve(t,"patternSourceCanvas"),n=i.patternSourceCanvas,r=n.getObjects(),o=it(r,1),a=o[0],s=Ro(a);n.remove(a);var c=Go(e,!0),l=ta(c,e.angle,s);n.add(l)}function Go(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return No&&!e||(No=t.toCanvasElement()),No}function Xo(t){var e=t.type,i=t.shapeObj,n=t.outDistance,r=t.left,o=t.top,a=t.flipX,s=t.flipY,c=qo(i),l=[[1,2],[0,3],[0,3],[1,2]],u=Vo(e,c,l),h=Jo(e,c,u),f=u.startPointIndex,d=Zo({outDistance:n,startPointIndex:f,flipX:a,flipY:s,reatAngles:h});return[r+d.left,o+d.top]}function Zo(t){var e=t.outDistance,i=t.startPointIndex,n=t.flipX,r=t.flipY,o=t.reatAngles,a=e*Math.cos(o[0]*Math.PI/180),s=e*Math.cos(o[1]*Math.PI/180),c=2===i||3===i,l={top:c?a:s,left:c?s:a};return Qo(i,n,r)&&(l.left=-1*l.left),Ko(i,n,r)&&(l.top=-1*l.top),l}function Vo(t,e,i){var n=0,r=0;X()(e,(function(e,i){e[t]ha&&(i.remove(a),a.set(this._calcRectDimensionFromPoint(r,o)),i.add(a))}},{key:"_calcRectDimensionFromPoint",value:function(t,e){var i=this.getCanvas(),n=i.getWidth(),r=i.getHeight(),o=this._startPoint,a=o.x,s=o.y,c=Math.min,l=c(a,t),u=c(s,e),h=$t(t,a,n)-l,f=$t(e,s,r)-u;return{left:l,top:u,width:h,height:f}}},{key:"_onMouseUpWithZoomMode",value:function(){var t=this.zoomLevel,e=this.zoomArea,i=this._listeners,n=i.moveZoom,r=i.stopZoom,o=this.getCanvas(),a=this._getCenterPoint(),s=a.x,c=a.y;this._isMaxZoomLevel()||(this._centerPoints.push({x:s,y:c,prevZoomLevel:t,zoomLevel:t+1}),t+=1,o.zoomToPoint({x:s,y:c},t),this._fireZoomChanged(o,t),this.zoomLevel=t),o.off({"mouse:move":n,"mouse:up":r}),o.remove(e),this._startPoint=null}},{key:"_getCenterPoint",value:function(){var t=this.zoomArea,e=t.left,i=t.top,n=t.width,r=t.height,o=this._startPoint,a=o.x,s=o.y,c=this.aspectRatio;return nr?{x:e+c*r/2,y:i+r/2}:{x:e+n/2,y:i+n/c/2}}},{key:"zoom",value:function(t){for(var e=t.x,i=t.y,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.zoomLevel,r=this.getCanvas(),o=this._centerPoints,a=o.length-1;a>=0;a-=1){if(o[a].zoomLevel=5}},{key:"_movePointOfZoom",value:function(t){var e=t.x,i=t.y,n=this._centerPoints;if(n.length){var r=this.getCanvas(),o=this.zoomLevel,a=n.pop(),s=a.x,c=a.y,l=a.prevZoomLevel,u=s-e,h=c-i;r.zoomToPoint({x:s,y:c},l),r.zoomToPoint({x:u,y:h},o),n.push({x:u,y:h,prevZoomLevel:l,zoomLevel:o}),this._fireZoomChanged(r,o)}}},{key:"_onMouseDownWithHandMode",value:function(t){var e=t.target,i=t.e;if(!e){var n=this.getCanvas();if(!(this.zoomLevel<=pa)){n.selection=!1,this._startHandPoint=n.getPointer(i);var r=this._listeners,o=r.moveHand,a=r.stopHand;n.on({"mouse:move":o,"mouse:up":a})}}}},{key:"_onMouseMoveWithHandMode",value:function(t){var e=t.e,i=this.getCanvas(),n=i.getPointer(e),r=n.x,o=n.y,a=r-this._startHandPoint.x,s=o-this._startHandPoint.y;this._movePointOfZoom({x:a,y:s})}},{key:"_onMouseUpWithHandMode",value:function(){var t=this.getCanvas(),e=this._listeners,i=e.moveHand,n=e.stopHand;t.off({"mouse:move":i,"mouse:up":n}),this._startHandPoint=null}},{key:"_changeScrollState",value:function(t){var e=t.viewport,i=t.zoomLevel,n=this.getCanvas();if(n.remove(this._verticalScroll),n.remove(this._horizontalScroll),!this._isDefaultZoomLevel(i)){var r=n.width,o=n.height,a=e.tl,s=e.tr,c=e.bl,l=s.x-a.x,u=c.y-a.y,h=l*l/r,f=u*ga.SIZE,d=$t(a.x+a.x/r*l,a.x,s.x-h),g=u*ga.MARGIN,p=u*ga.BORDER_RADIUS;this._horizontalScroll.set({left:d,top:c.y-f-g,width:h,height:f,rx:p,ry:p});var v=l*da.SIZE,m=u*u/o,y=$t(a.y+a.y/o*u,s.y,c.y-m),b=l*da.MARGIN,_=l*da.BORDER_RADIUS;this._verticalScroll.set({left:s.x-v-b,top:y,width:v,height:m,rx:_,ry:_}),this._addScrollBar()}}},{key:"_changeObjectsEventedState",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.getCanvas();e.forEachObject((function(e){e.evented=t}))}},{key:"_addScrollBar",value:function(){var t=this,e=this.getCanvas();e.add(this._horizontalScroll),e.add(this._verticalScroll),this.scrollBarTid&&clearTimeout(this.scrollBarTid),this.scrollBarTid=p()((function(){e.remove(t._horizontalScroll),e.remove(t._verticalScroll)}),3e3)}},{key:"_isDefaultZoomLevel",value:function(t){return t===pa}},{key:"_fireZoomChanged",value:function(t,e){t.fire(va,{viewport:t.calcViewportBoundaries(),zoomLevel:e})}},{key:"mode",get:function(){return this.zoomMode}}]),i}(ur),Sa=Ma,wa=Oe.create,Ta=Oe.types,Aa=function(){function t(e){D(this,t),this.name=e}return k(t,[{key:"getName",value:function(){return this.name}},{key:"start",value:function(){throw new Error(wa(Ta.UN_IMPLEMENTATION,"start"))}},{key:"end",value:function(){throw new Error(wa(Ta.UN_IMPLEMENTATION,"stop"))}}]),t}(),Da=Aa;function Ea(t){var e=ka();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function ka(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Oa=function(t){oi(i,t);var e=Ea(i);function i(){return D(this,i),e.call(this,kt.CROPPER)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.CROPPER);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.CROPPER);e.end()}}]),i}(Da),ja=Oa;function La(t){var e=Na();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Na(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Pa=function(t){oi(i,t);var e=La(i);function i(){return D(this,i),e.call(this,kt.FREE_DRAWING)}return k(i,[{key:"start",value:function(t,e){var i=t.getComponent(Mt.FREE_DRAWING);i.start(e)}},{key:"end",value:function(t){var e=t.getComponent(Mt.FREE_DRAWING);e.end()}}]),i}(Da),za=Pa;function Ra(t){var e=Ba();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Ba(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Fa=function(t){oi(i,t);var e=Ra(i);function i(){return D(this,i),e.call(this,kt.LINE_DRAWING)}return k(i,[{key:"start",value:function(t,e){var i=t.getComponent(Mt.LINE);i.start(e)}},{key:"end",value:function(t){var e=t.getComponent(Mt.LINE);e.end()}}]),i}(Da),Ya=Fa;function Ha(t){var e=Ua();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Ua(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Wa=function(t){oi(i,t);var e=Ha(i);function i(){return D(this,i),e.call(this,kt.SHAPE)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.SHAPE);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.SHAPE);e.end()}}]),i}(Da),Ga=Wa;function Xa(t){var e=Za();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Za(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var Va=function(t){oi(i,t);var e=Xa(i);function i(){return D(this,i),e.call(this,kt.TEXT)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.TEXT);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.TEXT);e.end()}}]),i}(Da),Ja=Va;function Qa(t){var e=Ka();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function Ka(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var qa=function(t){oi(i,t);var e=Qa(i);function i(){return D(this,i),e.call(this,kt.ICON)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.ICON);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.ICON);e.end()}}]),i}(Da),$a=qa;function ts(t){var e=es();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function es(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var is=function(t){oi(i,t);var e=ts(i);function i(){return D(this,i),e.call(this,kt.ZOOM)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.ZOOM);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.ZOOM);e.end()}}]),i}(Da),ns=is,rs=null;function os(t){rs=t}function as(){return rs}function ss(t,e){var i,n;"activeSelection"===t.type?i=Ve()(n=t.getObjects()).call(n,(function(i){var n=i.angle,r=i.left,o=i.top,a=i.scaleX,s=i.scaleY,c=i.width,l=i.height;F.fabric.util.addTransformToObject(i,t.calcTransformMatrix());var u=e(i);return i.set({angle:n,left:r,top:o,width:c,height:l,scaleX:a,scaleY:s}),u})):i=[e(t)];return i}function cs(t,e,i){return i?{id:t,width:e.width,height:e.height,top:e.top,left:e.left,angle:e.angle,scaleX:e.scaleX,scaleY:e.scaleY}:H()({id:t},e)}function ls(t){var e=us();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function us(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var hs=function(t){oi(i,t);var e=ls(i);function i(t){var n;return D(this,i),n=e.call(this,Mt.RESIZE,t),n._dimensions=null,n._originalDimensions=null,n}return k(i,[{key:"getCurrentDimensions",value:function(){var t=this.getCanvasImage();if(!this._dimensions&&t){var e=t.width,i=t.height;this._dimensions={width:e,height:i}}return this._dimensions}},{key:"getOriginalDimensions",value:function(){return this._originalDimensions}},{key:"setOriginalDimensions",value:function(t){this._originalDimensions=t}},{key:"resize",value:function(t){var e=this.getCanvasImage(),i=e.width,n=e.height,r=e.scaleX,o=e.scaleY,a=t.width,s=t.height,c={scaleX:a?a/i:r,scaleY:s?s/n:o};return r===c.scaleX&&o===c.scaleY||(e.set(c).setCoords(),this._dimensions={width:e.width*e.scaleX,height:e.height*e.scaleY}),this.adjustCanvasDimensionBase(),z().resolve()}},{key:"start",value:function(){var t=this.getCurrentDimensions();this.setOriginalDimensions(t)}},{key:"end",value:function(){}}]),i}(ur),fs=hs;function ds(t){var e=gs();return function(){var i,n=hi(t);if(e){var r=hi(this).constructor;i=ei()(n,arguments,r)}else i=n.apply(this,arguments);return li(this,i)}}function gs(){if("undefined"===typeof Reflect||!ei())return!1;if(ei().sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(ei()(Boolean,[],(function(){}))),!0}catch(t){return!1}}var ps=function(t){oi(i,t);var e=ds(i);function i(){return D(this,i),e.call(this,kt.RESIZE)}return k(i,[{key:"start",value:function(t){var e=t.getComponent(Mt.RESIZE);e.start()}},{key:"end",value:function(t){var e=t.getComponent(Mt.RESIZE);e.end()}}]),i}(Da),vs=ps,ms=1e3,ys=800,bs=10,_s={cssOnly:!0},xs={backstoreOnly:!0},Cs=function(){function t(e){var i,n,r,o,a,s,c,l,u,h,f,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=d.cssMaxWidth,p=d.cssMaxHeight;D(this,t),this.canvasImage=null,this.cssMaxWidth=g||ms,this.cssMaxHeight=p||ys,this.cropSelectionStyle={},this.targetObjectForCopyPaste=null,this.imageName="",this._objects={},this._canvas=null,this._drawingMode=kt.NORMAL,this._drawingModeMap={},this._componentMap={},this._handler={onMouseDown:j()(i=this._onMouseDown).call(i,this),onObjectAdded:j()(n=this._onObjectAdded).call(n,this),onObjectRemoved:j()(r=this._onObjectRemoved).call(r,this),onObjectMoved:j()(o=this._onObjectMoved).call(o,this),onObjectScaled:j()(a=this._onObjectScaled).call(a,this),onObjectModified:j()(s=this._onObjectModified).call(s,this),onObjectRotated:j()(c=this._onObjectRotated).call(c,this),onObjectSelected:j()(l=this._onObjectSelected).call(l,this),onPathCreated:j()(u=this._onPathCreated).call(u,this),onSelectionCleared:j()(h=this._onSelectionCleared).call(h,this),onSelectionCreated:j()(f=this._onSelectionCreated).call(f,this)},this._setObjectCachingToFalse(),this._setCanvasElement(e),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents(),this._attachZoomEvents()}return k(t,[{key:"destroy",value:function(){var t=this._canvas.wrapperEl;this._canvas.clear(),t.parentNode.removeChild(t),this._detachZoomEvents()}},{key:"_attachZoomEvents",value:function(){var t=this.getComponent(Mt.ZOOM);t.attachKeyboardZoomEvents()}},{key:"_detachZoomEvents",value:function(){var t=this.getComponent(Mt.ZOOM);t.detachKeyboardZoomEvents()}},{key:"deactivateAll",value:function(){return this._canvas.discardActiveObject(),this}},{key:"renderAll",value:function(){return this._canvas.renderAll(),this}},{key:"add",value:function(t){var e,i=[];ar()(t)?i=t:i.push(t),(e=this._canvas).add.apply(e,w(i))}},{key:"contains",value:function(t){return this._canvas.contains(t)}},{key:"getObjects",value:function(){var t;return h()(t=this._canvas.getObjects()).call(t)}},{key:"getObject",value:function(t){return this._objects[t]}},{key:"remove",value:function(t){this._canvas.remove(t)}},{key:"removeAll",value:function(t){var e,i=this._canvas,n=h()(e=i.getObjects()).call(e);return i.remove.apply(i,w(this._canvas.getObjects())),t&&i.clear(),n}},{key:"removeObjectById",value:function(t){var e=[],i=this._canvas,n=this.getObject(t),r=n&&n.isType("group")&&!n.isEmpty();return r?(i.discardActiveObject(),n.forEachObject((function(t){e.push(t),i.remove(t)}))):i.contains(n)&&(e.push(n),i.remove(n)),e}},{key:"getObjectId",value:function(t){var e=null;for(e in this._objects)if(this._objects.hasOwnProperty(e)&&t===this._objects[e])return e;return null}},{key:"getActiveObject",value:function(){return this._canvas._activeObject}},{key:"getActiveObjectIdForRemove",value:function(){var t=this.getActiveObject(),e=t.type,i=t.left,n=t.top,r="activeSelection"===e;if(r){var o=new F.fabric.Group(w(t.getObjects()),{left:i,top:n});return this._addFabricObject(o)}return this.getObjectId(t)}},{key:"isReadyRemoveObject",value:function(){var t=this.getActiveObject();return t&&!t.isEditing}},{key:"getActiveObjects",value:function(){var t=this._canvas._activeObject;return t&&"activeSelection"===t.type?t:null}},{key:"getActiveSelectionFromObjects",value:function(t){var e=this.getCanvas();return new F.fabric.ActiveSelection(t,{canvas:e})}},{key:"setActiveObject",value:function(t){this._canvas.setActiveObject(t)}},{key:"setCropSelectionStyle",value:function(t){this.cropSelectionStyle=t}},{key:"getComponent",value:function(t){return this._componentMap[t]}},{key:"getDrawingMode",value:function(){return this._drawingMode}},{key:"startDrawingMode",value:function(t,e){if(this._isSameDrawingMode(t))return!0;this.stopDrawingMode();var i=this._getDrawingModeInstance(t);return i&&i.start&&(i.start(this,e),this._drawingMode=t),!!i}},{key:"stopDrawingMode",value:function(){if(!this._isSameDrawingMode(kt.NORMAL)){var t=this._getDrawingModeInstance(this.getDrawingMode());t&&t.end&&t.end(this),this._drawingMode=kt.NORMAL}}},{key:"zoom",value:function(t,e){var i=t.x,n=t.y,r=this.getComponent(Mt.ZOOM);r.zoom({x:i,y:n},e)}},{key:"getZoomMode",value:function(){var t=this.getComponent(Mt.ZOOM);return t.mode}},{key:"startZoomInMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.startZoomInMode()}},{key:"endZoomInMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.endZoomInMode()}},{key:"zoomOut",value:function(){var t=this.getComponent(Mt.ZOOM);t.zoomOut()}},{key:"startHandMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.startHandMode()}},{key:"endHandMode",value:function(){var t=this.getComponent(Mt.ZOOM);t.endHandMode()}},{key:"resetZoom",value:function(){var t=this.getComponent(Mt.ZOOM);t.resetZoom()}},{key:"toDataURL",value:function(t){var e=this.getComponent(Mt.CROPPER);e.changeVisibility(!1);var i=this._canvas&&this._canvas.toDataURL(t);return e.changeVisibility(!0),i}},{key:"setCanvasImage",value:function(t,e){e&&Kt(e),this.imageName=t,this.canvasImage=e}},{key:"setCssMaxDimension",value:function(t){this.cssMaxWidth=t.width||this.cssMaxWidth,this.cssMaxHeight=t.height||this.cssMaxHeight}},{key:"adjustCanvasDimension",value:function(){this.adjustCanvasDimensionBase(this.canvasImage.scale(1))}},{key:"adjustCanvasDimensionBase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t||(t=this.canvasImage);var e=t.getBoundingRect(),i=e.width,n=e.height,r=this._calcMaxDimension(i,n);this.setCanvasCssDimension({width:"100%",height:"100%","max-width":"".concat(r.width,"px"),"max-height":"".concat(r.height,"px")}),this.setCanvasBackstoreDimension({width:i,height:n}),this._canvas.centerObject(t)}},{key:"setCanvasCssDimension",value:function(t){this._canvas.setDimensions(t,_s)}},{key:"setCanvasBackstoreDimension",value:function(t){this._canvas.setDimensions(t,xs)}},{key:"setImageProperties",value:function(t,e){var i=this.canvasImage;i&&(i.set(t).setCoords(),e&&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(t){var e,i=this,n=j()(e=this._callbackAfterLoadingImageObject).call(e,this);return new(z())((function(e){F.fabric.Image.fromURL(t,(function(t){n(t),e(i.createObjectProperties(t))}),{crossOrigin:"Anonymous"})}))}},{key:"getCenter",value:function(){return this._canvas.getCenter()}},{key:"getCropzoneRect",value:function(){return this.getComponent(Mt.CROPPER).getCropzoneRect()}},{key:"setCropzoneRect",value:function(t){this.getComponent(Mt.CROPPER).setCropzoneRect(t)}},{key:"getCroppedImageData",value:function(t){return this.getComponent(Mt.CROPPER).getCroppedImageData(t)}},{key:"setBrush",value:function(t){var e=this._drawingMode,i=Mt.FREE_DRAWING;e===kt.LINE_DRAWING&&(i=Mt.LINE),this.getComponent(i).setBrush(t)}},{key:"setDrawingShape",value:function(t,e){this.getComponent(Mt.SHAPE).setStates(t,e)}},{key:"setIconStyle",value:function(t,e){this.getComponent(Mt.ICON).setStates(t,e)}},{key:"registerPaths",value:function(t){this.getComponent(Mt.ICON).registerPaths(t)}},{key:"changeCursor",value:function(t){var e=this.getCanvas();e.defaultCursor=t,e.renderAll()}},{key:"hasFilter",value:function(t){return this.getComponent(Mt.FILTER).hasFilter(t)}},{key:"setSelectionStyle",value:function(t){H()(Nt.SELECTION_STYLE,t)}},{key:"setObjectProperties",value:function(t,e){var i=this.getObject(t),n=H()({},e);return i.set(n),i.setCoords(),this.getCanvas().renderAll(),n}},{key:"getObjectProperties",value:function(t,e){var i=this.getObject(t),n={};return Q()(e)?n[e]=i[e]:ar()(e)?di()(e,(function(t){n[t]=i[t]})):cr()(e,(function(t,e){n[e]=i[e]})),n}},{key:"getObjectPosition",value:function(t,e,i){var n=this.getObject(t);return n?n.getPointByOrigin(e,i):null}},{key:"setObjectPosition",value:function(t,e){var i=this.getObject(t),n=e.x,r=e.y,o=e.originX,a=e.originY;if(!i)return!1;var s=i.getPointByOrigin(o,a),c=i.getPointByOrigin("center","center"),l=c.x-s.x,u=c.y-s.y;return i.set({left:n+l,top:r+u}),i.setCoords(),!0}},{key:"getCanvasSize",value:function(){var t=this.getCanvasImage();return{width:t?t.width:0,height:t?t.height:0}}},{key:"createStaticCanvas",value:function(){var t=new F.fabric.StaticCanvas;return t.set({enableRetinaScaling:!1}),t}},{key:"_getDrawingModeInstance",value:function(t){return this._drawingModeMap[t]}},{key:"_setObjectCachingToFalse",value:function(){F.fabric.Object.prototype.objectCaching=!1}},{key:"_setCanvasElement",value:function(t){var e,i;e=t.nodeType?t:document.querySelector(t),"CANVAS"!==e.nodeName.toUpperCase()&&(i=document.createElement("canvas"),e.appendChild(i)),this._canvas=new F.fabric.Canvas(i,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})}},{key:"_createDrawingModeInstances",value:function(){this._register(this._drawingModeMap,new ja),this._register(this._drawingModeMap,new za),this._register(this._drawingModeMap,new Ya),this._register(this._drawingModeMap,new Ga),this._register(this._drawingModeMap,new Ja),this._register(this._drawingModeMap,new $a),this._register(this._drawingModeMap,new ns),this._register(this._drawingModeMap,new vs)}},{key:"_createComponents",value:function(){this._register(this._componentMap,new pr(this)),this._register(this._componentMap,new Nr(this)),this._register(this._componentMap,new Br(this)),this._register(this._componentMap,new Ur(this)),this._register(this._componentMap,new Zr(this)),this._register(this._componentMap,new no(this)),this._register(this._componentMap,new uo(this)),this._register(this._componentMap,new vo(this)),this._register(this._componentMap,new Do(this)),this._register(this._componentMap,new ca(this)),this._register(this._componentMap,new Sa(this)),this._register(this._componentMap,new fs(this))}},{key:"_register",value:function(t,e){t[e.getName()]=e}},{key:"_isSameDrawingMode",value:function(t){return this.getDrawingMode()===t}},{key:"_calcMaxDimension",value:function(t,e){var i=this.cssMaxWidth/t,n=this.cssMaxHeight/e,r=Math.min(t,this.cssMaxWidth),o=Math.min(e,this.cssMaxHeight);return i<1&&i1)r=t.getActiveSelectionFromObjects(e);else{var i=it(e,1);r=i[0]}t.targetObjectForCopyPaste=r,t.setActiveObject(r)}))}},{key:"_cloneObject",value:function(t){var e=this,i=Ve()(t).call(t,(function(t){return e._cloneObjectItem(t)}));return z().all(i)}},{key:"_cloneObjectItem",value:function(t){var e=this;return this._copyFabricObjectForPaste(t).then((function(t){var i=e.createObjectProperties(t);return e.add(t),e.fire(At.ADD_OBJECT,i),t}))}},{key:"_copyFabricObjectForPaste",value:function(t){var e=this,i=function(t,e){return e?t-bs:t+bs};return this._copyFabricObject(t).then((function(t){var n=t.left,r=t.top,o=t.width,a=t.height,s=e.getCanvasSize(),c=s.width,l=s.height,u=n+o/2,h=r+a/2;return t.set(H()({left:i(n,u+bs>c),top:i(r,h+bs>l)},Nt.SELECTION_STYLE)),t}))}},{key:"_copyFabricObject",value:function(t){var e=this;return new(z())((function(i){t.clone((function(n){var r=e.getComponent(Mt.SHAPE);xe(n)&&r.processForCopiedObject(n,t),i(n)}))}))}},{key:"getCurrentDimensions",value:function(){var t=this.getComponent(Mt.RESIZE);return t.getCurrentDimensions()}},{key:"getOriginalDimensions",value:function(){var t=this.getComponent(Mt.RESIZE);return t.getOriginalDimensions()}},{key:"setOriginalDimensions",value:function(t){var e=this.getComponent(Mt.RESIZE);e.setOriginalDimensions(t)}},{key:"resize",value:function(t){var e=this.getComponent(Mt.RESIZE);return e.resize(t)}}]),t}();V().mixin(Cs);var Is=Cs,Ms=At.MOUSE_DOWN,Ss=At.OBJECT_MOVED,ws=At.OBJECT_SCALED,Ts=At.OBJECT_ACTIVATED,As=At.OBJECT_ROTATED,Ds=At.OBJECT_ADDED,Es=At.OBJECT_MODIFIED,ks=At.ADD_TEXT,Os=At.ADD_OBJECT,js=At.TEXT_EDITING,Ls=At.TEXT_CHANGED,Ns=At.ICON_CREATE_RESIZE,Ps=At.ICON_CREATE_END,zs=At.SELECTION_CLEARED,Rs=At.SELECTION_CREATED,Bs=At.ADD_OBJECT_AFTER,Fs=function(){function t(e,i){var n,r,o,a,s,c,l,u,h,f,d,g,p,v,m,y;if(D(this,t),i=H()({includeUI:!1,usageStatistics:!0},i),this.mode=null,this.activeObjectId=null,i.includeUI){var b=i.includeUI;b.usageStatistics=i.usageStatistics,this.ui=new tr(e,b,this.getActions()),i=this.ui.setUiDefaultSelectionStyle(i)}this._invoker=new He,this._graphics=new Is(this.ui?this.ui.getEditorArea():e,{cssMaxWidth:i.cssMaxWidth,cssMaxHeight:i.cssMaxHeight}),this._handlers={keydown:j()(n=this._onKeyDown).call(n,this),mousedown:j()(r=this._onMouseDown).call(r,this),objectActivated:j()(o=this._onObjectActivated).call(o,this),objectMoved:j()(a=this._onObjectMoved).call(a,this),objectScaled:j()(s=this._onObjectScaled).call(s,this),objectRotated:j()(c=this._onObjectRotated).call(c,this),objectAdded:j()(l=this._onObjectAdded).call(l,this),objectModified:j()(u=this._onObjectModified).call(u,this),createdPath:this._onCreatedPath,addText:j()(h=this._onAddText).call(h,this),addObject:j()(f=this._onAddObject).call(f,this),textEditing:j()(d=this._onTextEditing).call(d,this),textChanged:j()(g=this._onTextChanged).call(g,this),iconCreateResize:j()(p=this._onIconCreateResize).call(p,this),iconCreateEnd:j()(v=this._onIconCreateEnd).call(v,this),selectionCleared:j()(m=this._selectionCleared).call(m,this),selectionCreated:j()(y=this._selectionCreated).call(y,this)},this._attachInvokerEvents(),this._attachGraphicsEvents(),this._attachDomEvents(),this._setSelectionStyle(i.selectionStyle,{applyCropSelectionStyle:i.applyCropSelectionStyle,applyGroupSelectionStyle:i.applyGroupSelectionStyle}),i.usageStatistics&&ae(),this.ui&&(this.ui.initCanvas(),this.setReAction(),this._attachColorPickerInputBoxEvents()),F.fabric.enableGLFiltering=!1}return k(t,[{key:"_attachColorPickerInputBoxEvents",value:function(){var t=this;this.ui.on(At.INPUT_BOX_EDITING_STARTED,(function(){t.isColorPickerInputBoxEditing=!0})),this.ui.on(At.INPUT_BOX_EDITING_STOPPED,(function(){t.isColorPickerInputBoxEditing=!1}))}},{key:"_detachColorPickerInputBoxEvents",value:function(){this.ui.off(At.INPUT_BOX_EDITING_STARTED),this.ui.off(At.INPUT_BOX_EDITING_STOPPED)}},{key:"_setSelectionStyle",value:function(t,e){var i=e.applyCropSelectionStyle,n=e.applyGroupSelectionStyle;t&&this._graphics.setSelectionStyle(t),i&&this._graphics.setCropSelectionStyle(t),n&&this.on("selectionCreated",(function(e){"activeSelection"===e.type&&e.set(t)}))}},{key:"_attachInvokerEvents",value:function(){var t,e,i=this,n=At.UNDO_STACK_CHANGED,r=At.REDO_STACK_CHANGED,o=At.EXECUTE_COMMAND,a=At.AFTER_UNDO,s=At.AFTER_REDO,c=At.HAND_STARTED,l=At.HAND_STOPPED;if(this._invoker.on(n,j()(t=this.fire).call(t,this,n)),this._invoker.on(r,j()(e=this.fire).call(e,this,r)),this.ui){var u=this._graphics.getCanvas();this._invoker.on(o,(function(t){return i.ui.fire(o,t)})),this._invoker.on(a,(function(t){return i.ui.fire(a,t)})),this._invoker.on(s,(function(t){return i.ui.fire(s,t)})),u.on(c,(function(){return i.ui.fire(c)})),u.on(l,(function(){return i.ui.fire(l)}))}}},{key:"_attachGraphicsEvents",value:function(){var t;this._graphics.on((t={},A(t,Ms,this._handlers.mousedown),A(t,Ss,this._handlers.objectMoved),A(t,ws,this._handlers.objectScaled),A(t,As,this._handlers.objectRotated),A(t,Ts,this._handlers.objectActivated),A(t,Ds,this._handlers.objectAdded),A(t,Es,this._handlers.objectModified),A(t,ks,this._handlers.addText),A(t,Os,this._handlers.addObject),A(t,js,this._handlers.textEditing),A(t,Ls,this._handlers.textChanged),A(t,Ns,this._handlers.iconCreateResize),A(t,Ps,this._handlers.iconCreateEnd),A(t,zs,this._handlers.selectionCleared),A(t,Rs,this._handlers.selectionCreated),t))}},{key:"_attachDomEvents",value:function(){document.addEventListener("keydown",this._handlers.keydown)}},{key:"_detachDomEvents",value:function(){document.removeEventListener("keydown",this._handlers.keydown)}},{key:"_onKeyDown",value:function(t){var e=t.ctrlKey,i=t.keyCode,n=t.metaKey,r=e||n;r&&(i===Lt.C?this._graphics.resetTargetObjectForCopyPaste():i===Lt.V?(this._graphics.pasteObject(),this.clearRedoStack()):i===Lt.Z?this.undo()["catch"]((function(){})):i===Lt.Y&&this.redo()["catch"]((function(){})));var o=i===Lt.BACKSPACE||i===Lt.DEL,a=this._graphics.isReadyRemoveObject();!this.isColorPickerInputBoxEditing&&a&&o&&(t.preventDefault(),this.removeActiveObject())}},{key:"removeActiveObject",value:function(){var t=this._graphics.getActiveObjectIdForRemove();this.removeObject(t)}},{key:"_onMouseDown",value:function(t,e){this.fire(At.MOUSE_DOWN,t,e)}},{key:"_pushAddObjectCommand",value:function(t){var e=Fe.create(Tt.ADD_OBJECT,this._graphics,t);this._invoker.pushUndoStack(e)}},{key:"_pushModifyObjectCommand",value:function(t){var e=this,i=t.type,n=ss(t,(function(t){return cs(e._graphics.getObjectId(t),t,"activeSelection"===i)})),r=Fe.create(Tt.CHANGE_SELECTION,this._graphics,n);r.execute(this._graphics,n),this._invoker.pushUndoStack(r)}},{key:"_onObjectActivated",value:function(t){this.fire(At.OBJECT_ACTIVATED,t)}},{key:"_onObjectMoved",value:function(t){this.fire(At.OBJECT_MOVED,t)}},{key:"_onObjectScaled",value:function(t){this.fire(At.OBJECT_SCALED,t)}},{key:"_onObjectRotated",value:function(t){this.fire(At.OBJECT_ROTATED,t)}},{key:"getDrawingMode",value:function(){return this._graphics.getDrawingMode()}},{key:"clearObjects",value:function(){return this.execute(Tt.CLEAR_OBJECTS)}},{key:"deactivateAll",value:function(){this._graphics.deactivateAll(),this._graphics.renderAll()}},{key:"discardSelection",value:function(){this._graphics.discardSelection()}},{key:"changeSelectableAll",value:function(t){this._graphics.changeSelectableAll(t)}},{key:"_initHistory",value:function(){this.ui&&this.ui.initHistory()}},{key:"_clearHistory",value:function(){this.ui&&this.ui.clearHistory()}},{key:"execute",value:function(t){for(var e,i,n,r=arguments.length,o=new Array(r>1?r-1:0),a=1;a1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:1,i=z().resolve(),n=0;n0&&void 0!==arguments[0]?arguments[0]:1,i=z().resolve(),n=0;n1?arguments[1]:void 0),i=o(this,this.constructor),n=0,c=e.length,l=new(s(i))(c);while(c>n)l[n]=e[n++];return l}))},ca91:function(t,e,i){"use strict";var n=i("ebb5"),r=i("d58f").left,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("reduce",(function(t){return r(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}))},cd26:function(t,e,i){"use strict";var n=i("ebb5"),r=n.aTypedArray,o=n.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){var t,e=this,i=r(e).length,n=a(i/2),o=0;while(o1?arguments[1]:void 0)}))},d58f:function(t,e,i){var n=i("1c0b"),r=i("7b0b"),o=i("44ad"),a=i("50c4"),s=function(t){return function(e,i,s,c){n(i);var l=r(e),u=o(l),h=a(l.length),f=t?h-1:0,d=t?-1:1;if(s<2)while(1){if(f in u){c=u[f],f+=d;break}if(f+=d,t?f<0:h<=f)throw TypeError("Reduce of empty array with no initial value")}for(;t?f>=0:h>f;f+=d)f in u&&(c=i(c,u[f],f,l));return c}};t.exports={left:s(!1),right:s(!0)}},d5d6:function(t,e,i){"use strict";var n=i("ebb5"),r=i("b727").forEach,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("forEach",(function(t){r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},e58c:function(t,e,i){"use strict";var n=i("fc6a"),r=i("a691"),o=i("50c4"),a=i("a640"),s=i("ae40"),c=Math.min,l=[].lastIndexOf,u=!!l&&1/[1].lastIndexOf(1,-0)<0,h=a("lastIndexOf"),f=s("indexOf",{ACCESSORS:!0,1:0}),d=u||!h||!f;t.exports=d?function(t){if(u)return l.apply(this,arguments)||0;var e=n(this),i=o(e.length),a=i-1;for(arguments.length>1&&(a=c(a,r(arguments[1]))),a<0&&(a=i+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:l},e91f:function(t,e,i){"use strict";var n=i("ebb5"),r=i("4d64").indexOf,o=n.aTypedArray,a=n.exportTypedArrayMethod;a("indexOf",(function(t){return r(o(this),t,arguments.length>1?arguments[1]:void 0)}))},ebb5:function(t,e,i){"use strict";var n,r=i("a981"),o=i("83ab"),a=i("da84"),s=i("861d"),c=i("5135"),l=i("f5df"),u=i("9112"),h=i("6eeb"),f=i("9bf2").f,d=i("e163"),g=i("d2bb"),p=i("b622"),v=i("90e3"),m=a.Int8Array,y=m&&m.prototype,b=a.Uint8ClampedArray,_=b&&b.prototype,x=m&&d(m),C=y&&d(y),I=Object.prototype,M=I.isPrototypeOf,S=p("toStringTag"),w=v("TYPED_ARRAY_TAG"),T=r&&!!g&&"Opera"!==l(a.opera),A=!1,D={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},E=function(t){var e=l(t);return"DataView"===e||c(D,e)},k=function(t){return s(t)&&c(D,l(t))},O=function(t){if(k(t))return t;throw TypeError("Target is not a typed array")},j=function(t){if(g){if(M.call(x,t))return t}else for(var e in D)if(c(D,n)){var i=a[e];if(i&&(t===i||M.call(i,t)))return t}throw TypeError("Target is not a typed array constructor")},L=function(t,e,i){if(o){if(i)for(var n in D){var r=a[n];r&&c(r.prototype,t)&&delete r.prototype[t]}C[t]&&!i||h(C,t,i?e:T&&y[t]||e)}},N=function(t,e,i){var n,r;if(o){if(g){if(i)for(n in D)r=a[n],r&&c(r,t)&&delete r[t];if(x[t]&&!i)return;try{return h(x,t,i?e:T&&m[t]||e)}catch(s){}}for(n in D)r=a[n],!r||r[t]&&!i||h(r,t,e)}};for(n in D)a[n]||(T=!1);if((!T||"function"!=typeof x||x===Function.prototype)&&(x=function(){throw TypeError("Incorrect invocation")},T))for(n in D)a[n]&&g(a[n],x);if((!T||!C||C===I)&&(C=x.prototype,T))for(n in D)a[n]&&g(a[n].prototype,C);if(T&&d(_)!==C&&g(_,C),o&&!c(C,S))for(n in A=!0,f(C,S,{get:function(){return s(this)?this[w]:void 0}}),D)a[n]&&u(a[n],w,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:A&&w,aTypedArray:O,aTypedArrayConstructor:j,exportTypedArrayMethod:L,exportTypedArrayStaticMethod:N,isView:E,isTypedArray:k,TypedArray:x,TypedArrayPrototype:C}},f8cd:function(t,e,i){var n=i("a691");t.exports=function(t){var e=n(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}},fec2:function(t,e,i){ /*! * TOAST UI Color Picker * @version 2.2.8 * @author NHN Cloud FE Development Team * @license MIT */ (function(e,i){t.exports=i()})(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="dist",i(i.s=33)}([function(t,e,i){"use strict";function n(t,e){var i,n,r,o,a=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;r=0&&r-1?e[i][1]+=1:e.push([t,1]))},h.prototype._forgetContext=function(t){var e,i;r(t)&&(e=this._safeContext(),i=this._indexOfContext(t),i>-1&&(e[i][1]-=1,e[i][1]<=0&&e.splice(i,1)))},h.prototype._bindEvent=function(t,e,i){var n=this._safeEvent(t);this._memorizeContext(i),n.push(this._getHandlerItem(e,i))},h.prototype.on=function(t,e,i){var n=this;o(t)?(t=t.split(u),l(t,(function(t){n._bindEvent(t,e,i)}))):a(t)&&(i=e,l(t,(function(t,e){n.on(e,t,i)})))},h.prototype.once=function(t,e,i){var n=this;if(a(t))return i=e,void l(t,(function(t,e){n.once(e,t,i)}));function r(){e.apply(i,arguments),n.off(t,r,i)}this.on(t,r,i)},h.prototype._spliceMatches=function(t,e){var i,n=0;if(s(t))for(i=t.length;n0},h.prototype.getListenerLength=function(t){var e=this._safeEvent(t);return e.length},t.exports=h},function(t,e,i){"use strict";function n(t){return"string"===typeof t||t instanceof String}t.exports=n},function(t,e,i){"use strict";var n=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,r={leadingZero:function(t,e){var i="",n=0;if((t+"").length>e)return t+"";for(;n1?n(h.call(arguments),(function(t){this.add(t)}),this):(e=this.getItemID(t),i=this.items,i[e]||(this.length+=1),i[e]=t)},f.prototype.remove=function(t){var e,i,n=[];return this.length?arguments.length>1?(n=u.map(h.call(arguments),(function(t){return this.remove(t)}),this),n):(e=this.items,l(t)&&(t=this.getItemID(t)),e[t]?(this.length-=1,i=e[t],delete e[t],i):n):n},f.prototype.clear=function(){this.items={},this.length=0},f.prototype.has=function(t){var e,i;return!!this.length&&(e=c(t),i=!1,e?this.each((function(e){return!0!==t(e)||(i=!0,!1)})):(t=l(t)?this.getItemID(t):t,i=s(this.items[t])),i)},f.prototype.doWhenHas=function(t,e,i){var n=this.items[t];s(n)&&e.call(i||this,n)},f.prototype.find=function(t){var e=new f;return this.hasOwnProperty("getItemID")&&(e.getItemID=this.getItemID),this.each((function(i){!0===t(i)&&e.add(i)})),e},f.prototype.groupBy=function(t,e){var i,r,o={},s=c(t),l=this.getItemID;if(a(t)){if(n(t,(function(t){o[t+""]=new f(l)})),!e)return o;t=e,s=!0}return this.each((function(e){s?r=t(e):(r=e[t],c(r)&&(r=r.apply(e))),i=o[r],i||(i=o[r]=new f(l)),i.add(e)})),o},f.prototype.single=function(){var t;return this.each((function(e){return t=e,!1}),this),t},f.prototype.sort=function(t){var e=[];return this.each((function(t){e.push(t)})),c(t)&&(e=e.sort(t)),e},f.prototype.each=function(t,e){r(this.items,t,e||this)},f.prototype.toArray=function(){return this.length?u.map(this.items,(function(t){return t})):[]},t.exports=f},function(t,e,i){"use strict";var n=i(3),r=i(36);function o(t){return!n(t)&&!r(t)}t.exports=o},function(t,e,i){"use strict";function n(t){return t===Object(t)}t.exports=n},function(t,e,i){"use strict";var n={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};function r(){var t,e,i=window.navigator,r=i.appName.replace(/\s/g,"_"),o=i.userAgent,a=/MSIE\s([0-9]+[.0-9]*)/,s=/Trident.*rv:11\./,c=/Edge\/(\d+)\./,l={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},u={Microsoft_Internet_Explorer:function(){var t=o.match(a);t?(n.msie=!0,n.version=parseFloat(t[1])):n.others=!0},Netscape:function(){var i=!1;if(s.exec(o))n.msie=!0,n.version=11,i=!0;else if(c.exec(o))n.edge=!0,n.version=o.match(c)[1],i=!0;else for(t in l)if(l.hasOwnProperty(t)&&(e=o.match(l[t]),e&&e.length>1)){n[t]=i=!0,n.version=parseFloat(e[1]||0);break}i||(n.others=!0)}},h=u[r];h&&u[r]()}"undefined"!==typeof window&&window.navigator&&r(),t.exports=n},function(t,e,i){"use strict";var n=i(3);function r(t){return t&&t.className?n(t.className.baseVal)?t.className:t.className.baseVal:""}t.exports=r},function(t,e,i){"use strict";(function(e){var n=i(10),r=i(42),o=i(44),a=i(47),s=i(28),c=i(17),l=i(14),u=i(15),h=i(0);function f(t,e){l(e,"mousedown",this._onMouseDown,this),this.options=h({distance:10},t),this.container=e,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}f.prototype.destroy=function(){c(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},f.prototype._toggleDragEvent=function(t){var i=this.container;t?(r(i),l(window,"dragstart",u),l(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(o(i),c(window,"dragstart",u),c(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},f.prototype._getEventData=function(t){return{target:s(t),originEvent:t}},f.prototype._onMouseDown=function(t){0===a(t)&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(t),this._toggleDragEvent(!0))},f.prototype._onMouseMove=function(t){var e=this.options.distance;u(t),this._isMoved=!0,this._distance-1)}t.exports=o},function(t,e,i){"use strict";var n=i(10),r=i(53),o=i(54),a=i(30),s=i(0),c=i(18),l=i(9),u=i(32),h=i(12),f=i(8),d=i(24),g=i(57),p=-7,v=112,m=-3,y=115,b=359.99;function _(t,e){e=l.appendHTMLElement("div",e,t.cssPrefix+"slider-container"),e.style.display="none",f.call(this,t,e),this.options=s({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},t),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new d({distance:0},e),this.colorSliderPosLimitRange=[p,v],this.huebarPosLimitRange=[m,y],this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}c(_,f),_.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},_.prototype.toggle=function(t){this.container.style.display=t?"block":"none"},_.prototype.isVisible=function(){return"block"===this.container.style.display},_.prototype.render=function(t){var e,i,n=this.container,r=this.options,o=g.layout;h.isValidRGB(t)&&(o=o.replace(/{{slider}}/,g.slider),o=o.replace(/{{huebar}}/,g.huebar),o=o.replace(/{{cssPrefix}}/g,r.cssPrefix),o=o.replace(/{{id}}/g,r.id),this.container.innerHTML=o,this.sliderSvgElement=n.querySelector("."+r.cssPrefix+"svg-slider"),this.huebarSvgElement=n.querySelector("."+r.cssPrefix+"svg-huebar"),this.sliderHandleElement=n.querySelector("."+r.cssPrefix+"slider-handle"),this.huebarHandleElement=n.querySelector("."+r.cssPrefix+"huebar-handle"),this.baseColorElement=n.querySelector("."+r.cssPrefix+"slider-basecolor"),e=h.hexToRGB(t),i=h.rgbToHSV.apply(null,e),this.moveHue(i[0],!0),this.moveSaturationAndValue(i[1],i[2],!0))},_.prototype._setColorSliderPosMax=function(){var t=this.sliderSvgElement.getClientRects()[0];t&&(this.colorSliderPosLimitRange[1]=t.height-10)},_.prototype._moveColorSliderHandle=function(t,e,i){var n,r=this.sliderHandleElement;e=Math.max(this.colorSliderPosLimitRange[0],e),e=Math.min(this.colorSliderPosLimitRange[1],e),t=Math.max(this.colorSliderPosLimitRange[0],t),t=Math.min(this.colorSliderPosLimitRange[1],t),u.setTranslateXY(r,t,e),n=e>50?"white":"black",u.setStrokeColor(r,n),i||this.fire("_selectColor",{color:h.rgbToHEX.apply(null,this.getRGB())})},_.prototype.moveSaturationAndValue=function(t,e,i){var n,r,o,a;t=t||0,e=e||0,n=Math.abs(this.colorSliderPosLimitRange[0]),r=this.colorSliderPosLimitRange[1],o=t*r/100-n,a=r-e*r/100-n,this._moveColorSliderHandle(o,a,i)},_.prototype._moveColorSliderByPosition=function(t,e){var i=this.colorSliderPosLimitRange[0];this._moveColorSliderHandle(t+i,e+i)},_.prototype.getSaturationAndValue=function(){var t,e,i=Math.abs(this.colorSliderPosLimitRange[0]),n=i+this.colorSliderPosLimitRange[1],r=u.getTranslateXY(this.sliderHandleElement);return t=(r[1]+i)/n*100,e=100-(r[0]+i)/n*100,[t,e]},_.prototype._setHueBarPosMax=function(){var t=this.huebarSvgElement.getClientRects()[0];t&&(this.huebarPosLimitRange[1]=t.height-7)},_.prototype._moveHueHandle=function(t,e){var i,n,r=this.huebarHandleElement,o=this.baseColorElement;t=Math.max(this.huebarPosLimitRange[0],t),t=Math.min(this.huebarPosLimitRange[1],t),u.setTranslateY(r,t),i=h.hsvToRGB(this.getHue(),100,100),n=h.rgbToHEX.apply(null,i),u.setGradientColorStop(o,n),e||this.fire("_selectColor",{color:h.rgbToHEX.apply(null,this.getRGB())})},_.prototype.moveHue=function(t,e){var i,n,r=0;i=Math.abs(this.huebarPosLimitRange[0]),n=i+this.huebarPosLimitRange[1],t=t||0,r=n*t/b-i,this._moveHueHandle(r,e)},_.prototype._moveHueByPosition=function(t){var e=this.huebarPosLimitRange[0];this._moveHueHandle(t+e)},_.prototype.getHue=function(){var t,e,i=this.huebarHandleElement,n=u.getTranslateXY(i);return t=Math.abs(this.huebarPosLimitRange[0]),e=t+this.huebarPosLimitRange[1],(n[0]+t)*b/e},_.prototype.getHSV=function(){var t=this.getSaturationAndValue(),e=this.getHue();return[e].concat(t)},_.prototype.getRGB=function(){return h.hsvToRGB.apply(null,this.getHSV())},_.prototype._prepareColorSliderForMouseEvent=function(t){var e,i=this.options,n=o(t.target,"."+i.cssPrefix+"slider-part");return e=this._dragDataCache={isColorSlider:a(n,i.cssPrefix+"slider-left"),parentElement:n},e},_.prototype._onClick=function(t){var e=this._prepareColorSliderForMouseEvent(t),i=r(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(i[0],i[1]):this._moveHueByPosition(i[1]),this._dragDataCache=null},_.prototype._onDragStart=function(t){this._setColorSliderPosMax(),this._setHueBarPosMax(),this._prepareColorSliderForMouseEvent(t)},_.prototype._onDrag=function(t){var e=this._dragDataCache,i=r(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(i[0],i[1]):this._moveHueByPosition(i[1])},_.prototype._onDragEnd=function(){this._dragDataCache=null},n.mixin(_),t.exports=_},function(t,e,i){"use strict";var n=i(4).isOldBrowser,r=/[\.\-0-9]+/g,o=-6,a={getTranslateXY:function(t){var e;return n?(e=t.style,[parseFloat(e.top),parseFloat(e.left)]):(e=t.getAttribute("transform"),e?(e=e.match(r),[parseFloat(e[1]),parseFloat(e[0])]):[0,0])},setTranslateXY:function(t,e,i){n?(t.style.left=e+"px",t.style.top=i+"px"):t.setAttribute("transform","translate("+e+","+i+")")},setTranslateY:function(t,e){n?t.style.top=e+"px":t.setAttribute("transform","translate("+o+","+e+")")},setStrokeColor:function(t,e){n?t.strokecolor=e:t.setAttribute("stroke",e)},setGradientColorStop:function(t,e){n?t.color=e:t.setAttribute("stop-color",e)}};t.exports=a},function(t,e,i){i(34),t.exports=i(35)},function(t,e,i){},function(t,e,i){"use strict";var n=i(19),r=i(8),o=i(24),a=i(48),s=i(29),c=i(31),l=i(12),u=i(32),h={Collection:n,View:r,Drag:o,create:a,Palette:s,Slider:c,colorutil:l,svgvml:u};t.exports=h},function(t,e,i){"use strict";function n(t){return null===t}t.exports=n},function(t,e,i){"use strict";var n=i(3),r=i(38),o=6048e5;function a(t){var e=(new Date).getTime();return e-t>o}function s(t,e){var i="https://www.google-analytics.com/collect",o=location.hostname,s="event",c="use",l="TOAST UI "+t+" for "+o+": Statistics",u=window.localStorage.getItem(l);(n(window.tui)||!1!==window.tui.usageStatistics)&&(u&&!a(u)||(window.localStorage.setItem(l,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r(i,{v:1,t:s,tid:e,cid:o,dp:o,dh:t,el:t,ec:c})}),1e3)))}t.exports=s},function(t,e,i){"use strict";var n=i(7);function r(t,e){var i=document.createElement("img"),r="";return n(e,(function(t,e){r+="&"+e+"="+t})),r=r.substring(1),i.src=t+"?"+r,i.style.display="none",document.body.appendChild(i),document.body.removeChild(i),i}t.exports=r},function(t,e,i){"use strict";var n=i(2),r=i(5),o=i(23),a=i(40);function s(t){var e,i=Array.prototype.slice.call(arguments,1),s=t.classList,c=[];s?n(i,(function(e){t.classList.add(e)})):(e=o(t),e&&(i=[].concat(e.split(/\s+/),i)),n(i,(function(t){r(t,c)<0&&c.push(t)})),a(t,c))}t.exports=s},function(t,e,i){"use strict";var n=i(1),r=i(3);function o(t,e){e=n(e)?e.join(" "):e,e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),r(t.className.baseVal)?t.className=e:t.className.baseVal=e}t.exports=o},function(t,e,i){"use strict";function n(t){return"number"===typeof t||t instanceof Number}t.exports=n},function(t,e,i){"use strict";var n=i(14),r=i(15),o=i(43),a=i(27),s="onselectstart"in document,c="prevUserSelect",l=a(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function u(t){t||(t=document),s?n(t,"selectstart",r):(t=t===document?document.documentElement:t,o(t,c,t.style[l]),t.style[l]="none")}t.exports=u},function(t,e,i){"use strict";var n=i(16);function r(t,e,i){t.dataset?t.dataset[e]=i:t.setAttribute("data-"+n(e),i)}t.exports=r},function(t,e,i){"use strict";var n=i(17),r=i(15),o=i(45),a=i(46),s=i(27),c="onselectstart"in document,l="prevUserSelect",u=s(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function h(t){t||(t=document),c?n(t,"selectstart",r):(t=t===document?document.documentElement:t,t.style[u]=o(t,l)||"auto",a(t,l))}t.exports=h},function(t,e,i){"use strict";var n=i(16);function r(t,e){return t.dataset?t.dataset[e]:t.getAttribute("data-"+n(e))}t.exports=r},function(t,e,i){"use strict";var n=i(16);function r(t,e){t.dataset?delete t.dataset[e]:t.removeAttribute("data-"+n(e))}t.exports=r},function(t,e,i){"use strict";var n=i(22),r=i(5),o=["0","1","3","5","7"],a=["2","6"],s=["4"];function c(t){return n.msie&&n.version<=8?l(t):t.button}function l(t){var e=String(t.button);return r(e,o)>-1?0:r(e,a)>-1?2:r(e,s)>-1?1:null}t.exports=c},function(t,e,i){"use strict";var n=i(10),r=i(0),o=i(4),a=i(12),s=i(49),c=i(29),l=i(31),u=0;function h(){return u+=1,u}function f(t){var e;if(!(this instanceof f))return new f(t);if(t=this.options=r({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:h(),usageStatistics:!0},t),!t.container)throw new Error("ColorPicker(): need container option.");e=this.layout=new s(t,t.container),this.palette=new c(t,e.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new l(t,e.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),e.addChild(this.palette),e.addChild(this.slider),this.render(t.color),t.usageStatistics&&o.sendHostName()}f.prototype._onSelectColorInPalette=function(t){var e=t.color,i=this.options;a.isValidRGB(e)||""===e?(this.fire("selectColor",{color:e,origin:"palette"}),i.color!==e&&(i.color=e,this.render(e))):this.render()},f.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},f.prototype._onSelectColorInSlider=function(t){var e=t.color,i=this.options;this.fire("selectColor",{color:e,origin:"slider"}),i.color!==e&&(i.color=e,this.palette.render(e))},f.prototype.setColor=function(t){if(!a.isValidRGB(t))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=t,this.render(t)},f.prototype.getColor=function(){return this.options.color},f.prototype.toggle=function(t){this.layout.container.style.display=t?"block":"none"},f.prototype.render=function(t){this.layout.render(t||this.options.color)},f.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},n.mixin(f),t.exports=f},function(t,e,i){"use strict";var n=i(0),r=i(18),o=i(9),a=i(8);function s(t,e){this.options=n({cssPrefix:"tui-colorpicker-"},t),e=o.appendHTMLElement("div",e,this.options.cssPrefix+"container"),a.call(this,t,e),this.render()}r(s,a),s.prototype.render=function(t){this.recursive((function(e){e.render(t)}),!0)},t.exports=s},function(t,e,i){"use strict";function n(t){function e(){}return e.prototype=t,new e}t.exports=n},function(t,e,i){"use strict";var n=i(52);t.exports=function(t){var e=['
    • '].join(""),i=['
        ',"{{each preset}}",e,"{{/each}}","
      ",'
      ','','','{{color}}',"
      "].join("\n");return n(i,t)}},function(t,e,i){"use strict";var n=i(5),r=i(2),o=i(1),a=i(11),s=i(0),c=/{{\s?|\s?}}/g,l=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,u=/\[\s?|\s?\]/,h=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,f=/\./,d=/^["']\w+["']$/,g=/"|'/g,p=/^-?\d+\.?\d*$/,v=2,m={if:C,each:I,with:M},y=3==="a".split(/a/).length,b=function(){return y?function(t,e){return t.split(e)}:function(t,e){var i,n,r=[],o=0;e.global||(e=new RegExp(e,"g")),i=e.exec(t);while(null!==i)n=i.index,r.push(t.slice(o,n)),o=n+i[0].length,i=e.exec(t);return r.push(t.slice(o)),r}}();function _(t,e){var i,n=e[t];return"true"===t?n=!0:"false"===t?n=!1:d.test(t)?n=t.replace(g,""):l.test(t)?(i=t.split(u),n=_(i[0],e)[_(i[1],e)]):h.test(t)?(i=t.split(f),n=_(i[0],e)[i[1]]):p.test(t)&&(n=parseFloat(t)),n}function x(t,e){var i=[t],n=[],o=0,a=0;return r(e,(function(t,r){0===t.indexOf("if")?o+=1:"/if"===t?o-=1:o||0!==t.indexOf("elseif")&&"else"!==t||(i.push("else"===t?["true"]:t.split(" ").slice(1)),n.push(e.slice(a,r)),a=r+1)})),n.push(e.slice(a)),{exps:i,sourcesInsideIf:n}}function C(t,e,i){var n=x(t,e),o=!1,a="";return r(n.exps,(function(t,e){return o=T(t,i),o&&(a=D(n.sourcesInsideIf[e],i)),!o})),a}function I(t,e,i){var n=T(t,i),a=o(n)?"@index":"@key",c={},l="";return r(n,(function(t,n){c[a]=n,c["@this"]=t,s(i,c),l+=D(e.slice(),i)})),l}function M(t,e,i){var r=n("as",t),o=t[r+1],a=T(t.slice(0,r),i),c={};return c[o]=a,D(e,s(i,c))||""}function S(t,e,i){var n=t.splice(e+1,i-e);return n.pop(),n}function w(t,e,i){var n,r=m[t],o=1,s=0,c=s+v,l=e[c];while(o&&a(l))0===l.indexOf(t)?o+=1:0===l.indexOf("/"+t)&&(o-=1,n=c),c+=v,l=e[c];if(o)throw Error(t+" needs {{/"+t+"}} expression.");return e[s]=r(e[s].split(" ").slice(1),S(e,s,n),i),e}function T(t,e){var i=_(t[0],e);return i instanceof Function?A(i,t.slice(1),e):i}function A(t,e,i){var n=[];return r(e,(function(t){n.push(_(t,i))})),t.apply(null,n)}function D(t,e){var i,n,r,o=1,s=t[o];while(a(s))i=s.split(" "),n=i[0],m[n]?(r=w(n,t.splice(o,t.length-o),e),t=t.concat(r)):t[o]=T(i,e),o+=v,s=t[o];return t.join("")}function E(t,e){return D(b(t,c),e)}t.exports=E},function(t,e,i){"use strict";var n=i(1);function r(t,e){var i,r=n(t),o=r?t[0]:t.clientX,a=r?t[1]:t.clientY;return e?(i=e.getBoundingClientRect(),[o-i.left-e.clientLeft,a-i.top-e.clientTop]):[o,a]}t.exports=r},function(t,e,i){"use strict";var n=i(55);function r(t,e){var i=t.parentNode;if(n(t,e))return t;while(i&&i!==document){if(n(i,e))return i;i=i.parentNode}return null}t.exports=r},function(t,e,i){"use strict";var n=i(5),r=i(56),o=Element.prototype,a=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||function(t){var e=this.document||this.ownerDocument;return n(this,r(e.querySelectorAll(t)))>-1};function s(t,e){return a.call(t,e)}t.exports=s},function(t,e,i){"use strict";var n=i(6);function r(t){var e;try{e=Array.prototype.slice.call(t)}catch(i){e=[],n(t,(function(t){e.push(t)}))}return e}t.exports=r},function(t,e,i){"use strict";(function(e){var n=i(4).isOldBrowser,r=['
      {{slider}}
      ','
      {{huebar}}
      '].join("\n"),o=['',"",'','','',"",'','','',"","",'','','',""].join("\n"),a=['
      ','','',"",'','',"",'',"
      "].join("\n"),s=['',"",'','','','','','','','',"","",'','',""].join("\n"),c=['
      ','','',"",'',"
      "].join("\n");n&&e.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),t.exports={layout:r,slider:n?a:o,huebar:n?c:s}}).call(this,i(25))}])}))}}]);