yui-image-editor 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +8 -0
- package/.gitattributes +1 -0
- package/.nrmrc +1 -0
- package/.oxlintrc.json +10 -0
- package/.prettierrc.json +6 -0
- package/.vscode/extensions.json +11 -0
- package/README.md +73 -0
- package/dist/types/index.d.ts +1 -0
- package/dist-app/assets/css/main-Dn6XCgL-.css +1 -0
- package/dist-app/assets/js/main-Bo-yvzk4.js +3 -0
- package/dist-app/favicon.ico +0 -0
- package/dist-app/index.html +14 -0
- package/e2e/tsconfig.json +4 -0
- package/e2e/vue.spec.ts +8 -0
- package/env.d.ts +1 -0
- package/eslint.config.ts +38 -0
- package/index.html +13 -0
- package/package.json +94 -0
- package/playwright.config.ts +110 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +165 -0
- package/src/assets/annotation/hjjd.svg +33 -0
- package/src/assets/annotation/kjjd.svg +38 -0
- package/src/assets/annotation/zbz.svg +19 -0
- package/src/assets/base.css +86 -0
- package/src/assets/logo.svg +1 -0
- package/src/assets/main.css +28 -0
- package/src/assets/variable.scss +15 -0
- package/src/components/ImageEditor/index.ts +220 -0
- package/src/components/ImageEditor/index.vue +344 -0
- package/src/components/icons/IconCommunity.vue +7 -0
- package/src/components/icons/IconDocumentation.vue +7 -0
- package/src/components/icons/IconEcosystem.vue +7 -0
- package/src/components/icons/IconSupport.vue +7 -0
- package/src/components/icons/IconTooling.vue +19 -0
- package/src/index.ts +25 -0
- package/src/main.ts +11 -0
- package/src/router/index.ts +30 -0
- package/src/stores/counter.ts +12 -0
- package/src/types/index.ts +196 -0
- package/src/types/tui.d.ts +27 -0
- package/src/utils/specialMapTool.ts +358 -0
- package/src/views/HomeView.vue +12 -0
- package/src/views/MapPluginView.vue +16 -0
- package/src/views/TestView.vue +12 -0
- package/tsconfig.app.json +18 -0
- package/tsconfig.json +14 -0
- package/tsconfig.node.json +28 -0
- package/tsconfig.vitest.json +19 -0
- package/vite.config.ts +124 -0
- package/vitest.config.ts +27 -0
- package/yui-image-editor-1.0.0.tgz +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var t=Object.defineProperty,e=(e,i,n)=>((e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n)(e,"symbol"!=typeof i?i+"":i,n);function i(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return t=>t in e}!function(){const t=document.createElement("link").relList;if(!(t&&t.supports&&t.supports("modulepreload"))){for(const t of document.querySelectorAll('link[rel="modulepreload"]'))e(t);new MutationObserver(t=>{for(const i of t)if("childList"===i.type)for(const t of i.addedNodes)"LINK"===t.tagName&&"modulepreload"===t.rel&&e(t)}).observe(document,{childList:!0,subtree:!0})}function e(t){if(t.ep)return;t.ep=!0;const e=function(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),"use-credentials"===t.crossOrigin?e.credentials="include":"anonymous"===t.crossOrigin?e.credentials="omit":e.credentials="same-origin",e}(t);fetch(t.href,e)}}();const n={},r=[],o=()=>{},s=()=>!1,a=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),l=t=>t.startsWith("onUpdate:"),c=Object.assign,u=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},h=Object.prototype.hasOwnProperty,f=(t,e)=>h.call(t,e),d=Array.isArray,g=t=>"[object Map]"===C(t),p=t=>"[object Date]"===C(t),v=t=>"function"==typeof t,m=t=>"string"==typeof t,y=t=>"symbol"==typeof t,b=t=>null!==t&&"object"==typeof t,x=t=>(b(t)||v(t))&&v(t.then)&&v(t.catch),_=Object.prototype.toString,C=t=>_.call(t),I=t=>m(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,M=i(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),S=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},w=/-\w/g,k=S(t=>t.replace(w,t=>t.slice(1).toUpperCase())),T=/\B([A-Z])/g,D=S(t=>t.replace(T,"-$1").toLowerCase()),A=S(t=>t.charAt(0).toUpperCase()+t.slice(1)),E=S(t=>t?`on${A(t)}`:""),O=(t,e)=>!Object.is(t,e),j=(t,...e)=>{for(let i=0;i<t.length;i++)t[i](...e)},L=(t,e,i,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:i})},P=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let N;const z=()=>N||(N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function R(t){if(d(t)){const e={};for(let i=0;i<t.length;i++){const n=t[i],r=m(n)?H(n):R(n);if(r)for(const t in r)e[t]=r[t]}return e}if(m(t)||b(t))return t}const B=/;(?![^(]*\))/g,F=/:([^]+)/,Y=/\/\*[^]*?\*\//g;function H(t){const e={};return t.replace(Y,"").split(B).forEach(t=>{if(t){const i=t.split(F);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function W(t){let e="";if(m(t))e=t;else if(d(t))for(let i=0;i<t.length;i++){const n=W(t[i]);n&&(e+=n+" ")}else if(b(t))for(const i in t)t[i]&&(e+=i+" ");return e.trim()}const U=i("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function G(t){return!!t||""===t}function X(t,e){if(t===e)return!0;let i=p(t),n=p(e);if(i||n)return!(!i||!n)&&t.getTime()===e.getTime();if(i=y(t),n=y(e),i||n)return t===e;if(i=d(t),n=d(e),i||n)return!(!i||!n)&&function(t,e){if(t.length!==e.length)return!1;let i=!0;for(let n=0;i&&n<t.length;n++)i=X(t[n],e[n]);return i}(t,e);if(i=b(t),n=b(e),i||n){if(!i||!n)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t){const n=t.hasOwnProperty(i),r=e.hasOwnProperty(i);if(n&&!r||!n&&r||!X(t[i],e[i]))return!1}}return String(t)===String(e)}let Z,V;class J{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Z,!t&&Z&&(this.index=(Z.scopes||(Z.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let t,e;if(this._isPaused=!0,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].pause();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){let t,e;if(this._isPaused=!1,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].resume();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].resume()}}run(t){if(this._active){const e=Z;try{return Z=this,t()}finally{Z=e}}}on(){1===++this._on&&(this.prevScope=Z,Z=this)}off(){this._on>0&&0===--this._on&&(Z=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){let e,i;for(this._active=!1,e=0,i=this.effects.length;e<i;e++)this.effects[e].stop();for(this.effects.length=0,e=0,i=this.cleanups.length;e<i;e++)this.cleanups[e]();if(this.cleanups.length=0,this.scopes){for(e=0,i=this.scopes.length;e<i;e++)this.scopes[e].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0}}}const Q=new WeakSet;class K{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Z&&Z.active&&Z.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Q.has(this)&&(Q.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||et(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,gt(this),rt(this);const t=V,e=ut;V=this,ut=!0;try{return this.fn()}finally{ot(this),V=t,ut=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)lt(t);this.deps=this.depsTail=void 0,gt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Q.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){st(this)&&this.run()}get dirty(){return st(this)}}let q,$,tt=0;function et(t,e=!1){if(t.flags|=8,e)return t.next=$,void($=t);t.next=q,q=t}function it(){tt++}function nt(){if(--tt>0)return;if($){let t=$;for($=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let t;for(;q;){let i=q;for(q=void 0;i;){const n=i.next;if(i.next=void 0,i.flags&=-9,1&i.flags)try{i.trigger()}catch(e){t||(t=e)}i=n}}if(t)throw t}function rt(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ot(t){let e,i=t.depsTail,n=i;for(;n;){const t=n.prevDep;-1===n.version?(n===i&&(i=t),lt(n),ct(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=t}t.deps=e,t.depsTail=i}function st(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(at(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function at(t){if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===pt)return;if(t.globalVersion=pt,!t.isSSR&&128&t.flags&&(!t.deps&&!t._dirty||!st(t)))return;t.flags|=2;const e=t.dep,i=V,n=ut;V=t,ut=!0;try{rt(t);const i=t.fn(t._value);(0===e.version||O(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(r){throw e.version++,r}finally{V=i,ut=n,ot(t),t.flags&=-3}}function lt(t,e=!1){const{dep:i,prevSub:n,nextSub:r}=t;if(n&&(n.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=n,t.nextSub=void 0),i.subs===t&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let t=i.computed.deps;t;t=t.nextDep)lt(t,!0)}e||--i.sc||!i.map||i.map.delete(i.key)}function ct(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}let ut=!0;const ht=[];function ft(){ht.push(ut),ut=!1}function dt(){const t=ht.pop();ut=void 0===t||t}function gt(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=V;V=void 0;try{e()}finally{V=t}}}let pt=0;class vt{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class mt{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!V||!ut||V===this.computed)return;let e=this.activeLink;if(void 0===e||e.sub!==V)e=this.activeLink=new vt(V,this),V.deps?(e.prevDep=V.depsTail,V.depsTail.nextDep=e,V.depsTail=e):V.deps=V.depsTail=e,yt(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=V.depsTail,e.nextDep=void 0,V.depsTail.nextDep=e,V.depsTail=e,V.deps===e&&(V.deps=t)}return e}trigger(t){this.version++,pt++,this.notify(t)}notify(t){it();try{0;for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{nt()}}}function yt(t){if(t.dep.sc++,4&t.sub.flags){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)yt(t)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const bt=new WeakMap,xt=Symbol(""),_t=Symbol(""),Ct=Symbol("");function It(t,e,i){if(ut&&V){let e=bt.get(t);e||bt.set(t,e=new Map);let n=e.get(i);n||(e.set(i,n=new mt),n.map=e,n.key=i),n.track()}}function Mt(t,e,i,n,r,o){const s=bt.get(t);if(!s)return void pt++;const a=t=>{t&&t.trigger()};if(it(),"clear"===e)s.forEach(a);else{const r=d(t),o=r&&I(i);if(r&&"length"===i){const t=Number(n);s.forEach((e,i)=>{("length"===i||i===Ct||!y(i)&&i>=t)&&a(e)})}else switch((void 0!==i||s.has(void 0))&&a(s.get(i)),o&&a(s.get(Ct)),e){case"add":r?o&&a(s.get("length")):(a(s.get(xt)),g(t)&&a(s.get(_t)));break;case"delete":r||(a(s.get(xt)),g(t)&&a(s.get(_t)));break;case"set":g(t)&&a(s.get(xt))}}nt()}function St(t){const e=he(t);return e===t?e:(It(e,0,Ct),ce(t)?e:e.map(de))}function wt(t){return It(t=he(t),0,Ct),t}function kt(t,e){return le(t)?ge(ae(t)?de(e):e):de(e)}const Tt={__proto__:null,[Symbol.iterator](){return Dt(this,Symbol.iterator,t=>kt(this,t))},concat(...t){return St(this).concat(...t.map(t=>d(t)?St(t):t))},entries(){return Dt(this,"entries",t=>(t[1]=kt(this,t[1]),t))},every(t,e){return Et(this,"every",t,e,void 0,arguments)},filter(t,e){return Et(this,"filter",t,e,t=>t.map(t=>kt(this,t)),arguments)},find(t,e){return Et(this,"find",t,e,t=>kt(this,t),arguments)},findIndex(t,e){return Et(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Et(this,"findLast",t,e,t=>kt(this,t),arguments)},findLastIndex(t,e){return Et(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Et(this,"forEach",t,e,void 0,arguments)},includes(...t){return jt(this,"includes",t)},indexOf(...t){return jt(this,"indexOf",t)},join(t){return St(this).join(t)},lastIndexOf(...t){return jt(this,"lastIndexOf",t)},map(t,e){return Et(this,"map",t,e,void 0,arguments)},pop(){return Lt(this,"pop")},push(...t){return Lt(this,"push",t)},reduce(t,...e){return Ot(this,"reduce",t,e)},reduceRight(t,...e){return Ot(this,"reduceRight",t,e)},shift(){return Lt(this,"shift")},some(t,e){return Et(this,"some",t,e,void 0,arguments)},splice(...t){return Lt(this,"splice",t)},toReversed(){return St(this).toReversed()},toSorted(t){return St(this).toSorted(t)},toSpliced(...t){return St(this).toSpliced(...t)},unshift(...t){return Lt(this,"unshift",t)},values(){return Dt(this,"values",t=>kt(this,t))}};function Dt(t,e,i){const n=wt(t),r=n[e]();return n===t||ce(t)||(r._next=r.next,r.next=()=>{const t=r._next();return t.done||(t.value=i(t.value)),t}),r}const At=Array.prototype;function Et(t,e,i,n,r,o){const s=wt(t),a=s!==t&&!ce(t),l=s[e];if(l!==At[e]){const e=l.apply(t,o);return a?de(e):e}let c=i;s!==t&&(a?c=function(e,n){return i.call(this,kt(t,e),n,t)}:i.length>2&&(c=function(e,n){return i.call(this,e,n,t)}));const u=l.call(s,c,n);return a&&r?r(u):u}function Ot(t,e,i,n){const r=wt(t);let o=i;return r!==t&&(ce(t)?i.length>3&&(o=function(e,n,r){return i.call(this,e,n,r,t)}):o=function(e,n,r){return i.call(this,e,kt(t,n),r,t)}),r[e](o,...n)}function jt(t,e,i){const n=he(t);It(n,0,Ct);const r=n[e](...i);return-1!==r&&!1!==r||!ue(i[0])?r:(i[0]=he(i[0]),n[e](...i))}function Lt(t,e,i=[]){ft(),it();const n=he(t)[e].apply(t,i);return nt(),dt(),n}const Pt=i("__proto__,__v_isRef,__isVue"),Nt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>"arguments"!==t&&"caller"!==t).map(t=>Symbol[t]).filter(y));function zt(t){y(t)||(t=String(t));const e=he(this);return It(e,0,t),e.hasOwnProperty(t)}class Rt{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,i){if("__v_skip"===e)return t.__v_skip;const n=this._isReadonly,r=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return r;if("__v_raw"===e)return i===(n?r?ee:te:r?$t:qt).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const o=d(t);if(!n){let t;if(o&&(t=Tt[e]))return t;if("hasOwnProperty"===e)return zt}const s=Reflect.get(t,e,pe(t)?t:i);if(y(e)?Nt.has(e):Pt(e))return s;if(n||It(t,0,e),r)return s;if(pe(s)){const t=o&&I(e)?s:s.value;return n&&b(t)?oe(t):t}return b(s)?n?oe(s):ne(s):s}}class Bt extends Rt{constructor(t=!1){super(!1,t)}set(t,e,i,n){let r=t[e];const o=d(t)&&I(e);if(!this._isShallow){const t=le(r);if(ce(i)||le(i)||(r=he(r),i=he(i)),!o&&pe(r)&&!pe(i))return t||(r.value=i),!0}const s=o?Number(e)<t.length:f(t,e),a=Reflect.set(t,e,i,pe(t)?t:n);return t===he(n)&&(s?O(i,r)&&Mt(t,"set",e,i):Mt(t,"add",e,i)),a}deleteProperty(t,e){const i=f(t,e);t[e];const n=Reflect.deleteProperty(t,e);return n&&i&&Mt(t,"delete",e,void 0),n}has(t,e){const i=Reflect.has(t,e);return y(e)&&Nt.has(e)||It(t,0,e),i}ownKeys(t){return It(t,0,d(t)?"length":xt),Reflect.ownKeys(t)}}class Ft extends Rt{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const Yt=new Bt,Ht=new Ft,Wt=new Bt(!0),Ut=t=>t,Gt=t=>Reflect.getPrototypeOf(t);function Xt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Zt(t,e){const i={get(i){const n=this.__v_raw,r=he(n),o=he(i);t||(O(i,o)&&It(r,0,i),It(r,0,o));const{has:s}=Gt(r),a=e?Ut:t?ge:de;return s.call(r,i)?a(n.get(i)):s.call(r,o)?a(n.get(o)):void(n!==r&&n.get(i))},get size(){const e=this.__v_raw;return!t&&It(he(e),0,xt),e.size},has(e){const i=this.__v_raw,n=he(i),r=he(e);return t||(O(e,r)&&It(n,0,e),It(n,0,r)),e===r?i.has(e):i.has(e)||i.has(r)},forEach(i,n){const r=this,o=r.__v_raw,s=e?Ut:t?ge:de;return!t&&It(he(o),0,xt),o.forEach((t,e)=>i.call(n,s(t),s(e),r))}};c(i,t?{add:Xt("add"),set:Xt("set"),delete:Xt("delete"),clear:Xt("clear")}:{add(t){e||ce(t)||le(t)||(t=he(t));const i=he(this);return Gt(i).has.call(i,t)||(i.add(t),Mt(i,"add",t,t)),this},set(t,i){e||ce(i)||le(i)||(i=he(i));const n=he(this),{has:r,get:o}=Gt(n);let s=r.call(n,t);s||(t=he(t),s=r.call(n,t));const a=o.call(n,t);return n.set(t,i),s?O(i,a)&&Mt(n,"set",t,i):Mt(n,"add",t,i),this},delete(t){const e=he(this),{has:i,get:n}=Gt(e);let r=i.call(e,t);r||(t=he(t),r=i.call(e,t)),n&&n.call(e,t);const o=e.delete(t);return r&&Mt(e,"delete",t,void 0),o},clear(){const t=he(this),e=0!==t.size,i=t.clear();return e&&Mt(t,"clear",void 0,void 0),i}});return["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=function(t,e,i){return function(...n){const r=this.__v_raw,o=he(r),s=g(o),a="entries"===t||t===Symbol.iterator&&s,l="keys"===t&&s,u=r[t](...n),h=i?Ut:e?ge:de;return!e&&It(o,0,l?_t:xt),c(Object.create(u),{next(){const{value:t,done:e}=u.next();return e?{value:t,done:e}:{value:a?[h(t[0]),h(t[1])]:h(t),done:e}}})}}(n,t,e)}),i}function Vt(t,e){const i=Zt(t,e);return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(f(i,n)&&n in e?i:e,n,r)}const Jt={get:Vt(!1,!1)},Qt={get:Vt(!1,!0)},Kt={get:Vt(!0,!1)},qt=new WeakMap,$t=new WeakMap,te=new WeakMap,ee=new WeakMap;function ie(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>C(t).slice(8,-1))(t))}function ne(t){return le(t)?t:se(t,!1,Yt,Jt,qt)}function re(t){return se(t,!1,Wt,Qt,$t)}function oe(t){return se(t,!0,Ht,Kt,te)}function se(t,e,i,n,r){if(!b(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const o=ie(t);if(0===o)return t;const s=r.get(t);if(s)return s;const a=new Proxy(t,2===o?n:i);return r.set(t,a),a}function ae(t){return le(t)?ae(t.__v_raw):!(!t||!t.__v_isReactive)}function le(t){return!(!t||!t.__v_isReadonly)}function ce(t){return!(!t||!t.__v_isShallow)}function ue(t){return!!t&&!!t.__v_raw}function he(t){const e=t&&t.__v_raw;return e?he(e):t}function fe(t){return!f(t,"__v_skip")&&Object.isExtensible(t)&&L(t,"__v_skip",!0),t}const de=t=>b(t)?ne(t):t,ge=t=>b(t)?oe(t):t;function pe(t){return!!t&&!0===t.__v_isRef}function ve(t){return ye(t,!1)}function me(t){return ye(t,!0)}function ye(t,e){return pe(t)?t:new be(t,e)}class be{constructor(t,e){this.dep=new mt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:he(t),this._value=e?t:de(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,i=this.__v_isShallow||ce(t)||le(t);O(t=i?t:he(t),e)&&(this._rawValue=t,this._value=i?t:de(t),this.dep.trigger())}}function xe(t){return pe(t)?t.value:t}const _e={get:(t,e,i)=>"__v_raw"===e?t:xe(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const r=t[e];return pe(r)&&!pe(i)?(r.value=i,!0):Reflect.set(t,e,i,n)}};function Ce(t){return ae(t)?t:new Proxy(t,_e)}class Ie{constructor(t,e,i){this.fn=t,this.setter=e,this._value=void 0,this.dep=new mt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=pt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=i}notify(){if(this.flags|=16,!(8&this.flags)&&V!==this)return et(this,!0),!0}get value(){const t=this.dep.track();return at(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Me(t,e,i=!1){let n,r;v(t)?n=t:(n=t.get,r=t.set);return new Ie(n,r,i)}const Se={},we=new WeakMap;let ke;function Te(t,e,i=n){const{immediate:r,deep:s,once:a,scheduler:l,augmentJob:c,call:h}=i,f=t=>s?t:ce(t)||!1===s||0===s?De(t,1):De(t);let g,p,m,y,b=!1,x=!1;if(pe(t)?(p=()=>t.value,b=ce(t)):ae(t)?(p=()=>f(t),b=!0):d(t)?(x=!0,b=t.some(t=>ae(t)||ce(t)),p=()=>t.map(t=>pe(t)?t.value:ae(t)?f(t):v(t)?h?h(t,2):t():void 0)):p=v(t)?e?h?()=>h(t,2):t:()=>{if(m){ft();try{m()}finally{dt()}}const e=ke;ke=g;try{return h?h(t,3,[y]):t(y)}finally{ke=e}}:o,e&&s){const t=p,e=!0===s?1/0:s;p=()=>De(t(),e)}const _=Z,C=()=>{g.stop(),_&&_.active&&u(_.effects,g)};if(a&&e){const t=e;e=(...e)=>{t(...e),C()}}let I=x?new Array(t.length).fill(Se):Se;const M=t=>{if(1&g.flags&&(g.dirty||t))if(e){const t=g.run();if(s||b||(x?t.some((t,e)=>O(t,I[e])):O(t,I))){m&&m();const i=ke;ke=g;try{const i=[t,I===Se?void 0:x&&I[0]===Se?[]:I,y];I=t,h?h(e,3,i):e(...i)}finally{ke=i}}}else g.run()};return c&&c(M),g=new K(p),g.scheduler=l?()=>l(M,!1):M,y=t=>function(t,e=!1,i=ke){if(i){let e=we.get(i);e||we.set(i,e=[]),e.push(t)}}(t,!1,g),m=g.onStop=()=>{const t=we.get(g);if(t){if(h)h(t,4);else for(const e of t)e();we.delete(g)}},e?r?M(!0):I=g.run():l?l(M.bind(null,!0),!0):g.run(),C.pause=g.pause.bind(g),C.resume=g.resume.bind(g),C.stop=C,C}function De(t,e=1/0,i){if(e<=0||!b(t)||t.__v_skip)return t;if(((i=i||new Map).get(t)||0)>=e)return t;if(i.set(t,e),e--,pe(t))De(t.value,e,i);else if(d(t))for(let n=0;n<t.length;n++)De(t[n],e,i);else if("[object Set]"===C(t)||g(t))t.forEach(t=>{De(t,e,i)});else if((t=>"[object Object]"===C(t))(t)){for(const n in t)De(t[n],e,i);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&De(t[n],e,i)}return t}function Ae(t,e,i,n){try{return n?t(...n):t()}catch(r){Oe(r,e,i)}}function Ee(t,e,i,n){if(v(t)){const r=Ae(t,e,i,n);return r&&x(r)&&r.catch(t=>{Oe(t,e,i)}),r}if(d(t)){const r=[];for(let o=0;o<t.length;o++)r.push(Ee(t[o],e,i,n));return r}}function Oe(t,e,i,r=!0){e&&e.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||n;if(e){let n=e.parent;const r=e.proxy,s=`https://vuejs.org/error-reference/#runtime-${i}`;for(;n;){const e=n.ec;if(e)for(let i=0;i<e.length;i++)if(!1===e[i](t,r,s))return;n=n.parent}if(o)return ft(),Ae(o,null,10,[t,r,s]),void dt()}!function(t,e,i,n=!0,r=!1){if(r)throw t}(t,0,0,r,s)}const je=[];let Le=-1;const Pe=[];let Ne=null,ze=0;const Re=Promise.resolve();let Be=null;function Fe(t){const e=Be||Re;return t?e.then(this?t.bind(this):t):e}function Ye(t){if(!(1&t.flags)){const e=Ge(t),i=je[je.length-1];!i||!(2&t.flags)&&e>=Ge(i)?je.push(t):je.splice(function(t){let e=Le+1,i=je.length;for(;e<i;){const n=e+i>>>1,r=je[n],o=Ge(r);o<t||o===t&&2&r.flags?e=n+1:i=n}return e}(e),0,t),t.flags|=1,He()}}function He(){Be||(Be=Re.then(Xe))}function We(t,e,i=Le+1){for(;i<je.length;i++){const e=je[i];if(e&&2&e.flags){if(t&&e.id!==t.uid)continue;je.splice(i,1),i--,4&e.flags&&(e.flags&=-2),e(),4&e.flags||(e.flags&=-2)}}}function Ue(t){if(Pe.length){const t=[...new Set(Pe)].sort((t,e)=>Ge(t)-Ge(e));if(Pe.length=0,Ne)return void Ne.push(...t);for(Ne=t,ze=0;ze<Ne.length;ze++){const t=Ne[ze];4&t.flags&&(t.flags&=-2),8&t.flags||t(),t.flags&=-2}Ne=null,ze=0}}const Ge=t=>null==t.id?2&t.flags?-1:1/0:t.id;function Xe(t){try{for(Le=0;Le<je.length;Le++){const t=je[Le];!t||8&t.flags||(4&t.flags&&(t.flags&=-2),Ae(t,t.i,t.i?15:14),4&t.flags||(t.flags&=-2))}}finally{for(;Le<je.length;Le++){const t=je[Le];t&&(t.flags&=-2)}Le=-1,je.length=0,Ue(),Be=null,(je.length||Pe.length)&&Xe()}}let Ze=null,Ve=null;function Je(t){const e=Ze;return Ze=t,Ve=t&&t.type.__scopeId||null,e}function Qe(t,e=Ze,i){if(!e)return t;if(t._n)return t;const n=(...i)=>{n._d&&Wn(-1);const r=Je(e);let o;try{o=t(...i)}finally{Je(r),n._d&&Wn(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function Ke(t,e,i,n){const r=t.dirs,o=e&&e.dirs;for(let s=0;s<r.length;s++){const a=r[s];o&&(a.oldValue=o[s].value);let l=a.dir[n];l&&(ft(),Ee(l,i,8,[t.el,a,t,e]),dt())}}function qe(t,e){if(sr){let i=sr.provides;const n=sr.parent&&sr.parent.provides;n===i&&(i=sr.provides=Object.create(n)),i[t]=e}}function $e(t,e,i=!1){const n=ar();if(n||en){let r=en?en._context.provides:n?null==n.parent||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return i&&v(e)?e.call(n&&n.proxy):e}}const ti=Symbol.for("v-scx");function ei(t,e,i){return ii(t,e,i)}function ii(t,e,i=n){const{immediate:r,deep:s,flush:a,once:l}=i,u=c({},i),h=e&&r||!e&&"post"!==a;let f;if(dr)if("sync"===a){const t=$e(ti);f=t.__watcherHandles||(t.__watcherHandles=[])}else if(!h){const t=()=>{};return t.stop=o,t.resume=o,t.pause=o,t}const d=sr;u.call=(t,e,i)=>Ee(t,d,e,i);let g=!1;"post"===a?u.scheduler=t=>{wn(t,d&&d.suspense)}:"sync"!==a&&(g=!0,u.scheduler=(t,e)=>{e?t():Ye(t)}),u.augmentJob=t=>{e&&(t.flags|=4),g&&(t.flags|=2,d&&(t.id=d.uid,t.i=d))};const p=Te(t,e,u);return dr&&(f?f.push(p):h&&p()),p}function ni(t,e,i){const n=this.proxy,r=m(t)?t.includes(".")?ri(n,t):()=>n[t]:t.bind(n,n);let o;v(e)?o=e:(o=e.handler,i=e);const s=ur(this),a=ii(r,o.bind(n),i);return s(),a}function ri(t,e){const i=e.split(".");return()=>{let e=t;for(let t=0;t<i.length&&e;t++)e=e[i[t]];return e}}const oi=Symbol("_vte"),si=Symbol("_leaveCb");function ai(t,e){6&t.shapeFlag&&t.component?(t.transition=e,ai(t.component.subTree,e)):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function li(t,e){return v(t)?(()=>c({name:t.name},e,{setup:t}))():t}function ci(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function ui(t,e){let i;return!(!(i=Object.getOwnPropertyDescriptor(t,e))||i.configurable)}const hi=new WeakMap;function fi(t,e,i,r,o=!1){if(d(t))return void t.forEach((t,n)=>fi(t,e&&(d(e)?e[n]:e),i,r,o));if(gi(r)&&!o)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&fi(t,e,i,r.component.subTree));const a=4&r.shapeFlag?mr(r.component):r.el,l=o?null:a,{i:c,r:h}=t,g=e&&e.r,p=c.refs===n?c.refs={}:c.refs,y=c.setupState,b=he(y),x=y===n?s:t=>!ui(p,t)&&f(b,t),_=(t,e)=>!e||!ui(p,e);if(null!=g&&g!==h)if(di(e),m(g))p[g]=null,x(g)&&(y[g]=null);else if(pe(g)){const t=e;_(0,t.k)&&(g.value=null),t.k&&(p[t.k]=null)}if(v(h))Ae(h,c,12,[l,p]);else{const e=m(h),n=pe(h);if(e||n){const r=()=>{if(t.f){const i=e?x(h)?y[h]:p[h]:_()||!t.k?h.value:p[t.k];if(o)d(i)&&u(i,a);else if(d(i))i.includes(a)||i.push(a);else if(e)p[h]=[a],x(h)&&(y[h]=p[h]);else{const e=[a];_(0,t.k)&&(h.value=e),t.k&&(p[t.k]=e)}}else e?(p[h]=l,x(h)&&(y[h]=l)):n&&(_(0,t.k)&&(h.value=l),t.k&&(p[t.k]=l))};if(l){const e=()=>{r(),hi.delete(t)};e.id=-1,hi.set(t,e),wn(e,i)}else di(t),r()}}}function di(t){const e=hi.get(t);e&&(e.flags|=8,hi.delete(t))}z().requestIdleCallback,z().cancelIdleCallback;const gi=t=>!!t.type.__asyncLoader,pi=t=>t.type.__isKeepAlive;function vi(t,e){yi(t,"a",e)}function mi(t,e){yi(t,"da",e)}function yi(t,e,i=sr){const n=t.__wdc||(t.__wdc=()=>{let e=i;for(;e;){if(e.isDeactivated)return;e=e.parent}return t()});if(xi(e,n,i),i){let t=i.parent;for(;t&&t.parent;)pi(t.parent.vnode)&&bi(n,e,i,t),t=t.parent}}function bi(t,e,i,n){const r=xi(e,t,n,!0);ki(()=>{u(n[e],r)},i)}function xi(t,e,i=sr,n=!1){if(i){const r=i[t]||(i[t]=[]),o=e.__weh||(e.__weh=(...n)=>{ft();const r=ur(i),o=Ee(e,i,t,n);return r(),dt(),o});return n?r.unshift(o):r.push(o),o}}const _i=t=>(e,i=sr)=>{dr&&"sp"!==t||xi(t,(...t)=>e(...t),i)},Ci=_i("bm"),Ii=_i("m"),Mi=_i("bu"),Si=_i("u"),wi=_i("bum"),ki=_i("um"),Ti=_i("sp"),Di=_i("rtg"),Ai=_i("rtc");function Ei(t,e=sr){xi("ec",t,e)}function Oi(t,e){return function(t,e,i=!0,n=!1){const r=Ze||sr;if(r){const i=r.type;{const t=yr(i,!1);if(t&&(t===e||t===k(e)||t===A(k(e))))return i}const o=Li(r[t]||i[t],e)||Li(r.appContext[t],e);return!o&&n?i:o}}("components",t,!0,e)||t}const ji=Symbol.for("v-ndc");function Li(t,e){return t&&(t[e]||t[k(e)]||t[A(k(e))])}const Pi=t=>t?fr(t)?mr(t):Pi(t.parent):null,Ni=c(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Pi(t.parent),$root:t=>Pi(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Ui(t),$forceUpdate:t=>t.f||(t.f=()=>{Ye(t.update)}),$nextTick:t=>t.n||(t.n=Fe.bind(t.proxy)),$watch:t=>ni.bind(t)}),zi=(t,e)=>t!==n&&!t.__isScriptSetup&&f(t,e),Ri={get({_:t},e){if("__v_skip"===e)return!0;const{ctx:i,setupState:r,data:o,props:s,accessCache:a,type:l,appContext:c}=t;if("$"!==e[0]){const t=a[e];if(void 0!==t)switch(t){case 1:return r[e];case 2:return o[e];case 4:return i[e];case 3:return s[e]}else{if(zi(r,e))return a[e]=1,r[e];if(o!==n&&f(o,e))return a[e]=2,o[e];if(f(s,e))return a[e]=3,s[e];if(i!==n&&f(i,e))return a[e]=4,i[e];Fi&&(a[e]=0)}}const u=Ni[e];let h,d;return u?("$attrs"===e&&It(t.attrs,0,""),u(t)):(h=l.__cssModules)&&(h=h[e])?h:i!==n&&f(i,e)?(a[e]=4,i[e]):(d=c.config.globalProperties,f(d,e)?d[e]:void 0)},set({_:t},e,i){const{data:r,setupState:o,ctx:s}=t;return zi(o,e)?(o[e]=i,!0):r!==n&&f(r,e)?(r[e]=i,!0):!f(t.props,e)&&(("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=i,!0))},has({_:{data:t,setupState:e,accessCache:i,ctx:r,appContext:o,props:s,type:a}},l){let c;return!!(i[l]||t!==n&&"$"!==l[0]&&f(t,l)||zi(e,l)||f(s,l)||f(r,l)||f(Ni,l)||f(o.config.globalProperties,l)||(c=a.__cssModules)&&c[l])},defineProperty(t,e,i){return null!=i.get?t._.accessCache[e]=0:f(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function Bi(t){return d(t)?t.reduce((t,e)=>(t[e]=null,t),{}):t}let Fi=!0;function Yi(t){const e=Ui(t),i=t.proxy,n=t.ctx;Fi=!1,e.beforeCreate&&Hi(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:a,watch:l,provide:c,inject:u,created:h,beforeMount:f,mounted:g,beforeUpdate:p,updated:m,activated:y,deactivated:x,beforeDestroy:_,beforeUnmount:C,destroyed:I,unmounted:M,render:S,renderTracked:w,renderTriggered:k,errorCaptured:T,serverPrefetch:D,expose:A,inheritAttrs:E,components:O,directives:j,filters:L}=e;if(u&&function(t,e){d(t)&&(t=Vi(t));for(const i in t){const n=t[i];let r;r=b(n)?"default"in n?$e(n.from||i,n.default,!0):$e(n.from||i):$e(n),pe(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:t=>r.value=t}):e[i]=r}}(u,n,null),a)for(const o in a){const t=a[o];v(t)&&(n[o]=t.bind(i))}if(r){const e=r.call(i,i);b(e)&&(t.data=ne(e))}if(Fi=!0,s)for(const d in s){const t=s[d],e=v(t)?t.bind(i,i):v(t.get)?t.get.bind(i,i):o,r=!v(t)&&v(t.set)?t.set.bind(i):o,a=br({get:e,set:r});Object.defineProperty(n,d,{enumerable:!0,configurable:!0,get:()=>a.value,set:t=>a.value=t})}if(l)for(const o in l)Wi(l[o],n,i,o);if(c){const t=v(c)?c.call(i):c;Reflect.ownKeys(t).forEach(e=>{qe(e,t[e])})}function P(t,e){d(e)?e.forEach(e=>t(e.bind(i))):e&&t(e.bind(i))}if(h&&Hi(h,t,"c"),P(Ci,f),P(Ii,g),P(Mi,p),P(Si,m),P(vi,y),P(mi,x),P(Ei,T),P(Ai,w),P(Di,k),P(wi,C),P(ki,M),P(Ti,D),d(A))if(A.length){const e=t.exposed||(t.exposed={});A.forEach(t=>{Object.defineProperty(e,t,{get:()=>i[t],set:e=>i[t]=e,enumerable:!0})})}else t.exposed||(t.exposed={});S&&t.render===o&&(t.render=S),null!=E&&(t.inheritAttrs=E),O&&(t.components=O),j&&(t.directives=j),D&&ci(t)}function Hi(t,e,i){Ee(d(t)?t.map(t=>t.bind(e.proxy)):t.bind(e.proxy),e,i)}function Wi(t,e,i,n){let r=n.includes(".")?ri(i,n):()=>i[n];if(m(t)){const i=e[t];v(i)&&ei(r,i)}else if(v(t))ei(r,t.bind(i));else if(b(t))if(d(t))t.forEach(t=>Wi(t,e,i,n));else{const n=v(t.handler)?t.handler.bind(i):e[t.handler];v(n)&&ei(r,n,t)}}function Ui(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:r,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,a=o.get(e);let l;return a?l=a:r.length||i||n?(l={},r.length&&r.forEach(t=>Gi(l,t,s,!0)),Gi(l,e,s)):l=e,b(e)&&o.set(e,l),l}function Gi(t,e,i,n=!1){const{mixins:r,extends:o}=e;o&&Gi(t,o,i,!0),r&&r.forEach(e=>Gi(t,e,i,!0));for(const s in e)if(n&&"expose"===s);else{const n=Xi[s]||i&&i[s];t[s]=n?n(t[s],e[s]):e[s]}return t}const Xi={data:Zi,props:Ki,emits:Ki,methods:Qi,computed:Qi,beforeCreate:Ji,created:Ji,beforeMount:Ji,mounted:Ji,beforeUpdate:Ji,updated:Ji,beforeDestroy:Ji,beforeUnmount:Ji,destroyed:Ji,unmounted:Ji,activated:Ji,deactivated:Ji,errorCaptured:Ji,serverPrefetch:Ji,components:Qi,directives:Qi,watch:function(t,e){if(!t)return e;if(!e)return t;const i=c(Object.create(null),t);for(const n in e)i[n]=Ji(t[n],e[n]);return i},provide:Zi,inject:function(t,e){return Qi(Vi(t),Vi(e))}};function Zi(t,e){return e?t?function(){return c(v(t)?t.call(this,this):t,v(e)?e.call(this,this):e)}:e:t}function Vi(t){if(d(t)){const e={};for(let i=0;i<t.length;i++)e[t[i]]=t[i];return e}return t}function Ji(t,e){return t?[...new Set([].concat(t,e))]:e}function Qi(t,e){return t?c(Object.create(null),t,e):e}function Ki(t,e){return t?d(t)&&d(e)?[...new Set([...t,...e])]:c(Object.create(null),Bi(t),Bi(null!=e?e:{})):e}function qi(){return{app:null,config:{isNativeTag:s,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let $i=0;function tn(t,e){return function(e,i=null){v(e)||(e=c({},e)),null==i||b(i)||(i=null);const n=qi(),r=new WeakSet,o=[];let s=!1;const a=n.app={_uid:$i++,_component:e,_props:i,_container:null,_context:n,_instance:null,version:_r,get config(){return n.config},set config(t){},use:(t,...e)=>(r.has(t)||(t&&v(t.install)?(r.add(t),t.install(a,...e)):v(t)&&(r.add(t),t(a,...e))),a),mixin:t=>(n.mixins.includes(t)||n.mixins.push(t),a),component:(t,e)=>e?(n.components[t]=e,a):n.components[t],directive:(t,e)=>e?(n.directives[t]=e,a):n.directives[t],mount(r,o,l){if(!s){const o=a._ceVNode||Kn(e,i);return o.appContext=n,!0===l?l="svg":!1===l&&(l=void 0),t(o,r,l),s=!0,a._container=r,r.__vue_app__=a,mr(o.component)}},onUnmount(t){o.push(t)},unmount(){s&&(Ee(o,a._instance,16),t(null,a._container),delete a._container.__vue_app__)},provide:(t,e)=>(n.provides[t]=e,a),runWithContext(t){const e=en;en=a;try{return t()}finally{en=e}}};return a}}let en=null;function nn(t,e,...i){if(t.isUnmounted)return;const r=t.vnode.props||n;let o=i;const s=e.startsWith("update:"),a=s&&((t,e)=>"modelValue"===e||"model-value"===e?t.modelModifiers:t[`${e}Modifiers`]||t[`${k(e)}Modifiers`]||t[`${D(e)}Modifiers`])(r,e.slice(7));let l;a&&(a.trim&&(o=i.map(t=>m(t)?t.trim():t)),a.number&&(o=i.map(P)));let c=r[l=E(e)]||r[l=E(k(e))];!c&&s&&(c=r[l=E(D(e))]),c&&Ee(c,t,6,o);const u=r[l+"Once"];if(u){if(t.emitted){if(t.emitted[l])return}else t.emitted={};t.emitted[l]=!0,Ee(u,t,6,o)}}const rn=new WeakMap;function on(t,e,i=!1){const n=i?rn:e.emitsCache,r=n.get(t);if(void 0!==r)return r;const o=t.emits;let s={},a=!1;if(!v(t)){const n=t=>{const i=on(t,e,!0);i&&(a=!0,c(s,i))};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}return o||a?(d(o)?o.forEach(t=>s[t]=null):c(s,o),b(t)&&n.set(t,s),s):(b(t)&&n.set(t,null),null)}function sn(t,e){return!(!t||!a(e))&&(e=e.slice(2).replace(/Once$/,""),f(t,e[0].toLowerCase()+e.slice(1))||f(t,D(e))||f(t,e))}function an(t){const{type:e,vnode:i,proxy:n,withProxy:r,propsOptions:[o],slots:s,attrs:a,emit:c,render:u,renderCache:h,props:f,data:d,setupState:g,ctx:p,inheritAttrs:v}=t,m=Je(t);let y,b;try{if(4&i.shapeFlag){const t=r||n,e=t;y=tr(u.call(e,t,h,f,g,d,p)),b=a}else{const t=e;0,y=tr(t.length>1?t(f,{attrs:a,slots:s,emit:c}):t(f,null)),b=e.props?a:ln(a)}}catch(_){Bn.length=0,Oe(_,t,1),y=Kn(zn)}let x=y;if(b&&!1!==v){const t=Object.keys(b),{shapeFlag:e}=x;t.length&&7&e&&(o&&t.some(l)&&(b=cn(b,o)),x=qn(x,b,!1,!0))}return i.dirs&&(x=qn(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(i.dirs):i.dirs),i.transition&&ai(x,i.transition),y=x,Je(m),y}const ln=t=>{let e;for(const i in t)("class"===i||"style"===i||a(i))&&((e||(e={}))[i]=t[i]);return e},cn=(t,e)=>{const i={};for(const n in t)l(n)&&n.slice(9)in e||(i[n]=t[n]);return i};function un(t,e,i){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let r=0;r<n.length;r++){const o=n[r];if(hn(e,t,o)&&!sn(i,o))return!0}return!1}function hn(t,e,i){const n=t[i],r=e[i];return"style"===i&&b(n)&&b(r)?!X(n,r):n!==r}const fn={},dn=()=>Object.create(fn),gn=t=>Object.getPrototypeOf(t)===fn;function pn(t,e,i,r){const[o,s]=t.propsOptions;let a,l=!1;if(e)for(let n in e){if(M(n))continue;const c=e[n];let u;o&&f(o,u=k(n))?s&&s.includes(u)?(a||(a={}))[u]=c:i[u]=c:sn(t.emitsOptions,n)||n in r&&c===r[n]||(r[n]=c,l=!0)}if(s){const e=he(i),r=a||n;for(let n=0;n<s.length;n++){const a=s[n];i[a]=vn(o,e,a,r[a],t,!f(r,a))}}return l}function vn(t,e,i,n,r,o){const s=t[i];if(null!=s){const t=f(s,"default");if(t&&void 0===n){const t=s.default;if(s.type!==Function&&!s.skipFactory&&v(t)){const{propsDefaults:o}=r;if(i in o)n=o[i];else{const s=ur(r);n=o[i]=t.call(null,e),s()}}else n=t;r.ce&&r.ce._setProp(i,n)}s[0]&&(o&&!t?n=!1:!s[1]||""!==n&&n!==D(i)||(n=!0))}return n}const mn=new WeakMap;function yn(t,e,i=!1){const o=i?mn:e.propsCache,s=o.get(t);if(s)return s;const a=t.props,l={},u=[];let h=!1;if(!v(t)){const n=t=>{h=!0;const[i,n]=yn(t,e,!0);c(l,i),n&&u.push(...n)};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}if(!a&&!h)return b(t)&&o.set(t,r),r;if(d(a))for(let r=0;r<a.length;r++){const t=k(a[r]);bn(t)&&(l[t]=n)}else if(a)for(const n in a){const t=k(n);if(bn(t)){const e=a[n],i=l[t]=d(e)||v(e)?{type:e}:c({},e),r=i.type;let o=!1,s=!0;if(d(r))for(let t=0;t<r.length;++t){const e=r[t],i=v(e)&&e.name;if("Boolean"===i){o=!0;break}"String"===i&&(s=!1)}else o=v(r)&&"Boolean"===r.name;i[0]=o,i[1]=s,(o||f(i,"default"))&&u.push(t)}}const g=[l,u];return b(t)&&o.set(t,g),g}function bn(t){return"$"!==t[0]&&!M(t)}const xn=t=>"_"===t||"_ctx"===t||"$stable"===t,_n=t=>d(t)?t.map(tr):[tr(t)],Cn=(t,e,i)=>{if(e._n)return e;const n=Qe((...t)=>_n(e(...t)),i);return n._c=!1,n},In=(t,e,i)=>{const n=t._ctx;for(const r in t){if(xn(r))continue;const i=t[r];if(v(i))e[r]=Cn(0,i,n);else if(null!=i){const t=_n(i);e[r]=()=>t}}},Mn=(t,e)=>{const i=_n(e);t.slots.default=()=>i},Sn=(t,e,i)=>{for(const n in e)!i&&xn(n)||(t[n]=e[n])},wn=function(t,e){e&&e.pendingBranch?d(t)?e.effects.push(...t):e.effects.push(t):(d(i=t)?Pe.push(...i):Ne&&-1===i.id?Ne.splice(ze+1,0,i):1&i.flags||(Pe.push(i),i.flags|=1),He());var i};function kn(t){return function(t){z().__VUE__=!0;const{insert:e,remove:i,patchProp:s,createElement:a,createText:l,createComment:c,setText:u,setElementText:h,parentNode:d,nextSibling:g,setScopeId:p=o,insertStaticContent:v}=t,m=(t,e,i,n=null,r=null,o=null,s=void 0,a=null,l=!!e.dynamicChildren)=>{if(t===e)return;t&&!Zn(t,e)&&(n=tt(t),Z(t,r,o,!0),t=null),-2===e.patchFlag&&(l=!1,e.dynamicChildren=null);const{type:c,ref:u,shapeFlag:h}=e;switch(c){case Nn:y(t,e,i,n);break;case zn:b(t,e,i,n);break;case Rn:null==t&&_(e,i,n,s);break;case Pn:N(t,e,i,n,r,o,s,a,l);break;default:1&h?S(t,e,i,n,r,o,s,a,l):6&h?R(t,e,i,n,r,o,s,a,l):(64&h||128&h)&&c.process(t,e,i,n,r,o,s,a,l,nt)}null!=u&&r?fi(u,t&&t.ref,o,e||t,!e):null==u&&t&&null!=t.ref&&fi(t.ref,null,o,t,!0)},y=(t,i,n,r)=>{if(null==t)e(i.el=l(i.children),n,r);else{const e=i.el=t.el;i.children!==t.children&&u(e,i.children)}},b=(t,i,n,r)=>{null==t?e(i.el=c(i.children||""),n,r):i.el=t.el},_=(t,e,i,n)=>{[t.el,t.anchor]=v(t.children,e,i,n,t.el,t.anchor)},C=({el:t,anchor:i},n,r)=>{let o;for(;t&&t!==i;)o=g(t),e(t,n,r),t=o;e(i,n,r)},I=({el:t,anchor:e})=>{let n;for(;t&&t!==e;)n=g(t),i(t),t=n;i(e)},S=(t,e,i,n,r,o,s,a,l)=>{if("svg"===e.type?s="svg":"math"===e.type&&(s="mathml"),null==t)w(e,i,n,r,o,s,a,l);else{const i=t.el&&t.el._isVueCE?t.el:null;try{i&&i._beginPatch(),E(t,e,r,o,s,a,l)}finally{i&&i._endPatch()}}},w=(t,i,n,r,o,l,c,u)=>{let f,d;const{props:g,shapeFlag:p,transition:v,dirs:m}=t;if(f=t.el=a(t.type,l,g&&g.is,g),8&p?h(f,t.children):16&p&&A(t.children,f,null,r,o,Tn(t,l),c,u),m&&Ke(t,null,r,"created"),T(f,t,t.scopeId,c,r),g){for(const t in g)"value"===t||M(t)||s(f,t,null,g[t],l,r);"value"in g&&s(f,"value",null,g.value,l),(d=g.onVnodeBeforeMount)&&nr(d,r,t)}m&&Ke(t,null,r,"beforeMount");const y=function(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}(o,v);y&&v.beforeEnter(f),e(f,i,n),((d=g&&g.onVnodeMounted)||y||m)&&wn(()=>{d&&nr(d,r,t),y&&v.enter(f),m&&Ke(t,null,r,"mounted")},o)},T=(t,e,i,n,r)=>{if(i&&p(t,i),n)for(let o=0;o<n.length;o++)p(t,n[o]);if(r){let i=r.subTree;if(e===i||Ln(i.type)&&(i.ssContent===e||i.ssFallback===e)){const e=r.vnode;T(t,e,e.scopeId,e.slotScopeIds,r.parent)}}},A=(t,e,i,n,r,o,s,a,l=0)=>{for(let c=l;c<t.length;c++){const l=t[c]=a?er(t[c]):tr(t[c]);m(null,l,e,i,n,r,o,s,a)}},E=(t,e,i,r,o,a,l)=>{const c=e.el=t.el;let{patchFlag:u,dynamicChildren:f,dirs:d}=e;u|=16&t.patchFlag;const g=t.props||n,p=e.props||n;let v;if(i&&Dn(i,!1),(v=p.onVnodeBeforeUpdate)&&nr(v,i,e,t),d&&Ke(e,t,i,"beforeUpdate"),i&&Dn(i,!0),(g.innerHTML&&null==p.innerHTML||g.textContent&&null==p.textContent)&&h(c,""),f?O(t.dynamicChildren,f,c,i,r,Tn(e,o),a):l||W(t,e,c,null,i,r,Tn(e,o),a,!1),u>0){if(16&u)P(c,g,p,i,o);else if(2&u&&g.class!==p.class&&s(c,"class",null,p.class,o),4&u&&s(c,"style",g.style,p.style,o),8&u){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const n=t[e],r=g[n],a=p[n];a===r&&"value"!==n||s(c,n,r,a,o,i)}}1&u&&t.children!==e.children&&h(c,e.children)}else l||null!=f||P(c,g,p,i,o);((v=p.onVnodeUpdated)||d)&&wn(()=>{v&&nr(v,i,e,t),d&&Ke(e,t,i,"updated")},r)},O=(t,e,i,n,r,o,s)=>{for(let a=0;a<e.length;a++){const l=t[a],c=e[a],u=l.el&&(l.type===Pn||!Zn(l,c)||198&l.shapeFlag)?d(l.el):i;m(l,c,u,null,n,r,o,s,!0)}},P=(t,e,i,r,o)=>{if(e!==i){if(e!==n)for(const n in e)M(n)||n in i||s(t,n,e[n],null,o,r);for(const n in i){if(M(n))continue;const a=i[n],l=e[n];a!==l&&"value"!==n&&s(t,n,l,a,o,r)}"value"in i&&s(t,"value",e.value,i.value,o)}},N=(t,i,n,r,o,s,a,c,u)=>{const h=i.el=t?t.el:l(""),f=i.anchor=t?t.anchor:l("");let{patchFlag:d,dynamicChildren:g,slotScopeIds:p}=i;p&&(c=c?c.concat(p):p),null==t?(e(h,n,r),e(f,n,r),A(i.children||[],n,f,o,s,a,c,u)):d>0&&64&d&&g&&t.dynamicChildren&&t.dynamicChildren.length===g.length?(O(t.dynamicChildren,g,n,o,s,a,c),(null!=i.key||o&&i===o.subTree)&&An(t,i,!0)):W(t,i,n,f,o,s,a,c,u)},R=(t,e,i,n,r,o,s,a,l)=>{e.slotScopeIds=a,null==t?512&e.shapeFlag?r.ctx.activate(e,i,n,s,l):B(e,i,n,r,o,s,l):F(t,e,l)},B=(t,e,i,r,o,s,a)=>{const l=t.component=function(t,e,i){const r=t.type,o=(e?e.appContext:t.appContext)||rr,s={uid:or++,vnode:t,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new J(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:yn(r,o),emitsOptions:on(r,o),emit:null,emitted:null,propsDefaults:n,inheritAttrs:r.inheritAttrs,ctx:n,data:n,props:n,attrs:n,slots:n,refs:n,setupState:n,setupContext:null,suspense:i,suspenseId:i?i.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};s.ctx={_:s},s.root=e?e.root:s,s.emit=nn.bind(null,s),t.ce&&t.ce(s);return s}(t,r,o);if(pi(t)&&(l.ctx.renderer=nt),function(t,e=!1,i=!1){e&&cr(e);const{props:n,children:r}=t.vnode,o=fr(t);(function(t,e,i,n=!1){const r={},o=dn();t.propsDefaults=Object.create(null),pn(t,e,r,o);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);i?t.props=n?r:re(r):t.type.props?t.props=r:t.props=o,t.attrs=o})(t,n,o,e),((t,e,i)=>{const n=t.slots=dn();if(32&t.vnode.shapeFlag){const t=e._;t?(Sn(n,e,i),i&&L(n,"_",t,!0)):In(e,n)}else e&&Mn(t,e)})(t,r,i||e);const s=o?function(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Ri);const{setup:n}=i;if(n){ft();const i=t.setupContext=n.length>1?function(t){const e=e=>{t.exposed=e||{}};return{attrs:new Proxy(t.attrs,vr),slots:t.slots,emit:t.emit,expose:e}}(t):null,r=ur(t),o=Ae(n,t,0,[t.props,i]),s=x(o);if(dt(),r(),!s&&!t.sp||gi(t)||ci(t),s){if(o.then(hr,hr),e)return o.then(e=>{gr(t,e)}).catch(e=>{Oe(e,t,0)});t.asyncDep=o}else gr(t,o)}else pr(t)}(t,e):void 0;e&&cr(!1)}(l,!1,a),l.asyncDep){if(o&&o.registerDep(l,Y,a),!t.el){const n=l.subTree=Kn(zn);b(null,n,e,i),t.placeholder=n.el}}else Y(l,t,e,i,o,s,a)},F=(t,e,i)=>{const n=e.component=t.component;if(function(t,e,i){const{props:n,children:r,component:o}=t,{props:s,children:a,patchFlag:l}=e,c=o.emitsOptions;if(e.dirs||e.transition)return!0;if(!(i&&l>=0))return!(!r&&!a||a&&a.$stable)||n!==s&&(n?!s||un(n,s,c):!!s);if(1024&l)return!0;if(16&l)return n?un(n,s,c):!!s;if(8&l){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e];if(hn(s,n,i)&&!sn(c,i))return!0}}return!1}(t,e,i)){if(n.asyncDep&&!n.asyncResolved)return void H(n,e,i);n.next=e,n.update()}else e.el=t.el,n.vnode=e},Y=(t,e,i,n,r,o,s)=>{const a=()=>{if(t.isMounted){let{next:e,bu:i,u:n,parent:a,vnode:l}=t;{const i=En(t);if(i)return e&&(e.el=l.el,H(t,e,s)),void i.asyncDep.then(()=>{wn(()=>{t.isUnmounted||c()},r)})}let u,h=e;Dn(t,!1),e?(e.el=l.el,H(t,e,s)):e=l,i&&j(i),(u=e.props&&e.props.onVnodeBeforeUpdate)&&nr(u,a,e,l),Dn(t,!0);const f=an(t),g=t.subTree;t.subTree=f,m(g,f,d(g.el),tt(g),t,r,o),e.el=f.el,null===h&&function({vnode:t,parent:e},i){for(;e;){const n=e.subTree;if(n.suspense&&n.suspense.activeBranch===t&&(n.el=t.el),n!==t)break;(t=e.vnode).el=i,e=e.parent}}(t,f.el),n&&wn(n,r),(u=e.props&&e.props.onVnodeUpdated)&&wn(()=>nr(u,a,e,l),r)}else{let s;const{el:a,props:l}=e,{bm:c,m:u,parent:h,root:f,type:d}=t,g=gi(e);Dn(t,!1),c&&j(c),!g&&(s=l&&l.onVnodeBeforeMount)&&nr(s,h,e),Dn(t,!0);{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(d);const s=t.subTree=an(t);m(null,s,i,n,t,r,o),e.el=s.el}if(u&&wn(u,r),!g&&(s=l&&l.onVnodeMounted)){const t=e;wn(()=>nr(s,h,t),r)}(256&e.shapeFlag||h&&gi(h.vnode)&&256&h.vnode.shapeFlag)&&t.a&&wn(t.a,r),t.isMounted=!0,e=i=n=null}};t.scope.on();const l=t.effect=new K(a);t.scope.off();const c=t.update=l.run.bind(l),u=t.job=l.runIfDirty.bind(l);u.i=t,u.id=t.uid,l.scheduler=()=>Ye(u),Dn(t,!0),c()},H=(t,e,i)=>{e.component=t;const r=t.vnode.props;t.vnode=e,t.next=null,function(t,e,i,n){const{props:r,attrs:o,vnode:{patchFlag:s}}=t,a=he(r),[l]=t.propsOptions;let c=!1;if(!(n||s>0)||16&s){let n;pn(t,e,r,o)&&(c=!0);for(const o in a)e&&(f(e,o)||(n=D(o))!==o&&f(e,n))||(l?!i||void 0===i[o]&&void 0===i[n]||(r[o]=vn(l,a,o,void 0,t,!0)):delete r[o]);if(o!==a)for(const t in o)e&&f(e,t)||(delete o[t],c=!0)}else if(8&s){const i=t.vnode.dynamicProps;for(let n=0;n<i.length;n++){let s=i[n];if(sn(t.emitsOptions,s))continue;const u=e[s];if(l)if(f(o,s))u!==o[s]&&(o[s]=u,c=!0);else{const e=k(s);r[e]=vn(l,a,e,u,t,!1)}else u!==o[s]&&(o[s]=u,c=!0)}}c&&Mt(t.attrs,"set","")}(t,e.props,r,i),((t,e,i)=>{const{vnode:r,slots:o}=t;let s=!0,a=n;if(32&r.shapeFlag){const t=e._;t?i&&1===t?s=!1:Sn(o,e,i):(s=!e.$stable,In(e,o)),a=e}else e&&(Mn(t,e),a={default:1});if(s)for(const n in o)xn(n)||null!=a[n]||delete o[n]})(t,e.children,i),ft(),We(t),dt()},W=(t,e,i,n,r,o,s,a,l=!1)=>{const c=t&&t.children,u=t?t.shapeFlag:0,f=e.children,{patchFlag:d,shapeFlag:g}=e;if(d>0){if(128&d)return void G(c,f,i,n,r,o,s,a,l);if(256&d)return void U(c,f,i,n,r,o,s,a,l)}8&g?(16&u&&$(c,r,o),f!==c&&h(i,f)):16&u?16&g?G(c,f,i,n,r,o,s,a,l):$(c,r,o,!0):(8&u&&h(i,""),16&g&&A(f,i,n,r,o,s,a,l))},U=(t,e,i,n,o,s,a,l,c)=>{e=e||r;const u=(t=t||r).length,h=e.length,f=Math.min(u,h);let d;for(d=0;d<f;d++){const n=e[d]=c?er(e[d]):tr(e[d]);m(t[d],n,i,null,o,s,a,l,c)}u>h?$(t,o,s,!0,!1,f):A(e,i,n,o,s,a,l,c,f)},G=(t,e,i,n,o,s,a,l,c)=>{let u=0;const h=e.length;let f=t.length-1,d=h-1;for(;u<=f&&u<=d;){const n=t[u],r=e[u]=c?er(e[u]):tr(e[u]);if(!Zn(n,r))break;m(n,r,i,null,o,s,a,l,c),u++}for(;u<=f&&u<=d;){const n=t[f],r=e[d]=c?er(e[d]):tr(e[d]);if(!Zn(n,r))break;m(n,r,i,null,o,s,a,l,c),f--,d--}if(u>f){if(u<=d){const t=d+1,r=t<h?e[t].el:n;for(;u<=d;)m(null,e[u]=c?er(e[u]):tr(e[u]),i,r,o,s,a,l,c),u++}}else if(u>d)for(;u<=f;)Z(t[u],o,s,!0),u++;else{const g=u,p=u,v=new Map;for(u=p;u<=d;u++){const t=e[u]=c?er(e[u]):tr(e[u]);null!=t.key&&v.set(t.key,u)}let y,b=0;const x=d-p+1;let _=!1,C=0;const I=new Array(x);for(u=0;u<x;u++)I[u]=0;for(u=g;u<=f;u++){const n=t[u];if(b>=x){Z(n,o,s,!0);continue}let r;if(null!=n.key)r=v.get(n.key);else for(y=p;y<=d;y++)if(0===I[y-p]&&Zn(n,e[y])){r=y;break}void 0===r?Z(n,o,s,!0):(I[r-p]=u+1,r>=C?C=r:_=!0,m(n,e[r],i,null,o,s,a,l,c),b++)}const M=_?function(t){const e=t.slice(),i=[0];let n,r,o,s,a;const l=t.length;for(n=0;n<l;n++){const l=t[n];if(0!==l){if(r=i[i.length-1],t[r]<l){e[n]=r,i.push(n);continue}for(o=0,s=i.length-1;o<s;)a=o+s>>1,t[i[a]]<l?o=a+1:s=a;l<t[i[o]]&&(o>0&&(e[n]=i[o-1]),i[o]=n)}}o=i.length,s=i[o-1];for(;o-- >0;)i[o]=s,s=e[s];return i}(I):r;for(y=M.length-1,u=x-1;u>=0;u--){const t=p+u,r=e[t],f=e[t+1],d=t+1<h?f.el||jn(f):n;0===I[u]?m(null,r,i,d,o,s,a,l,c):_&&(y<0||u!==M[y]?X(r,i,d,2):y--)}}},X=(t,n,r,o,s=null)=>{const{el:a,type:l,transition:c,children:u,shapeFlag:h}=t;if(6&h)return void X(t.component.subTree,n,r,o);if(128&h)return void t.suspense.move(n,r,o);if(64&h)return void l.move(t,n,r,nt);if(l===Pn){e(a,n,r);for(let t=0;t<u.length;t++)X(u[t],n,r,o);return void e(t.anchor,n,r)}if(l===Rn)return void C(t,n,r);if(2!==o&&1&h&&c)if(0===o)c.beforeEnter(a),e(a,n,r),wn(()=>c.enter(a),s);else{const{leave:o,delayLeave:s,afterLeave:l}=c,u=()=>{t.ctx.isUnmounted?i(a):e(a,n,r)},h=()=>{a._isLeaving&&a[si](!0),o(a,()=>{u(),l&&l()})};s?s(a,u,h):h()}else e(a,n,r)},Z=(t,e,i,n=!1,r=!1)=>{const{type:o,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:h,dirs:f,cacheIndex:d}=t;if(-2===h&&(r=!1),null!=a&&(ft(),fi(a,null,i,t,!0),dt()),null!=d&&(e.renderCache[d]=void 0),256&u)return void e.ctx.deactivate(t);const g=1&u&&f,p=!gi(t);let v;if(p&&(v=s&&s.onVnodeBeforeUnmount)&&nr(v,e,t),6&u)q(t.component,i,n);else{if(128&u)return void t.suspense.unmount(i,n);g&&Ke(t,null,e,"beforeUnmount"),64&u?t.type.remove(t,e,i,nt,n):c&&!c.hasOnce&&(o!==Pn||h>0&&64&h)?$(c,e,i,!1,!0):(o===Pn&&384&h||!r&&16&u)&&$(l,e,i),n&&V(t)}(p&&(v=s&&s.onVnodeUnmounted)||g)&&wn(()=>{v&&nr(v,e,t),g&&Ke(t,null,e,"unmounted")},i)},V=t=>{const{type:e,el:n,anchor:r,transition:o}=t;if(e===Pn)return void Q(n,r);if(e===Rn)return void I(t);const s=()=>{i(n),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&t.shapeFlag&&o&&!o.persisted){const{leave:e,delayLeave:i}=o,r=()=>e(n,s);i?i(t.el,s,r):r()}else s()},Q=(t,e)=>{let n;for(;t!==e;)n=g(t),i(t),t=n;i(e)},q=(t,e,i)=>{const{bum:n,scope:r,job:o,subTree:s,um:a,m:l,a:c}=t;On(l),On(c),n&&j(n),r.stop(),o&&(o.flags|=8,Z(s,t,e,i)),a&&wn(a,e),wn(()=>{t.isUnmounted=!0},e)},$=(t,e,i,n=!1,r=!1,o=0)=>{for(let s=o;s<t.length;s++)Z(t[s],e,i,n,r)},tt=t=>{if(6&t.shapeFlag)return tt(t.component.subTree);if(128&t.shapeFlag)return t.suspense.next();const e=g(t.anchor||t.el),i=e&&e[oi];return i?g(i):e};let et=!1;const it=(t,e,i)=>{let n;null==t?e._vnode&&(Z(e._vnode,null,null,!0),n=e._vnode.component):m(e._vnode||null,t,e,null,null,null,i),e._vnode=t,et||(et=!0,We(n),Ue(),et=!1)},nt={p:m,um:Z,m:X,r:V,mt:B,mc:A,pc:W,pbc:O,n:tt,o:t};let rt;return{render:it,hydrate:rt,createApp:tn(it)}}(t)}function Tn({type:t,props:e},i){return"svg"===i&&"foreignObject"===t||"mathml"===i&&"annotation-xml"===t&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function Dn({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function An(t,e,i=!1){const n=t.children,r=e.children;if(d(n)&&d(r))for(let o=0;o<n.length;o++){const t=n[o];let e=r[o];1&e.shapeFlag&&!e.dynamicChildren&&((e.patchFlag<=0||32===e.patchFlag)&&(e=r[o]=er(r[o]),e.el=t.el),i||-2===e.patchFlag||An(t,e)),e.type===Nn&&(-1===e.patchFlag&&(e=r[o]=er(e)),e.el=t.el),e.type!==zn||e.el||(e.el=t.el)}}function En(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:En(e)}function On(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function jn(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?jn(e.subTree):null}const Ln=t=>t.__isSuspense;const Pn=Symbol.for("v-fgt"),Nn=Symbol.for("v-txt"),zn=Symbol.for("v-cmt"),Rn=Symbol.for("v-stc"),Bn=[];let Fn=null;function Yn(t=!1){Bn.push(Fn=t?null:[])}let Hn=1;function Wn(t,e=!1){Hn+=t,t<0&&Fn&&e&&(Fn.hasOnce=!0)}function Un(t){return t.dynamicChildren=Hn>0?Fn||r:null,Bn.pop(),Fn=Bn[Bn.length-1]||null,Hn>0&&Fn&&Fn.push(t),t}function Gn(t,e,i,n,r,o){return Un(Qn(t,e,i,n,r,o,!0))}function Xn(t){return!!t&&!0===t.__v_isVNode}function Zn(t,e){return t.type===e.type&&t.key===e.key}const Vn=({key:t})=>null!=t?t:null,Jn=({ref:t,ref_key:e,ref_for:i})=>("number"==typeof t&&(t=""+t),null!=t?m(t)||pe(t)||v(t)?{i:Ze,r:t,k:e,f:!!i}:t:null);function Qn(t,e=null,i=null,n=0,r=null,o=(t===Pn?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Vn(e),ref:e&&Jn(e),scopeId:Ve,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ze};return a?(ir(l,i),128&o&&t.normalize(l)):i&&(l.shapeFlag|=m(i)?8:16),Hn>0&&!s&&Fn&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&Fn.push(l),l}const Kn=function(t,e=null,i=null,n=0,r=null,o=!1){t&&t!==ji||(t=zn);if(Xn(t)){const n=qn(t,e,!0);return i&&ir(n,i),Hn>0&&!o&&Fn&&(6&n.shapeFlag?Fn[Fn.indexOf(t)]=n:Fn.push(n)),n.patchFlag=-2,n}s=t,v(s)&&"__vccOpts"in s&&(t=t.__vccOpts);var s;if(e){e=function(t){return t?ue(t)||gn(t)?c({},t):t:null}(e);let{class:t,style:i}=e;t&&!m(t)&&(e.class=W(t)),b(i)&&(ue(i)&&!d(i)&&(i=c({},i)),e.style=R(i))}const a=m(t)?1:Ln(t)?128:(t=>t.__isTeleport)(t)?64:b(t)?4:v(t)?2:0;return Qn(t,e,i,n,r,a,o,!0)};function qn(t,e,i=!1,n=!1){const{props:r,ref:o,patchFlag:s,children:l,transition:c}=t,u=e?function(...t){const e={};for(let i=0;i<t.length;i++){const n=t[i];for(const t in n)if("class"===t)e.class!==n.class&&(e.class=W([e.class,n.class]));else if("style"===t)e.style=R([e.style,n.style]);else if(a(t)){const i=e[t],r=n[t];!r||i===r||d(i)&&i.includes(r)||(e[t]=i?[].concat(i,r):r)}else""!==t&&(e[t]=n[t])}return e}(r||{},e):r,h={__v_isVNode:!0,__v_skip:!0,type:t.type,props:u,key:u&&Vn(u),ref:e&&e.ref?i&&o?d(o)?o.concat(Jn(e)):[o,Jn(e)]:Jn(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Pn?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&qn(t.ssContent),ssFallback:t.ssFallback&&qn(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&n&&ai(h,c.clone(h)),h}function $n(t=" ",e=0){return Kn(Nn,null,t,e)}function tr(t){return null==t||"boolean"==typeof t?Kn(zn):d(t)?Kn(Pn,null,t.slice()):Xn(t)?er(t):Kn(Nn,null,String(t))}function er(t){return null===t.el&&-1!==t.patchFlag||t.memo?t:qn(t)}function ir(t,e){let i=0;const{shapeFlag:n}=t;if(null==e)e=null;else if(d(e))i=16;else if("object"==typeof e){if(65&n){const i=e.default;return void(i&&(i._c&&(i._d=!1),ir(t,i()),i._c&&(i._d=!0)))}{i=32;const n=e._;n||gn(e)?3===n&&Ze&&(1===Ze.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=Ze}}else v(e)?(e={default:e,_ctx:Ze},i=32):(e=String(e),64&n?(i=16,e=[$n(e)]):i=8);t.children=e,t.shapeFlag|=i}function nr(t,e,i,n=null){Ee(t,e,7,[i,n])}const rr=qi();let or=0;let sr=null;const ar=()=>sr||Ze;let lr,cr;{const t=z(),e=(e,i)=>{let n;return(n=t[e])||(n=t[e]=[]),n.push(i),t=>{n.length>1?n.forEach(e=>e(t)):n[0](t)}};lr=e("__VUE_INSTANCE_SETTERS__",t=>sr=t),cr=e("__VUE_SSR_SETTERS__",t=>dr=t)}const ur=t=>{const e=sr;return lr(t),t.scope.on(),()=>{t.scope.off(),lr(e)}},hr=()=>{sr&&sr.scope.off(),lr(null)};function fr(t){return 4&t.vnode.shapeFlag}let dr=!1;function gr(t,e,i){v(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:b(e)&&(t.setupState=Ce(e)),pr(t)}function pr(t,e,i){const n=t.type;t.render||(t.render=n.render||o);{const e=ur(t);ft();try{Yi(t)}finally{dt(),e()}}}const vr={get:(t,e)=>(It(t,0,""),t[e])};function mr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Ce(fe(t.exposed)),{get:(e,i)=>i in e?e[i]:i in Ni?Ni[i](t):void 0,has:(t,e)=>e in t||e in Ni})):t.proxy}function yr(t,e=!0){return v(t)?t.displayName||t.name:t.name||e&&t.__name}const br=(t,e)=>Me(t,0,dr);function xr(t,e,i){try{Wn(-1);const n=arguments.length;return 2===n?b(e)&&!d(e)?Xn(e)?Kn(t,null,[e]):Kn(t,e):Kn(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):3===n&&Xn(i)&&(i=[i]),Kn(t,e,i))}finally{Wn(1)}}const _r="3.5.29";let Cr;const Ir="undefined"!=typeof window&&window.trustedTypes;if(Ir)try{Cr=Ir.createPolicy("vue",{createHTML:t=>t})}catch(ea){}const Mr=Cr?t=>Cr.createHTML(t):t=>t,Sr="undefined"!=typeof document?document:null,wr=Sr&&Sr.createElement("template"),kr={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const r="svg"===e?Sr.createElementNS("http://www.w3.org/2000/svg",t):"mathml"===e?Sr.createElementNS("http://www.w3.org/1998/Math/MathML",t):i?Sr.createElement(t,{is:i}):Sr.createElement(t);return"select"===t&&n&&null!=n.multiple&&r.setAttribute("multiple",n.multiple),r},createText:t=>Sr.createTextNode(t),createComment:t=>Sr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Sr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,r,o){const s=i?i.previousSibling:e.lastChild;if(r&&(r===o||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),i),r!==o&&(r=r.nextSibling););else{wr.innerHTML=Mr("svg"===n?`<svg>${t}</svg>`:"mathml"===n?`<math>${t}</math>`:t);const r=wr.content;if("svg"===n||"mathml"===n){const t=r.firstChild;for(;t.firstChild;)r.appendChild(t.firstChild);r.removeChild(t)}e.insertBefore(r,i)}return[s?s.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},Tr=Symbol("_vtc");const Dr=Symbol("_vod"),Ar=Symbol("_vsh"),Er=Symbol(""),Or=/(?:^|;)\s*display\s*:/;const jr=/\s*!important$/;function Lr(t,e,i){if(d(i))i.forEach(i=>Lr(t,e,i));else if(null==i&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const n=function(t,e){const i=Nr[e];if(i)return i;let n=k(e);if("filter"!==n&&n in t)return Nr[e]=n;n=A(n);for(let r=0;r<Pr.length;r++){const i=Pr[r]+n;if(i in t)return Nr[e]=i}return e}(t,e);jr.test(i)?t.setProperty(D(n),i.replace(jr,""),"important"):t[n]=i}}const Pr=["Webkit","Moz","ms"],Nr={};const zr="http://www.w3.org/1999/xlink";function Rr(t,e,i,n,r,o=U(e)){n&&e.startsWith("xlink:")?null==i?t.removeAttributeNS(zr,e.slice(6,e.length)):t.setAttributeNS(zr,e,i):null==i||o&&!G(i)?t.removeAttribute(e):t.setAttribute(e,o?"":y(i)?String(i):i)}function Br(t,e,i,n,r){if("innerHTML"===e||"textContent"===e)return void(null!=i&&(t[e]="innerHTML"===e?Mr(i):i));const o=t.tagName;if("value"===e&&"PROGRESS"!==o&&!o.includes("-")){const n="OPTION"===o?t.getAttribute("value")||"":t.value,r=null==i?"checkbox"===t.type?"on":"":String(i);return n===r&&"_value"in t||(t.value=r),null==i&&t.removeAttribute(e),void(t._value=i)}let s=!1;if(""===i||null==i){const n=typeof t[e];"boolean"===n?i=G(i):null==i&&"string"===n?(i="",s=!0):"number"===n&&(i=0,s=!0)}try{t[e]=i}catch(ea){}s&&t.removeAttribute(r||e)}const Fr=Symbol("_vei");function Yr(t,e,i,n,r=null){const o=t[Fr]||(t[Fr]={}),s=o[e];if(n&&s)s.value=n;else{const[i,a]=function(t){let e;if(Hr.test(t)){let i;for(e={};i=t.match(Hr);)t=t.slice(0,t.length-i[0].length),e[i[0].toLowerCase()]=!0}const i=":"===t[2]?t.slice(3):D(t.slice(2));return[i,e]}(e);if(n){const s=o[e]=function(t,e){const i=t=>{if(t._vts){if(t._vts<=i.attached)return}else t._vts=Date.now();Ee(function(t,e){if(d(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(t=>e=>!e._stopped&&t&&t(e))}return e}(t,i.value),e,5,[t])};return i.value=t,i.attached=Gr(),i}(n,r);!function(t,e,i,n){t.addEventListener(e,i,n)}(t,i,s,a)}else s&&(!function(t,e,i,n){t.removeEventListener(e,i,n)}(t,i,s,a),o[e]=void 0)}}const Hr=/(?:Once|Passive|Capture)$/;let Wr=0;const Ur=Promise.resolve(),Gr=()=>Wr||(Ur.then(()=>Wr=0),Wr=Date.now());const Xr=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123;const Zr=c({patchProp:(t,e,i,n,r,o)=>{const s="svg"===r;"class"===e?function(t,e,i){const n=t[Tr];n&&(e=(e?[e,...n]:[...n]).join(" ")),null==e?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}(t,n,s):"style"===e?function(t,e,i){const n=t.style,r=m(i);let o=!1;if(i&&!r){if(e)if(m(e))for(const t of e.split(";")){const e=t.slice(0,t.indexOf(":")).trim();null==i[e]&&Lr(n,e,"")}else for(const t in e)null==i[t]&&Lr(n,t,"");for(const t in i)"display"===t&&(o=!0),Lr(n,t,i[t])}else if(r){if(e!==i){const t=n[Er];t&&(i+=";"+t),n.cssText=i,o=Or.test(i)}}else e&&t.removeAttribute("style");Dr in t&&(t[Dr]=o?n.display:"",t[Ar]&&(n.display="none"))}(t,i,n):a(e)?l(e)||Yr(t,e,0,n,o):("."===e[0]?(e=e.slice(1),1):"^"===e[0]?(e=e.slice(1),0):function(t,e,i,n){if(n)return"innerHTML"===e||"textContent"===e||!!(e in t&&Xr(e)&&v(i));if("spellcheck"===e||"draggable"===e||"translate"===e||"autocorrect"===e)return!1;if("sandbox"===e&&"IFRAME"===t.tagName)return!1;if("form"===e)return!1;if("list"===e&&"INPUT"===t.tagName)return!1;if("type"===e&&"TEXTAREA"===t.tagName)return!1;if("width"===e||"height"===e){const e=t.tagName;if("IMG"===e||"VIDEO"===e||"CANVAS"===e||"SOURCE"===e)return!1}if(Xr(e)&&m(i))return!1;return e in t}(t,e,n,s))?(Br(t,e,n),t.tagName.includes("-")||"value"!==e&&"checked"!==e&&"selected"!==e||Rr(t,e,n,s,0,"value"!==e)):!t._isVueCE||!/[A-Z]/.test(e)&&m(n)?("true-value"===e?t._trueValue=n:"false-value"===e&&(t._falseValue=n),Rr(t,e,n,s)):Br(t,k(e),n,0,e)}},kr);let Vr;const Jr=Symbol();var Qr,Kr;(Kr=Qr||(Qr={})).direct="direct",Kr.patchObject="patch object",Kr.patchFunction="patch function";const qr="undefined"!=typeof document;function $r(t){return"object"==typeof t||"displayName"in t||"props"in t||"__vccOpts"in t}const to=Object.assign;function eo(t,e){const i={};for(const n in e){const r=e[n];i[n]=no(r)?r.map(t):t(r)}return i}const io=()=>{},no=Array.isArray;function ro(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}let oo=function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t}({});const so=Symbol("");function ao(t,e){return to(new Error,{type:t,[so]:!0},e)}function lo(t,e){return t instanceof Error&&so in t&&(null==e||!!(t.type&e))}oo.MATCHER_NOT_FOUND,oo.NAVIGATION_GUARD_REDIRECT,oo.NAVIGATION_ABORTED,oo.NAVIGATION_CANCELLED,oo.NAVIGATION_DUPLICATED;const co=Symbol(""),uo=Symbol(""),ho=Symbol(""),fo=Symbol(""),go=Symbol("");const po=/#/g,vo=/&/g,mo=/\//g,yo=/=/g,bo=/\?/g,xo=/\+/g,_o=/%5B/g,Co=/%5D/g,Io=/%5E/g,Mo=/%60/g,So=/%7B/g,wo=/%7C/g,ko=/%7D/g,To=/%20/g;function Do(t){return null==t?"":encodeURI(""+t).replace(wo,"|").replace(_o,"[").replace(Co,"]")}function Ao(t){return Do(t).replace(xo,"%2B").replace(To,"+").replace(po,"%23").replace(vo,"%26").replace(Mo,"`").replace(So,"{").replace(ko,"}").replace(Io,"^")}function Eo(t){return Ao(t).replace(yo,"%3D")}function Oo(t){return function(t){return Do(t).replace(po,"%23").replace(bo,"%3F")}(t).replace(mo,"%2F")}function jo(t){if(null==t)return null;try{return decodeURIComponent(""+t)}catch(e){}return""+t}const Lo=/\/$/;function Po(t,e,i="/"){let n,r={},o="",s="";const a=e.indexOf("#");let l=e.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(n=e.slice(0,l),o=e.slice(l,a>0?a:e.length),r=t(o.slice(1))),a>=0&&(n=n||e.slice(0,a),s=e.slice(a,e.length)),n=function(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),r=n[n.length-1];".."!==r&&"."!==r||n.push("");let o,s,a=i.length-1;for(o=0;o<n.length;o++)if(s=n[o],"."!==s){if(".."!==s)break;a>1&&a--}return i.slice(0,a).join("/")+"/"+n.slice(o).join("/")}(null!=n?n:e,i),{fullPath:n+o+s,path:n,query:r,hash:jo(s)}}function No(t,e){return e&&t.toLowerCase().startsWith(e.toLowerCase())?t.slice(e.length)||"/":t}function zo(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Ro(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var i in t)if(!Bo(t[i],e[i]))return!1;return!0}function Bo(t,e){return no(t)?Fo(t,e):no(e)?Fo(e,t):(t&&t.valueOf())===(e&&e.valueOf())}function Fo(t,e){return no(e)?t.length===e.length&&t.every((t,i)=>t===e[i]):1===t.length&&t[0]===e}const Yo={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ho=function(t){return t.pop="pop",t.push="push",t}({}),Wo=function(t){return t.back="back",t.forward="forward",t.unknown="",t}({});function Uo(t){if(!t)if(qr){const e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return"/"!==t[0]&&"#"!==t[0]&&(t="/"+t),t.replace(Lo,"")}const Go=/^[^#]+#/;function Xo(t,e){return t.replace(Go,"#")+e}const Zo=()=>({left:window.scrollX,top:window.scrollY});function Vo(t){let e;if("el"in t){const i=t.el,n="string"==typeof i&&i.startsWith("#"),r="string"==typeof i?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!r)return;e=function(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(null!=e.left?e.left:window.scrollX,null!=e.top?e.top:window.scrollY)}function Jo(t,e){return(history.state?history.state.position-e:-1)+t}const Qo=new Map;function Ko(t){return"string"==typeof t||"symbol"==typeof t}function qo(t){const e={};if(""===t||"?"===t)return e;const i=("?"===t[0]?t.slice(1):t).split("&");for(let n=0;n<i.length;++n){const t=i[n].replace(xo," "),r=t.indexOf("="),o=jo(r<0?t:t.slice(0,r)),s=r<0?null:jo(t.slice(r+1));if(o in e){let t=e[o];no(t)||(t=e[o]=[t]),t.push(s)}else e[o]=s}return e}function $o(t){let e="";for(let i in t){const n=t[i];i=Eo(i),null!=n?(no(n)?n.map(t=>t&&Ao(t)):[n&&Ao(n)]).forEach(t=>{void 0!==t&&(e+=(e.length?"&":"")+i,null!=t&&(e+="="+t))}):void 0!==n&&(e+=(e.length?"&":"")+i)}return e}function ts(t){const e={};for(const i in t){const n=t[i];void 0!==n&&(e[i]=no(n)?n.map(t=>null==t?null:""+t):null==n?n:""+n)}return e}function es(){let t=[];return{add:function(e){return t.push(e),()=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)}},list:()=>t.slice(),reset:function(){t=[]}}}function is(t,e,i,n,r,o=t=>t()){const s=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const c=t=>{var o;!1===t?l(ao(oo.NAVIGATION_ABORTED,{from:i,to:e})):t instanceof Error?l(t):"string"==typeof(o=t)||o&&"object"==typeof o?l(ao(oo.NAVIGATION_GUARD_REDIRECT,{from:e,to:t})):(s&&n.enterCallbacks[r]===s&&"function"==typeof t&&s.push(t),a())},u=o(()=>t.call(n&&n.instances[r],e,i,c));let h=Promise.resolve(u);t.length<3&&(h=h.then(c)),h.catch(t=>l(t))})}function ns(t,e,i,n,r=t=>t()){const o=[];for(const s of t)for(const t in s.components){let a=s.components[t];if("beforeRouteEnter"===e||s.instances[t])if($r(a)){const l=(a.__vccOpts||a)[e];l&&o.push(is(l,i,n,s,t,r))}else{let l=a();o.push(()=>l.then(o=>{if(!o)throw new Error(`Couldn't resolve component "${t}" at "${s.path}"`);const a=(l=o).__esModule||"Module"===l[Symbol.toStringTag]||l.default&&$r(l.default)?o.default:o;var l;s.mods[t]=o,s.components[t]=a;const c=(a.__vccOpts||a)[e];return c&&is(c,i,n,s,t,r)()}))}}return o}function rs(t,e){const{pathname:i,search:n,hash:r}=e,o=t.indexOf("#");if(o>-1){let e=r.includes(t.slice(o))?t.slice(o).length:1,i=r.slice(e);return"/"!==i[0]&&(i="/"+i),No(i,"")}return No(i,t)+n+r}function os(t,e,i,n=!1,r=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:r?Zo():null}}function ss(t){const{history:e,location:i}=window,n={value:rs(t,i)},r={value:e.state};function o(n,o,s){const a=t.indexOf("#"),l=a>-1?(i.host&&document.querySelector("base")?t:t.slice(a))+n:location.protocol+"//"+location.host+t+n;try{e[s?"replaceState":"pushState"](o,"",l),r.value=o}catch(c){i[s?"replace":"assign"](l)}}return r.value||o(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0),{location:n,state:r,push:function(t,i){const s=to({},r.value,e.state,{forward:t,scroll:Zo()});o(s.current,s,!0),o(t,to({},os(n.value,t,null),{position:s.position+1},i),!1),n.value=t},replace:function(t,i){o(t,to({},e.state,os(r.value.back,t,r.value.forward,!0),i,{position:r.value.position}),!0),n.value=t}}}let as=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t}({});var ls=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t}(ls||{});const cs={type:as.Static,value:""},us=/[a-zA-Z0-9_]/;const hs="[^/]+?",fs={sensitive:!1,strict:!1,start:!0,end:!0};var ds=function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t}(ds||{});const gs=/[.+*?^${}()[\]/\\]/g;function ps(t,e){let i=0;for(;i<t.length&&i<e.length;){const n=e[i]-t[i];if(n)return n;i++}return t.length<e.length?1===t.length&&t[0]===ds.Static+ds.Segment?-1:1:t.length>e.length?1===e.length&&e[0]===ds.Static+ds.Segment?1:-1:0}function vs(t,e){let i=0;const n=t.score,r=e.score;for(;i<n.length&&i<r.length;){const t=ps(n[i],r[i]);if(t)return t;i++}if(1===Math.abs(r.length-n.length)){if(ms(n))return 1;if(ms(r))return-1}return r.length-n.length}function ms(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const ys={strict:!1,end:!0,sensitive:!1};function bs(t,e,i){const n=function(t,e){const i=to({},fs,e),n=[];let r=i.start?"^":"";const o=[];for(const l of t){const t=l.length?[]:[ds.Root];i.strict&&!l.length&&(r+="/");for(let e=0;e<l.length;e++){const n=l[e];let s=ds.Segment+(i.sensitive?ds.BonusCaseSensitive:0);if(n.type===as.Static)e||(r+="/"),r+=n.value.replace(gs,"\\$&"),s+=ds.Static;else if(n.type===as.Param){const{value:t,repeatable:i,optional:c,regexp:u}=n;o.push({name:t,repeatable:i,optional:c});const h=u||hs;if(h!==hs){s+=ds.BonusCustomRegExp;try{new RegExp(`(${h})`)}catch(a){throw new Error(`Invalid custom RegExp for param "${t}" (${h}): `+a.message)}}let f=i?`((?:${h})(?:/(?:${h}))*)`:`(${h})`;e||(f=c&&l.length<2?`(?:/${f})`:"/"+f),c&&(f+="?"),r+=f,s+=ds.Dynamic,c&&(s+=ds.BonusOptional),i&&(s+=ds.BonusRepeatable),".*"===h&&(s+=ds.BonusWildcard)}t.push(s)}n.push(t)}if(i.strict&&i.end){const t=n.length-1;n[t][n[t].length-1]+=ds.BonusStrict}i.strict||(r+="/?"),i.end?r+="$":i.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const s=new RegExp(r,i.sensitive?"":"i");return{re:s,score:n,keys:o,parse:function(t){const e=t.match(s),i={};if(!e)return null;for(let n=1;n<e.length;n++){const t=e[n]||"",r=o[n-1];i[r.name]=t&&r.repeatable?t.split("/"):t}return i},stringify:function(e){let i="",n=!1;for(const r of t){n&&i.endsWith("/")||(i+="/"),n=!1;for(const t of r)if(t.type===as.Static)i+=t.value;else if(t.type===as.Param){const{value:o,repeatable:s,optional:a}=t,l=o in e?e[o]:"";if(no(l)&&!s)throw new Error(`Provided param "${o}" is an array but it is not repeatable (* or + modifiers)`);const c=no(l)?l.join("/"):l;if(!c){if(!a)throw new Error(`Missing required param "${o}"`);r.length<2&&(i.endsWith("/")?i=i.slice(0,-1):n=!0)}i+=c}}return i||"/"}}}(function(t){if(!t)return[[]];if("/"===t)return[[cs]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(t){throw new Error(`ERR (${i})/"${c}": ${t}`)}let i=ls.Static,n=i;const r=[];let o;function s(){o&&r.push(o),o=[]}let a,l=0,c="",u="";function h(){c&&(i===ls.Static?o.push({type:as.Static,value:c}):i===ls.Param||i===ls.ParamRegExp||i===ls.ParamRegExpEnd?(o.length>1&&("*"===a||"+"===a)&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),o.push({type:as.Param,value:c,regexp:u,repeatable:"*"===a||"+"===a,optional:"*"===a||"?"===a})):e("Invalid state to consume buffer"),c="")}function f(){c+=a}for(;l<t.length;)if(a=t[l++],"\\"!==a||i===ls.ParamRegExp)switch(i){case ls.Static:"/"===a?(c&&h(),s()):":"===a?(h(),i=ls.Param):f();break;case ls.EscapeNext:f(),i=n;break;case ls.Param:"("===a?i=ls.ParamRegExp:us.test(a)?f():(h(),i=ls.Static,"*"!==a&&"?"!==a&&"+"!==a&&l--);break;case ls.ParamRegExp:")"===a?"\\"==u[u.length-1]?u=u.slice(0,-1)+a:i=ls.ParamRegExpEnd:u+=a;break;case ls.ParamRegExpEnd:h(),i=ls.Static,"*"!==a&&"?"!==a&&"+"!==a&&l--,u="";break;default:e("Unknown state")}else n=i,i=ls.EscapeNext;return i===ls.ParamRegExp&&e(`Unfinished custom RegExp for param "${c}"`),h(),s(),r}(t.path),i),r=to(n,{record:t,parent:e,children:[],alias:[]});return e&&!r.record.aliasOf==!e.record.aliasOf&&e.children.push(r),r}function xs(t,e){const i=[],n=new Map;function r(t,i,n){const a=!n,l=Cs(t);l.aliasOf=n&&n.record;const c=ro(e,t),u=[l];if("alias"in t){const e="string"==typeof t.alias?[t.alias]:t.alias;for(const t of e)u.push(Cs(to({},l,{components:n?n.record.components:l.components,path:t,aliasOf:n?n.record:l})))}let h,f;for(const e of u){const{path:u}=e;if(i&&"/"!==u[0]){const t=i.record.path,n="/"===t[t.length-1]?"":"/";e.path=i.record.path+(u&&n+u)}if(h=bs(e,i,c),n?n.alias.push(h):(f=f||h,f!==h&&f.alias.push(h),a&&t.name&&!Ms(h)&&o(t.name)),ws(h)&&s(h),l.children){const t=l.children;for(let e=0;e<t.length;e++)r(t[e],h,n&&n.children[e])}n=n||h}return f?()=>{o(f)}:io}function o(t){if(Ko(t)){const e=n.get(t);e&&(n.delete(t),i.splice(i.indexOf(e),1),e.children.forEach(o),e.alias.forEach(o))}else{const e=i.indexOf(t);e>-1&&(i.splice(e,1),t.record.name&&n.delete(t.record.name),t.children.forEach(o),t.alias.forEach(o))}}function s(t){const e=function(t,e){let i=0,n=e.length;for(;i!==n;){const r=i+n>>1;vs(t,e[r])<0?n=r:i=r+1}const r=function(t){let e=t;for(;e=e.parent;)if(ws(e)&&0===vs(t,e))return e}(t);r&&(n=e.lastIndexOf(r,n-1));return n}(t,i);i.splice(e,0,t),t.record.name&&!Ms(t)&&n.set(t.record.name,t)}return e=ro(ys,e),t.forEach(t=>r(t)),{addRoute:r,resolve:function(t,e){let r,o,s,a={};if("name"in t&&t.name){if(r=n.get(t.name),!r)throw ao(oo.MATCHER_NOT_FOUND,{location:t});s=r.record.name,a=to(_s(e.params,r.keys.filter(t=>!t.optional).concat(r.parent?r.parent.keys.filter(t=>t.optional):[]).map(t=>t.name)),t.params&&_s(t.params,r.keys.map(t=>t.name))),o=r.stringify(a)}else if(null!=t.path)o=t.path,r=i.find(t=>t.re.test(o)),r&&(a=r.parse(o),s=r.record.name);else{if(r=e.name?n.get(e.name):i.find(t=>t.re.test(e.path)),!r)throw ao(oo.MATCHER_NOT_FOUND,{location:t,currentLocation:e});s=r.record.name,a=to({},e.params,t.params),o=r.stringify(a)}const l=[];let c=r;for(;c;)l.unshift(c.record),c=c.parent;return{name:s,path:o,params:a,matched:l,meta:Ss(l)}},removeRoute:o,clearRoutes:function(){i.length=0,n.clear()},getRoutes:function(){return i},getRecordMatcher:function(t){return n.get(t)}}}function _s(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function Cs(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:Is(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function Is(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]="object"==typeof i?i[n]:i;return e}function Ms(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function Ss(t){return t.reduce((t,e)=>to(t,e.meta),{})}function ws({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function ks(t){const e=$e(ho),i=$e(fo),n=br(()=>{const i=xe(t.to);return e.resolve(i)}),r=br(()=>{const{matched:t}=n.value,{length:e}=t,r=t[e-1],o=i.matched;if(!r||!o.length)return-1;const s=o.findIndex(zo.bind(null,r));if(s>-1)return s;const a=Ds(t[e-2]);return e>1&&Ds(r)===a&&o[o.length-1].path!==a?o.findIndex(zo.bind(null,t[e-2])):s}),o=br(()=>r.value>-1&&function(t,e){for(const i in e){const n=e[i],r=t[i];if("string"==typeof n){if(n!==r)return!1}else if(!no(r)||r.length!==n.length||n.some((t,e)=>t.valueOf()!==r[e].valueOf()))return!1}return!0}(i.params,n.value.params)),s=br(()=>r.value>-1&&r.value===i.matched.length-1&&Ro(i.params,n.value.params));return{route:n,href:br(()=>n.value.href),isActive:o,isExactActive:s,navigate:function(i={}){if(function(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return;if(t.defaultPrevented)return;if(void 0!==t.button&&0!==t.button)return;if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}t.preventDefault&&t.preventDefault();return!0}(i)){const i=e[xe(t.replace)?"replace":"push"](xe(t.to)).catch(io);return t.viewTransition&&"undefined"!=typeof document&&"startViewTransition"in document&&document.startViewTransition(()=>i),i}return Promise.resolve()}}}const Ts=li({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:ks,setup(t,{slots:e}){const i=ne(ks(t)),{options:n}=$e(ho),r=br(()=>({[As(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[As(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const n=e.default&&(1===(o=e.default(i)).length?o[0]:o);var o;return t.custom?n:xr("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:r.value},n)}}});function Ds(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const As=(t,e,i)=>null!=t?t:null!=e?e:i;function Es(t,e){if(!t)return null;const i=t(e);return 1===i.length?i[0]:i}const Os=li({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=$e(go),r=br(()=>t.route||n.value),o=$e(uo,0),s=br(()=>{let t=xe(o);const{matched:e}=r.value;let i;for(;(i=e[t])&&!i.components;)t++;return t}),a=br(()=>r.value.matched[s.value]);qe(uo,br(()=>s.value+1)),qe(co,a),qe(go,r);const l=ve();return ei(()=>[l.value,a.value,t.name],([t,e,i],[n,r,o])=>{e&&(e.instances[i]=t,r&&r!==e&&t&&t===n&&(e.leaveGuards.size||(e.leaveGuards=r.leaveGuards),e.updateGuards.size||(e.updateGuards=r.updateGuards))),!t||!e||r&&zo(e,r)&&n||(e.enterCallbacks[i]||[]).forEach(e=>e(t))},{flush:"post"}),()=>{const n=r.value,o=t.name,s=a.value,c=s&&s.components[o];if(!c)return Es(i.default,{Component:c,route:n});const u=s.props[o],h=u?!0===u?n.params:"function"==typeof u?u(n):u:null,f=xr(c,to({},h,e,{onVnodeUnmounted:t=>{t.component.isUnmounted&&(s.instances[o]=null)},ref:l}));return Es(i.default,{Component:f,route:n})||f}}});const js={class:"main-container"},Ls={class:"link-group"},Ps={class:"router-view-container"},Ns=(t,e)=>{const i=t.__vccOpts||t;for(const[n,r]of e)i[n]=r;return i},zs=Ns(li({__name:"App",setup:t=>($e(ho),(t,e)=>{const i=Oi("router-link");return Yn(),Gn("div",js,[Qn("div",Ls,[Kn(i,{class:"nav-link",to:{name:"mapPlugin"}},{default:Qe(()=>[...e[0]||(e[0]=[$n(" 专题图插件 ",-1)])]),_:1}),Kn(i,{class:"nav-link",to:{name:"test"}},{default:Qe(()=>[...e[1]||(e[1]=[$n(" 测试界面 ",-1)])]),_:1}),Kn(i,{class:"nav-link",to:{name:"home"}},{default:Qe(()=>[...e[2]||(e[2]=[$n(" 返回首页 ",-1)])]),_:1})]),Qn("div",Ps,[Kn(xe(Os))])])})}),[["__scopeId","data-v-dadef81d"]]);const Rs=Ns({},[["render",function(t,e){return Yn(),Gn("div",null,"首页")}]]);class Bs{constructor(t){e(this,"editor"),e(this,"colors"),e(this,"fonts"),e(this,"addedElements",[]),this.editor=t,this.colors={yellow:"#FFFF00",blue:"#50C8FF",black:"#000000",white:"#FFFFFF"},this.fonts={title:"方正小标宋简体",normal:"黑体"}}async setA4Landscape(){return await this.editor.resizeCanvasDimension({width:1123,height:794}),this.addedElements=[],{width:1123,height:794}}async addTitle(t="专题图标题"){const e=this.editor.getCanvasSize(),i={styles:{fill:this.colors.black,fontSize:23,fontFamily:this.fonts.title,fontWeight:"normal",textAlign:"center"},position:{x:e.width/2,y:80}},n=await this.editor.addText(t,i);return this.addedElements.push({id:n.id,type:"title",properties:{text:t,...i}}),n}async addFigureLabel(t="附图"){const e={styles:{fill:this.colors.black,fontSize:20,fontFamily:this.fonts.normal,fontWeight:"normal"},position:{x:50,y:40}},i=await this.editor.addText(t,e);return this.addedElements.push({id:i.id,type:"figureLabel",properties:{text:t,...e}}),i}async addTimestamp(){const t=(new Date).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),e=this.editor.getCanvasSize(),i={styles:{fill:this.colors.black,fontSize:11,fontFamily:this.fonts.normal,fontWeight:"normal"},position:{x:e.width-150,y:e.height-40}},n=await this.editor.addText(`时间: ${t}`,i);return this.addedElements.push({id:n.id,type:"timestamp",properties:{text:t,...i}}),n}async addYellowLabel(t,e,i){const n=1.5,r=await this.editor.addText(t,{styles:{fill:this.colors.black,fontSize:12,fontFamily:this.fonts.normal,fontWeight:"normal"},position:{x:e-n,y:i-n},isSilent:!0}),o=await this.editor.addText(t,{styles:{fill:this.colors.yellow,fontSize:12,fontFamily:this.fonts.normal,fontWeight:"normal"},position:{x:e,y:i}});return this.addedElements.push({id:r.id,type:"yellowLabelStroke",properties:{text:t,x:e-n,y:i-n}},{id:o.id,type:"yellowLabel",properties:{text:t,x:e,y:i}}),o}async addBlueLabel(t,e,i){const n={styles:{fill:this.colors.blue,fontSize:12,fontFamily:this.fonts.normal,fontWeight:"normal"},position:{x:e,y:i}},r=await this.editor.addText(t,n);return this.addedElements.push({id:r.id,type:"blueLabel",properties:{text:t,x:e,y:i,...n}}),r}async addComparisonBox(t,e,i,n,r=""){const o={left:t,top:e,width:i,height:n,fill:"transparent",stroke:this.colors.yellow,strokeWidth:3},s=await this.editor.addShape("rect",o);if(this.addedElements.push({id:s.id,type:"comparisonBox",properties:{x:t,y:e,...o}}),r){const o=await this.editor.addText(r,{styles:{fill:this.colors.black,fontSize:10,fontFamily:this.fonts.normal,fontWeight:"normal"},position:{x:t+i/2,y:e+n+15},isSilent:!0});this.addedElements.push({id:o.id,type:"comparisonBoxLabel",properties:{text:r,x:t+i/2,y:e+n+15}})}return s}async addCalibrationTarget(t,e,i,n){const r={left:t,top:e,width:i,height:n,fill:"transparent",stroke:this.colors.yellow,strokeWidth:3,strokeDashArray:[10,5]},o=await this.editor.addShape("rect",r);return this.addedElements.push({id:o.id,type:"calibrationTarget",properties:{x:t,y:e,...r}}),o}async addCompass(t,e,i=60){const n=`<?xml version="1.0" encoding="UTF-8"?>\n<svg width="${i}" height="${i}" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n \x3c!-- 圆形背景 --\x3e\n <circle cx="50" cy="50" r="40" fill="none" stroke="${this.colors.yellow}" stroke-width="3"/>\n\n \x3c!-- N方向箭头 --\x3e\n <polygon points="50,15 45,35 55,35" fill="${this.colors.yellow}"/>\n <text x="50" y="35" text-anchor="middle" fill="${this.colors.yellow}" font-size="14" font-weight="bold">N</text>\n\n \x3c!-- 方向刻度线 --\x3e\n <line x1="50" y1="15" x2="50" y2="10" stroke="${this.colors.yellow}" stroke-width="2"/>\n <line x1="85" y1="50" x2="90" y2="50" stroke="${this.colors.yellow}" stroke-width="2"/>\n <line x1="50" y1="85" x2="50" y2="90" stroke="${this.colors.yellow}" stroke-width="2"/>\n <line x1="15" y1="50" x2="10" y2="50" stroke="${this.colors.yellow}" stroke-width="2"/>\n\n \x3c!-- 次要方向 - 使用纯英文,避免编码问题 --\x3e\n <text x="73" y="27" fill="${this.colors.yellow}" font-size="10">NE</text>\n <text x="73" y="73" fill="${this.colors.yellow}" font-size="10">SE</text>\n <text x="27" y="73" fill="${this.colors.yellow}" font-size="10">SW</text>\n <text x="27" y="27" fill="${this.colors.yellow}" font-size="10">NW</text>\n</svg>`,r=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(n)))}`,o={left:t,top:e,width:i,height:i},s=await this.editor.addImageObject(r,o);return this.addedElements.push({id:s.id,type:"compass",properties:{x:t,y:e,size:i,...o}}),s}async createFullSpecialMap(t="专题图标题",e="附图"){return await this.setA4Landscape(),await this.addFigureLabel(e),await this.addTitle(t),await this.addTimestamp(),{canvasSize:this.editor.getCanvasSize(),message:"专题图框架已创建完成,请添加具体内容和标注"}}getAllElements(){return[...this.addedElements]}async clearAllElements(){this.addedElements=[]}}function Fs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ys,Hs,Ws,Us={exports:{}},Gs={exports:{}};function Xs(){return Ys?Gs.exports:(Ys=1,window,t=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){t.exports=function(t,e){var i,n,r,o,s=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;r<o;r+=1)for(n in i=arguments[r])s.call(i,n)&&(t[n]=i[n]);return t}},function(t,e,i){t.exports=function(t){return t instanceof Array}},function(t,e,i){var n=i(1),r=i(6),o=i(7);t.exports=function(t,e,i){n(t)?r(t,e,i):o(t,e,i)}},function(t,e,i){t.exports=function(t){return void 0===t}},function(t,e,i){var n=i(22),r=i(2),o=i(6),s=i(7),a=i(37),l=0,c={getLength:function(t){var e=0;return s(t,function(){e+=1}),e},map:function(t,e,i){var n=[];return r(t,function(){n.push(e.apply(i||null,arguments))}),n},filter:function(t,e,i){var n=[];return o(t,function(t){e.apply(i||null,arguments)&&n.push(t)}),n},generateId:function(){return l+=1},isOldBrowser:n.msie&&n.version<9,sendHostName:function(){a("color-picker","UA-129987462-1")}};t.exports=c},function(t,e,i){var n=i(1);t.exports=function(t,e,i){var r,o;if(i=i||0,!n(e))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t,i);for(o=e.length,r=i;i>=0&&r<o;r+=1)if(e[r]===t)return r;return-1}},function(t,e,i){t.exports=function(t,e,i){var n=0,r=t.length;for(i=i||null;n<r&&!1!==e.call(i,t[n],n,t);n+=1);}},function(t,e,i){t.exports=function(t,e,i){var n;for(n in i=i||null,t)if(t.hasOwnProperty(n)&&!1===e.call(i,t[n],n,t))break}},function(t,e,i){var n=i(39),r=i(13),o=i(41),s=i(3),a=i(9),l=i(19),c=i(4);function u(t,e){var i=c.generateId();s(e)&&(e=a.appendHTMLElement("div")),n(e,"tui-view-"+i),this.id=i,this.container=e,this.childs=new l(function(t){return t.id}),this.parent=null}u.prototype.addChild=function(t,e){e&&e.call(t,this),t.parent=this,this.childs.add(t)},u.prototype.removeChild=function(t,e){var i=o(t)?this.childs.items[t]:t;e&&e.call(i,this),this.childs.remove(i.id)},u.prototype.render=function(){this.childs.each(function(t){t.render()})},u.prototype.recursive=function(t,e){r(t)&&(e||t(this),this.childs.each(function(e){e.recursive(t)}))},u.prototype.resize=function(){for(var t=Array.prototype.slice.call(arguments),e=this.parent;e;)r(e._onResize)&&e._onResize.apply(e,t),e=e.parent},u.prototype._beforeDestroy=function(){},u.prototype._destroy=function(){this._beforeDestroy(),this.container.innerHTML="",this.id=this.parent=this.childs=this.container=null},u.prototype.destroy=function(t){this.childs&&(this.childs.each(function(t){t.destroy(!0),t._destroy()}),this.childs.clear()),t||this._destroy()},u.prototype.getViewBound=function(){var t=this.container.getBoundingClientRect();return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}},t.exports=u},function(t,e,i){var n={appendHTMLElement:function(t,e,i){var n=document.createElement(t);return n.className=i||"",e?e.appendChild(n):document.body.appendChild(n),n}};t.exports=n},function(t,e,i){var n=i(0),r=i(20),o=i(11),s=i(21),a=i(1),l=i(13),c=i(2),u=/\s+/g;function h(){this.events=null,this.contexts=null}h.mixin=function(t){n(t.prototype,h.prototype)},h.prototype._getHandlerItem=function(t,e){var i={handler:t};return e&&(i.context=e),i},h.prototype._safeEvent=function(t){var e,i=this.events;return i||(i=this.events={}),t&&((e=i[t])||(e=[],i[t]=e),i=e),i},h.prototype._safeContext=function(){var t=this.contexts;return t||(t=this.contexts=[]),t},h.prototype._indexOfContext=function(t){for(var e=this._safeContext(),i=0;e[i];){if(t===e[i][0])return i;i+=1}return-1},h.prototype._memorizeContext=function(t){var e,i;r(t)&&(e=this._safeContext(),(i=this._indexOfContext(t))>-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))>-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),c(t,function(t){n._bindEvent(t,e,i)})):s(t)&&(i=e,c(t,function(t,e){n.on(e,t,i)}))},h.prototype.once=function(t,e,i){var n=this;if(s(t))return i=e,void c(t,function(t,e){n.once(e,t,i)});this.on(t,function r(){e.apply(i,arguments),n.off(t,r,i)},i)},h.prototype._spliceMatches=function(t,e){var i,n=0;if(a(t))for(i=t.length;n<i;n+=1)!0===e(t[n])&&(t.splice(n,1),i-=1,n-=1)},h.prototype._matchHandler=function(t){var e=this;return function(i){var n=t===i.handler;return n&&e._forgetContext(i.context),n}},h.prototype._matchContext=function(t){var e=this;return function(i){var n=t===i.context;return n&&e._forgetContext(i.context),n}},h.prototype._matchHandlerAndContext=function(t,e){var i=this;return function(n){var r=t===n.handler,o=e===n.context,s=r&&o;return s&&i._forgetContext(n.context),s}},h.prototype._offByEventName=function(t,e){var i=this,n=l(e),r=i._matchHandler(e);t=t.split(u),c(t,function(t){var e=i._safeEvent(t);n?i._spliceMatches(e,r):(c(e,function(t){i._forgetContext(t.context)}),i.events[t]=[])})},h.prototype._offByHandler=function(t){var e=this,i=this._matchHandler(t);c(this._safeEvent(),function(t){e._spliceMatches(t,i)})},h.prototype._offByObject=function(t,e){var i,n=this;this._indexOfContext(t)<0?c(t,function(t,e){n.off(e,t)}):o(e)?(i=this._matchContext(t),n._spliceMatches(this._safeEvent(e),i)):l(e)?(i=this._matchHandlerAndContext(e,t),c(this._safeEvent(),function(t){n._spliceMatches(t,i)})):(i=this._matchContext(t),c(this._safeEvent(),function(t){n._spliceMatches(t,i)}))},h.prototype.off=function(t,e){o(t)?this._offByEventName(t,e):arguments.length?l(t)?this._offByHandler(t):s(t)&&this._offByObject(t,e):(this.events={},this.contexts=[])},h.prototype.fire=function(t){this.invoke.apply(this,arguments)},h.prototype.invoke=function(t){var e,i,n,r;if(!this.hasListener(t))return!0;for(e=this._safeEvent(t),i=Array.prototype.slice.call(arguments,1),n=0;e[n];){if(!1===(r=e[n]).handler.apply(r.context,i))return!1;n+=1}return!0},h.prototype.hasListener=function(t){return this.getListenerLength(t)>0},h.prototype.getListenerLength=function(t){return this._safeEvent(t).length},t.exports=h},function(t,e,i){t.exports=function(t){return"string"==typeof t||t instanceof String}},function(t,e,i){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(;n<e-1;n+=1)i+="0";return(i+t).slice(-1*e)},isValidRGB:function(t){return n.test(t)},
|
|
2
|
+
// @license RGB <-> HSV conversion utilities based off of http://www.cs.rit.edu/~ncs/color/t_convert.html
|
|
3
|
+
hexToRGB:function(t){return!!r.isValidRGB(t)&&(t=t.substring(1),[parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)])},rgbToHEX:function(t,e,i){var n="#"+r.leadingZero(t.toString(16),2)+r.leadingZero(e.toString(16),2)+r.leadingZero(i.toString(16),2);return!!r.isValidRGB(n)&&n},rgbToHSV:function(t,e,i){var n,r,o,s,a,l;if(t/=255,e/=255,i/=255,a=n=Math.max(t,e,i),l=n-(r=Math.min(t,e,i)),s=0===n?0:l/n,n===r)o=0;else{switch(n){case t:o=(e-i)/l+(e<i?6:0);break;case e:o=(i-t)/l+2;break;case i:o=(t-e)/l+4}o/=6}return[Math.round(360*o),Math.round(100*s),Math.round(100*a)]},hsvToRGB:function(t,e,i){var n,r,o,s,a,l,c,u;if(t=Math.max(0,Math.min(360,t)),e=Math.max(0,Math.min(100,e)),i=Math.max(0,Math.min(100,i)),i/=100,0==(e/=100))return n=r=o=i,[Math.round(255*n),Math.round(255*r),Math.round(255*o)];switch(l=i*(1-e),c=i*(1-e*(a=(t/=60)-(s=Math.floor(t)))),u=i*(1-e*(1-a)),s){case 0:n=i,r=u,o=l;break;case 1:n=c,r=i,o=l;break;case 2:n=l,r=i,o=u;break;case 3:n=l,r=c,o=i;break;case 4:n=u,r=l,o=i;break;default:n=i,r=l,o=c}return[Math.round(255*n),Math.round(255*r),Math.round(255*o)]}};t.exports=r},function(t,e,i){t.exports=function(t){return t instanceof Function}},function(t,e,i){var n=i(11),r=i(2),o=i(26);function s(t,e,i,n){function s(e){i.call(n||t,e||window.event)}"addEventListener"in t?t.addEventListener(e,s):"attachEvent"in t&&t.attachEvent("on"+e,s),function(t,e,i,n){var s=o(t,e),a=!1;r(s,function(t){return t.handler!==i||(a=!0,!1)}),a||s.push({handler:i,wrappedHandler:n})}(t,e,i,s)}t.exports=function(t,e,i,o){n(e)?r(e.split(/\s+/g),function(e){s(t,e,i,o)}):r(e,function(e,n){s(t,n,e,i)})}},function(t,e,i){t.exports=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}},function(t,e,i){t.exports=function(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}},function(t,e,i){var n=i(11),r=i(2),o=i(26);function s(t,e,i){var n,s=o(t,e);i?(r(s,function(r,o){return i!==r.handler||(a(t,e,r.wrappedHandler),n=o,!1)}),s.splice(n,1)):(r(s,function(i){a(t,e,i.wrappedHandler)}),s.splice(0,s.length))}function a(t,e,i){"removeEventListener"in t?t.removeEventListener(e,i):"detachEvent"in t&&t.detachEvent("on"+e,i)}t.exports=function(t,e,i){n(e)?r(e.split(/\s+/g),function(e){s(t,e,i)}):r(e,function(e,i){s(t,i,e)})}},function(t,e,i){var n=i(50);t.exports=function(t,e){var i=n(e.prototype);i.constructor=t,t.prototype=i}},function(t,e,i){var n=i(6),r=i(7),o=i(0),s=i(1),a=i(20),l=i(13),c=i(21),u=i(4),h=Array.prototype.slice;function f(t){this.items={},this.length=0,l(t)&&(this.getItemID=t)}f.and=function(t){var e;return t=h.call(arguments),e=t.length,function(i){for(var n=0;n<e;n+=1)if(!t[n].call(null,i))return!1;return!0}},f.or=function(t){var e;return t=h.call(arguments),e=t.length,function(i){for(var n=1,r=t[0].call(null,i);n<e;n+=1)r=r||t[n].call(null,i);return r}},f.merge=function(t){var e={},i=new f(t.getItemID);return n(arguments,function(t){o(e,t.items)}),i.items=e,i.length=u.getLength(i.items),i},f.prototype.getItemID=function(t){return t._id+""},f.prototype.add=function(t){var e,i;arguments.length>1?n(h.call(arguments),function(t){this.add(t)},this):(e=this.getItemID(t),(i=this.items)[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):(e=this.items,c(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=l(t),i=!1,e?this.each(function(e){return!0!==t(e)||(i=!0,!1)}):(t=c(t)?this.getItemID(t):t,i=a(this.items[t])),i)},f.prototype.doWhenHas=function(t,e,i){var n=this.items[t];a(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={},a=l(t),c=this.getItemID;if(s(t)){if(n(t,function(t){o[t+""]=new f(c)}),!e)return o;t=e,a=!0}return this.each(function(e){a?r=t(e):(r=e[t],l(r)&&(r=r.apply(e))),(i=o[r])||(i=o[r]=new f(c)),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)}),l(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){var n=i(3),r=i(36);t.exports=function(t){return!n(t)&&!r(t)}},function(t,e,i){t.exports=function(t){return t===Object(t)}},function(t,e,i){var n,r,o,s,a,l,c,u,h,f,d={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};"undefined"!=typeof window&&window.navigator&&(o=window.navigator,s=o.appName.replace(/\s/g,"_"),a=o.userAgent,l=/MSIE\s([0-9]+[.0-9]*)/,c=/Trident.*rv:11\./,u=/Edge\/(\d+)\./,h={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},(f={Microsoft_Internet_Explorer:function(){var t=a.match(l);t?(d.msie=!0,d.version=parseFloat(t[1])):d.others=!0},Netscape:function(){var t=!1;if(c.exec(a))d.msie=!0,d.version=11,t=!0;else if(u.exec(a))d.edge=!0,d.version=a.match(u)[1],t=!0;else for(n in h)if(h.hasOwnProperty(n)&&(r=a.match(h[n]))&&r.length>1){d[n]=t=!0,d.version=parseFloat(r[1]||0);break}t||(d.others=!0)}})[s]&&f[s]()),t.exports=d},function(t,e,i){var n=i(3);t.exports=function(t){return t&&t.className?n(t.className.baseVal)?t.className:t.className.baseVal:""}},function(t,e,i){(function(e){var n=i(10),r=i(42),o=i(44),s=i(47),a=i(28),l=i(17),c=i(14),u=i(15),h=i(0);function f(t,e){c(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(){l(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),c(window,"dragstart",u),c(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(o(i),l(window,"dragstart",u),l(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},f.prototype._getEventData=function(t){return{target:a(t),originEvent:t}},f.prototype._onMouseDown=function(t){0===s(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<e?this._distance+=1:this._dragStartFired||(this._dragStartFired=!0,this.invoke("dragStart",this._dragStartEventData))?this.fire("drag",this._getEventData(t)):this._toggleDragEvent(!1)},f.prototype._onMouseUp=function(t){if(this._toggleDragEvent(!1),this._isMoved)return this._isMoved=!1,void this.fire("dragEnd",this._getEventData(t));this.fire("click",this._getEventData(t))},n.mixin(f),t.exports=f}).call(this,i(25))},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(ea){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n="_feEventKey";t.exports=function(t,e){var i,r=t[n];return r||(r=t[n]={}),(i=r[e])||(i=r[e]=[]),i}},function(t,e,i){t.exports=function(t){var e,i,n=document.documentElement.style;for(e=0,i=t.length;e<i;e+=1)if(t[e]in n)return t[e];return!1}},function(t,e,i){t.exports=function(t){return t.target||t.srcElement}},function(t,e,i){var n=i(10),r=i(28),o=i(17),s=i(14),a=i(30),l=i(0),c=i(18),u=i(9),h=i(12),f=i(8),d=i(51);function g(t,e){this.options=l({cssPrefix:"tui-colorpicker-",preset:["#181818","#282828","#383838","#585858","#B8B8B8","#D8D8D8","#E8E8E8","#F8F8F8","#AB4642","#DC9656","#F7CA88","#A1B56C","#86C1B9","#7CAFC2","#BA8BAF","#A16946"],detailTxt:"Detail"},t),e=u.appendHTMLElement("div",e,this.options.cssPrefix+"palette-container"),f.call(this,t,e)}c(g,f),g.prototype._onClick=function(t){var e=this.options,i=r(t),n={};if(a(i,e.cssPrefix+"palette-button"))return n.color=i.value,void this.fire("_selectColor",n);a(i,e.cssPrefix+"palette-toggle-slider")&&this.fire("_toggleSlider")},g.prototype._onChange=function(t){var e=this.options,i=r(t),n={};a(i,e.cssPrefix+"palette-hex")&&(n.color=i.value,this.fire("_selectColor",n))},g.prototype._beforeDestroy=function(){this._toggleEvent(!1)},g.prototype._toggleEvent=function(t){var e,i=this.options,n=this.container,r=t?s:o;r(n,"click",this._onClick,this),(e=n.querySelector("."+i.cssPrefix+"palette-hex",n))&&r(e,"change",this._onChange,this)},g.prototype.render=function(t){var e,i=this.options;this._toggleEvent(!1),e=d({cssPrefix:i.cssPrefix,preset:i.preset,detailTxt:i.detailTxt,color:t,isValidRGB:h.isValidRGB,getItemClass:function(t){return t?"":" "+i.cssPrefix+"color-transparent"},isSelected:function(e){return e===t?" "+i.cssPrefix+"selected":""}}),this.container.innerHTML=e,this._toggleEvent(!0)},n.mixin(g),t.exports=g},function(t,e,i){var n=i(5),r=i(23);t.exports=function(t,e){var i;return t.classList?t.classList.contains(e):(i=r(t).split(/\s+/),n(e,i)>-1)}},function(t,e,i){var n=i(10),r=i(53),o=i(54),s=i(30),a=i(0),l=i(18),c=i(9),u=i(32),h=i(12),f=i(8),d=i(24),g=i(57),p=359.99;function v(t,e){(e=c.appendHTMLElement("div",e,t.cssPrefix+"slider-container")).style.display="none",f.call(this,t,e),this.options=a({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=[-7,112],this.huebarPosLimitRange=[-3,115],this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}l(v,f),v.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},v.prototype.toggle=function(t){this.container.style.display=t?"block":"none"},v.prototype.isVisible=function(){return"block"===this.container.style.display},v.prototype.render=function(t){var e,i,n=this.container,r=this.options,o=g.layout;h.isValidRGB(t)&&(o=(o=(o=(o=o.replace(/{{slider}}/,g.slider)).replace(/{{huebar}}/,g.huebar)).replace(/{{cssPrefix}}/g,r.cssPrefix)).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))},v.prototype._setColorSliderPosMax=function(){var t=this.sliderSvgElement.getClientRects()[0];t&&(this.colorSliderPosLimitRange[1]=t.height-10)},v.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())})},v.prototype.moveSaturationAndValue=function(t,e,i){var n,r,o,s;t=t||0,e=e||0,n=Math.abs(this.colorSliderPosLimitRange[0]),o=t*(r=this.colorSliderPosLimitRange[1])/100-n,s=r-e*r/100-n,this._moveColorSliderHandle(o,s,i)},v.prototype._moveColorSliderByPosition=function(t,e){var i=this.colorSliderPosLimitRange[0];this._moveColorSliderHandle(t+i,e+i)},v.prototype.getSaturationAndValue=function(){var t=Math.abs(this.colorSliderPosLimitRange[0]),e=t+this.colorSliderPosLimitRange[1],i=u.getTranslateXY(this.sliderHandleElement);return[(i[1]+t)/e*100,100-(i[0]+t)/e*100]},v.prototype._setHueBarPosMax=function(){var t=this.huebarSvgElement.getClientRects()[0];t&&(this.huebarPosLimitRange[1]=t.height-7)},v.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())})},v.prototype.moveHue=function(t,e){var i,n;i=((n=Math.abs(this.huebarPosLimitRange[0]))+this.huebarPosLimitRange[1])*(t=t||0)/p-n,this._moveHueHandle(i,e)},v.prototype._moveHueByPosition=function(t){var e=this.huebarPosLimitRange[0];this._moveHueHandle(t+e)},v.prototype.getHue=function(){var t,e,i=this.huebarHandleElement,n=u.getTranslateXY(i);return e=(t=Math.abs(this.huebarPosLimitRange[0]))+this.huebarPosLimitRange[1],(n[0]+t)*p/e},v.prototype.getHSV=function(){var t=this.getSaturationAndValue();return[this.getHue()].concat(t)},v.prototype.getRGB=function(){return h.hsvToRGB.apply(null,this.getHSV())},v.prototype._prepareColorSliderForMouseEvent=function(t){var e=this.options,i=o(t.target,"."+e.cssPrefix+"slider-part");return this._dragDataCache={isColorSlider:s(i,e.cssPrefix+"slider-left"),parentElement:i}},v.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},v.prototype._onDragStart=function(t){this._setColorSliderPosMax(),this._setHueBarPosMax(),this._prepareColorSliderForMouseEvent(t)},v.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])},v.prototype._onDragEnd=function(){this._dragDataCache=null},n.mixin(v),t.exports=v},function(t,e,i){var n=i(4).isOldBrowser,r=/[\.\-0-9]+/g,o={getTranslateXY:function(t){var e;return n?(e=t.style,[parseFloat(e.top),parseFloat(e.left)]):(e=t.getAttribute("transform"))?(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(-6,"+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=o},function(t,e,i){i(34),t.exports=i(35)},function(t,e,i){},function(t,e,i){var n={Collection:i(19),View:i(8),Drag:i(24),create:i(48),Palette:i(29),Slider:i(31),colorutil:i(12),svgvml:i(32)};t.exports=n},function(t,e,i){t.exports=function(t){return null===t}},function(t,e,i){var n=i(3),r=i(38);t.exports=function(t,e){var i=location.hostname,o="TOAST UI "+t+" for "+i+": Statistics",s=window.localStorage.getItem(o);(n(window.tui)||!1!==window.tui.usageStatistics)&&(s&&!function(t){return(new Date).getTime()-t>6048e5}(s)||(window.localStorage.setItem(o,(new Date).getTime()),setTimeout(function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r("https://www.google-analytics.com/collect",{v:1,t:"event",tid:e,cid:i,dp:i,dh:t,el:t,ec:"use"})},1e3)))}},function(t,e,i){var n=i(7);t.exports=function(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}},function(t,e,i){var n=i(2),r=i(5),o=i(23),s=i(40);t.exports=function(t){var e,i=Array.prototype.slice.call(arguments,1),a=t.classList,l=[];a?n(i,function(e){t.classList.add(e)}):((e=o(t))&&(i=[].concat(e.split(/\s+/),i)),n(i,function(t){r(t,l)<0&&l.push(t)}),s(t,l))}},function(t,e,i){var n=i(1),r=i(3);t.exports=function(t,e){e=(e=n(e)?e.join(" "):e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),r(t.className.baseVal)?t.className=e:t.className.baseVal=e}},function(t,e,i){t.exports=function(t){return"number"==typeof t||t instanceof Number}},function(t,e,i){var n=i(14),r=i(15),o=i(43),s=i(27),a="onselectstart"in document,l=s(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);t.exports=function(t){t||(t=document),a?n(t,"selectstart",r):(t=t===document?document.documentElement:t,o(t,"prevUserSelect",t.style[l]),t.style[l]="none")}},function(t,e,i){var n=i(16);t.exports=function(t,e,i){t.dataset?t.dataset[e]=i:t.setAttribute("data-"+n(e),i)}},function(t,e,i){var n=i(17),r=i(15),o=i(45),s=i(46),a=i(27),l="onselectstart"in document,c="prevUserSelect",u=a(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);t.exports=function(t){t||(t=document),l?n(t,"selectstart",r):((t=t===document?document.documentElement:t).style[u]=o(t,c)||"auto",s(t,c))}},function(t,e,i){var n=i(16);t.exports=function(t,e){return t.dataset?t.dataset[e]:t.getAttribute("data-"+n(e))}},function(t,e,i){var n=i(16);t.exports=function(t,e){t.dataset?delete t.dataset[e]:t.removeAttribute("data-"+n(e))}},function(t,e,i){var n=i(22),r=i(5),o=["0","1","3","5","7"],s=["2","6"],a=["4"];t.exports=function(t){return n.msie&&n.version<=8?function(t){var e=String(t.button);return r(e,o)>-1?0:r(e,s)>-1?2:r(e,a)>-1?1:null}(t):t.button}},function(t,e,i){var n=i(10),r=i(0),o=i(4),s=i(12),a=i(49),l=i(29),c=i(31),u=0;function h(t){var e;if(!(this instanceof h))return new h(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:u+=1,usageStatistics:!0},t)).container)throw new Error("ColorPicker(): need container option.");e=this.layout=new a(t,t.container),this.palette=new l(t,e.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new c(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()}h.prototype._onSelectColorInPalette=function(t){var e=t.color,i=this.options;s.isValidRGB(e)||""===e?(this.fire("selectColor",{color:e,origin:"palette"}),i.color!==e&&(i.color=e,this.render(e))):this.render()},h.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},h.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))},h.prototype.setColor=function(t){if(!s.isValidRGB(t))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=t,this.render(t)},h.prototype.getColor=function(){return this.options.color},h.prototype.toggle=function(t){this.layout.container.style.display=t?"block":"none"},h.prototype.render=function(t){this.layout.render(t||this.options.color)},h.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},n.mixin(h),t.exports=h},function(t,e,i){var n=i(0),r=i(18),o=i(9),s=i(8);function a(t,e){this.options=n({cssPrefix:"tui-colorpicker-"},t),e=o.appendHTMLElement("div",e,this.options.cssPrefix+"container"),s.call(this,t,e),this.render()}r(a,s),a.prototype.render=function(t){this.recursive(function(e){e.render(t)},!0)},t.exports=a},function(t,e,i){t.exports=function(t){function e(){}return e.prototype=t,new e}},function(t,e,i){var n=i(52);t.exports=function(t){var e=['<ul class="{{cssPrefix}}clearfix">',"{{each preset}}",['<li><input class="{{cssPrefix}}palette-button{{isSelected @this}}{{getItemClass @this}}" type="button"',"{{if isValidRGB @this}}",' style="background-color:{{@this}};color:{{@this}}"',"{{/if}}",' title="{{@this}}" value="{{@this}}" /></li>'].join(""),"{{/each}}","</ul>",'<div class="{{cssPrefix}}clearfix" style="overflow:hidden">','<input type="button" class="{{cssPrefix}}palette-toggle-slider" value="{{detailTxt}}" />','<input type="text" class="{{cssPrefix}}palette-hex" value="{{color}}" maxlength="7" />','<span class="{{cssPrefix}}palette-preview" style="background-color:{{color}};color:{{color}}">{{color}}</span>',"</div>"].join("\n");return n(e,t)}},function(t,e,i){var n=i(5),r=i(2),o=i(1),s=i(11),a=i(0),l=/{{\s?|\s?}}/g,c=/^[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={if:function(t,e,i){var n=function(t,e){var i=[t],n=[],o=0,s=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(s,r)),s=r+1)}),n.push(e.slice(s)),{exps:i,sourcesInsideIf:n}}(t,e),o=!1,s="";return r(n.exps,function(t,e){return(o=x(t,i))&&(s=_(n.sourcesInsideIf[e],i)),!o}),s},each:function(t,e,i){var n=x(t,i),s=o(n)?"@index":"@key",l={},c="";return r(n,function(t,n){l[s]=n,l["@this"]=t,a(i,l),c+=_(e.slice(),i)}),c},with:function(t,e,i){var r=n("as",t),o=t[r+1],s=x(t.slice(0,r),i),l={};return l[o]=s,_(e,a(i,l))||""}},m=3==="a".split(/a/).length?function(t,e){return t.split(e)}:function(t,e){var i,n,r=[],o=0;for(e.global||(e=new RegExp(e,"g")),i=e.exec(t);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 y(t,e){var i,n=e[t];return"true"===t?n=!0:"false"===t?n=!1:d.test(t)?n=t.replace(g,""):c.test(t)?n=y((i=t.split(u))[0],e)[y(i[1],e)]:h.test(t)?n=y((i=t.split(f))[0],e)[i[1]]:p.test(t)&&(n=parseFloat(t)),n}function b(t,e,i){for(var n,r,o,a,l=v[t],c=1,u=2,h=e[u];c&&s(h);)0===h.indexOf(t)?c+=1:0===h.indexOf("/"+t)&&(c-=1,n=u),h=e[u+=2];if(c)throw Error(t+" needs {{/"+t+"}} expression.");return e[0]=l(e[0].split(" ").slice(1),(r=0,o=n,(a=e.splice(r+1,o-r)).pop(),a),i),e}function x(t,e){var i=y(t[0],e);return i instanceof Function?function(t,e,i){var n=[];return r(e,function(t){n.push(y(t,i))}),t.apply(null,n)}(i,t.slice(1),e):i}function _(t,e){for(var i,n,r,o=1,a=t[o];s(a);)n=(i=a.split(" "))[0],v[n]?(r=b(n,t.splice(o,t.length-o),e),t=t.concat(r)):t[o]=x(i,e),a=t[o+=2];return t.join("")}t.exports=function(t,e){return _(m(t,l),e)}},function(t,e,i){var n=i(1);t.exports=function(t,e){var i,r=n(t),o=r?t[0]:t.clientX,s=r?t[1]:t.clientY;return e?[o-(i=e.getBoundingClientRect()).left-e.clientLeft,s-i.top-e.clientTop]:[o,s]}},function(t,e,i){var n=i(55);t.exports=function(t,e){var i=t.parentNode;if(n(t,e))return t;for(;i&&i!==document;){if(n(i,e))return i;i=i.parentNode}return null}},function(t,e,i){var n=i(5),r=i(56),o=Element.prototype,s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||function(t){var e=this.document||this.ownerDocument;return n(this,r(e.querySelectorAll(t)))>-1};t.exports=function(t,e){return s.call(t,e)}},function(t,e,i){var n=i(6);t.exports=function(t){var e;try{e=Array.prototype.slice.call(t)}catch(ea){e=[],n(t,function(t){e.push(t)})}return e}},function(t,e,i){(function(e){var n=i(4).isOldBrowser,r=['<div class="{{cssPrefix}}slider-left {{cssPrefix}}slider-part">{{slider}}</div>','<div class="{{cssPrefix}}slider-right {{cssPrefix}}slider-part">{{huebar}}</div>'].join("\n"),o=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-slider">',"<defs>",'<linearGradient id="{{cssPrefix}}svg-fill-color-{{id}}" x1="0%" y1="0%" x2="100%" y2="0%">','<stop offset="0%" stop-color="rgb(255,255,255)" />','<stop class="{{cssPrefix}}slider-basecolor" offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>",'<linearGradient id="{{cssPrefix}}svn-fill-black-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" style="stop-color:rgb(0,0,0);stop-opacity:0" />','<stop offset="100%" style="stop-color:rgb(0,0,0);stop-opacity:1" />',"</linearGradient>","</defs>",'<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svg-fill-color-{{id}})"></rect>','<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svn-fill-black-{{id}})"></rect>','<path transform="translate(0,0)" class="{{cssPrefix}}slider-handle" d="M0 7.5 L15 7.5 M7.5 15 L7.5 0 M2 7 a5.5 5.5 0 1 1 0 1 Z" stroke="black" stroke-width="0.75" fill="none" />',"</svg>"].join("\n"),s=['<div class="{{cssPrefix}}vml-slider">','<v:rect strokecolor="none" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill class="{{cssPrefix}}vml {{cssPrefix}}slider-basecolor" type="gradient" method="none" color="#ff0000" color2="#fff" angle="90" />',"</v:rect>",'<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill type="gradient" method="none" color="black" color2="white" o:opacity2="0%" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}slider-handle" coordsize="1 1" style="width:1px;height:1px;"path="m 0,7 l 14,7 m 7,14 l 7,0 ar 12,12 2,2 z" filled="false" stroked="true" />',"</div>"].join("\n"),a=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-huebar">',"<defs>",'<linearGradient id="g-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" stop-color="rgb(255,0,0)" />','<stop offset="16.666%" stop-color="rgb(255,255,0)" />','<stop offset="33.333%" stop-color="rgb(0,255,0)" />','<stop offset="50%" stop-color="rgb(0,255,255)" />','<stop offset="66.666%" stop-color="rgb(0,0,255)" />','<stop offset="83.333%" stop-color="rgb(255,0,255)" />','<stop offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>","</defs>",'<rect width="18px" height="100%" fill="url(#g-{{id}})"></rect>','<path transform="translate(-6,-3)" class="{{cssPrefix}}huebar-handle" d="M0 0 L4 4 L0 8 L0 0 Z" fill="black" stroke="none" />',"</svg>"].join("\n"),l=['<div class="{{cssPrefix}}vml-huebar">','<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-huebar-bg">','<v:fill type="gradient" method="none" colors="0% rgb(255,0,0), 16.666% rgb(255,255,0), 33.333% rgb(0,255,0), 50% rgb(0,255,255), 66.666% rgb(0,0,255), 83.333% rgb(255,0,255), 100% rgb(255,0,0)" angle="180" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}huebar-handle" coordsize="1 1" style="width:1px;height:1px;position:absolute;z-index:1;right:22px;top:-3px;"path="m 0,0 l 4,4 l 0,8 l 0,0 z" filled="true" fillcolor="black" stroked="false" />',"</div>"].join("\n");n&&e.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),t.exports={layout:r,slider:n?s:o,huebar:n?l:a}}).call(this,i(25))}])},Gs.exports=t());var t}const Zs=Fs(Hs?Us.exports:(Hs=1,self,Us.exports=(Ws=Xs(),function(){var t={2777:function(t,e,i){var n,r,o,s,a,l,c,u,h,f,d,g,p,v,m,y,b,x,_,C,I,M=M||{version:"4.6.0"};if(e.fabric=M,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?M.document=document:M.document=document.implementation.createHTMLDocument(""),M.window=window;else{var S=new(i(4960).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;M.document=S.document,M.jsdomImplForWrapper=i(6759).implForWrapper,M.nodeCanvas=i(6272).Canvas,M.window=S,DOMParser=M.window.DOMParser}function w(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 k(t,e){var i=e.targetCanvas.getContext("2d"),n=e.destinationWidth,r=e.destinationHeight,o=n*r*4,s=new Uint8Array(this.imageBuffer,0,o),a=new Uint8ClampedArray(this.imageBuffer,0,o);t.readPixels(0,0,n,r,t.RGBA,t.UNSIGNED_BYTE,s);var l=new ImageData(a,n,r);i.putImageData(l,0,0)}M.isTouchSupported="ontouchstart"in M.window||"ontouchstart"in M.document||M.window&&M.window.navigator&&M.window.navigator.maxTouchPoints>0,M.isLikelyNode="undefined"!=typeof Buffer&&"undefined"==typeof window,M.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"],M.DPI=96,M.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",M.commaWsp="(?:\\s+,?\\s*|,\\s*)",M.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,M.reNonWord=/[ \n\.,;!\?\-]/,M.fontPaths={},M.iMatrix=[1,0,0,1,0,0],M.svgNS="http://www.w3.org/2000/svg",M.perfLimitSizeTotal=2097152,M.maxCacheSideLimit=4096,M.minCacheSideLimit=256,M.charWidthsCache={},M.textureSize=2048,M.disableStyleCopyPaste=!1,M.enableGLFiltering=!0,M.devicePixelRatio=M.window.devicePixelRatio||M.window.webkitDevicePixelRatio||M.window.mozDevicePixelRatio||1,M.browserShadowBlurConstant=1,M.arcToSegmentsCache={},M.boundsOfCurveCache={},M.cachesBoundsOfCurve=!0,M.forceGLPutImageData=!1,M.initFilterBackend=function(){return M.enableGLFiltering&&M.isWebglSupported&&M.isWebglSupported(M.textureSize)?new M.WebglFilterBackend({tileSize:M.textureSize}):M.Canvas2dFilterBackend?new M.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=M),function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:M.util.array.fill(i,!1)}}function e(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);this.on(t,i)}M.Observable={fire:function(t,e){if(!this.__eventListeners)return this;var i=this.__eventListeners[t];if(!i)return this;for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,e||{});return this.__eventListeners[t]=i.filter(function(t){return!1!==t}),this},on:function(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},once:function(t,i){if(1===arguments.length)for(var n in t)e.call(this,n,t[n]);else e.call(this,t,i);return this},off:function(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}}}(),M.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var t=0,e=arguments.length;t<e;t++)this._onObjectAdded(arguments[t]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(t,e,i){var n=this._objects;return i?n[e]=t:n.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var t,e=this._objects,i=!1,n=0,r=arguments.length;n<r;n++)-1!==(t=e.indexOf(arguments[n]))&&(i=!0,e.splice(t,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(t,e){for(var i=this.getObjects(),n=0,r=i.length;n<r;n++)t.call(e,i[n],n,i);return this},getObjects:function(t){return void 0===t?this._objects.concat():this._objects.filter(function(e){return e.type===t})},item:function(t){return this._objects[t]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(t,e){return this._objects.indexOf(t)>-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},0)}},M.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof M.Gradient||this.set(e,new M.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof M.Pattern?i&&i():this.set(e,new M.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]}},n=e,r=Math.sqrt,o=Math.atan2,s=Math.pow,a=Math.PI/180,l=Math.PI/2,M.util={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/l){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=1;switch(t<0&&(e=-1),t/l){case 1:return e;case 2:return 0;case 3:return-e}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*a},radiansToDegrees:function(t){return t/a},rotatePoint:function(t,e,i){var n=new M.Point(t.x-e.x,t.y-e.y),r=M.util.rotateVector(n,i);return new M.Point(r.x,r.y).addEquals(e)},rotateVector:function(t,e){var i=M.util.sin(e),n=M.util.cos(e);return{x:t.x*n-t.y*i,y:t.x*i+t.y*n}},transformPoint:function(t,e,i){return i?new M.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new M.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;i<t.length;i++)t[i]=M.util.transformPoint(t[i],e);var n=[t[0].x,t[1].x,t[2].x,t[3].x],r=M.util.array.min(n),o=M.util.array.max(n)-r,s=[t[0].y,t[1].y,t[2].y,t[3].y],a=M.util.array.min(s);return{left:r,top:a,width:o,height:M.util.array.max(s)-a}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),i=[e*t[3],-e*t[1],-e*t[2],e*t[0]],n=M.util.transformPoint({x:t[4],y:t[5]},i,!0);return i[4]=-n.x,i[5]=-n.y,i},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var i=/\D{0,2}$/.exec(t),n=parseFloat(t);switch(e||(e=M.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return n*M.DPI/25.4;case"cm":return n*M.DPI/2.54;case"in":return n*M.DPI;case"pt":return n*M.DPI/72;case"pc":return n*M.DPI/72*12;case"em":return n*e;default:return n}},falseFunction:function(){return!1},getKlass:function(t,e){return t=M.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),M.util.resolveNamespace(e)[t]},getSvgAttributes:function(t){var e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":e=e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":e=e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":e=e.concat(["offset","stop-color","stop-opacity"])}return e},resolveNamespace:function(t){if(!t)return M;var e,i=t.split("."),r=i.length,o=n||M.window;for(e=0;e<r;++e)o=o[i[e]];return o},loadImage:function(t,e,i,n){if(t){var r=M.util.createImage(),o=function(){e&&e.call(i,r,!1),r=r.onload=r.onerror=null};r.onload=o,r.onerror=function(){M.log("Error loading "+r.src),e&&e.call(i,null,!0),r=r.onload=r.onerror=null},0!==t.indexOf("data")&&null!=n&&(r.crossOrigin=n),"data:image/svg"===t.substring(0,14)&&(r.onload=null,M.util.loadImageInDom(r,o)),r.src=t}else e&&e.call(i,t)},loadImageInDom:function(t,e){var i=M.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(t),M.document.querySelector("body").appendChild(i),t.onload=function(){e(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(t,e,i,n){var r=[],o=0,s=(t=t||[]).length;function a(){++o===s&&e&&e(r.filter(function(t){return t}))}s?t.forEach(function(t,e){t&&t.type?M.util.getKlass(t.type,i).fromObject(t,function(i,o){o||(r[e]=i),n&&n(t,i,o),a()}):a()}):e&&e(r)},enlivenPatterns:function(t,e){function i(){++r===o&&e&&e(n)}var n=[],r=0,o=(t=t||[]).length;o?t.forEach(function(t,e){t&&t.source?new M.Pattern(t,function(t){n[e]=t,i()}):(n[e]=t,i())}):e&&e(n)},groupSVGElements:function(t,e,i){var n;return t&&1===t.length?t[0]:(e&&(e.width&&e.height?e.centerPoint={x:e.width/2,y:e.height/2}:(delete e.width,delete e.height)),n=new M.Group(t,e),void 0!==i&&(n.sourcePath=i),n)},populateWithProperties:function(t,e,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in t&&(e[i[n]]=t[i[n]])},drawDashedLine:function(t,e,i,n,s,a){var l=n-e,c=s-i,u=r(l*l+c*c),h=o(c,l),f=a.length,d=0,g=!0;for(t.save(),t.translate(e,i),t.moveTo(0,0),t.rotate(h),e=0;u>e;)(e+=a[d++%f])>u&&(e=u),t[g?"lineTo":"moveTo"](e,0),g=!g;t.restore()},createCanvasElement:function(){return M.document.createElement("canvas")},copyCanvasElement:function(t){var e=M.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 M.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 e=o(t[1],t[0]),i=s(t[0],2)+s(t[1],2),n=r(i),l=(t[0]*t[3]-t[2]*t[1])/n,c=o(t[0]*t[2]+t[1]*t[3],i);return{angle:e/a,scaleX:n,scaleY:l,skewX:c/a,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return M.iMatrix.concat();var e=M.util.degreesToRadians(t.angle),i=M.util.cos(e),n=M.util.sin(e);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(t){var e=void 0===t.scaleX?1:t.scaleX,i=void 0===t.scaleY?1:t.scaleY,n=[t.flipX?-e:e,0,0,t.flipY?-i:i,0,0],r=M.util.multiplyTransformMatrices,o=M.util.degreesToRadians;return t.skewX&&(n=r(n,[1,0,Math.tan(o(t.skewX)),1],!0)),t.skewY&&(n=r(n,[1,Math.tan(o(t.skewY)),0,1],!0)),n},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],i=M.util.multiplyTransformMatrices;return t.angle&&(e=i(e,M.util.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=i(e,M.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=!0,s=t.getImageData(e,i,2*n||1,2*n||1),a=s.data.length;for(r=3;r<a&&0!=(o=s.data[r]<=0);r+=4);return s=null,o},parsePreserveAspectRatioAttribute:function(t){var e,i="meet",n=t.split(" ");return n&&n.length&&("meet"!==(i=n.pop())&&"slice"!==i?(e=i,i="meet"):n.length&&(e=n.pop())),{meetOrSlice:i,alignX:"none"!==e?e.slice(1,4):"none",alignY:"none"!==e?e.slice(5,8):"none"}},clearFabricFontCache:function(t){(t=(t||"").toLowerCase())?M.charWidthsCache[t]&&delete M.charWidthsCache[t]:M.charWidthsCache={}},limitDimsByArea:function(t,e){var i=Math.sqrt(e*t),n=Math.floor(e/i);return{x:Math.floor(i),y:n}},capValue:function(t,e,i){return Math.max(t,Math.min(e,i))},findScaleToFit:function(t,e){return Math.min(e.width/t.width,e.height/t.height)},findScaleToCover:function(t,e){return Math.max(e.width/t.width,e.height/t.height)},matrixToSVG:function(t){return"matrix("+t.map(function(t){return M.util.toFixed(t,M.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(t,e){var i=M.util.invertTransform(e),n=M.util.multiplyTransformMatrices(i,t.calcOwnMatrix());M.util.applyTransformToObject(t,n)},addTransformToObject:function(t,e){M.util.applyTransformToObject(t,M.util.multiplyTransformMatrices(e,t.calcOwnMatrix()))},applyTransformToObject:function(t,e){var i=M.util.qrDecompose(e),n=new M.Point(i.translateX,i.translateY);t.flipX=!1,t.flipY=!1,t.set("scaleX",i.scaleX),t.set("scaleY",i.scaleY),t.skewX=i.skewX,t.skewY=i.skewY,t.angle=i.angle,t.setPositionByOrigin(n,"center","center")},sizeAfterTransform:function(t,e,i){var n=t/2,r=e/2,o=[{x:-n,y:-r},{x:n,y:-r},{x:-n,y:r},{x:n,y:r}],s=M.util.calcDimensionsMatrix(i),a=M.util.makeBoundingBoxFromPoints(o,s);return{x:a.width,y:a.height}}},function(){var t=Array.prototype.join,e={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},i={m:"l",M:"L"};function n(t,e,i,n,r,o,s,a,l,c,u){var h=M.util.cos(t),f=M.util.sin(t),d=M.util.cos(e),g=M.util.sin(e),p=i*r*d-n*o*g+s,v=n*r*d+i*o*g+a;return["C",c+l*(-i*r*f-n*o*h),u+l*(-n*r*f+i*o*h),p+l*(i*r*g+n*o*d),v+l*(n*r*g-i*o*d),p,v]}function r(t,e,i,r,s,a,l){var c=Math.PI,u=l*c/180,h=M.util.sin(u),f=M.util.cos(u),d=0,g=0,p=-f*t*.5-h*e*.5,v=-f*e*.5+h*t*.5,m=(i=Math.abs(i))*i,y=(r=Math.abs(r))*r,b=v*v,x=p*p,_=m*y-m*b-y*x,C=0;if(_<0){var I=Math.sqrt(1-_/(m*y));i*=I,r*=I}else C=(s===a?-1:1)*Math.sqrt(_/(m*b+y*x));var S=C*i*v/r,w=-C*r*p/i,k=f*S-h*w+.5*t,T=h*S+f*w+.5*e,D=o(1,0,(p-S)/i,(v-w)/r),A=o((p-S)/i,(v-w)/r,(-p-S)/i,(-v-w)/r);0===a&&A>0?A-=2*c:1===a&&A<0&&(A+=2*c);for(var E=Math.ceil(Math.abs(A/c*2)),O=[],j=A/E,L=8/3*Math.sin(j/4)*Math.sin(j/4)/Math.sin(j/2),P=D+j,N=0;N<E;N++)O[N]=n(D,P,f,h,i,r,k,T,L,d,g),d=O[N][5],g=O[N][6],D=P,P+=j;return O}function o(t,e,i,n){var r=Math.atan2(e,t),o=Math.atan2(n,i);return o>=r?o-r:2*Math.PI-(r-o)}function s(e,i,n,r,o,s,a,l){var c;if(M.cachesBoundsOfCurve&&(c=t.call(arguments),M.boundsOfCurveCache[c]))return M.boundsOfCurveCache[c];var u,h,f,d,g,p,v,m,y=Math.sqrt,b=Math.min,x=Math.max,_=Math.abs,C=[],I=[[],[]];h=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*a,f=3*n-3*e;for(var S=0;S<2;++S)if(S>0&&(h=6*i-12*r+6*s,u=-3*i+9*r-9*s+3*l,f=3*r-3*i),_(u)<1e-12){if(_(h)<1e-12)continue;0<(d=-f/h)&&d<1&&C.push(d)}else(v=h*h-4*f*u)<0||(0<(g=(-h+(m=y(v)))/(2*u))&&g<1&&C.push(g),0<(p=(-h-m)/(2*u))&&p<1&&C.push(p));for(var w,k,T,D=C.length,A=D;D--;)w=(T=1-(d=C[D]))*T*T*e+3*T*T*d*n+3*T*d*d*o+d*d*d*a,I[0][D]=w,k=T*T*T*i+3*T*T*d*r+3*T*d*d*s+d*d*d*l,I[1][D]=k;I[0][A]=e,I[1][A]=i,I[0][A+1]=a,I[1][A+1]=l;var E=[{x:b.apply(null,I[0]),y:b.apply(null,I[1])},{x:x.apply(null,I[0]),y:x.apply(null,I[1])}];return M.cachesBoundsOfCurve&&(M.boundsOfCurveCache[c]=E),E}function a(t,e,i){for(var n=i[1],o=i[2],s=i[3],a=i[4],l=i[5],c=r(i[6]-t,i[7]-e,n,o,a,l,s),u=0,h=c.length;u<h;u++)c[u][1]+=t,c[u][2]+=e,c[u][3]+=t,c[u][4]+=e,c[u][5]+=t,c[u][6]+=e;return c}function l(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))}function c(t,e,i,n,r,o,s,a){return function(l){var c,u=(c=l)*c*c,h=function(t){return 3*t*t*(1-t)}(l),f=function(t){return 3*t*(1-t)*(1-t)}(l),d=function(t){return(1-t)*(1-t)*(1-t)}(l);return{x:s*u+r*h+i*f+t*d,y:a*u+o*h+n*f+e*d}}}function u(t,e,i,n,r,o,s,a){return function(l){var c=1-l,u=3*c*c*(i-t)+6*c*l*(r-i)+3*l*l*(s-r),h=3*c*c*(n-e)+6*c*l*(o-n)+3*l*l*(a-o);return Math.atan2(h,u)}}function h(t,e,i,n,r,o){return function(s){var a,l=(a=s)*a,c=function(t){return 2*t*(1-t)}(s),u=function(t){return(1-t)*(1-t)}(s);return{x:r*l+i*c+t*u,y:o*l+n*c+e*u}}}function f(t,e,i,n,r,o){return function(s){var a=1-s,l=2*a*(i-t)+2*s*(r-i),c=2*a*(n-e)+2*s*(o-n);return Math.atan2(c,l)}}function d(t,e,i){var n,r,o={x:e,y:i},s=0;for(r=1;r<=100;r+=1)n=t(r/100),s+=l(o.x,o.y,n.x,n.y),o=n;return s}function g(t,e){for(var i,n,r,o=0,s=0,a=t.iterator,c={x:t.x,y:t.y},u=.01,h=t.angleFinder;s<e&&o<=1&&u>1e-4;)i=a(o),r=o,(n=l(c.x,c.y,i.x,i.y))+s>e?o-=u/=2:(c=i,o+=u,s+=n);return i.angle=h(r),i}function p(t){for(var e,i,n,r,o=0,s=t.length,a=0,g=0,p=0,v=0,m=[],y=0;y<s;y++){switch(n={x:a,y:g,command:(e=t[y])[0]},e[0]){case"M":n.length=0,p=a=e[1],v=g=e[2];break;case"L":n.length=l(a,g,e[1],e[2]),a=e[1],g=e[2];break;case"C":i=c(a,g,e[1],e[2],e[3],e[4],e[5],e[6]),r=u(a,g,e[1],e[2],e[3],e[4],e[5],e[6]),n.iterator=i,n.angleFinder=r,n.length=d(i,a,g),a=e[5],g=e[6];break;case"Q":i=h(a,g,e[1],e[2],e[3],e[4]),r=f(a,g,e[1],e[2],e[3],e[4]),n.iterator=i,n.angleFinder=r,n.length=d(i,a,g),a=e[3],g=e[4];break;case"Z":case"z":n.destX=p,n.destY=v,n.length=l(a,g,p,v),a=p,g=v}o+=n.length,m.push(n)}return m.push({length:o,x:a,y:g}),m}M.util.joinPath=function(t){return t.map(function(t){return t.join(" ")}).join(" ")},M.util.parsePath=function(t){var n,r,o,s,a,l=[],c=[],u=M.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+h+")"+M.commaWsp,d="([01])"+M.commaWsp+"?",g=new RegExp(f+"?"+f+"?"+f+d+d+f+"?("+h+")","g");if(!t||!t.match)return l;for(var p,v=0,m=(a=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<m;v++){s=(n=a[v]).slice(1).trim(),c.length=0;var y=n.charAt(0);if(p=[y],"a"===y.toLowerCase())for(var b;b=g.exec(s);)for(var x=1;x<b.length;x++)c.push(b[x]);else for(;o=u.exec(s);)c.push(o[0]);x=0;for(var _=c.length;x<_;x++)r=parseFloat(c[x]),isNaN(r)||p.push(r);var C=e[y.toLowerCase()],I=i[y]||y;if(p.length-1>C)for(var S=1,w=p.length;S<w;S+=C)l.push([y].concat(p.slice(S,S+C))),y=I;else l.push(p)}return l},M.util.makePathSimpler=function(t){var e,i,n,r,o,s,l=0,c=0,u=t.length,h=0,f=0,d=[];for(i=0;i<u;++i){switch(n=!1,(e=t[i].slice(0))[0]){case"l":e[0]="L",e[1]+=l,e[2]+=c;case"L":l=e[1],c=e[2];break;case"h":e[1]+=l;case"H":e[0]="L",e[2]=c,l=e[1];break;case"v":e[1]+=c;case"V":e[0]="L",c=e[1],e[1]=l,e[2]=c;break;case"m":e[0]="M",e[1]+=l,e[2]+=c;case"M":l=e[1],c=e[2],h=e[1],f=e[2];break;case"c":e[0]="C",e[1]+=l,e[2]+=c,e[3]+=l,e[4]+=c,e[5]+=l,e[6]+=c;case"C":o=e[3],s=e[4],l=e[5],c=e[6];break;case"s":e[0]="S",e[1]+=l,e[2]+=c,e[3]+=l,e[4]+=c;case"S":"C"===r?(o=2*l-o,s=2*c-s):(o=l,s=c),l=e[3],c=e[4],e[0]="C",e[5]=e[3],e[6]=e[4],e[3]=e[1],e[4]=e[2],e[1]=o,e[2]=s,o=e[3],s=e[4];break;case"q":e[0]="Q",e[1]+=l,e[2]+=c,e[3]+=l,e[4]+=c;case"Q":o=e[1],s=e[2],l=e[3],c=e[4];break;case"t":e[0]="T",e[1]+=l,e[2]+=c;case"T":"Q"===r?(o=2*l-o,s=2*c-s):(o=l,s=c),e[0]="Q",l=e[1],c=e[2],e[1]=o,e[2]=s,e[3]=l,e[4]=c;break;case"a":e[0]="A",e[6]+=l,e[7]+=c;case"A":n=!0,d=d.concat(a(l,c,e)),l=e[6],c=e[7];break;case"z":case"Z":l=h,c=f}n||d.push(e),r=e[0]}return d},M.util.getSmoothPathFromPoints=function(t,e){var i,n=[],r=new M.Point(t[0].x,t[0].y),o=new M.Point(t[1].x,t[1].y),s=t.length,a=1,l=0,c=s>2;for(e=e||0,c&&(a=t[2].x<o.x?-1:t[2].x===o.x?0:1,l=t[2].y<o.y?-1:t[2].y===o.y?0:1),n.push(["M",r.x-a*e,r.y-l*e]),i=1;i<s;i++){if(!r.eq(o)){var u=r.midPointFrom(o);n.push(["Q",r.x,r.y,u.x,u.y])}r=t[i],i+1<t.length&&(o=t[i+1])}return c&&(a=r.x>t[i-2].x?1:r.x===t[i-2].x?0:-1,l=r.y>t[i-2].y?1:r.y===t[i-2].y?0:-1),n.push(["L",r.x+a*e,r.y+l*e]),n},M.util.getPathSegmentsInfo=p,M.util.getBoundsOfCurve=s,M.util.getPointOnPath=function(t,e,i){i||(i=p(t));for(var n=0;e-i[n].length>0&&n<i.length-2;)e-=i[n].length,n++;var r,o=i[n],s=e/o.length,a=o.command,l=t[n];switch(a){case"M":return{x:o.x,y:o.y,angle:0};case"Z":case"z":return(r=new M.Point(o.x,o.y).lerp(new M.Point(o.destX,o.destY),s)).angle=Math.atan2(o.destY-o.y,o.destX-o.x),r;case"L":return(r=new M.Point(o.x,o.y).lerp(new M.Point(l[1],l[2]),s)).angle=Math.atan2(l[2]-o.y,l[1]-o.x),r;case"C":case"Q":return g(o,e)}},M.util.transformPath=function(t,e,i){return i&&(e=M.util.multiplyTransformMatrices(e,[1,0,0,1,-i.x,-i.y])),t.map(function(t){for(var i=t.slice(0),n={},r=1;r<t.length-1;r+=2)n.x=t[r],n.y=t[r+1],n=M.util.transformPoint(n,e),i[r]=n.x,i[r+1]=n.y;return i})},M.util.fromArcToBeizers=a,M.util.getBoundsOfArc=function(t,e,i,n,o,a,l,c,u){for(var h,f=0,d=0,g=[],p=r(c-t,u-e,i,n,a,l,o),v=0,m=p.length;v<m;v++)h=s(f,d,p[v][1],p[v][2],p[v][3],p[v][4],p[v][5],p[v][6]),g.push({x:h[0].x+t,y:h[0].y+e}),g.push({x:h[1].x+t,y:h[1].y+e}),f=p[v][5],d=p[v][6];return g},M.util.drawArc=function(t,e,i,n){a(e,i,n=n.slice(0).unshift("X")).forEach(function(e){t.bezierCurveTo.apply(t,e.slice(1))})}}(),function(){var t=Array.prototype.slice;function e(t,e,i){if(t&&0!==t.length){var n=t.length-1,r=e?t[n][e]:t[n];if(e)for(;n--;)i(t[n][e],r)&&(r=t[n][e]);else for(;n--;)i(t[n],r)&&(r=t[n]);return r}}M.util.array={fill:function(t,e){for(var i=t.length;i--;)t[i]=e;return t},invoke:function(e,i){for(var n=t.call(arguments,2),r=[],o=0,s=e.length;o<s;o++)r[o]=n.length?e[o][i].apply(e[o],n):e[o][i].call(e[o]);return r},min:function(t,i){return e(t,i,function(t,e){return t<e})},max:function(t,i){return e(t,i,function(t,e){return t>=e})}}}(),function(){function t(e,i,n){if(n)if(!M.isLikelyNode&&i instanceof Element)e=i;else if(i instanceof Array){e=[];for(var r=0,o=i.length;r<o;r++)e[r]=t({},i[r],n)}else if(i&&"object"==typeof i)for(var s in i)"canvas"===s||"group"===s?e[s]=null:i.hasOwnProperty(s)&&(e[s]=t({},i[s],n));else e=i;else for(var s in i)e[s]=i[s];return e}M.util.object={extend:t,clone:function(e,i){return t({},e,i)}},M.util.object.extend(M.util,M.Observable)}(),function(){function t(t,e){var i=t.charCodeAt(e);if(isNaN(i))return"";if(i<55296||i>57343)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}M.util.string={camelize:function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},capitalize:function(t,e){return t.charAt(0).toUpperCase()+(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:function(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(e){var i,n=0,r=[];for(n=0;n<e.length;n++)!1!==(i=t(e,n))&&r.push(i);return r}}}(),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 r(){}function o(e){for(var i=null,n=this;n.constructor.superclass;){var r=n.constructor.superclass.prototype[e];if(n[e]!==r){i=r;break}n=n.constructor.superclass.prototype}if(i)return arguments.length>1?i.apply(this,t.call(arguments,1)):i.call(this)}M.util.createClass=function(){var i=null,s=t.call(arguments,0);function a(){this.initialize.apply(this,arguments)}"function"==typeof s[0]&&(i=s.shift()),a.superclass=i,a.subclasses=[],i&&(r.prototype=i.prototype,a.prototype=new r,i.subclasses.push(a));for(var l=0,c=s.length;l<c;l++)n(a,s[l],i);return a.prototype.initialize||(a.prototype.initialize=e),a.prototype.constructor=a,a.prototype.callSuper=o,a}}(),c=!!M.document.createElement("div").attachEvent,u=["touchstart","touchmove","touchend"],M.util.addListener=function(t,e,i,n){t&&t.addEventListener(e,i,!c&&n)},M.util.removeListener=function(t,e,i,n){t&&t.removeEventListener(e,i,!c&&n)},M.util.getPointer=function(t){var e=t.target,i=M.util.getScrollLeftTop(e),n=function(t){var e=t.changedTouches;return e&&e[0]?e[0]:t}(t);return{x:n.clientX+i.left,y:n.clientY+i.top}},M.util.isTouchEvent=function(t){return u.indexOf(t.type)>-1||"touch"===t.pointerType},h=M.document.createElement("div"),f="string"==typeof h.style.opacity,d="string"==typeof h.style.filter,g=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,p=function(t){return t},f?p=function(t,e){return t.style.opacity=e,t}:d&&(p=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),g.test(i.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",i.filter=i.filter.replace(g,e)):i.filter+=" alpha(opacity="+100*e+")",t}),M.util.setStyle=function(t,e){var i=t.style;if(!i)return t;if("string"==typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?p(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var n in e)"opacity"===n?p(t,e[n]):i["float"===n||"cssFloat"===n?void 0===i.styleFloat?"cssFloat":"styleFloat":n]=e[n];return t},function(){var t,e,i,n,r=Array.prototype.slice,o=function(t){return r.call(t,0)};try{t=o(M.document.childNodes)instanceof Array}catch(l){}function s(t,e){var i=M.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 a(t){for(var e=0,i=0,n=M.document.documentElement,r=M.document.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===M.document?(e=r.scrollLeft||n.scrollLeft||0,i=r.scrollTop||n.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:i}}t||(o=function(t){for(var e=new Array(t.length),i=t.length;i--;)e[i]=t[i];return e}),e=M.document.defaultView&&M.document.defaultView.getComputedStyle?function(t,e){var i=M.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},i=M.document.documentElement.style,n="userSelect"in i?"userSelect":"MozUserSelect"in i?"MozUserSelect":"WebkitUserSelect"in i?"WebkitUserSelect":"KhtmlUserSelect"in i?"KhtmlUserSelect":"",M.util.makeElementUnselectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=M.util.falseFunction),n?t.style[n]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},M.util.makeElementSelectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=null),n?t.style[n]="":"string"==typeof t.unselectable&&(t.unselectable=""),t},M.util.setImageSmoothing=function(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e},M.util.getById=function(t){return"string"==typeof t?M.document.getElementById(t):t},M.util.toArray=o,M.util.addClass=function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},M.util.makeElement=s,M.util.wrapElement=function(t,e,i){return"string"==typeof e&&(e=s(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},M.util.getScrollLeftTop=a,M.util.getElementOffset=function(t){var i,n,r=t&&t.ownerDocument,o={left:0,top:0},s={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return s;for(var c in l)s[l[c]]+=parseInt(e(t,c),10)||0;return i=r.documentElement,void 0!==t.getBoundingClientRect&&(o=t.getBoundingClientRect()),n=a(t),{left:o.left+n.left-(i.clientLeft||0)+s.left,top:o.top+n.top-(i.clientTop||0)+s.top}},M.util.getNodeCanvas=function(t){var e=M.jsdomImplForWrapper(t);return e._canvas||e._image},M.util.cleanUpJsdomNode=function(t){if(M.isLikelyNode){var e=M.jsdomImplForWrapper(t);e&&(e._image=null,e._canvas=null,e._currentSrc=null,e._attributes=null,e._classList=null)}}}(),function(){function t(){}M.util.request=function(e,i){i||(i={});var n=i.method?i.method.toUpperCase():"GET",r=i.onComplete||function(){},o=new M.window.XMLHttpRequest,s=i.body||i.parameters;return o.onreadystatechange=function(){4===o.readyState&&(r(o),o.onreadystatechange=t)},"GET"===n&&(s=null,"string"==typeof i.parameters&&(e=function(t,e){return t+(/\?/.test(t)?"&":"?")+e}(e,i.parameters))),o.open(n,e,!0),"POST"!==n&&"PUT"!==n||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(s),o}}(),M.log=console.log,M.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}var i=M.window.requestAnimationFrame||M.window.webkitRequestAnimationFrame||M.window.mozRequestAnimationFrame||M.window.oRequestAnimationFrame||M.window.msRequestAnimationFrame||function(t){return M.window.setTimeout(t,1e3/60)},n=M.window.cancelAnimationFrame||M.window.clearTimeout;function r(){return i.apply(M.window,arguments)}M.util.animate=function(i){var n=!1;return r(function(o){i||(i={});var s,a=o||+new Date,l=i.duration||500,c=a+l,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){var i=(s=e||+new Date)>c?l:s-a,o=i/l,m=d(i,g,v,l),y=Math.abs((m-g)/v);if(!n){if(!h(m,y,o))return s>c?(u(p,1,1),void f(p,1,1)):(u(m,y,o),void r(t));f(p,1,1)}}(a)}),function(){n=!0}},M.util.requestAnimFrame=r,M.util.cancelAnimFrame=function(){return n.apply(M.window,arguments)}}(),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+=")"}M.util.animateColor=function(e,i,n,r){var o=new M.Color(e).getSource(),s=new M.Color(i).getSource(),a=r.onComplete,l=r.onChange;return r=r||{},M.util.animate(M.util.object.extend(r,{duration:n||500,startValue:o,endValue:s,byValue:s,easing:function(e,i,n,o){return t(i,n,r.colorEasing?r.colorEasing(e,o):1-Math.cos(e/o*(Math.PI/2)))},onComplete:function(e,i,n){if(a)return a(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)}}}))}}(),function(){function t(t,e,i,n){return t<Math.abs(e)?(t=e,n=i/4):n=0===e&&0===t?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(e/t),{a:t,c:e,p:i,s:n}}function e(t,e,i){return t.a*Math.pow(2,10*(e-=1))*Math.sin((e*i-t.s)*(2*Math.PI)/t.p)}function i(t,e,i,r){return i-n(r-t,0,i,r)+e}function n(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e}M.util.ease={easeInQuad:function(t,e,i,n){return i*(t/=n)*t+e},easeOutQuad:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,n){return i*(t/=n)*t*t+e},easeOutCubic:function(t,e,i,n){return i*((t=t/n-1)*t*t+1)+e},easeInOutCubic:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,i,n){return i*(t/=n)*t*t*t+e},easeOutQuart:function(t,e,i,n){return-i*((t=t/n-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},easeOutQuint:function(t,e,i,n){return i*((t=t/n-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOutSine:function(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e},easeInOutSine:function(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e},easeInExpo:function(t,e,i,n){return 0===t?e:i*Math.pow(2,10*(t/n-1))+e},easeOutExpo:function(t,e,i,n){return t===n?e+i:i*(1-Math.pow(2,-10*t/n))+e},easeInOutExpo:function(t,e,i,n){return 0===t?e:t===n?e+i:(t/=n/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,i,n){return-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOutCirc:function(t,e,i,n){return i*Math.sqrt(1-(t=t/n-1)*t)+e},easeInOutCirc:function(t,e,i,n){return(t/=n/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(i,n,r,o){var s=0;return 0===i?n:1===(i/=o)?n+r:(s||(s=.3*o),-e(t(r,r,s,1.70158),i,o)+n)},easeOutElastic:function(e,i,n,r){var o=0;if(0===e)return i;if(1===(e/=r))return i+n;o||(o=.3*r);var s=t(n,n,o,1.70158);return s.a*Math.pow(2,-10*e)*Math.sin((e*r-s.s)*(2*Math.PI)/s.p)+s.c+i},easeInOutElastic:function(i,n,r,o){var s=0;if(0===i)return n;if(2==(i/=o/2))return n+r;s||(s=o*(.3*1.5));var a=t(r,r,s,1.70158);return i<1?-.5*e(a,i,o)+n:a.a*Math.pow(2,-10*(i-=1))*Math.sin((i*o-a.s)*(2*Math.PI)/a.p)*.5+a.c+n},easeInBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*(t/=n)*t*((r+1)*t-r)+e},easeOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*((t=t/n-1)*t*((r+1)*t+r)+1)+e},easeInOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),(t/=n/2)<1?i/2*(t*t*((1+(r*=1.525))*t-r))+e:i/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},easeInBounce:i,easeOutBounce:n,easeInOutBounce:function(t,e,r,o){return t<o/2?.5*i(2*t,0,r,o)+e:.5*n(2*t-o,0,r,o)+.5*r+e}}}(),function(t){var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.parseUnit,s=e.util.multiplyTransformMatrices,a={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},l={stroke:"strokeOpacity",fill:"fillOpacity"},c="font-size",u="clip-path";function h(t){return t in a?a[t]:t}function f(t,i,n,r){var a,l="[object Array]"===Object.prototype.toString.call(i);if("fill"!==t&&"stroke"!==t||"none"!==i){if("strokeUniform"===t)return"non-scaling-stroke"===i;if("strokeDashArray"===t)i="none"===i?null:i.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)i=n&&n.transformMatrix?s(n.transformMatrix,e.parseTransformAttribute(i)):e.parseTransformAttribute(i);else if("visible"===t)i="none"!==i&&"hidden"!==i,n&&!1===n.visible&&(i=!1);else if("opacity"===t)i=parseFloat(i),n&&void 0!==n.opacity&&(i*=n.opacity);else if("textAnchor"===t)i="start"===i?"left":"end"===i?"right":"center";else if("charSpacing"===t)a=o(i,r)/r*1e3;else if("paintFirst"===t){var c=i.indexOf("fill"),u=i.indexOf("stroke");i="fill",(c>-1&&u>-1&&u<c||-1===c&&u>-1)&&(i="stroke")}else{if("href"===t||"xlink:href"===t||"font"===t)return i;if("imageSmoothing"===t)return"optimizeQuality"===i;a=l?i.map(o):o(i,r)}}else i="";return!l&&isNaN(a)?i:a}function d(t){return new RegExp("^("+t.join("|")+")\\b","i")}function g(t,e){var i,n,r,o,s=[];for(r=0,o=e.length;r<o;r++)i=e[r],n=t.getElementsByTagName(i),s=s.concat(Array.prototype.slice.call(n));return s}function p(t,e){var i,n=!0;return(i=v(t,e.pop()))&&e.length&&(n=function(t,e){for(var i,n=!0;t.parentNode&&1===t.parentNode.nodeType&&e.length;)n&&(i=e.pop()),n=v(t=t.parentNode,i);return 0===e.length}(t,e)),i&&n&&0===e.length}function v(t,e){var i,n,r=t.nodeName,o=t.getAttribute("class"),s=t.getAttribute("id");if(i=new RegExp("^"+r,"i"),e=e.replace(i,""),s&&e.length&&(i=new RegExp("#"+s+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"")),o&&e.length)for(n=(o=o.split(" ")).length;n--;)i=new RegExp("\\."+o[n]+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"");return 0===e.length}function m(t,e){var i;if(t.getElementById&&(i=t.getElementById(e)),i)return i;var n,r,o,s=t.getElementsByTagName("*");for(r=0,o=s.length;r<o;r++)if(e===(n=s[r]).getAttribute("id"))return n}e.svgValidTagNamesRegEx=d(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),e.svgViewBoxElementsRegEx=d(["symbol","image","marker","pattern","view","svg"]),e.svgInvalidAncestorsRegEx=d(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),e.svgValidParentsRegEx=d(["symbol","g","a","svg","clipPath","defs"]),e.cssRules={},e.gradientDefs={},e.clipPaths={},e.parseTransformAttribute=function(){function t(t,i,n){t[n]=Math.tan(e.util.degreesToRadians(i[0]))}var i=e.iMatrix,n=e.reNum,r=e.commaWsp,o="(?:(?:(matrix)\\s*\\(\\s*("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")\\s*\\))|(?:(translate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))|(?:(scale)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))|(?:(rotate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+")"+r+"("+n+"))?\\s*\\))|(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))|(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\)))",s=new RegExp("^\\s*(?:(?:"+o+"(?:"+r+"*"+o+")*)?)\\s*$"),a=new RegExp(o,"g");return function(n){var r=i.concat(),l=[];if(!n||n&&!s.test(n))return r;n.replace(a,function(n){var s=new RegExp(o).exec(n).filter(function(t){return!!t}),a=s[1],c=s.slice(2).map(parseFloat);switch(a){case"translate":!function(t,e){t[4]=e[0],2===e.length&&(t[5]=e[1])}(r,c);break;case"rotate":c[0]=e.util.degreesToRadians(c[0]),function(t,i){var n=e.util.cos(i[0]),r=e.util.sin(i[0]),o=0,s=0;3===i.length&&(o=i[1],s=i[2]),t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=o-(n*o-r*s),t[5]=s-(r*o+n*s)}(r,c);break;case"scale":!function(t,e){var i=e[0],n=2===e.length?e[1]:e[0];t[0]=i,t[3]=n}(r,c);break;case"skewX":t(r,c,2);break;case"skewY":t(r,c,1);break;case"matrix":r=c}l.push(r.concat()),r=i.concat()});for(var c=l[0];l.length>1;)l.shift(),c=e.util.multiplyTransformMatrices(c,l[0]);return c}}();var y=new RegExp("^\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*$");function b(t){if(!e.svgViewBoxElementsRegEx.test(t.nodeName))return{};var i,n,r,s,a,l,c=t.getAttribute("viewBox"),u=1,h=1,f=t.getAttribute("width"),d=t.getAttribute("height"),g=t.getAttribute("x")||0,p=t.getAttribute("y")||0,v=t.getAttribute("preserveAspectRatio")||"",m=!c||!(c=c.match(y)),b=!f||!d||"100%"===f||"100%"===d,x=m&&b,_={},C="",I=0,M=0;if(_.width=0,_.height=0,_.toBeParsed=x,m&&(g||p)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(C=" translate("+o(g)+" "+o(p)+") ",a=(t.getAttribute("transform")||"")+C,t.setAttribute("transform",a),t.removeAttribute("x"),t.removeAttribute("y")),x)return _;if(m)return _.width=o(f),_.height=o(d),_;if(i=-parseFloat(c[1]),n=-parseFloat(c[2]),r=parseFloat(c[3]),s=parseFloat(c[4]),_.minX=i,_.minY=n,_.viewBoxWidth=r,_.viewBoxHeight=s,b?(_.width=r,_.height=s):(_.width=o(f),_.height=o(d),u=_.width/r,h=_.height/s),"none"!==(v=e.util.parsePreserveAspectRatioAttribute(v)).alignX&&("meet"===v.meetOrSlice&&(h=u=u>h?h:u),"slice"===v.meetOrSlice&&(h=u=u>h?u:h),I=_.width-r*u,M=_.height-s*u,"Mid"===v.alignX&&(I/=2),"Mid"===v.alignY&&(M/=2),"Min"===v.alignX&&(I=0),"Min"===v.alignY&&(M=0)),1===u&&1===h&&0===i&&0===n&&0===g&&0===p)return _;if((g||p)&&"#document"!==t.parentNode.nodeName&&(C=" translate("+o(g)+" "+o(p)+") "),a=C+" matrix("+u+" 0 0 "+h+" "+(i*u+I)+" "+(n*h+M)+") ","svg"===t.nodeName){for(l=t.ownerDocument.createElementNS(e.svgNS,"g");t.firstChild;)l.appendChild(t.firstChild);t.appendChild(l)}else(l=t).removeAttribute("x"),l.removeAttribute("y"),a=l.getAttribute("transform")+a;return l.setAttribute("transform",a),_}function x(t,e){var i="xlink:href",n=m(t,e.getAttribute(i).substr(1));if(n&&n.getAttribute(i)&&x(t,n),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach(function(t){n&&!e.hasAttribute(t)&&n.hasAttribute(t)&&e.setAttribute(t,n.getAttribute(t))}),!e.children.length)for(var r=n.cloneNode(!0);r.firstChild;)e.appendChild(r.firstChild);e.removeAttribute(i)}e.parseSVGDocument=function(t,i,r,o){if(t){!function(t){for(var i=g(t,["use","svg:use"]),n=0;i.length&&n<i.length;){var r=i[n],o=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===o)return;var s,a,l,c,u=o.substr(1),h=r.getAttribute("x")||0,f=r.getAttribute("y")||0,d=m(t,u).cloneNode(!0),p=(d.getAttribute("transform")||"")+" translate("+h+", "+f+")",v=i.length,y=e.svgNS;if(b(d),/^svg$/i.test(d.nodeName)){var x=d.ownerDocument.createElementNS(y,"g");for(a=0,c=(l=d.attributes).length;a<c;a++)s=l.item(a),x.setAttributeNS(y,s.nodeName,s.nodeValue);for(;d.firstChild;)x.appendChild(d.firstChild);d=x}for(a=0,c=(l=r.attributes).length;a<c;a++)"x"!==(s=l.item(a)).nodeName&&"y"!==s.nodeName&&"xlink:href"!==s.nodeName&&"href"!==s.nodeName&&("transform"===s.nodeName?p=s.nodeValue+" "+p:d.setAttribute(s.nodeName,s.nodeValue));d.setAttribute("transform",p),d.setAttribute("instantiated_by_use","1"),d.removeAttribute("id"),r.parentNode.replaceChild(d,r),i.length===v&&n++}}(t);var s,a,l=e.Object.__uid++,c=b(t),u=e.util.toArray(t.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===u.length&&e.isLikelyNode){var h=[];for(s=0,a=(u=t.selectNodes('//*[name(.)!="svg"]')).length;s<a;s++)h[s]=u[s];u=h}var f=u.filter(function(t){return b(t),e.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))&&!function(t,e){for(;t&&(t=t.parentNode);)if(t.nodeName&&e.test(t.nodeName.replace("svg:",""))&&!t.getAttribute("instantiated_by_use"))return!0;return!1}(t,e.svgInvalidAncestorsRegEx)});if(!f||f&&!f.length)i&&i([],{});else{var d={};u.filter(function(t){return"clipPath"===t.nodeName.replace("svg:","")}).forEach(function(t){var i=t.getAttribute("id");d[i]=e.util.toArray(t.getElementsByTagName("*")).filter(function(t){return e.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))})}),e.gradientDefs[l]=e.getGradientDefs(t),e.cssRules[l]=e.getCSSRules(t),e.clipPaths[l]=d,e.parseElements(f,function(t,n){i&&(i(t,c,n,u),delete e.gradientDefs[l],delete e.cssRules[l],delete e.clipPaths[l])},n(c),r,o)}}};var _=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+e.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+e.reNum+"))?\\s+(.*)");i(e,{parseFontDeclaration:function(t,e){var i=t.match(_);if(i){var n=i[1],r=i[3],s=i[4],a=i[5],l=i[6];n&&(e.fontStyle=n),r&&(e.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),s&&(e.fontSize=o(s)),l&&(e.fontFamily=l),a&&(e.lineHeight="normal"===a?1:a)}},getGradientDefs:function(t){var e,i=g(t,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,r={};for(n=i.length;n--;)(e=i[n]).getAttribute("xlink:href")&&x(t,e),r[e.getAttribute("id")]=e;return r},parseAttributes:function(t,n,s){if(t){var a,d,g,v={};void 0===s&&(s=t.getAttribute("svgUid")),t.parentNode&&e.svgValidParentsRegEx.test(t.parentNode.nodeName)&&(v=e.parseAttributes(t.parentNode,n,s));var m=n.reduce(function(e,i){return(a=t.getAttribute(i))&&(e[i]=a),e},{}),y=i(function(t,i){var n={};for(var r in e.cssRules[i])if(p(t,r.split(" ")))for(var o in e.cssRules[i][r])n[o]=e.cssRules[i][r][o];return n}(t,s),e.parseStyleAttribute(t));m=i(m,y),y[u]&&t.setAttribute(u,y[u]),d=g=v.fontSize||e.Text.DEFAULT_SVG_FONT_SIZE,m[c]&&(m[c]=d=o(m[c],g));var b,x,_={};for(var C in m)x=f(b=h(C),m[C],v,d),_[b]=x;_&&_.font&&e.parseFontDeclaration(_.font,_);var I=i(v,_);return e.svgValidParentsRegEx.test(t.nodeName)?I:function(t){for(var i in l)if(void 0!==t[l[i]]&&""!==t[i]){if(void 0===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[l[i]],2)).toRgba()}}return t}(I)}},parseElements:function(t,i,n,r,o){new e.ElementsParser(t,i,n,r,o).parse()},parseStyleAttribute:function(t){var e={},i=t.getAttribute("style");return i?("string"==typeof i?function(t,e){var i,n;t.replace(/;\s*$/,"").split(";").forEach(function(t){var r=t.split(":");i=r[0].trim().toLowerCase(),n=r[1].trim(),e[i]=n})}(i,e):function(t,e){var i,n;for(var r in t)void 0!==t[r]&&(i=r.toLowerCase(),n=t[r],e[i]=n)}(i,e),e):e},parsePointsAttribute:function(t){if(!t)return null;var e,i,n=[];for(e=0,i=(t=(t=t.replace(/,/g," ").trim()).split(/\s+/)).length;e<i;e+=2)n.push({x:parseFloat(t[e]),y:parseFloat(t[e+1])});return n},getCSSRules:function(t){var i,n,r=t.getElementsByTagName("style"),o={};for(i=0,n=r.length;i<n;i++){var s=r[i].textContent;""!==(s=s.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&s.match(/[^{]*\{[\s\S]*?\}/g).map(function(t){return t.trim()}).forEach(function(t){var r=t.match(/([\s\S]*?)\s*\{([^}]*)\}/),s={},a=r[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(i=0,n=a.length;i<n;i++){var l=a[i].split(/\s*:\s*/),c=l[0],u=l[1];s[c]=u}(t=r[1]).split(",").forEach(function(t){""!==(t=t.replace(/^svg/i,"").trim())&&(o[t]?e.util.object.extend(o[t],s):o[t]=e.util.object.clone(s))})})}return o},loadSVGFromURL:function(t,i,n,r){t=t.replace(/^\n\s*/,"").trim(),new e.util.request(t,{method:"get",onComplete:function(t){var o=t.responseXML;if(!o||!o.documentElement)return i&&i(null),!1;e.parseSVGDocument(o.documentElement,function(t,e,n,r){i&&i(t,e,n,r)},n,r)}})},loadSVGFromString:function(t,i,n,r){var o=(new e.window.DOMParser).parseFromString(t.trim(),"text/xml");e.parseSVGDocument(o.documentElement,function(t,e,n,r){i(t,e,n,r)},n,r)}})}(e),M.ElementsParser=function(t,e,i,n,r,o){this.elements=t,this.callback=e,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},(v=M.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},v.createObjects=function(){var t=this;this.elements.forEach(function(e,i){e.setAttribute("svgUid",t.svgUid),t.createObject(e,i)})},v.findTag=function(t){return M[M.util.string.capitalize(t.tagName.replace("svg:",""))]},v.createObject=function(t,e){var i=this.findTag(t);if(i&&i.fromElement)try{i.fromElement(t,this.createCallback(e,t),this.options)}catch(n){M.log(n)}else this.checkIfDone()},v.createCallback=function(t,e){var i=this;return function(n){var r;i.resolveGradient(n,e,"fill"),i.resolveGradient(n,e,"stroke"),n instanceof M.Image&&n._originalElement&&(r=n.parsePreserveAspectRatioAttribute(e)),n._removeTransformMatrix(r),i.resolveClipPath(n,e),i.reviver&&i.reviver(e,n),i.instances[t]=n,i.checkIfDone()}},v.extractPropertyDefinition=function(t,e,i){var n=t[e],r=this.regexUrl;if(r.test(n)){r.lastIndex=0;var o=r.exec(n)[1];return r.lastIndex=0,M[i][this.svgUid][o]}},v.resolveGradient=function(t,e,i){var n=this.extractPropertyDefinition(t,i,"gradientDefs");if(n){var r=e.getAttribute(i+"-opacity"),o=M.Gradient.fromElement(n,t,r,this.options);t.set(i,o)}},v.createClipPathCallback=function(t,e){return function(t){t._removeTransformMatrix(),t.fillRule=t.clipRule,e.push(t)}},v.resolveClipPath=function(t,e){var i,n,r,o,s=this.extractPropertyDefinition(t,"clipPath","clipPaths");if(s){r=[],n=M.util.invertTransform(t.calcTransformMatrix());for(var a=s[0].parentNode,l=e;l.parentNode&&l.getAttribute("clip-path")!==t.clipPath;)l=l.parentNode;l.parentNode.appendChild(a);for(var c=0;c<s.length;c++)i=s[c],this.findTag(i).fromElement(i,this.createClipPathCallback(t,r),this.options);s=1===r.length?r[0]:new M.Group(r),o=M.util.multiplyTransformMatrices(n,s.calcTransformMatrix()),s.clipPath&&this.resolveClipPath(s,l);var u=M.util.qrDecompose(o);s.flipX=!1,s.flipY=!1,s.set("scaleX",u.scaleX),s.set("scaleY",u.scaleY),s.angle=u.angle,s.skewX=u.skewX,s.skewY=0,s.setPositionByOrigin({x:u.translateX,y:u.translateY},"center","center"),t.clipPath=s}else delete t.clipPath},v.checkIfDone=function(){0===--this.numElements&&(this.instances=this.instances.filter(function(t){return null!=t}),this.callback(this.instances,this.elements))},function(t){var e=t.fabric||(t.fabric={});function i(t,e){this.x=t,this.y=e}e.Point?e.warn("fabric.Point is already defined"):(e.Point=i,i.prototype={type:"point",constructor:i,add:function(t){return new i(this.x+t.x,this.y+t.y)},addEquals:function(t){return this.x+=t.x,this.y+=t.y,this},scalarAdd:function(t){return new i(this.x+t,this.y+t)},scalarAddEquals:function(t){return this.x+=t,this.y+=t,this},subtract:function(t){return new i(this.x-t.x,this.y-t.y)},subtractEquals:function(t){return this.x-=t.x,this.y-=t.y,this},scalarSubtract:function(t){return new i(this.x-t,this.y-t)},scalarSubtractEquals:function(t){return this.x-=t,this.y-=t,this},multiply:function(t){return new i(this.x*t,this.y*t)},multiplyEquals:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return new i(this.x/t,this.y/t)},divideEquals:function(t){return this.x/=t,this.y/=t,this},eq:function(t){return this.x===t.x&&this.y===t.y},lt:function(t){return this.x<t.x&&this.y<t.y},lte:function(t){return this.x<=t.x&&this.y<=t.y},gt:function(t){return this.x>t.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return void 0===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)}})}(e),function(t){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 s,a=(o.x-r.x)*(t.y-r.y)-(o.y-r.y)*(t.x-r.x),l=(n.x-t.x)*(t.y-r.y)-(n.y-t.y)*(t.x-r.x),c=(o.y-r.y)*(n.x-t.x)-(o.x-r.x)*(n.y-t.y);if(0!==c){var u=a/c,h=l/c;0<=u&&u<=1&&0<=h&&h<=1?(s=new i("Intersection")).appendPoint(new e.Point(t.x+u*(n.x-t.x),t.y+u*(n.y-t.y))):s=new i}else s=new i(0===a||0===l?"Coincident":"Parallel");return s},e.Intersection.intersectLinePolygon=function(t,e,n){var r,o,s,a,l=new i,c=n.length;for(a=0;a<c;a++)r=n[a],o=n[(a+1)%c],s=i.intersectLineLine(t,e,r,o),l.appendPoints(s.points);return l.points.length>0&&(l.status="Intersection"),l},e.Intersection.intersectPolygonPolygon=function(t,e){var n,r=new i,o=t.length;for(n=0;n<o;n++){var s=t[n],a=t[(n+1)%o],l=i.intersectLinePolygon(s,a,e);r.appendPoints(l.points)}return r.points.length>0&&(r.status="Intersection"),r},e.Intersection.intersectPolygonRectangle=function(t,n,r){var o=n.min(r),s=n.max(r),a=new e.Point(s.x,o.y),l=new e.Point(o.x,s.y),c=i.intersectLinePolygon(o,a,t),u=i.intersectLinePolygon(a,s,t),h=i.intersectLinePolygon(s,l,t),f=i.intersectLinePolygon(l,o,t),d=new i;return d.appendPoints(c.points),d.appendPoints(u.points),d.appendPoints(h.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d})}(e),function(t){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,s,a=e.util.array.max([t,i,n]),l=e.util.array.min([t,i,n]);if(s=(a+l)/2,a===l)r=o=0;else{var c=a-l;switch(o=s>.5?c/(2-a-l):c/(a+l),a){case t:r=(i-n)/c+(i<n?6:0);break;case i:r=(n-t)/c+2;break;case n:r=(t-i)/c+4}r/=6}return[Math.round(360*r),Math.round(100*o),Math.round(100*s)]},getSource:function(){return this._source},setSource:function(t){this._source=t},toRgb:function(){var t=this.getSource();return"rgb("+t[0]+","+t[1]+","+t[2]+")"},toRgba:function(){var t=this.getSource();return"rgba("+t[0]+","+t[1]+","+t[2]+","+t[3]+")"},toHsl:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsl("+e[0]+","+e[1]+"%,"+e[2]+"%)"},toHsla:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsla("+e[0]+","+e[1]+"%,"+e[2]+"%,"+t[3]+")"},toHex:function(){var t,e,i,n=this.getSource();return t=1===(t=n[0].toString(16)).length?"0"+t:t,e=1===(e=n[1].toString(16)).length?"0"+e:e,i=1===(i=n[2].toString(16)).length?"0"+i:i,t.toUpperCase()+e.toUpperCase()+i.toUpperCase()},toHexa:function(){var t,e=this.getSource();return t=1===(t=(t=Math.round(255*e[3])).toString(16)).length?"0"+t:t,this.toHex()+t.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(t){var e=this.getSource();return e[3]=t,this.setSource(e),this},toGrayscale:function(){var t=this.getSource(),e=parseInt((.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),10),i=t[3];return this.setSource([e,e,e,i]),this},toBlackWhite:function(t){var e=this.getSource(),i=(.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),n=e[3];return t=t||127,i=Number(i)<Number(t)?0:255,this.setSource([i,i,i,n]),this},overlayWith:function(t){t instanceof i||(t=new i(t));var e,n=[],r=this.getAlpha(),o=this.getSource(),s=t.getSource();for(e=0;e<3;e++)n.push(Math.round(.5*o[e]+.5*s[e]));return n[3]=r,this.setSource(n),this}},e.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,e.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,e.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,e.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},e.Color.fromRgb=function(t){return i.fromSource(i.sourceFromRgb(t))},e.Color.sourceFromRgb=function(t){var e=t.match(i.reRGBa);if(e){var n=parseInt(e[1],10)/(/%$/.test(e[1])?100:1)*(/%$/.test(e[1])?255:1),r=parseInt(e[2],10)/(/%$/.test(e[2])?100:1)*(/%$/.test(e[2])?255:1),o=parseInt(e[3],10)/(/%$/.test(e[3])?100:1)*(/%$/.test(e[3])?255:1);return[parseInt(n,10),parseInt(r,10),parseInt(o,10),e[4]?parseFloat(e[4]):1]}},e.Color.fromRgba=i.fromRgb,e.Color.fromHsl=function(t){return i.fromSource(i.sourceFromHsl(t))},e.Color.sourceFromHsl=function(t){var e=t.match(i.reHSLa);if(e){var r,o,s,a=(parseFloat(e[1])%360+360)%360/360,l=parseFloat(e[2])/(/%$/.test(e[2])?100:1),c=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(0===l)r=o=s=c;else{var u=c<=.5?c*(l+1):c+l-c*l,h=2*c-u;r=n(h,u,a+1/3),o=n(h,u,a),s=n(h,u,a-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*s),e[4]?parseFloat(e[4]):1]}},e.Color.fromHsla=i.fromHsl,e.Color.fromHex=function(t){return i.fromSource(i.sourceFromHex(t))},e.Color.sourceFromHex=function(t){if(t.match(i.reHex)){var e=t.slice(t.indexOf("#")+1),n=3===e.length||4===e.length,r=8===e.length||4===e.length,o=n?e.charAt(0)+e.charAt(0):e.substring(0,2),s=n?e.charAt(1)+e.charAt(1):e.substring(2,4),a=n?e.charAt(2)+e.charAt(2):e.substring(4,6),l=r?n?e.charAt(3)+e.charAt(3):e.substring(6,8):"FF";return[parseInt(o,16),parseInt(s,16),parseInt(a,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},e.Color.fromSource=function(t){var e=new i;return e.setSource(t),e})}(e),function(t){var e=t.fabric||(t.fabric={}),i=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],r={},o="left",s="top",a="right",l="bottom",c="center",u={top:l,bottom:s,left:a,right:o,center:c},h=e.util.radiansToDegrees,f=Math.sign||function(t){return(t>0)-(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=t[i.uniScaleKey];return i.uniformScaling&&!n||!i.uniformScaling&&n}function v(t){return t.originX===c&&t.originY===c}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,i,n){return{e:t,transform:e,pointer:{x:i,y:n}}}function b(t){return function(e,i,n,r){var o=i.target,s=o.getCenterPoint(),a=o.translateToOriginPoint(s,i.originX,i.originY),l=t(e,i,n,r);return o.setPositionByOrigin(a,i.originX,i.originY),l}}function x(t,e){return function(i,n,r,o){var s=e(i,n,r,o);return s&&g(t,y(i,n,r,o)),s}}function _(t,i,n,r,o){var s=t.target,a=s.controls[t.corner],l=s.canvas.getZoom(),c=s.padding/l,u=s.toLocalPoint(new e.Point(r,o),i,n);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=a.offsetX,u.y-=a.offsetY,u}function C(t){return t.flipX!==t.flipY}function I(t,e,i,n,r){if(0!==t[e]){var o=r/t._getTransformedDimensions()[n]*t[i];t.set(i,o)}}function M(t,e,i,n){var r,c=e.target,u=c._getTransformedDimensions(0,c.skewY),f=_(e,e.originX,e.originY,i,n),d=Math.abs(2*f.x)-u.x,g=c.skewX;d<2?r=0:(r=h(Math.atan2(d/c.scaleX,u.y/c.scaleY)),e.originX===o&&e.originY===l&&(r=-r),e.originX===a&&e.originY===s&&(r=-r),C(c)&&(r=-r));var p=g!==r;if(p){var v=c._getTransformedDimensions().y;c.set("skewX",r),I(c,"skewY","scaleY","y",v)}return p}function S(t,e,i,n){var r,c=e.target,u=c._getTransformedDimensions(c.skewX,0),f=_(e,e.originX,e.originY,i,n),d=Math.abs(2*f.y)-u.y,g=c.skewY;d<2?r=0:(r=h(Math.atan2(d/c.scaleY,u.x/c.scaleX)),e.originX===o&&e.originY===l&&(r=-r),e.originX===a&&e.originY===s&&(r=-r),C(c)&&(r=-r));var p=g!==r;if(p){var v=c._getTransformedDimensions().x;c.set("skewY",r),I(c,"skewX","scaleX","x",v)}return p}function w(t,e,i,n,r){r=r||{};var o,s,a,l,c,h,d=e.target,g=d.lockScalingX,y=d.lockScalingY,b=r.by,x=p(t,d),C=m(d,b,x),I=e.gestureScale;if(C)return!1;if(I)s=e.scaleX*I,a=e.scaleY*I;else{if(o=_(e,e.originX,e.originY,i,n),c="y"!==b?f(o.x):1,h="x"!==b?f(o.y):1,e.signX||(e.signX=c),e.signY||(e.signY=h),d.lockScalingFlip&&(e.signX!==c||e.signY!==h))return!1;if(l=d._getTransformedDimensions(),x&&!b){var M=Math.abs(o.x)+Math.abs(o.y),S=e.original,w=M/(Math.abs(l.x*S.scaleX/d.scaleX)+Math.abs(l.y*S.scaleY/d.scaleY));s=S.scaleX*w,a=S.scaleY*w}else s=Math.abs(o.x*d.scaleX/l.x),a=Math.abs(o.y*d.scaleY/l.y);v(e)&&(s*=2,a*=2),e.signX!==c&&"y"!==b&&(e.originX=u[e.originX],s*=-1,e.signX=c),e.signY!==h&&"x"!==b&&(e.originY=u[e.originY],a*=-1,e.signY=h)}var k=d.scaleX,T=d.scaleY;return b?("x"===b&&d.set("scaleX",s),"y"===b&&d.set("scaleY",a)):(!g&&d.set("scaleX",s),!y&&d.set("scaleY",a)),k!==d.scaleX||T!==d.scaleY}r.scaleCursorStyleHandler=function(t,e,n){var r=p(t,n),o="";if(0!==e.x&&0===e.y?o="x":0===e.x&&0!==e.y&&(o="y"),m(n,o,r))return"not-allowed";var s=d(n,e);return i[s]+"-resize"},r.skewCursorStyleHandler=function(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"},r.scaleSkewCursorStyleHandler=function(t,e,i){return t[i.canvas.altActionKey]?r.skewCursorStyleHandler(t,e,i):r.scaleCursorStyleHandler(t,e,i)},r.rotationWithSnapping=x("rotating",b(function(t,e,i,n){var r=e,o=r.target,s=o.translateToOriginPoint(o.getCenterPoint(),r.originX,r.originY);if(o.lockRotation)return!1;var a,l=Math.atan2(r.ey-s.y,r.ex-s.x),c=Math.atan2(n-s.y,i-s.x),u=h(c-l+r.theta);if(o.snapAngle>0){var f=o.snapAngle,d=o.snapThreshold||f,g=Math.ceil(u/f)*f,p=Math.floor(u/f)*f;Math.abs(u-p)<d?u=p:Math.abs(u-g)<d&&(u=g)}return u<0&&(u=360+u),u%=360,a=o.angle!==u,o.angle=u,a})),r.scalingEqually=x("scaling",b(function(t,e,i,n){return w(t,e,i,n)})),r.scalingX=x("scaling",b(function(t,e,i,n){return w(t,e,i,n,{by:"x"})})),r.scalingY=x("scaling",b(function(t,e,i,n){return w(t,e,i,n,{by:"y"})})),r.scalingYOrSkewingX=function(t,e,i,n){return t[e.target.canvas.altActionKey]?r.skewHandlerX(t,e,i,n):r.scalingY(t,e,i,n)},r.scalingXOrSkewingY=function(t,e,i,n){return t[e.target.canvas.altActionKey]?r.skewHandlerY(t,e,i,n):r.scalingX(t,e,i,n)},r.changeWidth=x("resizing",b(function(t,e,i,n){var r=e.target,o=_(e,e.originX,e.originY,i,n),s=r.strokeWidth/(r.strokeUniform?r.scaleX:1),a=v(e)?2:1,l=r.width,c=Math.abs(o.x*a/r.scaleX)-s;return r.set("width",Math.max(c,0)),l!==c})),r.skewHandlerX=function(t,e,i,n){var r,l=e.target,u=l.skewX,h=e.originY;return!l.lockSkewingX&&(0===u?r=_(e,c,c,i,n).x>0?o:a:(u>0&&(r=h===s?o:a),u<0&&(r=h===s?a:o),C(l)&&(r=r===o?a:o)),e.originX=r,x("skewing",b(M))(t,e,i,n))},r.skewHandlerY=function(t,e,i,n){var r,a=e.target,u=a.skewY,h=e.originX;return!a.lockSkewingY&&(0===u?r=_(e,c,c,i,n).y>0?s:l:(u>0&&(r=h===o?s:l),u<0&&(r=h===o?l:s),C(a)&&(r=r===s?l:s)),e.originY=r,x("skewing",b(S))(t,e,i,n))},r.dragHandler=function(t,e,i,n){var r=e.target,o=i-e.offsetX,s=n-e.offsetY,a=!r.get("lockMovementX")&&r.left!==o,l=!r.get("lockMovementY")&&r.top!==s;return a&&r.set("left",o),l&&r.set("top",s),(a||l)&&g("moving",y(t,e,i,n)),a||l},r.scaleOrSkewActionName=function(t,e,i){var n=t[i.canvas.altActionKey];return 0===e.x?n?"skewX":"scaleY":0===e.y?n?"skewY":"scaleX":void 0},r.rotationStyleHandler=function(t,e,i){return i.lockRotation?"not-allowed":e.cursorStyle},r.fireEvent=g,r.wrapWithFixedAnchor=b,r.wrapWithFireEvent=x,r.getLocalPoint=_,e.controlsUtils=r}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.util.degreesToRadians,n=e.controlsUtils;n.renderCircleControl=function(t,e,i,n,r){n=n||{};var o,s=this.sizeX||n.cornerSize||r.cornerSize,a=this.sizeY||n.cornerSize||r.cornerSize,l=void 0!==n.transparentCorners?n.transparentCorners:r.transparentCorners,c=l?"stroke":"fill",u=!l&&(n.cornerStrokeColor||r.cornerStrokeColor),h=e,f=i;t.save(),t.fillStyle=n.cornerColor||r.cornerColor,t.strokeStyle=n.cornerStrokeColor||r.cornerStrokeColor,s>a?(o=s,t.scale(1,a/s),f=i*s/a):a>s?(o=a,t.scale(s/a,1),h=e*a/s):o=s,t.lineWidth=1,t.beginPath(),t.arc(h,f,o/2,0,2*Math.PI,!1),t[c](),u&&t.stroke(),t.restore()},n.renderSquareControl=function(t,e,n,r,o){r=r||{};var s=this.sizeX||r.cornerSize||o.cornerSize,a=this.sizeY||r.cornerSize||o.cornerSize,l=void 0!==r.transparentCorners?r.transparentCorners:o.transparentCorners,c=l?"stroke":"fill",u=!l&&(r.cornerStrokeColor||o.cornerStrokeColor),h=s/2,f=a/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[c+"Rect"](-h,-f,s,a),u&&t.strokeRect(-h,-f,s,a),t.restore()}}(e),function(t){var e=t.fabric||(t.fabric={});e.Control=function(t){for(var e in t)this[e]=t[e]},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&&void 0!==i[e]?i[e]:this.visible},setVisibility:function(t){this.visible=t},positionHandler:function(t,i){return e.util.transformPoint({x:this.x*t.x+this.offsetX,y:this.y*t.y+this.offsetY},i)},calcCornerCoords:function(t,i,n,r,o){var s,a,l,c,u=o?this.touchSizeX:this.sizeX,h=o?this.touchSizeY:this.sizeY;if(u&&h&&u!==h){var 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);s=d*e.util.cos(g),a=d*e.util.sin(g),l=d*e.util.cos(p),c=d*e.util.sin(p)}else d=.7071067812*(u&&h?u:i),g=e.util.degreesToRadians(45-t),s=l=d*e.util.cos(g),a=c=d*e.util.sin(g);return{tl:{x:n-c,y:r-l},tr:{x:n+s,y:r-a},bl:{x:n-s,y:r+a},br:{x:n+c,y:r+l}}},render:function(t,i,n,r,o){"circle"===((r=r||{}).cornerStyle||o.cornerStyle)?e.controlsUtils.renderCircleControl.call(this,t,i,n,r,o):e.controlsUtils.renderSquareControl.call(this,t,i,n,r,o)}}}(e),function(){function t(t,e){var i,n,r,o,s=t.getAttribute("style"),a=t.getAttribute("offset")||0;if(a=(a=parseFloat(a)/(/%$/.test(a)?100:1))<0?0:a>1?1:a,s){var l=s.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),o=l.length;o--;){var c=l[o].split(/\s*:\s*/),u=c[0].trim(),h=c[1].trim();"stop-color"===u?i=h:"stop-opacity"===u&&(r=h)}}return i||(i=t.getAttribute("stop-color")||"rgb(0,0,0)"),r||(r=t.getAttribute("stop-opacity")),n=(i=new M.Color(i)).getAlpha(),r=isNaN(parseFloat(r))?1:parseFloat(r),r*=n*e,{offset:a,color:i.toRgb(),opacity:r}}var e=M.util.object.clone;M.Gradient=M.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+="_"+M.Object.__uid++:this.id=M.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 M.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 M.util.populateWithProperties(this,e,t),e},toSVG:function(t,i){var n,r,o,s,a=e(this.coords,!0),l=(i=i||{},e(this.colorStops,!0)),c=a.r1>a.r2,u=this.gradientTransform?this.gradientTransform.concat():M.iMatrix.concat(),h=-this.offsetX,f=-this.offsetY,d=!!i.additionalTransform,g="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort(function(t,e){return t.offset-e.offset}),"objectBoundingBox"===g?(h/=t.width,f/=t.height):(h+=t.width/2,f+=t.height/2),"path"===t.type&&"percentage"!==this.gradientUnits&&(h-=t.pathOffset.x,f-=t.pathOffset.y),u[4]-=h,u[5]-=f,s='id="SVGID_'+this.id+'" gradientUnits="'+g+'"',s+=' gradientTransform="'+(d?i.additionalTransform+" ":"")+M.util.matrixToSVG(u)+'" ',"linear"===this.type?o=["<linearGradient ",s,' x1="',a.x1,'" y1="',a.y1,'" x2="',a.x2,'" y2="',a.y2,'">\n']:"radial"===this.type&&(o=["<radialGradient ",s,' cx="',c?a.x1:a.x2,'" cy="',c?a.y1:a.y2,'" r="',c?a.r1:a.r2,'" fx="',c?a.x2:a.x1,'" fy="',c?a.y2:a.y1,'">\n']),"radial"===this.type){if(c)for((l=l.concat()).reverse(),n=0,r=l.length;n<r;n++)l[n].offset=1-l[n].offset;var p=Math.min(a.r1,a.r2);if(p>0){var v=p/Math.max(a.r1,a.r2);for(n=0,r=l.length;n<r;n++)l[n].offset+=v*(1-l[n].offset)}}for(n=0,r=l.length;n<r;n++){var m=l[n];o.push("<stop ",'offset="',100*m.offset+"%",'" style="stop-color:',m.color,void 0!==m.opacity?";stop-opacity: "+m.opacity:";",'"/>\n')}return o.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),o.join("")},toLive:function(t){var e,i,n,r=M.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(r.x1,r.y1,r.x2,r.y2):"radial"===this.type&&(e=t.createRadialGradient(r.x1,r.y1,r.r1,r.x2,r.y2,r.r2)),i=0,n=this.colorStops.length;i<n;i++){var o=this.colorStops[i].color,s=this.colorStops[i].opacity,a=this.colorStops[i].offset;void 0!==s&&(o=new M.Color(o).setAlpha(s).toRgba()),e.addColorStop(a,o)}return e}}}),M.util.object.extend(M.Gradient,{fromElement:function(e,i,n,r){var o=parseFloat(n)/(/%$/.test(n)?100:1);o=o<0?0:o>1?1:o,isNaN(o)&&(o=1);var s,a,l,c,u=e.getElementsByTagName("stop"),h="userSpaceOnUse"===e.getAttribute("gradientUnits")?"pixels":"percentage",f=e.getAttribute("gradientTransform")||"",d=[],g=0,p=0;for("linearGradient"===e.nodeName||"LINEARGRADIENT"===e.nodeName?(s="linear",a=function(t){return{x1:t.getAttribute("x1")||0,y1:t.getAttribute("y1")||0,x2:t.getAttribute("x2")||"100%",y2:t.getAttribute("y2")||0}}(e)):(s="radial",a=function(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%"}}(e)),l=u.length;l--;)d.push(t(u[l],o));return c=M.parseTransformAttribute(f),function(t,e,i,n){var r,o;Object.keys(e).forEach(function(t){"Infinity"===(r=e[t])?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})}(0,a,r,h),"pixels"===h&&(g=-i.left,p=-i.top),new M.Gradient({id:e.getAttribute("id"),type:s,coords:a,colorStops:d,gradientUnits:h,gradientTransform:c,offsetX:g,offsetY:p})}})}(),m=M.util.toFixed,M.Pattern=M.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,e){if(t||(t={}),this.id=M.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!=typeof t.source)e&&e(this);else{var i=this;this.source=M.util.createImage(),M.util.loadImage(t.source,function(t,n){i.source=t,e&&e(i,n)},null,this.crossOrigin)}},toObject:function(t){var e,i,n=M.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?e=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(e=this.source.toDataURL()),i={type:"pattern",source:e,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:m(this.offsetX,n),offsetY:m(this.offsetY,n),patternTransform:this.patternTransform?this.patternTransform.concat():null},M.util.populateWithProperties(this,i,t),i},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,s="";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?s=e.src:e.toDataURL&&(s=e.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+o+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+e.width+'" height="'+e.height+'" xlink:href="'+s+'"></image>\n</pattern>\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;if(!e)return"";if(void 0!==e.src){if(!e.complete)return"";if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}}),function(t){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)||[];return{color:(i.replace(e.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").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,s=e.util.rotateVector({x:this.offsetX,y:this.offsetY},e.util.degreesToRadians(-t.angle)),a=new e.Color(this.color);return t.width&&t.height&&(n=100*i((Math.abs(s.x)+this.blur)/t.width,o)+20,r=100*i((Math.abs(s.y)+this.blur)/t.height,o)+20),t.flipX&&(s.x*=-1),t.flipY&&(s.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+i(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+i(s.x,o)+'" dy="'+i(s.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+a.toRgb()+'" flood-opacity="'+a.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var 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)/)}(e),function(){if(M.StaticCanvas)M.warn("fabric.StaticCanvas is already defined.");else{var t=M.util.object.extend,e=M.util.getElementOffset,i=M.util.removeFromArray,n=M.util.toFixed,r=M.util.transformPoint,o=M.util.invertTransform,s=M.util.getNodeCanvas,a=M.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");M.StaticCanvas=M.util.createClass(M.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:M.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!==M.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?M.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var t=M.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?M.util.loadImage(e,function(e,r){if(e){var o=new M.Image(e,n);this[t]=o,o.canvas=this}i&&i(e,r)},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=a();if(!t)throw l;if(t.style||(t.style={}),void 0===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=M.util.getById(t)||this._createCanvasElement(),M.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,s=this.overlayImage;for(this.viewportTransform=t,i=0,n=this._objects.length;i<n;i++)(e=this._objects[i]).group||e.setCoords(!0);return r&&r.setCoords(),o&&o.setCoords(!0),s&&s.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(t,e){var i=t,n=this.viewportTransform.slice(0);t=r(t,o(this.viewportTransform)),n[0]=e,n[3]=e;var s=r(t,n);return n[4]+=i.x-s.x,n[5]+=i.y-s.y,this.setViewportTransform(n)},setZoom:function(t){return this.zoomToPoint(new M.Point(0,0),t),this},absolutePan:function(t){var e=this.viewportTransform.slice(0);return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)},relativePan:function(t){return this.absolutePan(new M.Point(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(t){this.stateful&&t.setupState(),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added")},_onObjectRemoved:function(t){this.fire("object:removed",{target:t}),t.fire("removed"),delete t.canvas},clearContext:function(t){return t.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var t=this.contextContainer;return this.renderCanvas(t,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=M.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var t={},e=this.width,i=this.height,n=o(this.viewportTransform);return t.tl=r({x:0,y:0},n),t.br=r({x:e,y:i},n),t.tr=new M.Point(t.br.x,t.tl.y),t.bl=new M.Point(t.tl.x,t.br.y),this.vptCoords=t,t},cancelRequestedRender:function(){this.isRendering&&(M.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(t,e){var i=this.viewportTransform,n=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(t),M.util.setImageSmoothing(t,this.imageSmoothingEnabled),this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(t,e),t.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),n&&(n.canvas=this,n.shouldCache(),n._transformDone=!0,n.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t)),this._renderOverlay(t),this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),this.fire("after:render",{ctx:t})},drawClipPathOnCanvas:function(t){var e=this.viewportTransform,i=this.clipPath;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t.globalCompositeOperation="destination-in",i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},_renderObjects:function(t,e){var i,n;for(i=0,n=e.length;i<n;++i)e[i]&&e[i].render(t)},_renderBackgroundOrOverlay:function(t,e){var i=this[e+"Color"],n=this[e+"Image"],r=this.viewportTransform,o=this[e+"Vpt"];if(i||n){if(i){t.save(),t.beginPath(),t.moveTo(0,0),t.lineTo(this.width,0),t.lineTo(this.width,this.height),t.lineTo(0,this.height),t.closePath(),t.fillStyle=i.toLive?i.toLive(t,this):i,o&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),t.transform(1,0,0,1,i.offsetX||0,i.offsetY||0);var s=i.gradientTransform||i.patternTransform;s&&t.transform(s[0],s[1],s[2],s[3],s[4],s[5]),t.fill(),t.restore()}n&&(t.save(),o&&t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),n.render(t),t.restore())}},_renderBackground:function(t){this._renderBackgroundOrOverlay(t,"background")},_renderOverlay:function(t){this._renderBackgroundOrOverlay(t,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(t){return this._centerObject(t,new M.Point(this.getCenter().left,t.getCenterPoint().y))},centerObjectV:function(t){return this._centerObject(t,new M.Point(t.getCenterPoint().x,this.getCenter().top))},centerObject:function(t){var e=this.getCenter();return this._centerObject(t,new M.Point(e.left,e.top))},viewportCenterObject:function(t){var e=this.getVpCenter();return this._centerObject(t,e)},viewportCenterObjectH:function(t){var e=this.getVpCenter();return this._centerObject(t,new M.Point(e.x,t.getCenterPoint().y)),this},viewportCenterObjectV:function(t){var e=this.getVpCenter();return this._centerObject(t,new M.Point(t.getCenterPoint().x,e.y))},getVpCenter:function(){var t=this.getCenter(),e=o(this.viewportTransform);return r({x:t.left,y:t.top},e)},_centerObject:function(t,e){return t.setPositionByOrigin(e,"center","center"),t.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(t){return this.toDatalessObject(t)},toObject:function(t){return this._toObjectMethod("toObject",t)},toDatalessObject:function(t){return this._toObjectMethod("toDatalessObject",t)},_toObjectMethod:function(e,i){var n=this.clipPath,r={version:M.version,objects:this._toObjects(e,i)};return n&&!n.excludeFromExport&&(r.clipPath=this._toObject(this.clipPath,e,i)),t(r,this.__serializeBgOverlay(e,i)),M.util.populateWithProperties(this,r,i),r},_toObjects:function(t,e){return this._objects.filter(function(t){return!t.excludeFromExport}).map(function(i){return this._toObject(i,t,e)},this)},_toObject:function(t,e,i){var n;this.includeDefaultValues||(n=t.includeDefaultValues,t.includeDefaultValues=!1);var r=t[e](i);return this.includeDefaultValues||(t.includeDefaultValues=n),r},__serializeBgOverlay:function(t,e){var i={},n=this.backgroundImage,r=this.overlayImage,o=this.backgroundColor,s=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(i.background=o.toObject(e)):o&&(i.background=o),s&&s.toObject?s.excludeFromExport||(i.overlay=s.toObject(e)):s&&(i.overlay=s),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,t,e)),r&&!r.excludeFromExport&&(i.overlayImage=this._toObject(r,t,e)),i},svgViewportTransformation:!0,toSVG:function(t,e){t||(t={}),t.reviver=e;var i=[];return this._setSVGPreamble(i,t),this._setSVGHeader(i,t),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push("</svg>"),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('<?xml version="1.0" encoding="',e.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(t,e){var i,r=e.width||this.width,o=e.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',a=M.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],a)+" "+n(-i[5]/i[3],a)+" "+n(this.width/i[0],a)+" "+n(this.height/i[3],a)+'" '),t.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',r,'" ','height="',o,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",M.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"</defs>\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+M.Object.__uid++,'<clipPath id="'+e.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(t.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var t=this;return["background","overlay"].map(function(e){var i=t[e+"Color"];if(i&&i.toLive){var n=t[e+"Vpt"],r=t.viewportTransform,o={width:t.width/(n?r[0]:1),height:t.height/(n?r[3]:1)};return i.toSVG(o,{additionalTransform:n?M.util.matrixToSVG(r):""})}}).join("")},createSVGFontFacesMarkup:function(){var t,e,i,n,r,o,s,a,l="",c={},u=M.fontPaths,h=[];for(this._objects.forEach(function t(e){h.push(e),e._objects&&e._objects.forEach(t)}),s=0,a=h.length;s<a;s++)if(e=(t=h[s]).fontFamily,-1!==t.type.indexOf("text")&&!c[e]&&u[e]&&(c[e]=!0,t.styles))for(r in i=t.styles)for(o in n=i[r])!c[e=n[o].fontFamily]&&u[e]&&(c[e]=!0);for(var f in c)l+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",u[f],"');\n","\t\t}\n"].join("");return l&&(l=['\t<style type="text/css">',"<![CDATA[\n",l,"]]>","</style>\n"].join("")),l},_setSVGObjects:function(t,e){var i,n,r,o=this._objects;for(n=0,r=o.length;n<r;n++)(i=o[n]).excludeFromExport||this._setSVGObject(t,i,e)},_setSVGObject:function(t,e,i){t.push(e.toSVG(i))},_setSVGBgOverlayImage:function(t,e,i){this[e]&&!this[e].excludeFromExport&&this[e].toSVG&&t.push(this[e].toSVG(i))},_setSVGBgOverlayColor:function(t,e){var i=this[e+"Color"],n=this.viewportTransform,r=this.width,o=this.height;if(i)if(i.toLive){var s=i.repeat,a=M.util.invertTransform(n),l=this[e+"Vpt"]?M.util.matrixToSVG(a):"";t.push('<rect transform="'+l+" translate(",r/2,",",o/2,')"',' x="',i.offsetX-r/2,'" y="',i.offsetY-o/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?i.source.width:r,'" height="',"repeat-x"===s||"no-repeat"===s?i.source.height:o,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else t.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',i,'"',"></rect>\n")},sendToBack:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(e=(r=o._objects).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;e<r.length;e++)n=r[e],i(this._objects,n),this._objects.push(n);else i(this._objects,t),this._objects.push(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(t,e){if(!t)return this;var n,r,o,s,a,l=this._activeObject,c=0;if(t===l&&"activeSelection"===t.type)for(a=l._objects,n=0;n<a.length;n++)r=a[n],(o=this._objects.indexOf(r))>0+c&&(s=o-1,i(this._objects,r),this._objects.splice(s,0,r)),c++;else 0!==(o=this._objects.indexOf(t))&&(s=this._findNewLowerIndex(t,o,e),i(this._objects,t),this._objects.splice(s,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)if(t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t)){n=r;break}}else n=e-1;return n},bringForward:function(t,e){if(!t)return this;var n,r,o,s,a,l=this._activeObject,c=0;if(t===l&&"activeSelection"===t.type)for(n=(a=l._objects).length;n--;)r=a[n],(o=this._objects.indexOf(r))<this._objects.length-1-c&&(s=o+1,i(this._objects,r),this._objects.splice(s,0,r)),c++;else(o=this._objects.indexOf(t))!==this._objects.length-1&&(s=this._findNewUpperIndex(t,o,e),i(this._objects,t),this._objects.splice(s,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(t,e,i){var n,r,o;if(i){for(n=e,r=e+1,o=this._objects.length;r<o;++r)if(t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t)){n=r;break}}else n=e+1;return n},moveTo:function(t,e){return i(this._objects,t),this._objects.splice(e,0,t),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(M.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(t){t.dispose&&t.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),M.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),t(M.StaticCanvas.prototype,M.Observable),t(M.StaticCanvas.prototype,M.Collection),t(M.StaticCanvas.prototype,M.DataURLExporter),t(M.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=a();if(!e||!e.getContext)return null;var i=e.getContext("2d");return i&&"setLineDash"===t?void 0!==i.setLineDash:null}}),M.StaticCanvas.prototype.toJSON=M.StaticCanvas.prototype.toObject,M.isLikelyNode&&(M.StaticCanvas.prototype.createPNGStream=function(){var t=s(this.lowerCanvasEl);return t&&t.createPNGStream()},M.StaticCanvas.prototype.createJPEGStream=function(t){var e=s(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}}(),M.BaseBrush=M.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*=M.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*n,i.shadowOffsetX=e.offsetX*n,i.shadowOffsetY=e.offsetY*n}},needsFullRender:function(){return new M.Color(this.color).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()}}),M.PencilBrush=M.util.createClass(M.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 M.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 M.Point(t.x,t.y);return this._addPoint(e)},_render:function(){var t,e,i=this.canvas.contextTop,n=this._points[0],r=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&n.x===r.x&&n.y===r.y){var o=this.width/1e3;n=new M.Point(n.x,n.y),r=new M.Point(r.x,r.y),n.x-=o,r.x+=o}for(i.moveTo(n.x,n.y),t=1,e=this._points.length;t<e;t++)this._drawSegment(i,n,r),n=this._points[t],r=this._points[t+1];i.lineTo(n.x,n.y),i.stroke(),i.restore()},convertPointsToSVGPath:function(t){var e=this.width/1e3;return M.util.getSmoothPathFromPoints(t,e)},_isEmptySVGPath:function(t){return"M 0 0 Q 0 0 0 0 L 0 0"===M.util.joinPath(t)},createPath:function(t){var e=new M.Path(t,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,e.shadow=new M.Shadow(this.shadow)),e},decimatePoints:function(t,e){if(t.length<=2)return t;var i,n=this.canvas.getZoom(),r=Math.pow(e/n,2),o=t.length-1,s=t[0],a=[s];for(i=1;i<o-1;i++)Math.pow(s.x-t[i].x,2)+Math.pow(s.y-t[i].y,2)>=r&&(s=t[i],a.push(s));return a.push(t[o]),a},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var t=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(t))this.canvas.requestRenderAll();else{var e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:e}),this.canvas.add(e),this.canvas.requestRenderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}}}),M.CircleBrush=M.util.createClass(M.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;t<e;t++)this.dot(i,n[t]);i.restore()},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(t),this._render()):this.drawDot(t))},onMouseUp:function(){var t,e,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var n=[];for(t=0,e=this.points.length;t<e;t++){var r=this.points[t],o=new M.Circle({radius:r.radius,left:r.x,top:r.y,originX:"center",originY:"center",fill:r.fill});this.shadow&&(o.shadow=new M.Shadow(this.shadow)),n.push(o)}var s=new M.Group(n);s.canvas=this.canvas,this.canvas.fire("before:path:created",{path:s}),this.canvas.add(s),this.canvas.fire("path:created",{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(t){var e=new M.Point(t.x,t.y),i=M.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,n=new M.Color(this.color).setAlpha(M.util.getRandomInt(0,100)/100).toRgba();return e.radius=i,e.fill=n,this.points.push(e),e}}),M.SprayBrush=M.util.createClass(M.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(t){this.canvas=t,this.sprayChunks=[]},onMouseDown:function(t){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(t),this.render(this.sprayChunkPoints)},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.addSprayChunk(t),this.render(this.sprayChunkPoints))},onMouseUp:function(){var t=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var e=[],i=0,n=this.sprayChunks.length;i<n;i++)for(var r=this.sprayChunks[i],o=0,s=r.length;o<s;o++){var a=new M.Rect({width:r[o].width,height:r[o].width,left:r[o].x+1,top:r[o].y+1,originX:"center",originY:"center",fill:this.color});e.push(a)}this.optimizeOverlapping&&(e=this._getOptimizedRects(e));var l=new M.Group(e);this.shadow&&l.set("shadow",new M.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=t,this.canvas.requestRenderAll()},_getOptimizedRects:function(t){var e,i,n,r={};for(i=0,n=t.length;i<n;i++)r[e=t[i].left+""+t[i].top]||(r[e]=t[i]);var o=[];for(e in r)o.push(r[e]);return o},render:function(t){var e,i,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,i=t.length;e<i;e++){var r=t[e];void 0!==r.opacity&&(n.globalAlpha=r.opacity),n.fillRect(r.x,r.y,r.width,r.width)}n.restore()},_render:function(){var t,e,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),t=0,e=this.sprayChunks.length;t<e;t++)this.render(this.sprayChunks[t]);i.restore()},addSprayChunk:function(t){this.sprayChunkPoints=[];var e,i,n,r,o=this.width/2;for(r=0;r<this.density;r++){e=M.util.getRandomInt(t.x-o,t.x+o),i=M.util.getRandomInt(t.y-o,t.y+o),n=this.dotWidthVariance?M.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new M.Point(e,i);s.width=n,this.randomOpacity&&(s.opacity=M.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),M.PatternBrush=M.util.createClass(M.PencilBrush,{getPatternSrc:function(){var t=M.util.createCanvasElement(),e=t.getContext("2d");return t.width=t.height=25,e.fillStyle=this.color,e.beginPath(),e.arc(10,10,10,0,2*Math.PI,!1),e.closePath(),e.fill(),t},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(t){var e=this.callSuper("createPath",t),i=e._getLeftTopCoords().scalarAdd(e.strokeWidth/2);return e.stroke=new M.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),e}}),function(){var t=M.util.getPointer,e=M.util.degreesToRadians,i=M.util.isTouchEvent;for(var n in M.Canvas=M.util.createClass(M.StaticCanvas,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=M.PencilBrush&&new M.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var t,e,i,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){e=[],i=[];for(var r=0,o=this._objects.length;r<o;r++)t=this._objects[r],-1===n.indexOf(t)?e.push(t):i.push(t);n.length>1&&(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=M.util.invertTransform(i),r=this.restorePointerVpt(e);return M.util.transformPoint(r,n)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject){var n=this._normalizePointer(t,{x:e,y:i}),r=Math.max(t.cacheTranslationX+n.x*t.zoomX,0),o=Math.max(t.cacheTranslationY+n.y*t.zoomY,0);return M.util.isTransparent(t._cacheContext,Math.round(r),Math.round(o),this.targetFindTolerance)}var s=this.contextCache,a=t.selectionBackgroundColor,l=this.viewportTransform;return t.selectionBackgroundColor="",this.clearContext(s),s.save(),s.transform(l[0],l[1],l[2],l[3],l[4],l[5]),t.render(s),s.restore(),t.selectionBackgroundColor=a,M.util.isTransparent(s,e,i,this.targetFindTolerance)},_isSelectionKeyPressed:function(t){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find(function(e){return!0===t[e]}):t[this.selectionKey]},_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 r=this.getPointer(t),o=i.__corner,s=i.controls[o],a=n&&o?s.getActionHandler(t,i,s):M.controlsUtils.dragHandler,l=this._getActionFromCorner(n,o,t,i),c=this._getOriginFromCorner(i,o),u=t[this.centeredKey],h={target:i,action:l,actionHandler:a,corner:o,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:r.x-i.left,offsetY:r.y-i.top,originX:c.x,originY:c.y,ex:r.x,ey:r.y,lastX:r.x,lastY:r.y,theta:e(i.angle),width:i.width*i.scaleX,shiftKey:t.shiftKey,altKey:u,original:M.util.saveObjectTransform(i)};this._shouldCenterTransform(i,l,u)&&(h.originX="center",h.originY="center"),h.original.originX=c.x,h.original.originY=c.y,this._currentTransform=h,this._beforeTransform(t)}},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new M.Point(e.ex,e.ey),n=M.util.transformPoint(i,this.viewportTransform),r=new M.Point(e.ex+e.left,e.ey+e.top),o=M.util.transformPoint(r,this.viewportTransform),s=Math.min(n.x,o.x),a=Math.min(n.y,o.y),l=Math.max(n.x,o.x),c=Math.max(n.y,o.y),u=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(s,a,l-s,c-a)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,s+=u,a+=u,l-=u,c-=u,M.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(s,a,l-s,c-a))},findTarget:function(t,e){if(!this.skipTargetFind){var n,r,o=this.getPointer(t,!0),s=this._activeObject,a=this.getActiveObjects(),l=i(t),c=a.length>1&&!e||1===a.length;if(this.targets=[],c&&s._findTargetCorner(o,l))return s;if(a.length>1&&!e&&s===this._searchPossibleTargets([s],o))return s;if(1===a.length&&s===this._searchPossibleTargets([s],o)){if(!this.preserveObjectStacking)return s;n=s,r=this.targets,this.targets=[]}var u=this._searchPossibleTargets(this._objects,o);return t[this.altSelectionKey]&&u&&n&&u!==n&&(u=n,this.targets=r),u}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t)){if(!this.perPixelTargetFind&&!e.perPixelTargetFind||e.isEditing)return!0;if(!this.isTargetTransparent(e,i.x,i.y))return!0}},_searchPossibleTargets:function(t,e){for(var i,n,r=t.length;r--;){var o=t[r],s=o.group?this._normalizePointer(o.group,e):e;if(this._checkTarget(s,o,e)){(i=t[r]).subTargetCheck&&i instanceof M.Group&&(n=this._searchPossibleTargets(i._objects,e))&&this.targets.push(n);break}}return i},restorePointerVpt:function(t){return M.util.transformPoint(t,M.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,s=o.getBoundingClientRect(),a=s.width||0,l=s.height||0;a&&l||("top"in s&&"bottom"in s&&(l=Math.abs(s.top-s.bottom)),"right"in s&&"left"in s&&(a=Math.abs(s.right-s.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),n=0===a||0===l?{width:1,height:1}:{width:o.width/a,height:o.height/l},{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),M.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=M.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),M.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),M.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;M.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,M.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){M.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,M.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={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(i){e[i]=t[i]}),M.util.addTransformToObject(t,this._activeObject.calcOwnMatrix()),e}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(),M.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),M.StaticCanvas)"prototype"!==n&&(M.Canvas[n]=M.StaticCanvas[n])}(),function(){var t=M.util.addListener,e=M.util.removeListener,i={passive:!1};function n(t,e){return t.button&&t.button===e-1}M.util.object.extend(M.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 n=this.upperCanvasEl,r=this._getEventPrefix();t(M.window,"resize",this._onResize),t(n,r+"down",this._onMouseDown),t(n,r+"move",this._onMouseMove,i),t(n,r+"out",this._onMouseOut),t(n,r+"enter",this._onMouseEnter),t(n,"wheel",this._onMouseWheel),t(n,"contextmenu",this._onContextMenu),t(n,"dblclick",this._onDoubleClick),t(n,"dragover",this._onDragOver),t(n,"dragenter",this._onDragEnter),t(n,"dragleave",this._onDragLeave),t(n,"drop",this._onDrop),this.enablePointerEvents||t(n,"touchstart",this._onTouchStart,i),"undefined"!=typeof eventjs&&e in eventjs&&(eventjs[e](n,"gesture",this._onGesture),eventjs[e](n,"drag",this._onDrag),eventjs[e](n,"orientation",this._onOrientationChange),eventjs[e](n,"shake",this._onShake),eventjs[e](n,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(e,"remove");var t=this._getEventPrefix();e(M.document,t+"up",this._onMouseUp),e(M.document,"touchend",this._onTouchEnd,i),e(M.document,t+"move",this._onMouseMove,i),e(M.document,"touchmove",this._onMouseMove,i)},_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(n){n.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();t(M.document,"touchend",this._onTouchEnd,i),t(M.document,"touchmove",this._onMouseMove,i),e(r,o+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();e(r,o+"move",this._onMouseMove,i),t(M.document,o+"up",this._onMouseUp),t(M.document,o+"move",this._onMouseMove,i)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var r=this._getEventPrefix();e(M.document,"touchend",this._onTouchEnd,i),e(M.document,"touchmove",this._onMouseMove,i);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){t(o.upperCanvasEl,r+"down",o._onMouseDown),o._willAddMouseDown=0},400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var r=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(n)&&(e(M.document,o+"up",this._onMouseUp),e(M.document,o+"move",this._onMouseMove,i),t(r,o+"move",this._onMouseMove,i))},_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,i=this._currentTransform,r=this._groupSelector,o=!1,s=!r||0===r.left&&0===r.top;if(this._cacheTransformEventData(t),e=this._target,this._handleEvent(t,"up:before"),n(t,3))this.fireRightClick&&this._handleEvent(t,"up",3,s);else{if(n(t,2))return this.fireMiddleClick&&this._handleEvent(t,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(t);else if(this._isMainEvent(t)){if(i&&(this._finalizeCurrentTransform(t),o=i.actionPerformed),!s){var a=e===this._activeObject;this._maybeGroupObjects(t),o||(o=this._shouldRender(e)||!a&&e===this._activeObject)}if(e){if(e.selectable&&e!==this._activeObject&&"up"===e.activeOn)this.setActiveObject(e,t),o=!0;else{var l=e._findTargetCorner(this.getPointer(t,!0),M.util.isTouchEvent(t)),c=e.controls[l],u=c&&c.getMouseUpHandler(t,e,c);if(u){var h=this.getPointer(t);u(t,i,h.x,h.y)}}e.isMoving=!1}this._setCursorFromEvent(t,e),this._handleEvent(t,"up",1,s),this._groupSelector=null,this._currentTransform=null,e&&(e.__corner=0),o?this.requestRenderAll():s||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;o<n.length;o++)n[o].fire(t,r);return i},_handleEvent:function(t,e,i,n){var r=this._target,o=this.targets||[],s={e:t,target:r,subTargets:o,button:i||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===e&&(s.currentTarget=this.findTarget(t),s.currentSubTargets=this.targets),this.fire("mouse:"+e,s),r&&r.fire("mouse"+e,s);for(var a=0;a<o.length;a++)o[a].fire("mouse"+e,s)},_finalizeCurrentTransform:function(t){var e,i=this._currentTransform,n=i.target,r={e:t,target:n,transform:i,action:i.action};n._scaling&&(n._scaling=!1),n.setCoords(),(i.actionPerformed||this.stateful&&n.hasStateChanged())&&(i.actionPerformed&&(e=this._addEventOptions(r,i),this._fire(e,r)),this._fire("modified",r))},_addEventOptions:function(t,e){var i,n;switch(e.action){case"scaleX":i="scaled",n="x";break;case"scaleY":i="scaled",n="y";break;case"skewX":i="skewed",n="x";break;case"skewY":i="skewed",n="y";break;case"scale":i="scaled",n="equally";break;case"rotate":i="rotated";break;case"drag":i="moved"}return t.by=n,i},_onMouseDownInDrawingMode:function(t){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(t).requestRenderAll();var e=this.getPointer(t);this.freeDrawingBrush.onMouseDown(e,{e:t,pointer:e}),this._handleEvent(t,"down")},_onMouseMoveInDrawingMode:function(t){if(this._isCurrentlyDrawing){var e=this.getPointer(t);this.freeDrawingBrush.onMouseMove(e,{e:t,pointer:e})}this.setCursor(this.freeDrawingCursor),this._handleEvent(t,"move")},_onMouseUpInDrawingMode:function(t){var e=this.getPointer(t);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:t,pointer:e}),this._handleEvent(t,"up")},__onMouseDown:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"down:before");var e=this._target;if(n(t,3))this.fireRightClick&&this._handleEvent(t,"down",3);else if(n(t,2))this.fireMiddleClick&&this._handleEvent(t,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(t);else if(this._isMainEvent(t)&&!this._currentTransform){var i=this._pointer;this._previousPointer=i;var r=this._shouldRender(e),o=this._shouldGroup(t,e);if(this._shouldClearSelection(t,e)?this.discardActiveObject(t):o&&(this._handleGrouping(t,e),e=this._activeObject),!this.selection||e&&(e.selectable||e.isEditing||e===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),e){var s=e===this._activeObject;e.selectable&&"down"===e.activeOn&&this.setActiveObject(e,t);var a=e._findTargetCorner(this.getPointer(t,!0),M.util.isTouchEvent(t));if(e.__corner=a,e===this._activeObject&&(a||!o)){this._setupCurrentTransform(t,e,s);var l=e.controls[a],c=(i=this.getPointer(t),l&&l.getMouseDownHandler(t,e,l));c&&c(t,this._currentTransform,i.x,i.y)}}this._handleEvent(t,"down"),(r||o)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(t){this._resetTransformEventData(),this._pointer=this.getPointer(t,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(t)||null},_beforeTransform:function(t){var e=this._currentTransform;this.stateful&&e.target.saveState(),this.fire("before:transform",{e:t,transform:e})},__onMouseMove:function(t){var e,i;if(this._handleEvent(t,"move:before"),this._cacheTransformEventData(t),this.isDrawingMode)this._onMouseMoveInDrawingMode(t);else if(this._isMainEvent(t)){var n=this._groupSelector;n?(i=this._absolutePointer,n.left=i.x-n.ex,n.top=i.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(t):(e=this.findTarget(t)||null,this._setCursorFromEvent(t,e),this._fireOverOutEvents(e,t)),this._handleEvent(t,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(t,e){var i=this._hoveredTarget,n=this._hoveredTargets,r=this.targets,o=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var s=0;s<o;s++)this.fireSyntheticInOutEvents(r[s],e,{oldTarget:n[s],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=t,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(t,e){var i=this._draggedoverTarget,n=this._hoveredTargets,r=this.targets,o=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var s=0;s<o;s++)this.fireSyntheticInOutEvents(r[s],e,{oldTarget:n[s],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=t},fireSyntheticInOutEvents:function(t,e,i){var n,r,o,s=i.oldTarget,a=s!==t,l=i.canvasEvtIn,c=i.canvasEvtOut;a&&(n={e:e,target:t,previousTarget:s},r={e:e,target:s,nextTarget:t}),o=t&&a,s&&a&&(c&&this.fire(c,r),s.fire(i.evtOut,r)),o&&(l&&this.fire(l,n),t.fire(i.evtIn,n))},__onMouseWheel:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"wheel"),this._resetTransformEventData()},_transformObject:function(t){var e=this.getPointer(t),i=this._currentTransform;i.reset=!1,i.shiftKey=t.shiftKey,i.altKey=t[this.centeredKey],this._performTransformAction(t,i,e),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(t,e,i){var n=i.x,r=i.y,o=e.action,s=!1,a=e.actionHandler;a&&(s=a(t,e,n,r)),"drag"===o&&s&&(e.target.isMoving=!0,this.setCursor(e.target.moveCursor||this.moveCursor)),e.actionPerformed=e.actionPerformed||s},_fire:M.controlsUtils.fireEvent,_setCursorFromEvent:function(t,e){if(!e)return this.setCursor(this.defaultCursor),!1;var i=e.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!n||!n.contains(e))&&e._findTargetCorner(this.getPointer(t,!0));r?this.setCursor(this.getCornerCursor(r,e,t)):(e.subTargetCheck&&this.targets.concat().reverse().map(function(t){i=t.hoverCursor||i}),this.setCursor(i))},getCornerCursor:function(t,e,i){var n=e.controls[t];return n.cursorStyleHandler(i,n,e)}})}(),y=Math.min,b=Math.max,M.util.object.extend(M.Canvas.prototype,{_shouldGroup:function(t,e){var i=this._activeObject;return i&&this._isSelectionKeyPressed(t)&&e&&e.selectable&&this.selection&&(i!==e||"activeSelection"===i.type)&&!e.onSelect({e:t})},_handleGrouping:function(t,e){var i=this._activeObject;i.__corner||(e!==i||(e=this.findTarget(t,!0))&&e.selectable)&&(i&&"activeSelection"===i.type?this._updateActiveSelection(e,t):this._createActiveSelection(e,t))},_updateActiveSelection:function(t,e){var i=this._activeObject,n=i._objects.slice(0);i.contains(t)?(i.removeWithUpdate(t),this._hoveredTarget=t,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),e)):(i.addWithUpdate(t),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,e)},_createActiveSelection:function(t,e){var i=this.getActiveObjects(),n=this._createGroup(t);this._hoveredTarget=n,this._setActiveObject(n,e),this._fireSelectionEvents(i,e)},_createGroup:function(t){var e=this._objects,i=e.indexOf(this._activeObject)<e.indexOf(t)?[this._activeObject,t]:[t,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new M.ActiveSelection(i,{canvas:this})},_groupSelectedObjects:function(t){var e,i=this._collectObjects(t);1===i.length?this.setActiveObject(i[0],t):i.length>1&&(e=new M.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(t){for(var e,i=[],n=this._groupSelector.ex,r=this._groupSelector.ey,o=n+this._groupSelector.left,s=r+this._groupSelector.top,a=new M.Point(y(n,o),y(r,s)),l=new M.Point(b(n,o),b(r,s)),c=!this.selectionFullyContained,u=n===o&&r===s,h=this._objects.length;h--&&!((e=this._objects[h])&&e.selectable&&e.visible&&(c&&e.intersectsWithRect(a,l,!0)||e.isContainedWithinRect(a,l,!0)||c&&e.containsPoint(a,null,!0)||c&&e.containsPoint(l,null,!0))&&(i.push(e),u)););return i.length>1&&(i=i.filter(function(e){return!e.onSelect({e:t})})),i},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}}),M.util.object.extend(M.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),r=this.toCanvasElement(n,t);return M.util.toDataURL(r,e,i)},toCanvasElement:function(t,e){t=t||1;var i=((e=e||{}).width||this.width)*t,n=(e.height||this.height)*t,r=this.getZoom(),o=this.width,s=this.height,a=r*t,l=this.viewportTransform,c=(l[4]-(e.left||0))*t,u=(l[5]-(e.top||0))*t,h=this.interactive,f=[a,0,0,a,c,u],d=this.enableRetinaScaling,g=M.util.createCanvasElement(),p=this.contextTop;return g.width=i,g.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=l,this.width=o,this.height=s,this.calcViewportBoundaries(),this.interactive=h,this.enableRetinaScaling=d,this.contextTop=p,g}}),M.util.object.extend(M.StaticCanvas.prototype,{loadFromJSON:function(t,e,i){if(t){var n="string"==typeof t?JSON.parse(t):M.util.object.clone(t),r=this,o=n.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,function(t){r.clear(),r._setBgOverlay(n,function(){o?r._enlivenObjects([o],function(i){r.clipPath=i[0],r.__setupCanvas.call(r,n,t,s,e)}):r.__setupCanvas.call(r,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 r=this;if(!e)return i[t]=!0,void(n&&n());"backgroundImage"===t||"overlayImage"===t?M.util.enlivenObjects([e],function(e){r[t]=e[0],i[t]=!0,n&&n()}):this["set"+M.util.string.capitalize(t,!0)](e,function(){i[t]=!0,n&&n()})},_enlivenObjects:function(t,e,i){t&&0!==t.length?M.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=M.util.createCanvasElement();e.width=this.width,e.height=this.height;var i=new M.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){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,s=e.util.degreesToRadians,a=!e.isLikelyNode;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:a,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(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,s=e.minCacheSideLimit;if(n<=o&&r<=o&&n*r<=i)return n<s&&(t.width=s),r<s&&(t.height=s),t;var a=n/r,l=e.util.limitDimsByArea(a,i),c=e.util.capValue,u=c(s,l.x,o),h=c(s,l.y,o);return n>u&&(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+2,height:n+2,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,s=this._cacheCanvas,a=this._limitCacheSize(this._getCacheCanvasDimensions()),l=e.minCacheSideLimit,c=a.width,u=a.height,h=a.zoomX,f=a.zoomY,d=c!==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,x=this._cacheCanvas.height,_=c>b||u>x;y=_||(c<.9*b||u<.9*x)&&b>l&&x>l,_&&!a.capped&&(c>l||u>l)&&(v=.1*c,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?(s.width=Math.ceil(c+v),s.height=Math.ceil(u+m)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,s.width,s.height)),r=a.x/2,o=a.y/2,this.cacheTranslationX=Math.round(s.width/2-r)+r,this.cacheTranslationY=Math.round(s.height/2-o)+o,this.cacheWidth=c,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(h,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;return i.stateProperties.forEach(function(e){"left"!==e&&"top"!==e&&(t[e]===i[e]&&delete t[e],"[object Array]"===Object.prototype.toString.call(t[e])&&"[object Array]"===Object.prototype.toString.call(i[e])&&0===t[e].length&&0===i[e].length&&delete t[e])}),t},toString:function(){return"#<fabric."+o(this.type)+">"},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,a=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(i=i||{}).hasBorders?i.hasBorders:this.hasBorders,o=void 0!==i.hasControls?i.hasControls:this.hasControls,l=e.util.multiplyTransformMatrices(a,l),n=e.util.qrDecompose(l),t.save(),t.translate(n.translateX,n.translateY),t.lineWidth=1*this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),t.rotate(s(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,s=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(o*=e.devicePixelRatio,s*=e.devicePixelRatio),t.shadowColor=n.color,t.shadowBlur=n.blur*e.browserShadowBlurConstant*(o+s)*(i.scaleX+i.scaleY)/4,t.shadowOffsetX=n.offsetX*o*i.scaleX,t.shadowOffsetY=n.offsetY*s*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(),s=this.canvas.getRetinaScaling(),a=r.x/this.scaleX/s,l=r.y/this.scaleY/s;o.width=a,o.height=l,(n=o.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(a,0),n.lineTo(a,l),n.lineTo(0,l),n.closePath(),n.translate(a/2,l/2),n.scale(r.zoomX/this.scaleX/s,r.zoomY/this.scaleY/s),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(s*this.scaleX/r.zoomX,s*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,s=Math.abs,a=(t.multiplier||1)*(t.enableRetinaScaling?e.devicePixelRatio:1);delete this.group,t.withoutTransform&&i.resetObjectTransform(this),t.withoutShadow&&(this.shadow=null);var l,c,u,h,f=e.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),g=this.shadow,p={x:0,y:0};g&&(c=g.blur,l=g.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),p.x=2*Math.round(s(g.offsetX)+c)*s(l.scaleX),p.y=2*Math.round(s(g.offsetY)+c)*s(l.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(a||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,s(-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 s=e[t];i=n(i,!0),e.util.enlivenPatterns([i.fill,i.stroke],function(t){void 0!==t[0]&&(i.fill=t[0]),void 0!==t[1]&&(i.stroke=t[1]),e.util.enlivenObjects([i.clipPath],function(t){i.clipPath=t[0];var e=o?new s(i[o],i):new s(i);r&&r(e)})})},e.Object.__uid=0)}(e),x=M.util.degreesToRadians,_={left:-.5,center:0,right:.5},C={top:-.5,center:0,bottom:.5},M.util.object.extend(M.Object.prototype,{translateToGivenOrigin:function(t,e,i,n,r){var o,s,a,l=t.x,c=t.y;return"string"==typeof e?e=_[e]:e-=.5,"string"==typeof n?n=_[n]:n-=.5,"string"==typeof i?i=C[i]:i-=.5,"string"==typeof r?r=C[r]:r-=.5,s=r-i,((o=n-e)||s)&&(a=this._getTransformedDimensions(),l=t.x+o*a.x,c=t.y+s*a.y),new M.Point(l,c)},translateToCenterPoint:function(t,e,i){var n=this.translateToGivenOrigin(t,e,i,"center","center");return this.angle?M.util.rotatePoint(n,t,x(this.angle)):n},translateToOriginPoint:function(t,e,i){var n=this.translateToGivenOrigin(t,"center","center",e,i);return this.angle?M.util.rotatePoint(n,t,x(this.angle)):n},getCenterPoint:function(){var t=new M.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(t,e,i){var n,r,o=this.getCenterPoint();return n=void 0!==e&&void 0!==i?this.translateToGivenOrigin(o,"center","center",e,i):new M.Point(this.left,this.top),r=new M.Point(t.x,t.y),this.angle&&(r=M.util.rotatePoint(r,o,-x(this.angle))),r.subtractEquals(n)},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(t){var e,i,n=x(this.angle),r=this.getScaledWidth(),o=M.util.cos(n)*r,s=M.util.sin(n)*r;e="string"==typeof this.originX?_[this.originX]:this.originX-.5,i="string"==typeof t?_[t]:t-.5,this.left+=o*(i-e),this.top+=s*(i-e),this.setCoords(),this.originX=t},_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(){var t=M.util,e=t.degreesToRadians,i=t.multiplyTransformMatrices,n=t.transformPoint;t.object.extend(M.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(t,e){return i=this._getCoords(t,e),[new M.Point(i.tl.x,i.tl.y),new M.Point(i.tr.x,i.tr.y),new M.Point(i.br.x,i.br.y),new M.Point(i.bl.x,i.bl.y)];var i},intersectsWithRect:function(t,e,i,n){var r=this.getCoords(i,n);return"Intersection"===M.Intersection.intersectPolygonRectangle(r,t,e).status},intersectsWithObject:function(t,e,i){return"Intersection"===M.Intersection.intersectPolygonPolygon(this.getCoords(e,i),t.getCoords(e,i)).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,s=t._getImageLines(r);o<4;o++)if(!t.containsPoint(n[o],s))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;return!!this.getCoords(!0,t).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;return!!this.intersectsWithRect(e,i,!0,t)||this.getCoords(!0,t).every(function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)})&&this._containsCenterOfCanvas(e,i,t)},_getImageLines:function(t){return{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}}},_findCrossPoints:function(t,e){var i,n,r,o=0;for(var s in e)if(!((r=e[s]).o.y<t.y&&r.d.y<t.y||r.o.y>=t.y&&r.d.y>=t.y||(r.o.x===r.d.x&&r.o.x>=t.x?n=r.o.x:(i=(r.d.y-r.o.y)/(r.d.x-r.o.x),n=-(t.y-0*t.x-(r.o.y-i*r.o.x))/(0-i)),n>=t.x&&(o+=1),2!==o)))break;return o},getBoundingRect:function(e,i){var n=this.getCoords(e,i);return t.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){return Math.abs(t)<this.minScaleLimit?t<0?-this.minScaleLimit:this.minScaleLimit:0===t?1e-4:t},scale:function(t){return this._set("scaleX",t),this._set("scaleY",t),this.setCoords()},scaleToWidth:function(t,e){var i=this.getBoundingRect(e).width/this.getScaledWidth();return this.scale(t/this.width/i)},scaleToHeight:function(t,e){var i=this.getBoundingRect(e).height/this.getScaledHeight();return this.scale(t/this.height/i)},calcCoords:function(t){return t?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var i=this.getViewportTransform(),r=this.padding,o=e(this.angle),s=t.cos(o)*r,a=t.sin(o)*r,l=s+a,c=s-a,u=this.calcACoords(),h={tl:n(u.tl,i),tr:n(u.tr,i),bl:n(u.bl,i),br:n(u.br,i)};return r&&(h.tl.x-=c,h.tl.y-=l,h.tr.x+=l,h.tr.y-=c,h.bl.x-=l,h.bl.y+=c,h.br.x+=c,h.br.y+=l),h},calcOCoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),n=this.getViewportTransform(),r=i(n,e),o=i(r,t),s=(o=i(o,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),a={};return this.forEachControl(function(t,e,i){a[e]=t.positionHandler(s,o,i)}),a},calcACoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),r=i(e,t),o=this._getTransformedDimensions(),s=o.x/2,a=o.y/2;return{tl:n({x:-s,y:-a},r),tr:n({x:s,y:-a},r),bl:n({x:-s,y:a},r),br:n({x:s,y:a},r)}},setCoords:function(t){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),t||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return t.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var t=this.getCenterPoint();return[1,0,0,1,t.x,t.y]},transformMatrixKey:function(t){var e="_",i="";return!t&&this.group&&(i=this.group.transformMatrixKey(t)+e),i+this.top+e+this.left+e+this.scaleX+e+this.scaleY+e+this.skewX+e+this.skewY+e+this.angle+e+this.originX+e+this.originY+e+this.width+e+this.height+e+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(t){var e=this.calcOwnMatrix();if(t||!this.group)return e;var n=this.transformMatrixKey(t),r=this.matrixCache||(this.matrixCache={});return r.key===n?r.value:(this.group&&(e=i(this.group.calcTransformMatrix(!1),e)),r.key=n,r.value=e,e)},calcOwnMatrix:function(){var e=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});if(i.key===e)return i.value;var n=this._calcTranslateMatrix(),r={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return i.key=e,i.value=t.composeMatrix(r),i.value},_calcDimensionsTransformMatrix:function(e,i,n){return t.calcDimensionsMatrix({skewX:e,skewY:i,scaleX:this.scaleX*(n&&this.flipX?-1:1),scaleY:this.scaleY*(n&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var t=this.strokeWidth;return{x:this.width+t,y:this.height+t}},_getTransformedDimensions:function(e,i){void 0===e&&(e=this.skewX),void 0===i&&(i=this.skewY);var n,r,o,s=0===e&&0===i;if(this.strokeUniform?(r=this.width,o=this.height):(r=(n=this._getNonTransformedDimensions()).x,o=n.y),s)return this._finalizeDimensions(r*this.scaleX,o*this.scaleY);var a=t.sizeAfterTransform(r,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:e,skewY:i});return this._finalizeDimensions(a.x,a.y)},_finalizeDimensions:function(t,e){return this.strokeUniform?{x:t+this.strokeWidth,y:e+this.strokeWidth}:{x:t,y:e}},_calculateCurrentDimensions:function(){var t=this.getViewportTransform(),e=this._getTransformedDimensions();return n(e,t,!0).scalarAdd(2*this.padding)}})}(),M.util.object.extend(M.Object.prototype,{sendToBack:function(){return this.group?M.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?M.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(t){return this.group?M.StaticCanvas.prototype.sendBackwards.call(this.group,this,t):this.canvas&&this.canvas.sendBackwards(this,t),this},bringForward:function(t){return this.group?M.StaticCanvas.prototype.bringForward.call(this.group,this,t):this.canvas&&this.canvas.bringForward(this,t),this},moveTo:function(t){return this.group&&"activeSelection"!==this.group.type?M.StaticCanvas.prototype.moveTo.call(this.group,this,t):this.canvas&&this.canvas.moveTo(this,t),this}}),function(){function t(t,e){if(e){if(e.toLive)return t+": url(#SVGID_"+e.id+"); ";var i=new M.Color(e),n=t+": "+i.toRgb()+"; ",r=i.getAlpha();return 1!==r&&(n+=t+"-opacity: "+r.toString()+"; "),n}return t+": none; "}var e=M.util.toFixed;M.util.object.extend(M.Object.prototype,{getSvgStyles:function(e){var i=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",s=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=void 0!==this.opacity?this.opacity:"1",u=this.visible?"":" visibility: hidden;",h=e?"":this.getSvgFilter(),f=t("fill",this.fill);return[t("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",s,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",l,"; ",f,"fill-rule: ",i,"; ","opacity: ",c,";",h,u].join("")},getSvgSpanStyles:function(e,i){var n="; ",r=e.fontFamily?"font-family: "+(-1===e.fontFamily.indexOf("'")&&-1===e.fontFamily.indexOf('"')?"'"+e.fontFamily+"'":e.fontFamily)+n:"",o=e.strokeWidth?"stroke-width: "+e.strokeWidth+n:"",s=e.fontSize?"font-size: "+e.fontSize+"px"+n:"",a=e.fontStyle?"font-style: "+e.fontStyle+n:"",l=e.fontWeight?"font-weight: "+e.fontWeight+n:"",c=e.fill?t("fill",e.fill):"",u=e.stroke?t("stroke",e.stroke):"",h=this.getSvgTextDecoration(e);return h&&(h="text-decoration: "+h+n),[u,o,r,s,a,l,h,c,e.deltaY?"baseline-shift: "+-e.deltaY+"; ":"",i?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(t){return["overline","underline","line-through"].filter(function(e){return t[e.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(t,e){var i=t?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+M.util.matrixToSVG(i)+(e||"")+'" '},_setSVGBg:function(t){if(this.backgroundColor){var i=M.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',e(-this.width/2,i),'" y="',e(-this.height/2,i),'" width="',e(this.width,i),'" height="',e(this.height,i),'"></rect>\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){var i=(e=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){var i,n,r=(e=e||{}).noStyle,o=e.reviver,s=r?"":'style="'+this.getSvgStyles()+'" ',a=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",u=l&&l.absolutePositioned,h=this.stroke,f=this.fill,d=this.shadow,g=[],p=t.indexOf("COMMON_PARTS"),v=e.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+M.Object.__uid++,n='<clipPath id="'+l.clipPathId+'" >\n'+l.toClipPathSVG(o)+"</clipPath>\n"),u&&g.push("<g ",a,this.getSvgCommons()," >\n"),g.push("<g ",this.getSvgTransform(!1),u?"":a+this.getSvgCommons()," >\n"),i=[s,c,r?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),t[p]=i,f&&f.toLive&&g.push(f.toSVG(this)),h&&h.toLive&&g.push(h.toSVG(this)),d&&g.push(d.toSVG(this)),l&&g.push(n),g.push(t.join("")),g.push("</g>\n"),u&&g.push("</g>\n"),o?o(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var t=M.util.object.extend,e="stateProperties";function i(e,i,n){var r={};n.forEach(function(t){r[t]=e[t]}),t(e[i],r,!0)}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<o;r++)if(!n(t[r],e[r]))return!1;return!0}if(t&&"object"==typeof t){var s,a=Object.keys(t);if(!e||"object"!=typeof e||!i&&a.length!==Object.keys(e).length)return!1;for(r=0,o=a.length;r<o;r++)if("canvas"!==(s=a[r])&&"group"!==s&&!n(t[s],e[s]))return!1;return!0}}M.util.object.extend(M.Object.prototype,{hasStateChanged:function(t){var i="_"+(t=t||e);return Object.keys(this[i]).length<this[t].length||!n(this[i],this,!0)},saveState:function(t){var n=t&&t.propertySet||e,r="_"+n;return this[r]?(i(this,r,this[n]),t&&t.stateProperties&&i(this,r,t.stateProperties),this):this.setupState(t)},setupState:function(t){var i=(t=t||{}).propertySet||e;return t.propertySet=i,this["_"+i]={},this.saveState(t),this}})}(),function(){var t=M.util.degreesToRadians;M.util.object.extend(M.Object.prototype,{_findTargetCorner:function(t,e){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var i,n,r,o=t.x,s=t.y,a=Object.keys(this.oCoords),l=a.length-1;for(this.__corner=0;l>=0;l--)if(r=a[l],this.isControlVisible(r)&&(n=this._getImageLines(e?this.oCoords[r].touchCorner:this.oCoords[r].corner),0!==(i=this._findCrossPoints({x:o,y:s},n))&&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,s=void 0!==e.hasControls?e.hasControls:this.hasControls,a=!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),s&&(t.beginPath(),this.forEachControl(function(e,i,n){e.withConnection&&e.getVisibility(n,i)&&(a=!0,t.moveTo(e.x*r,e.y*o),t.lineTo(e.x*r+e.offsetX,e.y*o+e.offsetY))}),a&&t.stroke()),t.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var n=M.util.sizeAfterTransform(this.width,this.height,e),r=this.strokeWidth,o=this.strokeUniform,s=this.borderScaleFactor,a=n.x+r*(o?this.canvas.getZoom():e.scaleX)+s,l=n.y+r*(o?this.canvas.getZoom():e.scaleY)+s;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-a/2,-l/2,a,l),t.restore(),this},drawControls:function(t,e){e=e||{},t.save();var i,n,r=this.canvas.getRetinaScaling();return t.setTransform(r,0,0,r,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(r,o,s){n=s.oCoords[o],r.getVisibility(s,o)&&(i&&(n=M.util.transformPoint(n,i)),r.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(){}})}(),M.util.object.extend(M.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,r=e.onChange||i,o=this;return M.util.animate({startValue:t.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(e){t.set("left",e),o.requestRenderAll(),r()},onComplete:function(){t.setCoords(),n()}}),this},fxCenterObjectV:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,r=e.onChange||i,o=this;return M.util.animate({startValue:t.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(e){t.set("top",e),o.requestRenderAll(),r()},onComplete:function(){t.setCoords(),n()}}),this},fxRemove:function(t,e){var i=function(){},n=(e=e||{}).onComplete||i,r=e.onChange||i,o=this;return M.util.animate({startValue:t.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(e){t.set("opacity",e),o.requestRenderAll(),r()},onComplete:function(){o.remove(t),n()}}),this}}),M.util.object.extend(M.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<r;n++)t=i[n],e=n!==r-1,this._animate(t,arguments[0][t],arguments[1],e)}else this._animate.apply(this,arguments);return this},_animate:function(t,e,i,n){var r,o=this;e=e.toString(),i=i?M.util.object.clone(i):{},~t.indexOf(".")&&(r=t.split("."));var s=o.colorProperties.indexOf(t)>-1||r&&o.colorProperties.indexOf(r[1])>-1,a=r?this.get(r[0])[r[1]]:this.get(t);"from"in i||(i.from=a),s||(e=~e.indexOf("=")?a+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(o,t,e,n)},onChange:function(e,s,a){r?o[r[0]][r[1]]=e:o.set(t,e),n||i.onChange&&i.onChange(e,s,a)},onComplete:function(t,e,r){n||(o.setCoords(),i.onComplete&&i.onComplete(t,e,r))}};return s?M.util.animateColor(l.startValue,l.endValue,l.duration,l):M.util.animate(l)}}),function(t){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,s=e.nearest,a=e.center,l=e.farthest;return function(){switch(this.get(i)){case s:return Math.min(this.get(n),this.get(r));case a:return Math.min(this.get(n),this.get(r))+.5*this.get(o);case l: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),void 0!==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;return{x1:i,x2:t*this.width*-.5,y1:n,y2:e*this.height*-.5}},_toSVG:function(){var t=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',t.x1,'" y1="',t.y1,'" x2="',t.x2,'" y2="',t.y2,'" />\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),s=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];n(new e.Line(s,i(o,r)))},e.Line.fromObject=function(t,i){var r=n(t,!0);r.points=[t.x1,t.y1,t.x2,t.y2],e.Object._fromObject("Line",r,function(t){delete t.points,i&&i(t)},"points")})}(e),function(t){var e=t.fabric||(t.fabric={}),i=Math.PI;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=(this.endAngle-this.startAngle)%(2*i);if(0===n)t=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var r=e.util.cos(this.startAngle)*this.radius,o=e.util.sin(this.startAngle)*this.radius,s=e.util.cos(this.endAngle)*this.radius,a=e.util.sin(this.endAngle)*this.radius,l=n>i?"1":"0";t=['<path d="M '+r+" "+o," A "+this.radius+" "+this.radius," 0 ",+l+" 1"," "+s+" "+a,'" ',"COMMON_PARTS"," />\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 n,r=e.parseAttributes(t,e.Circle.ATTRIBUTE_NAMES);if(!("radius"in(n=r)&&n.radius>=0))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,i(new e.Circle(r))},e.Circle.fromObject=function(t,i){e.Object._fromObject("Circle",t,i)})}(e),function(t){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;return["<polygon ","COMMON_PARTS",'points="',[-t+" "+e,"0 "+-e,t+" "+e].join(","),'" />']}}),e.Triangle.fromObject=function(t,i){return e.Object._fromObject("Triangle",t,i)})}(e),function(t){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)}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["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\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)})}(e),function(t){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,s=-this.height/2,a=0!==e||0!==i,l=.4477152502;t.beginPath(),t.moveTo(o+e,s),t.lineTo(o+n-e,s),a&&t.bezierCurveTo(o+n-l*e,s,o+n,s+l*i,o+n,s+i),t.lineTo(o+n,s+r-i),a&&t.bezierCurveTo(o+n,s+r-l*i,o+n-l*e,s+r,o+n-e,s+r),t.lineTo(o+e,s+r),a&&t.bezierCurveTo(o+l*e,s+r,o,s+r-l*i,o,s+r-i),t.lineTo(o,s+i),a&&t.bezierCurveTo(o,s+l*i,o+l*e,s,o+e,s),t.closePath(),this._renderPaintInOrder(t)},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),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 s=new e.Rect(i(r?e.util.object.clone(r):{},o));s.visible=s.visible&&s.width>0&&s.height>0,n(s)},e.Rect.fromObject=function(t,i){return e.Object._fromObject("Rect",t,i)})}(e),function(t){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)),void 0===t.left&&(this.left=t.fromSVG?i.left:e.x),void 0===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;return{left:e,top:i,width:(r(t,"x")||0)-e,height:(r(t,"y")||0)-i}},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,s=0,a=this.points.length;s<a;s++)t.push(o(this.points[s].x-i,r),",",o(this.points[s].y-n,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',t.join(""),'" />\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<i;o++)e=this.points[o],t.lineTo(e.x-n,e.y-r);return!0},_render:function(t){this.commonRender(t)&&this._renderPaintInOrder(t)},complexity:function(){return this.get("points").length}}),e.Polyline.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polyline.fromElementGenerator=function(t){return function(n,r,o){if(!n)return r(null);o||(o={});var s=e.parsePointsAttribute(n.getAttribute("points")),a=e.parseAttributes(n,e[t].ATTRIBUTE_NAMES);a.fromSVG=!0,r(new e[t](s,i(a,o)))}},e.Polyline.fromElement=e.Polyline.fromElementGenerator("Polyline"),e.Polyline.fromObject=function(t,i){return e.Object._fromObject("Polyline",t,i,"points")})}(e),function(t){var e=t.fabric||(t.fabric={});e.Polygon?e.warn("fabric.Polygon is already defined"):(e.Polygon=e.util.createClass(e.Polyline,{type:"polygon",_render:function(t){this.commonRender(t)&&(t.closePath(),this._renderPaintInOrder(t))}}),e.Polygon.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polygon.fromElement=e.Polyline.fromElementGenerator("Polygon"),e.Polygon.fromObject=function(t,i){e.Object._fromObject("Polygon",t,i,"points")})}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.util.array.min,n=e.util.array.max,r=e.util.object.extend,o=Object.prototype.toString,s=e.util.toFixed;e.Path?e.warn("fabric.Path is already defined"):(e.Path=e.util.createClass(e.Object,{type:"path",path:null,cacheProperties:e.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:e.Object.prototype.stateProperties.concat("path"),initialize:function(t,i){i=i||{},this.callSuper("initialize",i),t||(t=[]);var n="[object Array]"===o.call(t);this.path=e.util.makePathSimpler(n?t:e.util.parsePath(t)),this.path&&e.Polyline.prototype._setPositionDimensions.call(this,i)},_renderPathCommands:function(t){var e,i=0,n=0,r=0,o=0,s=0,a=0,l=-this.pathOffset.x,c=-this.pathOffset.y;t.beginPath();for(var u=0,h=this.path.length;u<h;++u)switch((e=this.path[u])[0]){case"L":r=e[1],o=e[2],t.lineTo(r+l,o+c);break;case"M":i=r=e[1],n=o=e[2],t.moveTo(r+l,o+c);break;case"C":r=e[5],o=e[6],s=e[3],a=e[4],t.bezierCurveTo(e[1]+l,e[2]+c,s+l,a+c,r+l,o+c);break;case"Q":t.quadraticCurveTo(e[1]+l,e[2]+c,e[3]+l,e[4]+c),r=e[3],o=e[4],s=e[1],a=e[2];break;case"z":case"Z":r=i,o=n,t.closePath()}},_render:function(t){this._renderPathCommands(t),this._renderPaintInOrder(t)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},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(){return["<path ","COMMON_PARTS",'d="',e.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var t=e.Object.NUM_FRACTION_DIGITS;return" translate("+s(-this.pathOffset.x,t)+", "+s(-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=[],s=[],a=0,l=0,c=0,u=0,h=0,f=this.path.length;h<f;++h){switch((t=this.path[h])[0]){case"L":c=t[1],u=t[2],r=[];break;case"M":a=c=t[1],l=u=t[2],r=[];break;case"C":r=e.util.getBoundsOfCurve(c,u,t[1],t[2],t[3],t[4],t[5],t[6]),c=t[5],u=t[6];break;case"Q":r=e.util.getBoundsOfCurve(c,u,t[1],t[2],t[1],t[2],t[3],t[4]),c=t[3],u=t[4];break;case"z":case"Z":c=a,u=l}r.forEach(function(t){o.push(t.x),s.push(t.y)}),o.push(c),s.push(u)}var d=i(o)||0,g=i(s)||0;return{left:d,top:g,width:(n(o)||0)-d,height:(n(s)||0)-g}}}),e.Path.fromObject=function(t,i){if("string"==typeof t.sourcePath){var n=t.sourcePath;e.loadSVGFromURL(n,function(e){var n=e[0];n.setOptions(t),i&&i(n)})}else e.Object._fromObject("Path",t,i,"path")},e.Path.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(["d"]),e.Path.fromElement=function(t,i,n){var o=e.parseAttributes(t,e.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,i(new e.Path(o.d,r(o,n)))})}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.util.array.min,n=e.util.array.max;e.Group||(e.Group=e.util.createClass(e.Object,e.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(t,e,i){e=e||{},this._objects=[],i&&this.callSuper("initialize",e),this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(i)this._updateObjectsACoords();else{var r=e&&e.centerPoint;void 0!==e.originX&&(this.originX=e.originX),void 0!==e.originY&&(this.originY=e.originY),r||this._calcBounds(),this._updateObjectsCoords(r),delete e.centerPoint,this.callSuper("initialize",e)}this.setCoords()},_updateObjectsACoords:function(){for(var t=this._objects.length;t--;)this._objects[t].setCoords(!0)},_updateObjectsCoords:function(t){t=t||this.getCenterPoint();for(var e=this._objects.length;e--;)this._updateObjectCoords(this._objects[e],t)},_updateObjectCoords:function(t,e){var i=t.left,n=t.top;t.set({left:i-e.x,top:n-e.y}),t.group=this,t.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},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)for(;n--;)this._objects[n].setOnGroup(t,i);if("canvas"===t)for(;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++)if(this._objects[i].willDrawShadow())return this.ownCaching=!1,!1;return t},willDrawShadow:function(){if(e.Object.prototype.willDrawShadow.call(this))return!0;for(var t=0,i=this._objects.length;t<i;t++)if(this._objects[t].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(t){for(var e=0,i=this._objects.length;e<i;e++)this._objects[e].render(t);this._drawClipPath(t)},isCacheDirty:function(t){if(this.callSuper("isCacheDirty",t))return!0;if(!this.statefullCache)return!1;for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-r/2,n,r)}return!0}return!1},_restoreObjectsState:function(){var t=this.calcOwnMatrix();return this._objects.forEach(function(i){e.util.addTransformToObject(i,t),delete i.group,i.setCoords()}),this},realizeTransform:function(t,i){return e.util.addTransformToObject(t,i),t},destroy:function(){return this._objects.forEach(function(t){t.set("dirty",!0)}),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var t=this._objects,i=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var r=new e.ActiveSelection([]);return r.set(n),r.type="activeSelection",i.remove(this),t.forEach(function(t){t.group=r,t.dirty=!0,i.add(t)}),r.canvas=i,r._objects=t,i._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(t){t.setCoords(!0)}),this},_calcBounds:function(t){for(var e,i,n,r,o=[],s=[],a=["tr","br","bl","tl"],l=0,c=this._objects.length,u=a.length;l<c;++l){for(n=(e=this._objects[l]).calcACoords(),r=0;r<u;r++)i=a[r],o.push(n[i].x),s.push(n[i].y);e.aCoords=n}this._getBounds(o,s,t)},_getBounds:function(t,r,o){var s=new e.Point(i(t),i(r)),a=new e.Point(n(t),n(r)),l=s.y||0,c=s.x||0,u=a.x-s.x||0,h=a.y-s.y||0;this.width=u,this.height=h,o||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(t){for(var e=["<g ","COMMON_PARTS"," >\n"],i=0,n=this._objects.length;i<n;i++)e.push("\t\t",this._objects[i].toSVG(t));return e.push("</g>\n"),e},getSvgStyles:function(){var t=void 0!==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<n;i++)e.push("\t",this._objects[i].toClipPathSVG(t));return this._createBaseClipPathSVGMarkup(e,{reviver:t})}}),e.Group.fromObject=function(t,i){var n=t.objects,r=e.util.object.clone(t,!0);delete r.objects,"string"!=typeof n?e.util.enlivenObjects(n,function(n){e.util.enlivenObjects([t.clipPath],function(r){var o=e.util.object.clone(t,!0);o.clipPath=r[0],delete o.objects,i&&i(new e.Group(n,o,!0))})}):e.loadSVGFromURL(n,function(o){var s=e.util.groupSVGElements(o,t,n);s.set(r),i&&i(s)})})}(e),function(t){var e=t.fabric||(t.fabric={});e.ActiveSelection||(e.ActiveSelection=e.util.createClass(e.Group,{type:"activeSelection",initialize:function(t,i){i=i||{},this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i.originX&&(this.originX=i.originX),i.originY&&(this.originY=i.originY),this._calcBounds(),this._updateObjectsCoords(),e.Object.prototype.initialize.call(this,i),this.setCoords()},toGroup:function(){var t=this._objects.concat();this._objects=[];var i=e.Object.prototype.toObject.call(this),n=new e.Group([]);if(delete i.type,n.set(i),t.forEach(function(t){t.canvas.remove(t),t.group=n}),n._objects=t,!this.canvas)return n;var r=this.canvas;return r.add(n),r._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},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),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n<r;n++)this._objects[n]._renderControls(t,i);t.restore()}}),e.ActiveSelection.fromObject=function(t,i){e.util.enlivenObjects(t.objects,function(n){delete t.objects,i&&i(new e.ActiveSelection(n,t,!0))})})}(e),function(t){var e=M.util.object.extend;t.fabric||(t.fabric={}),t.fabric.Image?M.warn("fabric.Image is already defined."):(M.Image=M.util.createClass(M.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:M.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:M.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(t,e){e||(e={}),this.filters=[],this.cacheKey="texture"+M.Object.__uid++,this.callSuper("initialize",e),this._initElement(t,e)},getElement:function(){return this._element||{}},setElement:function(t,e){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=t,this._originalElement=t,this._initConfig(e),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(t){var e=M.filterBackend;e&&e.evictCachesForKey&&e.evictCachesForKey(t)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(t){M.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var t=this.getElement();return{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}},_stroke:function(t){if(this.stroke&&0!==this.strokeWidth){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,-i),t.lineTo(e,-i),t.lineTo(e,i),t.lineTo(-e,i),t.lineTo(-e,-i),t.closePath()}},toObject:function(t){var i=[];this.filters.forEach(function(t){t&&i.push(t.toObject())});var n=e(this.callSuper("toObject",["cropX","cropY"].concat(t)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:i});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var t,e=[],i=[],n=this._element,r=-this.width/2,o=-this.height/2,s="",a="";if(!n)return[];if(this.hasCrop()){var l=M.Object.__uid++;e.push('<clipPath id="imageCrop_'+l+'">\n','\t<rect x="'+r+'" y="'+o+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),s=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(a='" image-rendering="optimizeSpeed'),i.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',r-this.cropX,'" y="',o-this.cropY,'" width="',n.width||n.naturalWidth,'" height="',n.height||n.height,a,'"',s,"></image>\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,t=["\t<rect ",'x="',r,'" y="',o,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=c}return e="fill"!==this.paintFirst?e.concat(t,i):e.concat(i,t)},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 M.util.loadImage(t,function(t,n){this.setElement(t,i),this._setWidthHeight(),e&&e(this,n)},this,i&&i.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,r=i.scaleY,o=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||n>e&&r>e)return this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,void(this._lastScaleY=r);M.filterBackend||(M.filterBackend=M.initFilterBackend());var s=M.util.createCanvasElement(),a=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=o.width,c=o.height;s.width=l,s.height=c,this._element=s,this._lastScaleX=t.scaleX=n,this._lastScaleY=t.scaleY=r,M.filterBackend.applyFilters([t],o,l,c,this._element,a),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(t){if(t=(t=t||this.filters||[]).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 r=M.util.createCanvasElement();r.width=i,r.height=n,this._element=r,this._filteredEl=r}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return M.filterBackend||(M.filterBackend=M.initFilterBackend()),M.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){M.util.setImageSmoothing(t,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)},drawCacheOnCanvas:function(t){M.util.setImageSmoothing(t,this.imageSmoothing),M.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,s=Math.min,a=Math.max,l=a(this.cropX,0),c=a(this.cropY,0),u=e.naturalWidth||e.width,h=e.naturalHeight||e.height,f=l*i,d=c*n,g=s(r*i,u-f),p=s(o*n,h-d),v=-r/2,m=-o/2,y=s(r,u/i-l),b=s(o,h/n-c);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(M.util.getById(t),e),M.util.addClass(this.getElement(),M.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t)},_initFilters:function(t,e){t&&t.length?M.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=M.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,r=1,o=1,s=0,a=0,l=0,c=0,u=this.width,h=this.height,f={width:u,height:h};return!e||"none"===e.alignX&&"none"===e.alignY?(r=u/i,o=h/n):("meet"===e.meetOrSlice&&(t=(u-i*(r=o=M.util.findScaleToFit(this._element,f)))/2,"Min"===e.alignX&&(s=-t),"Max"===e.alignX&&(s=t),t=(h-n*o)/2,"Min"===e.alignY&&(a=-t),"Max"===e.alignY&&(a=t)),"slice"===e.meetOrSlice&&(t=i-u/(r=o=M.util.findScaleToCover(this._element,f)),"Mid"===e.alignX&&(l=t/2),"Max"===e.alignX&&(l=t),t=n-h/o,"Mid"===e.alignY&&(c=t/2),"Max"===e.alignY&&(c=t),i=u/r,n=h/o)),{width:i,height:n,scaleX:r,scaleY:o,offsetLeft:s,offsetTop:a,cropX:l,cropY:c}}}),M.Image.CSS_CANVAS="canvas-img",M.Image.prototype.getSvgSrc=M.Image.prototype.getSrc,M.Image.fromObject=function(t,e){var i=M.util.object.clone(t);M.util.loadImage(i.src,function(t,n){n?e&&e(null,!0):M.Image.prototype._initFilters.call(i,i.filters,function(n){i.filters=n||[],M.Image.prototype._initFilters.call(i,[i.resizeFilter],function(n){i.resizeFilter=n[0],M.util.enlivenObjects([i.clipPath],function(n){i.clipPath=n[0];var r=new M.Image(t,i);e(r,!1)})})})},null,i.crossOrigin)},M.Image.fromURL=function(t,e,i){M.util.loadImage(t,function(t,n){e&&e(new M.Image(t,i),n)},null,i&&i.crossOrigin)},M.Image.ATTRIBUTE_NAMES=M.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),M.Image.fromElement=function(t,i,n){var r=M.parseAttributes(t,M.Image.ATTRIBUTE_NAMES);M.Image.fromURL(r["xlink:href"],i,e(n?M.util.object.clone(n):{},r))})}(e),M.util.object.extend(M.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){var e=function(){},i=(t=t||{}).onComplete||e,n=t.onChange||e,r=this;return M.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){r.rotate(t),n()},onComplete:function(){r.setCoords(),i()}}),this}}),M.util.object.extend(M.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){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()}M.isWebglSupported=function(e){if(M.isLikelyNode)return!1;e=e||M.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),n=i.getContext("webgl")||i.getContext("experimental-webgl"),r=!1;if(n){M.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),r=M.maxTextureSize>=e;for(var o=["highp","mediump","lowp"],s=0;s<3;s++)if(t(n,o[s])){M.webGlPrecision=o[s];break}}return this.isSupported=r,r},M.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=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(ea){i=!1}var r="undefined"!=typeof ArrayBuffer,o="undefined"!=typeof Uint8ClampedArray;if(n&&i&&r&&o){var s=M.util.createCanvasElement(),a=new ArrayBuffer(t*e*4);if(M.forceGLPutImageData)return this.imageBuffer=a,void(this.copyGLTo2D=k);var l,c,u={imageBuffer:a,destinationWidth:t,destinationHeight:e,targetCanvas:s};s.width=t,s.height=e,l=window.performance.now(),w.call(u,this.gl,u),c=window.performance.now()-l,l=window.performance.now(),k.call(u,this.gl,u),c>window.performance.now()-l?(this.imageBuffer=a,this.copyGLTo2D=k):this.copyGLTo2D=w}},createWebGLCanvas:function(t,e){var i=M.util.createCanvasElement();i.width=t,i.height=e;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},r=i.getContext("webgl",n);r||(r=i.getContext("experimental-webgl",n)),r&&(r.clearColor(0,0,0,0),this.canvas=i,this.gl=r)},applyFilters:function(t,e,i,n,r,o){var s,a=this.gl;o&&(s=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:a,sourceTexture:this.createTexture(a,i,n,!s&&e),targetTexture:this.createTexture(a,i,n),originalTexture:s||this.createTexture(a,i,n,!s&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},c=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,c),t.forEach(function(t){t&&t.applyTo(l)}),function(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)}(l),this.copyGLTo2D(a,l),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(l.sourceTexture),a.deleteTexture(l.targetTexture),a.deleteFramebuffer(c),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(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:w,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(){var t=function(){};function e(){}M.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 s={sourceWidth:i,sourceHeight:n,imageData:o.getImageData(0,0,i,n),originalEl:e,originalImageData:o.getImageData(0,0,i,n),canvasEl:r,ctx:o,filterBackend:this};return t.forEach(function(t){t.applyTo(s)}),s.imageData.width===i&&s.imageData.height===n||(r.width=s.imageData.width,r.height=s.imageData.height),o.putImageData(s.imageData,0,0),s}}}(),M.Image=M.Image||{},M.Image.filters=M.Image.filters||{},M.Image.filters.BaseFilter=M.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"!==M.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+M.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 r=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(r));var o=t.createProgram();if(t.attachShader(o,n),t.attachShader(o,r),t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(o));var s=this.getAttributeLocations(t,o),a=this.getUniformLocations(t,o)||{};return a.uStepW=t.getUniformLocation(o,"uStepW"),a.uStepH=t.getUniformLocation(o,"uStepH"),{program:o,attributeLocations:s,uniformLocations:a}},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=M.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()}}),M.Image.filters.BaseFilter.fromObject=function(t,e){var i=new M.Image.filters[t.type](t);return e&&e(i),i},function(t){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,s=t.imageData.data,a=s.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<a;o+=4)e=s[o],i=s[o+1],n=s[o+2],c?(s[o]=e*l[0]+i*l[1]+n*l[2]+255*l[4],s[o+1]=e*l[5]+i*l[6]+n*l[7]+255*l[9],s[o+2]=e*l[10]+i*l[11]+n*l[12]+255*l[14]):(r=s[o+3],s[o]=e*l[0]+i*l[1]+n*l[2]+r*l[3]+255*l[4],s[o+1]=e*l[5]+i*l[6]+n*l[7]+r*l[8]+255*l[9],s[o+2]=e*l[10]+i*l[11]+n*l[12]+r*l[13]+255*l[14],s[o+3]=e*l[15]+i*l[16]+n*l[17]+r*l[18]+255*l[19])},getUniformLocations:function(t,e){return{uColorMatrix:t.getUniformLocation(e,"uColorMatrix"),uConstants:t.getUniformLocation(e,"uConstants")}},sendUniformData:function(t,e){var i=this.matrix,n=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],r=[i[4],i[9],i[14],i[19]];t.uniformMatrix4fv(e.uColorMatrix,!1,n),t.uniform4fv(e.uConstants,r)}}),e.Image.filters.ColorMatrix.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Brightness=n(i.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(t){if(0!==this.brightness){var e,i=t.imageData.data,n=i.length,r=Math.round(255*this.brightness);for(e=0;e<n;e+=4)i[e]=i[e]+r,i[e+1]=i[e+1]+r,i[e+2]=i[e+2]+r}},getUniformLocations:function(t,e){return{uBrightness:t.getUniformLocation(e,"uBrightness")}},sendUniformData:function(t,e){t.uniform1f(e.uBrightness,this.brightness)}}),e.Image.filters.Brightness.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Convolute=r(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(t){var e=Math.sqrt(this.matrix.length),i=this.type+"_"+e+"_"+(this.opaque?1:0),n=this.fragmentSource[i];return t.programCache.hasOwnProperty(i)||(t.programCache[i]=this.createProgram(t.context,n)),t.programCache[i]},applyTo2d:function(t){var e,i,n,r,o,s,a,l,c,u,h,f,d,g=t.imageData,p=g.data,v=this.matrix,m=Math.round(Math.sqrt(v.length)),y=Math.floor(m/2),b=g.width,x=g.height,_=t.ctx.createImageData(b,x),C=_.data,I=this.opaque?1:0;for(h=0;h<x;h++)for(u=0;u<b;u++){for(o=4*(h*b+u),e=0,i=0,n=0,r=0,d=0;d<m;d++)for(f=0;f<m;f++)s=u+f-y,(a=h+d-y)<0||a>=x||s<0||s>=b||(l=4*(a*b+s),c=v[d*m+f],e+=p[l]*c,i+=p[l+1]*c,n+=p[l+2]*c,I||(r+=p[l+3]*c));C[o]=e,C[o+1]=i,C[o+2]=n,C[o+3]=I?p[o+3]:r}t.imageData=_},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}(e),function(t){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.data,r=n.length,o=this.mode;for(e=0;e<r;e+=4)"average"===o?i=(n[e]+n[e+1]+n[e+2])/3:"lightness"===o?i=(Math.min(n[e],n[e+1],n[e+2])+Math.max(n[e],n[e+1],n[e+2]))/2:"luminosity"===o&&(i=.21*n[e]+.72*n[e+1]+.07*n[e+2]),n[e]=i,n[e+1]=i,n[e+2]=i},retrieveShader:function(t){var e=this.type+"_"+this.mode;if(!t.programCache.hasOwnProperty(e)){var i=this.fragmentSource[this.mode];t.programCache[e]=this.createProgram(t.context,i)}return t.programCache[e]},getUniformLocations:function(t,e){return{uMode:t.getUniformLocation(e,"uMode")}},sendUniformData:function(t,e){t.uniform1i(e.uMode,1)},isNeutralState:function(){return!1}}),e.Image.filters.Grayscale.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Invert=n(i.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(t){var e,i=t.imageData.data,n=i.length;for(e=0;e<n;e+=4)i[e]=255-i[e],i[e+1]=255-i[e+1],i[e+2]=255-i[e+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(t,e){return{uInvert:t.getUniformLocation(e,"uInvert")}},sendUniformData:function(t,e){t.uniform1i(e.uInvert,this.invert)}}),e.Image.filters.Invert.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Noise=r(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(t){if(0!==this.noise){var e,i,n=t.imageData.data,r=n.length,o=this.noise;for(e=0,r=n.length;e<r;e+=4)i=(.5-Math.random())*o,n[e]+=i,n[e+1]+=i,n[e+2]+=i}},getUniformLocations:function(t,e){return{uNoise:t.getUniformLocation(e,"uNoise"),uSeed:t.getUniformLocation(e,"uSeed")}},sendUniformData:function(t,e){t.uniform1f(e.uNoise,this.noise/255),t.uniform1f(e.uSeed,Math.random())},toObject:function(){return i(this.callSuper("toObject"),{noise:this.noise})}}),e.Image.filters.Noise.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Pixelate=n(i.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(t){var e,i,n,r,o,s,a,l,c,u,h,f=t.imageData,d=f.data,g=f.height,p=f.width;for(i=0;i<g;i+=this.blocksize)for(n=0;n<p;n+=this.blocksize)for(r=d[e=4*i*p+4*n],o=d[e+1],s=d[e+2],a=d[e+3],u=Math.min(i+this.blocksize,g),h=Math.min(n+this.blocksize,p),l=i;l<u;l++)for(c=n;c<h;c++)d[e=4*l*p+4*c]=r,d[e+1]=o,d[e+2]=s,d[e+3]=a},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(t,e){return{uBlocksize:t.getUniformLocation(e,"uBlocksize"),uStepW:t.getUniformLocation(e,"uStepW"),uStepH:t.getUniformLocation(e,"uStepH")}},sendUniformData:function(t,e){t.uniform1f(e.uBlocksize,this.blocksize)}}),e.Image.filters.Pixelate.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.RemoveColor=r(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(t){var i,n,r,o,s=t.imageData.data,a=255*this.distance,l=new e.Color(this.color).getSource(),c=[l[0]-a,l[1]-a,l[2]-a],u=[l[0]+a,l[1]+a,l[2]+a];for(i=0;i<s.length;i+=4)n=s[i],r=s[i+1],o=s[i+2],n>c[0]&&r>c[1]&&o>c[2]&&n<u[0]&&r<u[1]&&o<u[2]&&(s[i+3]=0)},getUniformLocations:function(t,e){return{uLow:t.getUniformLocation(e,"uLow"),uHigh:t.getUniformLocation(e,"uHigh")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource(),r=parseFloat(this.distance),o=[0+n[0]/255-r,0+n[1]/255-r,0+n[2]/255-r,1],s=[n[0]/255+r,n[1]/255+r,n[2]/255+r,1];t.uniform4fv(i.uLow,o),t.uniform4fv(i.uHigh,s)},toObject:function(){return i(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),e.Image.filters.RemoveColor.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var o in r)i[o]=n(i.ColorMatrix,{type:o,matrix:r[o],mainParameter:!1,colorsOnly:!0}),e.Image.filters[o].fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendColor=n(i.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(t){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[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,s,a,l,c=t.imageData.data,u=c.length,h=1-this.alpha;i=(l=new e.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,r=l[2]*this.alpha;for(var f=0;f<u;f+=4)switch(o=c[f],s=c[f+1],a=c[f+2],this.mode){case"multiply":c[f]=o*i/255,c[f+1]=s*n/255,c[f+2]=a*r/255;break;case"screen":c[f]=255-(255-o)*(255-i)/255,c[f+1]=255-(255-s)*(255-n)/255,c[f+2]=255-(255-a)*(255-r)/255;break;case"add":c[f]=o+i,c[f+1]=s+n,c[f+2]=a+r;break;case"diff":case"difference":c[f]=Math.abs(o-i),c[f+1]=Math.abs(s-n),c[f+2]=Math.abs(a-r);break;case"subtract":c[f]=o-i,c[f+1]=s-n,c[f+2]=a-r;break;case"darken":c[f]=Math.min(o,i),c[f+1]=Math.min(s,n),c[f+2]=Math.min(a,r);break;case"lighten":c[f]=Math.max(o,i),c[f+1]=Math.max(s,n),c[f+2]=Math.max(a,r);break;case"overlay":c[f]=i<128?2*o*i/255:255-2*(255-o)*(255-i)/255,c[f+1]=n<128?2*s*n/255:255-2*(255-s)*(255-n)/255,c[f+2]=r<128?2*a*r/255:255-2*(255-a)*(255-r)/255;break;case"exclusion":c[f]=i+o-2*i*o/255,c[f+1]=n+s-2*n*s/255,c[f+2]=r+a-2*r*a/255;break;case"tint":c[f]=i+o*h,c[f+1]=n+s*h,c[f+2]=r+a*h}},getUniformLocations:function(t,e){return{uColor:t.getUniformLocation(e,"uColor")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,t.uniform4fv(i.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),e.Image.filters.BlendColor.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendImage=n(i.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(t){var e=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return t.programCache.hasOwnProperty(e)||(t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyToWebGL:function(t){var e=t.context,i=this.createTexture(t.filterBackend,this.image);this.bindAdditionalTexture(e,i,e.TEXTURE1),this.callSuper("applyToWebGL",t),this.unbindAdditionalTexture(e,e.TEXTURE1)},createTexture:function(t,e){return t.getCachedTexture(e.cacheKey,e._element)},calculateMatrix:function(){var t=this.image,e=t._element.width,i=t._element.height;return[1/t.scaleX,0,0,0,1/t.scaleY,0,-t.left/e,-t.top/i,1]},applyTo2d:function(t){var i,n,r,o,s,a,l,c,u,h,f,d=t.imageData,g=t.filterBackend.resources,p=d.data,v=p.length,m=d.width,y=d.height,b=this.image;g.blendImage||(g.blendImage=e.util.createCanvasElement()),h=(u=g.blendImage).getContext("2d"),u.width!==m||u.height!==y?(u.width=m,u.height=y):h.clearRect(0,0,m,y),h.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),h.drawImage(b._element,0,0,m,y),f=h.getImageData(0,0,m,y).data;for(var x=0;x<v;x+=4)switch(s=p[x],a=p[x+1],l=p[x+2],c=p[x+3],i=f[x],n=f[x+1],r=f[x+2],o=f[x+3],this.mode){case"multiply":p[x]=s*i/255,p[x+1]=a*n/255,p[x+2]=l*r/255,p[x+3]=c*o/255;break;case"mask":p[x+3]=o}},getUniformLocations:function(t,e){return{uTransformMatrix:t.getUniformLocation(e,"uTransformMatrix"),uImage:t.getUniformLocation(e,"uImage")}},sendUniformData:function(t,e){var i=this.calculateMatrix();t.uniform1i(e.uImage,1),t.uniformMatrix3fv(e.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),e.Image.filters.BlendImage.fromObject=function(t,i){e.Image.fromObject(t.image,function(n){var r=e.util.object.clone(t);r.image=n,i(new e.Image.filters.BlendImage(r))})}}(e),function(t){var e=t.fabric||(t.fabric={}),i=Math.pow,n=Math.floor,r=Math.sqrt,o=Math.abs,s=Math.round,a=Math.sin,l=Math.ceil,c=e.Image.filters,u=e.util.createClass;c.Resize=u(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(t,e){return{uDelta:t.getUniformLocation(e,"uDelta"),uTaps:t.getUniformLocation(e,"uTaps")}},sendUniformData:function(t,e){t.uniform2fv(e.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),t.uniform1fv(e.uTaps,this.taps)},retrieveShader:function(t){var e=this.getFilterWindow(),i=this.type+"_"+e;if(!t.programCache.hasOwnProperty(i)){var n=this.generateShader(e);t.programCache[i]=this.createProgram(t.context,n)}return t.programCache[i]},getFilterWindow:function(){var t=this.tempScale;return Math.ceil(this.lanczosLobes/t)},getTaps:function(){for(var t=this.lanczosCreate(this.lanczosLobes),e=this.tempScale,i=this.getFilterWindow(),n=new Array(i),r=1;r<=i;r++)n[r-1]=t(r*e);return n},generateShader:function(t){for(var e=new Array(t),i=this.fragmentSourceTOP,n=1;n<=t;n++)e[n-1]=n+".0 * uDelta";return i+="uniform float uTaps["+t+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",e.forEach(function(t,e){i+=" color += texture2D(uTexture, vTexCoord + "+t+") * uTaps["+e+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+t+") * uTaps["+e+"];\n",i+=" sum += 2.0 * uTaps["+e+"];\n"}),i+=" gl_FragColor = color / sum;\n",i+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(t){t.webgl?(t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceHeight=t.destinationHeight):this.applyTo2d(t)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(t){return function(e){if(e>=t||e<=-t)return 0;if(e<1.1920929e-7&&e>-1.1920929e-7)return 1;var i=(e*=Math.PI)/t;return a(e)/e*a(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,a=e.height,l=s(o*i),c=s(a*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(t,o,a,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(t,o,a,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(t,o,a,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(t,o,a,l,c)),t.imageData=r},sliceByTwo:function(t,i,r,o,s){var a,l,c=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;for(p.sliceByTwo||(p.sliceByTwo=document.createElement("canvas")),((a=p.sliceByTwo).width<1.5*i||a.height<r)&&(a.width=1.5*i,a.height=r),(l=a.getContext("2d")).clearRect(0,0,1.5*i,r),l.putImageData(c,0,0),o=n(o),s=n(s);!h||!f;)i=d,r=g,o<n(d*u)?d=n(d*u):(d=o,h=!0),s<n(g*u)?g=n(g*u):(g=s,f=!0),l.drawImage(a,v,m,i,r,y,b,d,g),v=y,m=b,b+=g;return l.getImageData(v,m,o,s)},lanczosResize:function(t,e,s,a,c){var u=t.imageData.data,h=t.ctx.createImageData(a,c),f=h.data,d=this.lanczosCreate(this.lanczosLobes),g=this.rcpScaleX,p=this.rcpScaleY,v=2/this.rcpScaleX,m=2/this.rcpScaleY,y=l(g*this.lanczosLobes/2),b=l(p*this.lanczosLobes/2),x={},_={},C={};return function t(l){var I,M,S,w,k,T,D,A,E,O,j;for(_.x=(l+.5)*g,C.x=n(_.x),I=0;I<c;I++){for(_.y=(I+.5)*p,C.y=n(_.y),k=0,T=0,D=0,A=0,E=0,M=C.x-y;M<=C.x+y;M++)if(!(M<0||M>=e)){O=n(1e3*o(M-_.x)),x[O]||(x[O]={});for(var L=C.y-b;L<=C.y+b;L++)L<0||L>=s||(j=n(1e3*o(L-_.y)),x[O][j]||(x[O][j]=d(r(i(O*v,2)+i(j*m,2))/1e3)),(S=x[O][j])>0&&(k+=S,T+=S*u[w=4*(L*e+M)],D+=S*u[w+1],A+=S*u[w+2],E+=S*u[w+3]))}f[w=4*(I*a+l)]=T/k,f[w+1]=D/k,f[w+2]=A/k,f[w+3]=E/k}return++l<a?t(l):h}(0)},bilinearFiltering:function(t,e,i,r,o){var s,a,l,c,u,h,f,d,g,p=0,v=this.rcpScaleX,m=this.rcpScaleY,y=4*(e-1),b=t.imageData.data,x=t.ctx.createImageData(r,o),_=x.data;for(l=0;l<o;l++)for(c=0;c<r;c++)for(u=v*c-(s=n(v*c)),h=m*l-(a=n(m*l)),g=4*(a*e+s),f=0;f<4;f++)d=b[g+f]*(1-u)*(1-h)+b[g+4+f]*u*(1-h)+b[g+y+f]*h*(1-u)+b[g+y+4+f]*u*h,_[p++]=d;return x},hermiteFastResize:function(t,e,i,s,a){for(var c=this.rcpScaleX,u=this.rcpScaleY,h=l(c/2),f=l(u/2),d=t.imageData.data,g=t.ctx.createImageData(s,a),p=g.data,v=0;v<a;v++)for(var m=0;m<s;m++){for(var y=4*(m+v*s),b=0,x=0,_=0,C=0,I=0,M=0,S=0,w=(v+.5)*u,k=n(v*u);k<(v+1)*u;k++)for(var T=o(w-(k+.5))/f,D=(m+.5)*c,A=T*T,E=n(m*c);E<(m+1)*c;E++){var O=o(D-(E+.5))/h,j=r(A+O*O);j>1&&j<-1||(b=2*j*j*j-3*j*j+1)>0&&(S+=b*d[3+(O=4*(E+k*e))],_+=b,d[O+3]<255&&(b=b*d[O+3]/250),C+=b*d[O],I+=b*d[O+1],M+=b*d[O+2],x+=b)}p[y]=C/x,p[y+1]=I/x,p[y+2]=M/x,p[y+3]=S/_}return g},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}(e),function(t){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.data,n=i.length,r=Math.floor(255*this.contrast),o=259*(r+255)/(255*(259-r));for(e=0;e<n;e+=4)i[e]=o*(i[e]-128)+128,i[e+1]=o*(i[e+1]-128)+128,i[e+2]=o*(i[e+2]-128)+128}},getUniformLocations:function(t,e){return{uContrast:t.getUniformLocation(e,"uContrast")}},sendUniformData:function(t,e){t.uniform1f(e.uContrast,this.contrast)}}),e.Image.filters.Contrast.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Saturation=n(i.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(t){if(0!==this.saturation){var e,i,n=t.imageData.data,r=n.length,o=-this.saturation;for(e=0;e<r;e+=4)i=Math.max(n[e],n[e+1],n[e+2]),n[e]+=i!==n[e]?(i-n[e])*o:0,n[e+1]+=i!==n[e+1]?(i-n[e+1])*o:0,n[e+2]+=i!==n[e+2]?(i-n[e+2])*o:0}},getUniformLocations:function(t,e){return{uSaturation:t.getUniformLocation(e,"uSaturation")}},sendUniformData:function(t,e){t.uniform1f(e.uSaturation,-this.saturation)}}),e.Image.filters.Saturation.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Vibrance=n(i.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(t){if(0!==this.vibrance){var e,i,n,r,o=t.imageData.data,s=o.length,a=-this.vibrance;for(e=0;e<s;e+=4)i=Math.max(o[e],o[e+1],o[e+2]),n=(o[e]+o[e+1]+o[e+2])/3,r=2*Math.abs(i-n)/255*a,o[e]+=i!==o[e]?(i-o[e])*r:0,o[e+1]+=i!==o[e+1]?(i-o[e+1])*r:0,o[e+2]+=i!==o[e+2]?(i-o[e+2])*r:0}},getUniformLocations:function(t,e){return{uVibrance:t.getUniformLocation(e,"uVibrance")}},sendUniformData:function(t,e){t.uniform1f(e.uVibrance,-this.vibrance)}}),e.Image.filters.Vibrance.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Blur=n(i.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(t){t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},applyTo2d:function(t){t.imageData=this.simpleBlur(t)},simpleBlur:function(t){var i,n,r=t.filterBackend.resources,o=t.imageData.width,s=t.imageData.height;r.blurLayer1||(r.blurLayer1=e.util.createCanvasElement(),r.blurLayer2=e.util.createCanvasElement()),i=r.blurLayer1,n=r.blurLayer2,i.width===o&&i.height===s||(n.width=i.width=o,n.height=i.height=s);var a,l,c,u,h=i.getContext("2d"),f=n.getContext("2d"),d=15,g=.06*this.blur*.5;for(h.putImageData(t.imageData,0,0),f.clearRect(0,0,o,s),u=-15;u<=d;u++)c=g*(l=u/d)*o+(a=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,c,a),h.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);for(u=-15;u<=d;u++)c=g*(l=u/d)*s+(a=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,a,c),h.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);t.ctx.drawImage(i,0,0);var p=t.ctx.getImageData(0,0,i.width,i.height);return h.globalAlpha=1,h.clearRect(0,0,i.width,i.height),p},getUniformLocations:function(t,e){return{delta:t.getUniformLocation(e,"uDelta")}},sendUniformData:function(t,e){var i=this.chooseRightDelta();t.uniform2fv(e.delta,i)},chooseRightDelta:function(){var t,e=1,i=[0,0];return this.horizontal?this.aspectRatio>1&&(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}(e),function(t){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.data,n=this.gamma,r=i.length,o=1/n[0],s=1/n[1],a=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,r=256;e<r;e++)this.rVals[e]=255*Math.pow(e/255,o),this.gVals[e]=255*Math.pow(e/255,s),this.bVals[e]=255*Math.pow(e/255,a);for(e=0,r=i.length;e<r;e+=4)i[e]=this.rVals[i[e]],i[e+1]=this.gVals[i[e+1]],i[e+2]=this.bVals[i[e+2]]},getUniformLocations:function(t,e){return{uGamma:t.getUniformLocation(e,"uGamma")}},sendUniformData:function(t,e){t.uniform3fv(e.uGamma,this.gamma)}}),e.Image.filters.Gamma.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Composed=n(i.BaseFilter,{type:"Composed",subFilters:[],initialize:function(t){this.callSuper("initialize",t),this.subFilters=this.subFilters.slice(0)},applyTo:function(t){t.passes+=this.subFilters.length-1,this.subFilters.forEach(function(e){e.applyTo(t)})},toObject:function(){return e.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(t){return t.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(t){return!t.isNeutralState()})}}),e.Image.filters.Composed.fromObject=function(t,i){var n=(t.subFilters||[]).map(function(t){return new e.Image.filters[t.type](t)}),r=new e.Image.filters.Composed({subFilters:n});return i&&i(r),r}}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.HueRotation=n(i.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var t=this.rotation*Math.PI,i=e.util.cos(t),n=e.util.sin(t),r=1/3,o=Math.sqrt(r)*n,s=1-i;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=i+s/3,this.matrix[1]=r*s-o,this.matrix[2]=r*s+o,this.matrix[5]=r*s+o,this.matrix[6]=i+r*s,this.matrix[7]=r*s-o,this.matrix[10]=r*s-o,this.matrix[11]=r*s+o,this.matrix[12]=i+r*s},isNeutralState:function(t){return this.calculateMatrix(),i.BaseFilter.prototype.isNeutralState.call(this,t)},applyTo:function(t){this.calculateMatrix(),i.BaseFilter.prototype.applyTo.call(this,t)}}),e.Image.filters.HueRotation.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){var e=t.fabric||(t.fabric={}),i=e.util.object.clone;if(e.Text)e.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");e.Text=e.util.createClass(e.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:e.Object.prototype.stateProperties.concat(n),cacheProperties:e.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(t,e){this.styles=e&&e.styles||{},this.text=t,this.__skipDimension=!0,this.callSuper("initialize",e),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var t=this.path;t&&(t.segmentsInfo=e.util.getPathSegmentsInfo(t.path))},getMeasuringContext:function(){return e._measuringContext||(e._measuringContext=this.canvas&&this.canvas.contextCache||e.util.createCanvasElement().getContext("2d")),e._measuringContext},_splitText:function(){var t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var t,e,i,n,r,o,s,a=0,l=this._textLines.length;a<l;a++)if(("justify"===this.textAlign||a!==l-1&&!this.isEndOfWrapping(a))&&(n=0,r=this._textLines[a],(e=this.getLineWidth(a))<this.width&&(s=this.textLines[a].match(this._reSpacesAndTabs)))){i=s.length,t=(this.width-e)/i;for(var c=0,u=r.length;c<=u;c++)o=this.__charBounds[a][c],this._reSpaceAndTab.test(r[c])?(o.width+=t,o.kernedWidth+=t,o.left+=n,n+=t):o.left+=n}},isEndOfWrapping:function(t){return t===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_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;e<i;e++){var n=this.getLineWidth(e);n>t&&(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,s,a,l=t.fillStyle,c=this._getLeftOffset(),u=this._getTopOffset(),h=0,f=0,d=this.path,g=0,p=this._textLines.length;g<p;g++)if(e=this.getHeightOfLine(g),this.textBackgroundColor||this.styleHas("textBackgroundColor",g)){n=this._textLines[g],i=this._getLineLeftOffset(g),f=0,h=0,r=this.getValueOfPropertyAt(g,0,"textBackgroundColor");for(var v=0,m=n.length;v<m;v++)o=this.__charBounds[g][v],s=this.getValueOfPropertyAt(g,v,"textBackgroundColor"),d?(t.save(),t.translate(o.renderLeft,o.renderTop),t.rotate(o.angle),t.fillStyle=s,s&&t.fillRect(-o.width/2,-e/this.lineHeight*(1-this._fontSizeFraction),o.width,e/this.lineHeight),t.restore()):s!==r?(a=c+i+h,"rtl"===this.direction&&(a=this.width-a-f),t.fillStyle=r,r&&t.fillRect(a,u,f,e/this.lineHeight),h=o.left,f=o.width,r=s):f+=o.kernedWidth;s&&!d&&(a=c+i+h,"rtl"===this.direction&&(a=this.width-a-f),t.fillStyle=s,t.fillRect(a,u,f,e/this.lineHeight)),u+=e}else u+=e;t.fillStyle=l,this._removeShadow(t)}},getFontCache:function(t){var i=t.fontFamily.toLowerCase();e.charWidthsCache[i]||(e.charWidthsCache[i]={});var n=e.charWidthsCache[i],r=t.fontStyle.toLowerCase()+"_"+(t.fontWeight+"").toLowerCase();return n[r]||(n[r]={}),n[r]},_measureChar:function(t,e,i,n){var r,o,s,a,l=this.getFontCache(e),c=i+t,u=this._getFontDeclaration(e)===this._getFontDeclaration(n),h=e.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==l[i]&&(s=l[i]),void 0!==l[t]&&(a=r=l[t]),u&&void 0!==l[c]&&(a=(o=l[c])-s),void 0===r||void 0===s||void 0===o){var f=this.getMeasuringContext();this._setTextStyles(f,e,!0)}return void 0===r&&(a=r=f.measureText(t).width,l[t]=r),void 0===s&&u&&i&&(s=f.measureText(i).width,l[i]=s),u&&void 0===o&&(o=f.measureText(c).width,l[c]=o,a=o-s),{width:r*h,kernedWidth:a*h}},getHeightOfChar:function(t,e){return this.getValueOfPropertyAt(t,e,"fontSize")},measureLine:function(t){var e=this._measureLine(t);return 0!==this.charSpacing&&(e.width-=this._getWidthOfCharSpacing()),e.width<0&&(e.width=0),e},_measureLine:function(t){var i,n,r,o,s,a,l=0,c=this._textLines[t],u=new Array(c.length),h=0,f=this.path,d="right"===this.pathSide;for(this.__charBounds[t]=u,i=0;i<c.length;i++)n=c[i],o=this._getGraphemeBox(n,t,i,r),u[i]=o,l+=o.kernedWidth,r=n;if(u[i]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},f){switch(a=f.segmentsInfo[f.segmentsInfo.length-1].length,(s=e.util.getPointOnPath(f.path,0,f.segmentsInfo)).x+=f.pathOffset.x,s.y+=f.pathOffset.y,this.textAlign){case"left":h=d?a-l:0;break;case"center":h=(a-l)/2;break;case"right":h=d?0:a-l}for(h+=this.pathStartOffset*(d?-1:1),i=d?c.length-1:0;d?i>=0:i<c.length;d?i--:i++)o=u[i],h>a?h%=a:h<0&&(h+=a),this._setGraphemeOnPath(h,o,s),h+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(t,i,n){var r=t+i.kernedWidth/2,o=this.path,s=e.util.getPointOnPath(o.path,r,o.segmentsInfo);i.renderLeft=s.x-n.x,i.renderTop=s.y-n.y,i.angle=s.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(t,e,i,n,r){var o,s=this.getCompleteStyleDeclaration(e,i),a=n?this.getCompleteStyleDeclaration(e,i-1):{},l=this._measureChar(t,s,n,a),c=l.kernedWidth,u=l.width;0!==this.charSpacing&&(u+=o=this._getWidthOfCharSpacing(),c+=o);var h={width:u,left:0,height:s.fontSize,kernedWidth:c,deltaY:s.deltaY};if(i>0&&!r){var f=this.__charBounds[e][i-1];h.left=f.left+f.width+l.kernedWidth-l.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;n<r;n++)i=Math.max(this.getHeightOfChar(t,n),i);return this.__lineHeights[t]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var t,e=0,i=0,n=this._textLines.length;i<n;i++)t=this.getHeightOfLine(i),e+=i===n-1?t/this.lineHeight:t;return e},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(t,e){t.save();for(var i=0,n=this._getLeftOffset(),r=this._getTopOffset(),o=0,s=this._textLines.length;o<s;o++){var a=this.getHeightOfLine(o),l=a/this.lineHeight,c=this._getLineLeftOffset(o);this._renderTextLine(e,t,this._textLines[o],n+c,r+i+l,o),i+=a}t.restore()},_renderTextFill:function(t){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(t,"fillText")},_renderTextStroke:function(t){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this._setLineDash(t,this.strokeDashArray),t.beginPath(),this._renderTextCommon(t,"strokeText"),t.closePath(),t.restore())},_renderChars:function(t,e,i,n,r,o){var s,a,l,c,u,h=this.getHeightOfLine(o),f=-1!==this.textAlign.indexOf("justify"),d="",g=0,p=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(o)&&!p,m="ltr"===this.direction,y="ltr"===this.direction?1:-1;if(e.save(),r-=h*this._fontSizeFraction/this.lineHeight,v)return e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right",this._renderChar(t,e,o,0,i.join(""),n,r,h),void e.restore();for(var b=0,x=i.length-1;b<=x;b++)c=b===x||this.charSpacing||p,d+=i[b],l=this.__charBounds[o][b],0===g?(n+=y*(l.kernedWidth-l.width),g+=l.width):g+=l.kernedWidth,f&&!c&&this._reSpaceAndTab.test(i[b])&&(c=!0),c||(s=s||this.getCompleteStyleDeclaration(o,b),a=this.getCompleteStyleDeclaration(o,b+1),c=this._hasStyleChanged(s,a)),c&&(p?(e.save(),e.translate(l.renderLeft,l.renderTop),e.rotate(l.angle),this._renderChar(t,e,o,b,d,-g/2,0,h),e.restore()):(u=n,e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right",this._renderChar(t,e,o,b,d,u,r,h)),d="",s=a,n+=y*g,g=0);e.restore()},_applyPatternGradientTransformText:function(t){var i,n=e.util.createCanvasElement(),r=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return n.width=r,n.height=o,(i=n.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(r,0),i.lineTo(r,o),i.lineTo(0,o),i.closePath(),i.translate(r/2,o/2),i.fillStyle=t.toLive(i),this._applyPatternGradientTransform(i,t),i.fill(),i.createPattern(n,"no-repeat")},handleFiller:function(t,e,i){var n,r;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(n=-this.width/2,r=-this.height/2,t.translate(n,r),t[e]=this._applyPatternGradientTransformText(i),{offsetX:n,offsetY:r}):(t[e]=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):(t[e]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(t,e){return t.lineWidth=e.strokeWidth,t.lineCap=this.strokeLineCap,t.lineDashOffset=this.strokeDashOffset,t.lineJoin=this.strokeLineJoin,t.miterLimit=this.strokeMiterLimit,this.handleFiller(t,"strokeStyle",e.stroke)},_setFillStyles:function(t,e){return this.handleFiller(t,"fillStyle",e.fill)},_renderChar:function(t,e,i,n,r,o,s){var a,l,c=this._getStyleDeclaration(i,n),u=this.getCompleteStyleDeclaration(i,n),h="fillText"===t&&u.fill,f="strokeText"===t&&u.stroke&&u.strokeWidth;(f||h)&&(e.save(),h&&(a=this._setFillStyles(e,u)),f&&(l=this._setStrokeStyles(e,u)),e.font=this._getFontDeclaration(u),c&&c.textBackgroundColor&&this._removeShadow(e),c&&c.deltaY&&(s+=c.deltaY),h&&e.fillText(r,o-a.offsetX,s-a.offsetY),f&&e.strokeText(r,o-l.offsetX,s-l.offsetY),e.restore())},setSuperscript:function(t,e){return this._setScript(t,e,this.superscript)},setSubscript:function(t,e){return this._setScript(t,e,this.subscript)},_setScript:function(t,e,i){var n=this.get2DCursorLocation(t,!0),r=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),o=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),s={fontSize:r*i.size,deltaY:o+r*i.baseline};return this.setSelectionStyles(s,t,e),this},_hasStyleChanged:function(t,e){return t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.deltaY!==e.deltaY},_hasStyleChangedForSvg:function(t,e){return this._hasStyleChanged(t,e)||t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough},_getLineLeftOffset:function(t){var e=this.getLineWidth(t),i=this.width-e,n=this.textAlign,r=this.direction,o=0,s=this.isEndOfWrapping(t);return"justify"===n||"justify-center"===n&&!s||"justify-right"===n&&!s||"justify-left"===n&&!s?0:("center"===n&&(o=i/2),"right"===n&&(o=i),"justify-center"===n&&(o=i/2),"justify-right"===n&&(o=i),"rtl"===r&&(o-=i),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var t=this._forceClearCache;return t||(t=this.hasStateChanged("_dimensionAffectingProps")),t&&(this.dirty=!0,this._forceClearCache=!1),t},getLineWidth:function(t){return this.__lineWidths[t]?this.__lineWidths[t]:(e=""===this._textLines[t]?0:this.measureLine(t).width,this.__lineWidths[t]=e,e);var e},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(t,e,i){var n=this._getStyleDeclaration(t,e);return n&&void 0!==n[i]?n[i]:this[i]},_renderTextDecoration:function(t,e){if(this[e]||this.styleHas(e)){for(var i,n,r,o,s,a,l,c,u,h,f,d,g,p,v,m,y=this._getLeftOffset(),b=this._getTopOffset(),x=this.path,_=this._getWidthOfCharSpacing(),C=this.offsets[e],I=0,M=this._textLines.length;I<M;I++)if(i=this.getHeightOfLine(I),this[e]||this.styleHas(e,I)){l=this._textLines[I],p=i/this.lineHeight,o=this._getLineLeftOffset(I),h=0,f=0,c=this.getValueOfPropertyAt(I,0,e),m=this.getValueOfPropertyAt(I,0,"fill"),u=b+p*(1-this._fontSizeFraction),n=this.getHeightOfChar(I,0),s=this.getValueOfPropertyAt(I,0,"deltaY");for(var S=0,w=l.length;S<w;S++)if(d=this.__charBounds[I][S],g=this.getValueOfPropertyAt(I,S,e),v=this.getValueOfPropertyAt(I,S,"fill"),r=this.getHeightOfChar(I,S),a=this.getValueOfPropertyAt(I,S,"deltaY"),x&&g&&v)t.save(),t.fillStyle=m,t.translate(d.renderLeft,d.renderTop),t.rotate(d.angle),t.fillRect(-d.kernedWidth/2,C*r+a,d.kernedWidth,this.fontSize/15),t.restore();else if((g!==c||v!==m||r!==n||a!==s)&&f>0){var k=y+o+h;"rtl"===this.direction&&(k=this.width-k-f),c&&m&&(t.fillStyle=m,t.fillRect(k,u+C*n+s,f,this.fontSize/15)),h=d.left,f=d.width,c=g,m=v,n=r,s=a}else f+=d.kernedWidth;k=y+o+h,"rtl"===this.direction&&(k=this.width-k-f),t.fillStyle=v,g&&v&&t.fillRect(k,u+C*n+s,f-_,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,s=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",s].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=[],s=0;s<i.length;s++)n[s]=e.util.string.graphemeSplit(i[s]),o=o.concat(n[s],r);return o.pop(),{_unwrappedLines:n,lines:i,graphemeText:o,graphemeLines:n}},toObject:function(t){var e=n.concat(t),r=this.callSuper("toObject",e);return r.styles=i(this.styles,!0),r.path&&(r.path=this.path.toObject()),r},set:function(t,e){this.callSuper("set",t,e);var i=!1,n=!1;if("object"==typeof t)for(var r in t)"path"===r&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(r),n=n||"path"===r;else i=-1!==this._dimensionAffectingProps.indexOf(t),n="path"===t;return n&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),e.Text.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),e.Text.DEFAULT_SVG_FONT_SIZE=16,e.Text.fromElement=function(t,n,r){if(!t)return n(null);var o=e.parseAttributes(t,e.Text.ATTRIBUTE_NAMES),s=o.textAnchor||"left";if((r=e.util.object.extend(r?i(r):{},o)).top=r.top||0,r.left=r.left||0,o.textDecoration){var a=o.textDecoration;-1!==a.indexOf("underline")&&(r.underline=!0),-1!==a.indexOf("overline")&&(r.overline=!0),-1!==a.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in o&&(r.left+=o.dx),"dy"in o&&(r.top+=o.dy),"fontSize"in r||(r.fontSize=e.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in t?l=t.textContent:"firstChild"in t&&null!==t.firstChild&&"data"in t.firstChild&&null!==t.firstChild.data&&(l=t.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=r.strokeWidth;r.strokeWidth=0;var u=new e.Text(l,r),h=u.getScaledHeight()/u.height,f=((u.height+u.strokeWidth)*u.lineHeight-u.height)*h,d=u.getScaledHeight()+f,g=0;"center"===s&&(g=u.getScaledWidth()/2),"right"===s&&(g=u.getScaledWidth()),u.set({left:u.left-g,top:u.top-(d-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:void 0!==c?c:1}),n(u)},e.Text.fromObject=function(t,n){var r=i(t),o=t.path;return delete r.path,e.Object._fromObject("Text",r,function(t){o?e.Object._fromObject("Path",o,function(e){t.set("path",e),n(t)},"path"):n(t)},"text")},e.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],e.util.createAccessors&&e.util.createAccessors(e.Text)}}(e),M.util.object.extend(M.Text.prototype,{isEmptyStyles:function(t){if(!this.styles)return!0;if(void 0!==t&&!this.styles[t])return!0;var e=void 0===t?this.styles:{line:this.styles[t]};for(var i in e)for(var n in e[i])for(var r in e[i][n])return!1;return!0},styleHas:function(t,e){if(!this.styles||!t||""===t)return!1;if(void 0!==e&&!this.styles[e])return!1;var i=void 0===e?this.styles:{0:this.styles[e]};for(var n in i)for(var r in i[n])if(void 0!==i[n][r][t])return!0;return!1},cleanStyle:function(t){if(!this.styles||!t||""===t)return!1;var e,i,n=this.styles,r=0,o=!0,s=0;for(var a in n){for(var l in e=0,n[a]){var c;r++,(c=n[a][l]).hasOwnProperty(t)?(i?c[t]!==i&&(o=!1):i=c[t],c[t]===this[t]&&delete c[t]):o=!1,0!==Object.keys(c).length?e++:delete n[a][l]}0===e&&delete n[a]}for(var u=0;u<this._textLines.length;u++)s+=this._textLines[u].length;o&&r===s&&(this[t]=i,this.removeStyle(t))},removeStyle:function(t){if(this.styles&&t&&""!==t){var e,i,n,r=this.styles;for(i in r){for(n in e=r[i])delete e[n][t],0===Object.keys(e[n]).length&&delete e[n];0===Object.keys(e).length&&delete r[i]}}},_extendStyles:function(t,e){var i=this.get2DCursorLocation(t);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),M.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),e)},get2DCursorLocation:function(t,e){void 0===t&&(t=this.selectionStart);for(var i=e?this._unwrappedTextLines:this._textLines,n=i.length,r=0;r<n;r++){if(t<=i[r].length)return{lineIndex:r,charIndex:t};t-=i[r].length+this.missingNewlineOffset(r)}return{lineIndex:r-1,charIndex:i[r-1].length<t?i[r-1].length:t}},getSelectionStyles:function(t,e,i){void 0===t&&(t=this.selectionStart||0),void 0===e&&(e=this.selectionEnd||t);for(var n=[],r=t;r<e;r++)n.push(this.getStyleAtPosition(r,i));return n},getStyleAtPosition:function(t,e){var i=this.get2DCursorLocation(t);return(e?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.charIndex))||{}},setSelectionStyles:function(t,e,i){void 0===e&&(e=this.selectionStart||0),void 0===i&&(i=this.selectionEnd||e);for(var n=e;n<i;n++)this._extendStyles(n,t);return this._forceClearCache=!0,this},_getStyleDeclaration:function(t,e){var i=this.styles&&this.styles[t];return i?i[e]:null},getCompleteStyleDeclaration:function(t,e){for(var i,n=this._getStyleDeclaration(t,e)||{},r={},o=0;o<this._styleProperties.length;o++)r[i=this._styleProperties[o]]=void 0===n[i]?this[i]:n[i];return r},_setStyleDeclaration:function(t,e,i){this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){delete this.styles[t][e]},_getLineStyle:function(t){return!!this.styles[t]},_setLineStyle:function(t){this.styles[t]={}},_deleteLineStyle:function(t){delete this.styles[t]}}),function(){function t(t){t.textDecoration&&(t.textDecoration.indexOf("underline")>-1&&(t.underline=!0),t.textDecoration.indexOf("line-through")>-1&&(t.linethrough=!0),t.textDecoration.indexOf("overline")>-1&&(t.overline=!0),delete t.textDecoration)}M.IText=M.util.createClass(M.Text,M.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){void 0===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,s=0,a=this.get2DCursorLocation(t);n=a.charIndex,i=a.lineIndex;for(var l=0;l<i;l++)o+=this.getHeightOfLine(l);e=this._getLineLeftOffset(i);var c=this.__charBounds[i][n];return c&&(s=c.left),0!==this.charSpacing&&n===this._textLines[i].length&&(s-=this._getWidthOfCharSpacing()),r={top:o,left:e+(s>0?s: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"),s=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/s,l=t.topOffset,c=this.getValueOfPropertyAt(n,r,"deltaY");l+=(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-a/2,l+t.top+c,a,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),s=this.get2DCursorLocation(n),a=o.lineIndex,l=s.lineIndex,c=o.charIndex<0?0:o.charIndex,u=s.charIndex<0?0:s.charIndex,h=a;h<=l;h++){var f,d=this._getLineLeftOffset(h)||0,g=this.getHeightOfLine(h),p=0,v=0;if(h===a&&(p=this.__charBounds[a][c].left),h>=a&&h<l)v=r&&!this.isEndOfWrapping(h)?this.width:this.getLineWidth(h)||5;else if(h===l)if(0===u)v=this.__charBounds[l][u].left;else{var m=this._getWidthOfCharSpacing();v=this.__charBounds[l][u-1].left+this.__charBounds[l][u-1].width-m}f=g,(this.lineHeight<1||h===l&&this.lineHeight>1)&&(g/=this.lineHeight);var y=t.left+d+p,b=v-p,x=g,_=0;this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",x=1,_=g):e.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),e.fillRect(y,t.top+t.topOffset+_,b,x),t.topOffset+=f}},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}}}),M.IText.fromObject=function(e,i){if(t(e),e.styles)for(var n in e.styles)for(var r in e.styles[n])t(e.styles[n][r]);M.Object._fromObject("IText",e,i,"text")}}(),I=M.util.object.clone,M.util.object.extend(M.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||[],M.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]))for(;this._reSpace.test(this._text[i]);)e++,i--;for(;/\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]))for(;this._reSpace.test(this._text[i]);)e++,i++;for(;/\S/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},findLineBoundaryLeft:function(t){for(var e=0,i=t-1;!/\n/.test(this._text[i])&&i>-1;)e++,i--;return t-e},findLineBoundaryRight:function(t){for(var e=0,i=t;!/\n/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},searchWordBoundary:function(t,e){for(var i=this._text,n=this._reSpace.test(i[t])?t-1:t,r=i[n],o=M.reNonWord;!o.test(r)&&n>0&&n<i.length;)r=i[n+=e];return o.test(r)&&(n+=1===e?0:1),n},selectWord:function(t){t=t||this.selectionStart;var e=this.searchWordBoundary(t,-1),i=this.searchWordBoundary(t,1);this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(t){t=t||this.selectionStart;var e=this.findLineBoundaryLeft(t),i=this.findLineBoundaryRight(t);return this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(t){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(t),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(t){t._iTextInstances&&t._iTextInstances.forEach(function(t){t.selected=!1,t.isEditing&&t.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(t){if(this.__isMousedown&&this.isEditing){var e=this.getSelectionStartFromPointer(t.e),i=this.selectionStart,n=this.selectionEnd;(e===this.__selectionStartOnMouseDown&&i!==n||i!==e&&n!==e)&&(e>this.__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),r=M.util.string.graphemeSplit(n).length;if(t===e)return{selectionStart:r,selectionEnd:r};var o=i.slice(t,e);return{selectionStart:r,selectionEnd:r+M.util.string.graphemeSplit(o).length}},fromGraphemeToStringSelection:function(t,e,i){var n=i.slice(0,t).join("").length;return t===e?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+i.slice(t,e).join("").length}},_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,r=i.charIndex,o=this.getValueOfPropertyAt(n,r,"fontSize")*this.lineHeight,s=e.leftOffset,a=this.calcTransformMatrix(),l={x:e.left+s,y:e.top+e.topOffset+o},c=this.canvas.getRetinaScaling(),u=this.canvas.upperCanvasEl,h=u.width/c,f=u.height/c,d=h-o,g=f-o,p=u.clientWidth/h,v=u.clientHeight/f;return l=M.util.transformPoint(l,a),(l=M.util.transformPoint(l,this.canvas.viewportTransform)).x*=p,l.y*=v,l.x<0&&(l.x=0),l.x>d&&(l.x=d),l.y<0&&(l.y=0),l.y>g&&(l.y=g),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:o+"px",charHeight:o}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var 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),s=r.lineIndex,a=r.charIndex,l=o.lineIndex,c=o.charIndex;if(s!==l){if(this.styles[s])for(i=a;i<this._unwrappedTextLines[s].length;i++)delete this.styles[s][i];if(this.styles[l])for(i=c;i<this._unwrappedTextLines[l].length;i++)(n=this.styles[l][i])&&(this.styles[s]||(this.styles[s]={}),this.styles[s][a+i-c]=n);for(i=s+1;i<=l;i++)delete this.styles[i];this.shiftLineStyles(l,s-l)}else if(this.styles[s]){n=this.styles[s];var u,h,f=c-a;for(i=a;i<c;i++)delete n[i];for(h in this.styles[s])(u=parseInt(h,10))>=c&&(n[u-f]=n[h],delete n[h])}},shiftLineStyles:function(t,e){var i=I(this.styles);for(var n in this.styles){var r=parseInt(n,10);r>t&&(this.styles[r+e]=i[r],i[r-e]||delete this.styles[r])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(t,e,i,n){var r,o={},s=!1,a=this._unwrappedTextLines[t].length===e;for(var l in i||(i=1),this.shiftLineStyles(t,i),this.styles[t]&&(r=this.styles[t][0===e?e:e-1]),this.styles[t]){var c=parseInt(l,10);c>=e&&(s=!0,o[c-e]=this.styles[t][l],a&&0===e||delete this.styles[t][l])}var u=!1;for(s&&!a&&(this.styles[t+i]=o,u=!0),u&&i--;i>0;)n&&n[i-1]?this.styles[t+i]={0:I(n[i-1])}:r?this.styles[t+i]={0:I(r)}:delete this.styles[t+i],i--;this._forceClearCache=!0},insertCharStyleObject:function(t,e,i,n){this.styles||(this.styles={});var r=this.styles[t],o=r?I(r):{};for(var s in i||(i=1),o){var a=parseInt(s,10);a>=e&&(r[a+i]=o[a],o[a-i]||delete r[a])}if(this._forceClearCache=!0,n)for(;i--;)Object.keys(n[i]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+i]=I(n[i]));else if(r)for(var l=r[e?e-1:1];l&&i--;)this.styles[t][e+i]=I(l)},insertNewStyleBlock:function(t,e,i){for(var n=this.get2DCursorLocation(e,!0),r=[0],o=0,s=0;s<t.length;s++)"\n"===t[s]?r[++o]=0:r[o]++;for(r[0]>0&&(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),s=1;s<o;s++)r[s]>0?this.insertCharStyleObject(n.lineIndex+s,0,r[s],i):i&&(this.styles[n.lineIndex+s][0]=i[0]),i=i&&i.slice(r[s]+1);r[s]>0&&this.insertCharStyleObject(n.lineIndex+s,0,r[s],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&&i<e?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(e===t?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=e),this.selectionEnd=i)},setSelectionInBoundaries:function(){var t=this.text.length;this.selectionStart>t?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}}),M.util.object.extend(M.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=this.getLocalPointer(t),n=0,r=0,o=0,s=0,a=0,l=0,c=this._textLines.length;l<c&&o<=i.y;l++)o+=this.getHeightOfLine(l)*this.scaleY,a=l,l>0&&(s+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));r=this._getLineLeftOffset(a)*this.scaleX,e=this._textLines[a],"rtl"===this.direction&&(i.x=this.width*this.scaleX-i.x+r);for(var u=0,h=e.length;u<h&&(n=r,(r+=this.__charBounds[a][u].kernedWidth*this.scaleX)<=i.x);u++)s++;return this._getNewSelectionStartFromOffset(i,n,r,s,h)},_getNewSelectionStartFromOffset:function(t,e,i,n,r){var o=t.x-e,s=i-t.x,a=n+(s>o||s<0?0:1);return this.flipX&&(a=r-a),a>this._text.length&&(a=this._text.length),a}}),M.util.object.extend(M.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=M.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):M.document.body.appendChild(this.hiddenTextarea),M.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),M.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),M.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),M.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),M.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),M.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),M.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),M.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),M.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(M.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,r,o,s,a=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,c=a.length,u=c-l,h=this.selectionStart,f=this.selectionEnd,d=h!==f;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 g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),p=h>g.selectionStart;d?(i=this._text.slice(h,f),u+=f-h):c<l&&(i=p?this._text.slice(f+u,f):this._text.slice(h,h-u)),n=a.slice(g.selectionEnd-u,g.selectionEnd),i&&i.length&&(n.length&&(r=this.getSelectionStyles(h,h+1,!1),r=n.map(function(){return r[0]})),d?(o=h,s=f):p?(o=f-i.length,s=f):(o=f,s=f+i.length),this.removeStyleFromTo(o,s)),n.length&&(e&&n.join("")===M.copiedText&&!M.disableStyleCopyPaste&&(r=M.copiedTextStyle),this.insertNewStyleBlock(n,h,r)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(t){this.compositionStart=t.target.selectionStart,this.compositionEnd=t.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(M.copiedText=this.getSelectedText(),M.disableStyleCopyPaste?M.copiedTextStyle=null:M.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(t){return t&&t.clipboardData||M.window.clipboardData},_getWidthBeforeCursor:function(t,e){var i,n=this._getLineLeftOffset(t);return e>0&&(n+=(i=this.__charBounds[t][e-1]).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,s=this._getWidthBeforeCursor(r,o),a=this._getIndexOnLine(r+1,s);return this._textLines[r].slice(o).length+a+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(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,s=this._getWidthBeforeCursor(r,o),a=this._getIndexOnLine(r-1,s),l=this._textLines[r].slice(0,o),c=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+a-l.length+(1-c)},_getIndexOnLine:function(t,e){for(var i,n,r=this._textLines[t],o=this._getLineLeftOffset(t),s=0,a=0,l=r.length;a<l;a++)if((o+=i=this.__charBounds[t][a].width)>e){n=!0;var c=o-i,u=o,h=Math.abs(c-e);s=Math.abs(u-e)<h?a:a-1;break}return n||(s=r.length-1),s},moveCursorDown:function(t){this.selectionStart>=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=this["get"+t+"CursorOffset"](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(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){void 0===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){void 0===n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var r=M.util.string.graphemeSplit(t);this.insertNewStyleBlock(r,i,e),this._text=[].concat(this._text.slice(0,i),r,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var t=M.util.toFixed,e=/ +/g;M.util.object.extend(M.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=this.getSvgTextDecoration(this);return[t.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",e?'text-decoration="'+e+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",t.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(t,e){var i,n=[],r=[],o=t;this._setSVGBg(r);for(var s=0,a=this._textLines.length;s<a;s++)i=this._getLineLeftOffset(s),(this.textBackgroundColor||this.styleHas("textBackgroundColor",s))&&this._setSVGTextLineBg(r,s,e+i,o),this._setSVGTextLineText(n,s,e+i,o),o+=this.getHeightOfLine(s);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(i,n,r,o){var s=i!==i.trim()||i.match(e),a=this.getSvgSpanStyles(n,s),l=a?'style="'+a+'"':"",c=n.deltaY,u="",h=M.Object.NUM_FRACTION_DIGITS;return c&&(u=' dy="'+t(c,h)+'" '),['<tspan x="',t(r,h),'" y="',t(o,h),'" ',u,l,">",M.util.string.escapeXml(i),"</tspan>"].join("")},_setSVGTextLineText:function(t,e,i,n){var r,o,s,a,l,c=this.getHeightOfLine(e),u=-1!==this.textAlign.indexOf("justify"),h="",f=0,d=this._textLines[e];n+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,p=d.length-1;g<=p;g++)l=g===p||this.charSpacing,h+=d[g],s=this.__charBounds[e][g],0===f?(i+=s.kernedWidth-s.width,f+=s.width):f+=s.kernedWidth,u&&!l&&this._reSpaceAndTab.test(d[g])&&(l=!0),l||(r=r||this.getCompleteStyleDeclaration(e,g),o=this.getCompleteStyleDeclaration(e,g+1),l=this._hasStyleChangedForSvg(r,o)),l&&(a=this._getStyleDeclaration(e,g)||{},t.push(this._createTextCharSpan(h,a,i,n)),h="",r=o,i+=f,f=0)},_pushTextBgRect:function(e,i,n,r,o,s){var a=M.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(i),' x="',t(n,a),'" y="',t(r,a),'" width="',t(o,a),'" height="',t(s,a),'"></rect>\n')},_setSVGTextLineBg:function(t,e,i,n){for(var r,o,s=this._textLines[e],a=this.getHeightOfLine(e)/this.lineHeight,l=0,c=0,u=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),h=0,f=s.length;h<f;h++)r=this.__charBounds[e][h],(o=this.getValueOfPropertyAt(e,h,"textBackgroundColor"))!==u?(u&&this._pushTextBgRect(t,u,i+c,n,l,a),c=r.left,l=r.width,u=o):l+=r.kernedWidth;o&&this._pushTextBgRect(t,o,i+c,n,l,a)},_getFillAttributes:function(t){var e=t&&"string"==typeof t?new M.Color(t):"";return e&&e.getSource()&&1!==e.getAlpha()?'opacity="'+e.getAlpha()+'" fill="'+e.setAlpha(1).toRgb()+'"':'fill="'+t+'"'},_getSVGLineTopOffset:function(t){for(var e,i=0,n=0;n<t;n++)i+=this.getHeightOfLine(n);return e=this.getHeightOfLine(n),{lineTop:i,offset:(this._fontSizeMult-this._fontSizeFraction)*e/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(t){return M.Object.prototype.getSvgStyles.call(this,t)+" white-space: pre;"}})}(),function(t){var e=t.fabric||(t.fabric={});e.Textbox=e.util.createClass(e.IText,e.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:e.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,n=0,r={},o=0;o<t.graphemeLines.length;o++)"\n"===t.graphemeText[n]&&o>0?(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=!1,o=this._styleMap[t],s=this._styleMap[t+1];for(var a in o&&(t=o.line,n=o.offset),s&&(r=s.line===t,e=s.offset),i=void 0===t?this.styles:{line:this.styles[t]})for(var l in i[a])if(l>=n&&(!r||l<e))for(var c in i[a][l])return!1;return!0},_getStyleDeclaration:function(t,e){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[t];if(!i)return null;t=i.line,e=i.offset+e}return this.callSuper("_getStyleDeclaration",t,e)},_setStyleDeclaration:function(t,e,i){var n=this._styleMap[t];t=n.line,e=n.offset+e,this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){var i=this._styleMap[t];t=i.line,e=i.offset+e,delete this.styles[t][e]},_getLineStyle:function(t){var e=this._styleMap[t];return!!this.styles[e.line]},_setLineStyle:function(t){var e=this._styleMap[t];this.styles[e.line]={}},_wrapText:function(t,e){var i,n=[];for(this.isWrapping=!0,i=0;i<t.length;i++)n=n.concat(this._wrapLine(t[i],i,e));return this.isWrapping=!1,n},_measureWord:function(t,e,i){var n,r=0;i=i||0;for(var o=0,s=t.length;o<s;o++)r+=this._getGraphemeBox(t[o],e,o+i,n,!0).kernedWidth,n=t[o];return r},_wrapLine:function(t,i,n,r){var o=0,s=this.splitByGrapheme,a=[],l=[],c=s?e.util.string.graphemeSplit(t):t.split(this._wordJoiners),u="",h=0,f=s?"":" ",d=0,g=0,p=0,v=!0,m=this._getWidthOfCharSpacing();r=r||0,0===c.length&&c.push([]),n-=r;for(var y=0;y<c.length;y++)u=s?c[y]:e.util.string.graphemeSplit(c[y]),d=this._measureWord(u,i,h),h+=u.length,(o+=g+d-m)>n&&!v?(a.push(l),l=[],o=d,v=!0):o+=m,v||s||l.push(f),l=l.concat(u),g=s?0:this._measureWord([f],i,h),h++,v=!1,d>p&&(p=d);return y&&a.push(l),p+r>this.dynamicMinWidth&&(this.dynamicMinWidth=p-m+r),a},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<n.length;o++)r[o]=n[o].join("");return i.lines=r,i.graphemeLines=n,i},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var t={};for(var e in this._styleMap)this._textLines[e]&&(t[this._styleMap[e].line]=1);for(var e in this.styles)t[e]||delete this.styles[e]},toObject:function(t){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(t))}}),e.Textbox.fromObject=function(t,i){return e.Object._fromObject("Textbox",t,i,"text")}}(e),function(){var t=M.controlsUtils,e=t.scaleSkewCursorStyleHandler,i=t.scaleCursorStyleHandler,n=t.scalingEqually,r=t.scalingYOrSkewingX,o=t.scalingXOrSkewingY,s=t.scaleOrSkewActionName,a=M.Object.prototype.controls;if(a.ml=new M.Control({x:-.5,y:0,cursorStyleHandler:e,actionHandler:o,getActionName:s}),a.mr=new M.Control({x:.5,y:0,cursorStyleHandler:e,actionHandler:o,getActionName:s}),a.mb=new M.Control({x:0,y:.5,cursorStyleHandler:e,actionHandler:r,getActionName:s}),a.mt=new M.Control({x:0,y:-.5,cursorStyleHandler:e,actionHandler:r,getActionName:s}),a.tl=new M.Control({x:-.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),a.tr=new M.Control({x:.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),a.bl=new M.Control({x:-.5,y:.5,cursorStyleHandler:i,actionHandler:n}),a.br=new M.Control({x:.5,y:.5,cursorStyleHandler:i,actionHandler:n}),a.mtr=new M.Control({x:0,y:-.5,actionHandler:t.rotationWithSnapping,cursorStyleHandler:t.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),M.Textbox){var l=M.Textbox.prototype.controls={};l.mtr=a.mtr,l.tr=a.tr,l.br=a.br,l.tl=a.tl,l.bl=a.bl,l.mt=a.mt,l.mb=a.mb,l.mr=new M.Control({x:.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"}),l.ml=new M.Control({x:-.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"})}}()},3053:function(t,e,i){var n=i(602);t.exports=function(t,e,i){var r,o;if(i=i||0,!n(e))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t,i);for(o=e.length,r=i;i>=0&&r<o;r+=1)if(e[r]===t)return r;return-1}},8592:function(t,e,i){var n=i(602),r=i(6092),o=i(5573);t.exports=function(t,e,i){n(t)?r(t,e,i):o(t,e,i)}},6092:function(t){t.exports=function(t,e,i){var n=0,r=t.length;for(i=i||null;n<r&&!1!==e.call(i,t[n],n,t);n+=1);}},5573:function(t){t.exports=function(t,e,i){var n;for(n in i=i||null,t)if(t.hasOwnProperty(n)&&!1===e.call(i,t[n],n,t))break}},9052:function(t,e,i){var n=i(961),r=i(9886),o=i(2560),s=i(5393),a=i(602),l=i(5183),c=i(8592),u=/\s+/g;function h(){this.events=null,this.contexts=null}h.mixin=function(t){n(t.prototype,h.prototype)},h.prototype._getHandlerItem=function(t,e){var i={handler:t};return e&&(i.context=e),i},h.prototype._safeEvent=function(t){var e,i=this.events;return i||(i=this.events={}),t&&((e=i[t])||(e=[],i[t]=e),i=e),i},h.prototype._safeContext=function(){var t=this.contexts;return t||(t=this.contexts=[]),t},h.prototype._indexOfContext=function(t){for(var e=this._safeContext(),i=0;e[i];){if(t===e[i][0])return i;i+=1}return-1},h.prototype._memorizeContext=function(t){var e,i;r(t)&&(e=this._safeContext(),(i=this._indexOfContext(t))>-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))>-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),c(t,function(t){n._bindEvent(t,e,i)})):s(t)&&(i=e,c(t,function(t,e){n.on(e,t,i)}))},h.prototype.once=function(t,e,i){var n=this;if(s(t))return i=e,void c(t,function(t,e){n.once(e,t,i)});this.on(t,function r(){e.apply(i,arguments),n.off(t,r,i)},i)},h.prototype._spliceMatches=function(t,e){var i,n=0;if(a(t))for(i=t.length;n<i;n+=1)!0===e(t[n])&&(t.splice(n,1),i-=1,n-=1)},h.prototype._matchHandler=function(t){var e=this;return function(i){var n=t===i.handler;return n&&e._forgetContext(i.context),n}},h.prototype._matchContext=function(t){var e=this;return function(i){var n=t===i.context;return n&&e._forgetContext(i.context),n}},h.prototype._matchHandlerAndContext=function(t,e){var i=this;return function(n){var r=t===n.handler,o=e===n.context,s=r&&o;return s&&i._forgetContext(n.context),s}},h.prototype._offByEventName=function(t,e){var i=this,n=l(e),r=i._matchHandler(e);t=t.split(u),c(t,function(t){var e=i._safeEvent(t);n?i._spliceMatches(e,r):(c(e,function(t){i._forgetContext(t.context)}),i.events[t]=[])})},h.prototype._offByHandler=function(t){var e=this,i=this._matchHandler(t);c(this._safeEvent(),function(t){e._spliceMatches(t,i)})},h.prototype._offByObject=function(t,e){var i,n=this;this._indexOfContext(t)<0?c(t,function(t,e){n.off(e,t)}):o(e)?(i=this._matchContext(t),n._spliceMatches(this._safeEvent(e),i)):l(e)?(i=this._matchHandlerAndContext(e,t),c(this._safeEvent(),function(t){n._spliceMatches(t,i)})):(i=this._matchContext(t),c(this._safeEvent(),function(t){n._spliceMatches(t,i)}))},h.prototype.off=function(t,e){o(t)?this._offByEventName(t,e):arguments.length?l(t)?this._offByHandler(t):s(t)&&this._offByObject(t,e):(this.events={},this.contexts=[])},h.prototype.fire=function(t){this.invoke.apply(this,arguments)},h.prototype.invoke=function(t){var e,i,n,r;if(!this.hasListener(t))return!0;for(e=this._safeEvent(t),i=Array.prototype.slice.call(arguments,1),n=0;e[n];){if(!1===(r=e[n]).handler.apply(r.context,i))return!1;n+=1}return!0},h.prototype.hasListener=function(t){return this.getListenerLength(t)>0},h.prototype.getListenerLength=function(t){return this._safeEvent(t).length},t.exports=h},961:function(t){t.exports=function(t,e){var i,n,r,o,s=Object.prototype.hasOwnProperty;for(r=1,o=arguments.length;r<o;r+=1)for(n in i=arguments[r])s.call(i,n)&&(t[n]=i[n]);return t}},1610:function(t,e,i){var n=i(5695),r=i(3778);t.exports=function(t,e){for(var i=arguments,o=i[0],s=1,a=i.length;s<a;s+=1){if(n(o)||r(o))return;o=o[i[s]]}return o}},4564:function(t,e,i){var n=i(5573);t.exports=function(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}},4729:function(t,e,i){var n=i(5695),r=i(4564);t.exports=function(t,e){var i=location.hostname,o="TOAST UI "+t+" for "+i+": Statistics",s=window.localStorage.getItem(o);(n(window.tui)||!1!==window.tui.usageStatistics)&&(s&&!function(t){return(new Date).getTime()-t>6048e5}(s)||(window.localStorage.setItem(o,(new Date).getTime()),setTimeout(function(){"interactive"!==document.readyState&&"complete"!==document.readyState||r("https://www.google-analytics.com/collect",{v:1,t:"event",tid:e,cid:i,dp:i,dh:t,el:t,ec:"use"})},1e3)))}},602:function(t){t.exports=function(t){return t instanceof Array}},9886:function(t,e,i){var n=i(5695),r=i(3778);t.exports=function(t){return!n(t)&&!r(t)}},5183:function(t){t.exports=function(t){return t instanceof Function}},3778:function(t){t.exports=function(t){return null===t}},5393:function(t){t.exports=function(t){return t===Object(t)}},2560:function(t){t.exports=function(t){return"string"==typeof t||t instanceof String}},5695:function(t){t.exports=function(t){return void 0===t}},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,e,i){var n=t.x,r=t.y,o=e.x,s=e.y,a=i*Math.PI/180;return{originX:n>(o-n)*Math.cos(a)-(s-r)*Math.sin(a)+n?"right":"left",originY:r>(o-n)*Math.sin(a)+(s-r)*Math.cos(a)+r?"bottom":"top"}}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,r,o){(function(t){return"center"===t.originX&&"center"===t.originY})(t)&&(function(t,e){var i=e.getPointByOrigin("center","center"),r=n(i,t,-e.angle),o=r.originX,s=r.originY,a=e.getPointByOrigin(o,s),l=e.left-(i.x-a.x),c=e.top-(i.y-a.y);e.set({originX:o,originY:s,left:l,top:c}),e.setCoords()}(r,t),function(t){var e=t.originX,i=t.originY,n=e.substring(0,1)+i.substring(0,1);t.startPoint=t.origins[n]}(t)),o?function(t){var e=t.type,n=t.scaleX,r=t.scaleY,o=i[e],s=t[o.w]*n,a=t[o.h]*r;if(t.isRegular){var l=Math.max(n,r);s=t[o.w]*l,a=t[o.h]*l}var c={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};c[o.w]=s,c[o.h]=a,t.set(c)}(t):function(t,n){var r=n.type,o=n.strokeWidth,s=n.startPoint,a=e[r],l=i[r],c=!("triangle"!==n.type),u={},h=Math.abs(s.x-t.x)/a,f=Math.abs(s.y-t.y)/a;h>o&&(h-=o/a),f>o&&(f-=o/a),n.isRegular&&(h=f=Math.max(h,f),c&&(f=Math.sqrt(3)/2*h)),u[l.w]=h,u[l.h]=f,n.set(u)}(r,t),function(t,e){var i=e.startPoint,r=n(i,t,-e.angle),o=r.originX,s=r.originY;e.setPositionByOrigin(i,o,s),e.setCoords()}(r,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),s=t.top+(e.y-r.y);t.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:o,top:s}),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).Object;t.exports=function(t,e){return n.create(t,e)}},3512:function(t,e,i){i(297);var n=i(7545).Object,r=t.exports=function(t,e,i){return n.defineProperty(t,e,i)};n.defineProperty.sham&&(r.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){var n=i(1795),r=i(7739),o=i(4104);t.exports=function(t){for(var e=n(this),i=o(e),s=arguments.length,a=r(s>1?arguments[1]:void 0,i),l=s>2?arguments[2]:void 0,c=void 0===l?i:r(l,i);c>a;)e[a++]=t;return e}},7397:function(t,e,i){var n=i(454).forEach,r=i(424)("forEach");t.exports=r?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},841:function(t,e,i){var n=i(8043),r=i(1795),o=i(1635),s=i(6109),a=i(2091),l=i(4104),c=i(9361),u=i(1669),h=i(8703);t.exports=function(t){var e=r(t),i=a(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(!_||this==Array&&s(_))for(p=l(e),v=i?new this(p):Array(p);p>C;C++)x=g?d(e[C],C):e[C],c(v,C,x);else for(b=(y=u(e,_)).next,v=i?new this:[];!(m=b.call(y)).done;C++)x=g?o(y,d,[m.value,C],!0):m.value,c(v,C,x);return v.length=C,v}},8180:function(t,e,i){var n=i(101),r=i(7739),o=i(4104),s=function(t){return function(e,i,s){var a,l=n(e),c=o(l),u=r(s,c);if(t&&i!=i){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===i)return t||u||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},454:function(t,e,i){var n=i(8043),r=i(2202),o=i(1795),s=i(4104),a=i(1321),l=[].push,c=function(t){var e=1==t,i=2==t,c=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,x=o(g),_=r(x),C=n(p,v,3),I=s(_),M=0,S=m||a,w=e?S(g,I):i||f?S(g,0):void 0;I>M;M++)if((d||M in _)&&(b=C(y=_[M],M,x),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:l.call(w,y)}else switch(t){case 4:return!1;case 7:l.call(w,y)}return h?-1:c||u?u:w}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},242:function(t,e,i){var n=i(6192),r=i(8182),o=i(4218),s=r("species");t.exports=function(t){return o>=51||!n(function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},424:function(t,e,i){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),s=i(8182)("species");t.exports=function(t){var e;return n(t)&&(e=t.constructor,(r(e)&&(e===Array||n(e.prototype))||o(e)&&null===(e=e[s]))&&(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(s){r(t,"throw",s)}}},9770:function(t,e,i){var n=i(8182)("iterator"),r=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){r=!0}};s[n]=function(){return this},Array.from(s,function(){throw 2})}catch(a){}t.exports=function(t,e){if(!e&&!r)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},t(o)}catch(a){}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),s=i(8182)("toStringTag"),a="Arguments"==o(function(){return arguments}());t.exports=n?o:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(i){}}(e=Object(t),s))?i:a?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){var n=i(4413).IteratorPrototype,r=i(2853),o=i(774),s=i(1284),a=i(7771),l=function(){return this};t.exports=function(t,e,i){var c=e+" Iterator";return t.prototype=r(n,{next:o(1,i)}),s(t,c,!1,!0),a[c]=l,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){var n=i(77),r=i(2760),o=i(774);t.exports=function(t,e,i){var s=n(e);s in t?r.f(t,s,o(0,i)):t[s]=i}},7218:function(t,e,i){var n=i(3085),r=i(5546),o=i(2282),s=i(6447),a=i(5148),l=i(9341),c=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,x=d("iterator"),_="keys",C="values",I="entries",M=function(){return this};t.exports=function(t,e,i,o,d,p,S){a(i,e,o);var w,k,T,D=function(t){if(t===d&&L)return L;if(!b&&t in O)return O[t];switch(t){case _:case C:case I:return function(){return new i(this,t)}}return function(){return new i(this)}},A=e+" Iterator",E=!1,O=t.prototype,j=O[x]||O["@@iterator"]||d&&O[d],L=!b&&j||D(d),P="Array"==e&&O.entries||j;if(P&&(w=l(P.call(new t)))!==Object.prototype&&w.next&&(r||l(w)===y||(c?c(w,y):s(w[x])||f(w,x,M)),u(w,A,!0,!0),r&&(g[A]=M)),v&&d==C&&j&&j.name!==C&&(!r&&m?h(O,"name",C):(E=!0,L=function(){return j.call(this)})),d)if(k={values:D(C),keys:p?L:D(_),entries:D(I)},S)for(T in k)(b||E||!(T in O))&&f(O,T,k[T]);else n({target:e,proto:!0,forced:b||E},k);return r&&!S||O[x]===L||f(O,x,L,{name:d}),g[e]=L,k}},1488:function(t,e,i){var n=i(7545),r=i(4500),o=i(9207),s=i(2760).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});r(e,t)||s(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,s=r(o)&&r(o.createElement);t.exports=function(t){return s?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),s=i(8989),a=o.process,l=o.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u?r=(n=u.split("."))[0]<4?1:n[0]+n[1]:s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(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){var n=i(8576),r=i(6447),o=i(5141).f,s=i(9245),a=i(7545),l=i(8043),c=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,_=t.stat,C=t.proto,I=x?n:_?n[b]:(n[b]||{}).prototype,M=x?a:a[b]||c(a,b,{})[b],S=M.prototype;for(d in e)i=!s(x?d:b+(_?".":"#")+d,t.forced)&&I&&u(I,d),p=M[d],i&&(v=t.noTargetGet?(y=o(I,d))&&y.value:I[d]),g=i&&v?v:e[d],i&&typeof p==typeof g||(m=t.bind&&i?l(g,n):t.wrap&&i?h(g):C&&r(g)?l(Function.call,g):g,(t.sham||g&&g.sham||p&&p.sham)&&c(m,"sham",!0),c(M,d,m),C&&(u(a,f=b+"Prototype")||c(a,f,{}),c(a[f],d,g),t.real&&S&&!S[d]&&c(S,d,g)))}},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){var n=i(6235),r=i(5744),o=[].slice,s={};t.exports=Function.bind||function(t){var e=n(this),i=o.call(arguments,1),a=function(){var n=i.concat(o.call(arguments));return this instanceof a?function(t,e,i){if(!(e in s)){for(var n=[],r=0;r<e;r++)n[r]="a["+r+"]";s[e]=Function("C,a","return new C("+n.join(",")+")")}return s[e](t,i)}(e,n.length,n):e.apply(t,n)};return r(e.prototype)&&(a.prototype=e.prototype),a}},2282:function(t,e,i){var n=i(69),r=i(4500),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),l=a&&"something"===function(){}.name,c=a&&(!n||n&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},150:function(t,e,i){var n=i(7545),r=i(8576),o=i(6447),s=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?s(n[t])||s(r[t]):n[t]&&n[t][e]||r[t]&&r[t][e]}},8703:function(t,e,i){var n=i(4696),r=i(5037),o=i(7771),s=i(8182)("iterator");t.exports=function(t){if(null!=t)return r(t,s)||r(t,"@@iterator")||o[n(t)]}},1669:function(t,e,i){var n=i(6235),r=i(1138),o=i(8703);t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(n(i))return r(i.call(t));throw TypeError(String(t)+" is not iterable")}},5037:function(t,e,i){var n=i(6235);t.exports=function(t,e){var i=t[e];return null==i?void 0:n(i)}},8576:function(t,e,i){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},4500:function(t,e,i){var n=i(1795),r={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return r.call(n(t),e)}},4535:function(t){t.exports={}},3681:function(t,e,i){var n=i(8576);t.exports=function(t,e){var i=n.console;i&&i.error&&(1===arguments.length?i.error(t):i.error(t,e))}},7403:function(t,e,i){var n=i(150);t.exports=n("document","documentElement")},188:function(t,e,i){var n=i(69),r=i(6192),o=i(7449);t.exports=!n&&!r(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},2202:function(t,e,i){var n=i(6192),r=i(9272),o="".split;t.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==r(t)?o.call(t,""):Object(t)}:Object},9516:function(t,e,i){var n=i(6447),r=i(6434),o=Function.toString;n(r.inspectSource)||(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},273:function(t,e,i){var n=i(5744),r=i(8711);t.exports=function(t,e){n(e)&&"cause"in e&&r(t,"cause",t.cause)}},3326:function(t,e,i){var n,r,o,s=i(8921),a=i(8576),l=i(5744),c=i(8711),u=i(4500),h=i(6434),f=i(9766),d=i(4535),g="Object already initialized",p=a.WeakMap;if(s||h.state){var v=h.state||(h.state=new p),m=v.get,y=v.has,b=v.set;n=function(t,e){if(y.call(v,t))throw new TypeError(g);return e.facade=t,b.call(v,t,e),e},r=function(t){return m.call(v,t)||{}},o=function(t){return y.call(v,t)}}else{var x=f("state");d[x]=!0,n=function(t,e){if(u(t,x))throw new TypeError(g);return e.facade=t,c(t,x,e),e},r=function(t){return u(t,x)?t[x]:{}},o=function(t){return u(t,x)}}t.exports={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}}},6109:function(t,e,i){var n=i(8182),r=i(7771),o=n("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||s[o]===t)}},4770:function(t,e,i){var n=i(9272);t.exports=Array.isArray||function(t){return"Array"==n(t)}},6447:function(t){t.exports=function(t){return"function"==typeof t}},2091:function(t,e,i){var n=i(6192),r=i(6447),o=i(4696),s=i(150),a=i(9516),l=[],c=s("Reflect","construct"),u=/^\s*(?:class|function)\b/,h=u.exec,f=!u.exec(function(){}),d=function(t){if(!r(t))return!1;try{return c(Object,l,t),!0}catch(e){return!1}};t.exports=!c||n(function(){var t;return d(d.call)||!d(Object)||!d(function(){t=!0})||t})?function(t){if(!r(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return f||!!h.call(u,a(t))}:d},9245:function(t,e,i){var n=i(6192),r=i(6447),o=/#|\.prototype\./,s=function(t,e){var i=l[a(t)];return i==u||i!=c&&(r(e)?n(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";t.exports=s},5744:function(t,e,i){var n=i(6447);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},5546:function(t){t.exports=!0},3236:function(t,e,i){var n=i(6447),r=i(150),o=i(615);t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&Object(t)instanceof e}},3442:function(t,e,i){var n=i(1138),r=i(6109),o=i(4104),s=i(8043),a=i(1669),l=i(8703),c=i(6639),u=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,i){var h,f,d,g,p,v,m,y=i&&i.that,b=!(!i||!i.AS_ENTRIES),x=!(!i||!i.IS_ITERATOR),_=!(!i||!i.INTERRUPTED),C=s(e,y,1+b+_),I=function(t){return h&&c(h,"normal",t),new u(!0,t)},M=function(t){return b?(n(t),_?C(t[0],t[1],I):C(t[0],t[1])):_?C(t,I):C(t)};if(x)h=t;else{if(!(f=l(t)))throw TypeError(String(t)+" is not iterable");if(r(f)){for(d=0,g=o(t);g>d;d++)if((p=M(t[d]))&&p instanceof u)return p;return new u(!1)}h=a(t,f)}for(v=h.next;!(m=v.call(h)).done;){try{p=M(m.value)}catch(S){c(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,s;n(t);try{if(!(o=r(t,"return"))){if("throw"===e)throw i;return i}o=o.call(t)}catch(a){s=!0,o=a}if("throw"===e)throw i;if(s)throw o;return n(o),i}},4413:function(t,e,i){var n,r,o,s=i(6192),a=i(6447),l=i(2853),c=i(9341),u=i(9482),h=i(8182),f=i(5546),d=h("iterator"),g=!1;[].keys&&("next"in(o=[].keys())?(r=c(c(o)))!==Object.prototype&&(n=r):g=!0),null==n||s(function(){var t={};return n[d].call(t)!==t})?n={}:f&&(n=l(n)),a(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,s,a,l,c,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,x=h.process,_=h.Promise,C=f(h,"queueMicrotask"),I=C&&C.value;I||(n=function(){var t,e;for(m&&(t=x.domain)&&t.exit();r;){e=r.fn,r=r.next;try{e()}catch(i){throw r?s():o=void 0,i}}o=void 0,t&&t.enter()},g||m||v||!y||!b?!p&&_&&_.resolve?((c=_.resolve(void 0)).constructor=_,u=c.then,s=function(){u.call(c,n)}):s=m?function(){x.nextTick(n)}:function(){d.call(h,n)}:(a=!0,l=b.createTextNode(""),new y(n).observe(l,{characterData:!0}),s=function(){l.data=a=!a})),t.exports=I||function(t){var e={fn:t,next:void 0};o&&(o.next=e),r||(r=e,s()),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),s=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[s]||"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),s=n.WeakMap;t.exports=r(s)&&/native code/.test(o(s))},9438:function(t,e,i){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),s=i(4277).trim,a=i(1450),l=n.parseFloat,c=n.Symbol,u=c&&c.iterator,h=1/l(a+"-0")!=-1/0||u&&!r(function(){l(Object(u))});t.exports=h?function(t){var e=s(o(t)),i=l(e);return 0===i&&"-"==e.charAt(0)?-0:i}:l},2558:function(t,e,i){var n=i(8576),r=i(6192),o=i(4845),s=i(4277).trim,a=i(1450),l=n.parseInt,c=n.Symbol,u=c&&c.iterator,h=/^[+-]?0[Xx]/,f=8!==l(a+"08")||22!==l(a+"0x16")||u&&!r(function(){l(Object(u))});t.exports=f?function(t,e){var i=s(o(t));return l(i,e>>>0||(h.test(i)?16:10))}:l},2503:function(t,e,i){var n=i(69),r=i(6192),o=i(7653),s=i(4750),a=i(6007),l=i(1795),c=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){for(var i=l(t),r=arguments.length,u=1,h=s.f,f=a.f;r>u;)for(var d,g=c(arguments[u++]),p=h?o(g).concat(h(g)):o(g),v=p.length,m=0;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),s=i(2952),a=i(4535),l=i(7403),c=i(7449),u=i(9766),h="prototype",f="script",d=u("IE_PROTO"),g=function(){},p=function(t){return"<"+f+">"+t+"</"+f+">"},v=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){try{n=new ActiveXObject("htmlfile")}catch(o){}var t,e,i;m="undefined"!=typeof document?document.domain&&n?v(n):(e=c("iframe"),i="java"+f+":",e.style.display="none",l.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):v(n);for(var r=s.length;r--;)delete m[h][s[r]];return m()};a[d]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(g[h]=r(t),i=new g,g[h]=null,i[d]=t):i=m(),void 0===e?i:o(i,e)}},1187:function(t,e,i){var n=i(69),r=i(2760),o=i(1138),s=i(7653);t.exports=n?Object.defineProperties:function(t,e){o(t);for(var i,n=s(e),a=n.length,l=0;a>l;)r.f(t,i=n[l++],e[i]);return t}},2760:function(t,e,i){var n=i(69),r=i(188),o=i(1138),s=i(77),a=Object.defineProperty;e.f=n?a:function(t,e,i){if(o(t),e=s(e),o(i),r)try{return a(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),s=i(101),a=i(77),l=i(4500),c=i(188),u=Object.getOwnPropertyDescriptor;e.f=n?u:function(t,e){if(t=s(t),e=a(e),c)try{return u(t,e)}catch(i){}if(l(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,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?function(t){try{return r(t)}catch(e){return s.slice()}}(t):r(n(t))}},2092:function(t,e,i){var n=i(7934),r=i(2952).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}},4750:function(t,e){e.f=Object.getOwnPropertySymbols},9341:function(t,e,i){var n=i(4500),r=i(6447),o=i(1795),s=i(9766),a=i(4635),l=s("IE_PROTO"),c=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){var e=o(t);if(n(e,l))return e[l];var i=e.constructor;return r(i)&&e instanceof i?i.prototype:e instanceof Object?c:null}},7934:function(t,e,i){var n=i(4500),r=i(101),o=i(8180).indexOf,s=i(4535);t.exports=function(t,e){var i,a=r(t),l=0,c=[];for(i in a)!n(s,i)&&n(a,i)&&c.push(i);for(;e.length>l;)n(a,i=e[l++])&&(~o(c,i)||c.push(i));return c}},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){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).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){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);return(0,i.resolve)(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(null==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){var n=i(150),r=i(2760),o=i(8182),s=i(69),a=o("species");t.exports=function(t){var e=n(t),i=r.f;s&&e&&!e[a]&&i(e,a,{configurable:!0,get:function(){return this}})}},1284:function(t,e,i){var n=i(3471),r=i(2760).f,o=i(8711),s=i(4500),a=i(158),l=i(8182)("toStringTag");t.exports=function(t,e,i,c){if(t){var u=i?t:t.prototype;s(u,l)||r(u,l,{configurable:!0,value:e}),c&&!n&&o(u,"toString",a)}}},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__",s=n[o]||r(o,{});t.exports=s},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)("species");t.exports=function(t,e){var i,s=n(t).constructor;return void 0===s||null==(i=n(s)[o])?e:r(i)}},863:function(t,e,i){var n=i(1941),r=i(4845),o=i(3209),s=function(t){return function(e,i){var s,a,l=r(o(e)),c=n(i),u=l.length;return c<0||c>=u?t?"":void 0:(s=l.charCodeAt(c))<55296||s>56319||c+1===u||(a=l.charCodeAt(c+1))<56320||a>57343?t?l.charAt(c):s:t?l.slice(c,c+2):a-56320+(s-55296<<10)+65536}};t.exports={codeAt:s(!1),charAt:s(!0)}},7977:function(t){var e=2147483647,i=/[^\0-\u007E]/,n=/[.\u3002\uFF0E\uFF61]/g,r="Overflow: input needs wider integers to process",o=Math.floor,s=String.fromCharCode,a=function(t){return t+22+75*(t<26)},l=function(t,e,i){var n=0;for(t=i?o(t/700):t>>1,t+=o(t/e);t>455;n+=36)t=o(t/35);return o(n+36*t/(t+38))},c=function(t){var i=[];t=function(t){for(var e=[],i=0,n=t.length;i<n;){var r=t.charCodeAt(i++);if(r>=55296&&r<=56319&&i<n){var o=t.charCodeAt(i++);56320==(64512&o)?e.push(((1023&r)<<10)+(1023&o)+65536):(e.push(r),i--)}else e.push(r)}return e}(t);var n,c,u=t.length,h=128,f=0,d=72;for(n=0;n<t.length;n++)(c=t[n])<128&&i.push(s(c));var g=i.length,p=g;for(g&&i.push("-");p<u;){var v=e;for(n=0;n<t.length;n++)(c=t[n])>=h&&c<v&&(v=c);var m=p+1;if(v-h>o((e-f)/m))throw RangeError(r);for(f+=(v-h)*m,h=v,n=0;n<t.length;n++){if((c=t[n])<h&&++f>e)throw RangeError(r);if(c==h){for(var y=f,b=36;;b+=36){var x=b<=d?1:b>=d+26?26:b-d;if(y<x)break;var _=y-x,C=36-x;i.push(s(a(x+_%C))),y=o(_/C)}i.push(s(a(y))),d=l(f,m,p==g),f=0,++p}}++f,++h}return i.join("")};t.exports=function(t){var e,r,o=[],s=t.toLowerCase().replace(n,".").split(".");for(e=0;e<s.length;e++)r=s[e],o.push(i.test(r)?"xn--"+c(r):r);return o.join(".")}},6815:function(t,e,i){var n=i(2282).PROPER,r=i(6192),o=i(1450);t.exports=function(t){return r(function(){return!!o[t]()||"
"!=="
"[t]()||n&&o[t].name!==t})}},4277:function(t,e,i){var n=i(3209),r=i(4845),o="["+i(1450)+"]",s=RegExp("^"+o+o+"*"),a=RegExp(o+o+"*$"),l=function(t){return function(e){var i=r(n(e));return 1&t&&(i=i.replace(s,"")),2&t&&(i=i.replace(a,"")),i}};t.exports={start:l(1),end:l(2),trim:l(3)}},7160:function(t,e,i){var n,r,o,s,a=i(8576),l=i(6447),c=i(6192),u=i(8043),h=i(7403),f=i(7449),d=i(9536),g=i(224),p=a.setImmediate,v=a.clearImmediate,m=a.process,y=a.MessageChannel,b=a.Dispatch,x=0,_={},C="onreadystatechange";try{n=a.location}catch(k){}var I=function(t){if(_.hasOwnProperty(t)){var e=_[t];delete _[t],e()}},M=function(t){return function(){I(t)}},S=function(t){I(t.data)},w=function(t){a.postMessage(String(t),n.protocol+"//"+n.host)};p&&v||(p=function(t){for(var e=[],i=arguments.length,n=1;i>n;)e.push(arguments[n++]);return _[++x]=function(){(l(t)?t:Function(t)).apply(void 0,e)},r(x),x},v=function(t){delete _[t]},g?r=function(t){m.nextTick(M(t))}:b&&b.now?r=function(t){b.now(M(t))}:y&&!d?(s=(o=new y).port2,o.port1.onmessage=S,r=u(s.postMessage,s,1)):a.addEventListener&&l(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!c(w)?(r=w,a.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),s=i(380),a=i(8182)("toPrimitive");t.exports=function(t,e){if(!n(t)||r(t))return t;var i,l=o(t,a);if(l){if(void 0===e&&(e="default"),i=l.call(t,e),!n(i)||r(i))return i;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(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={};n[i(8182)("toStringTag")]="z",t.exports="[object z]"===String(n)},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),s=i(2759),a=i(3045),l=i(615),c=r("wks"),u=n.Symbol,h=l?u:u&&u.withoutSetter||s;t.exports=function(t){return o(c,t)&&(a||"string"==typeof c[t])||(a&&o(u,t)?c[t]=u[t]:c[t]=h("Symbol."+t)),c[t]}},1450:function(t){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},4242:function(t,e,i){var n=i(3085),r=i(9341),o=i(4469),s=i(2853),a=i(8711),l=i(774),c=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&&a(i,"message",h(e)),c(i,n);var s=[];return u(t,s.push,{that:s}),a(i,"errors",s),i};f.prototype=s(Error.prototype,{constructor:l(5,f),message:l(5,""),name:l(5,"AggregateError")}),n({global:!0},{AggregateError:f})},9106:function(t,e,i){var n=i(3085),r=i(6192),o=i(4770),s=i(5744),a=i(1795),l=i(4104),c=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(!s(t))return!1;var e=t[g];return void 0!==e?!!e:o(t)};n({target:"Array",proto:!0,forced:!m||!y},{concat:function(t){var e,i,n,r,o,s=a(this),h=u(s,0),f=0;for(e=-1,n=arguments.length;e<n;e++)if(b(o=-1===e?s:arguments[e])){if(f+(r=l(o))>p)throw TypeError(v);for(i=0;i<r;i++,f++)i in o&&c(h,f,o[i])}else{if(f>=p)throw TypeError(v);c(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){var n=i(3085),r=i(454).filter;n({target:"Array",proto:!0,forced:!i(242)("filter")},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},9823:function(t,e,i){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);n({target:"Array",stat:!0,forced:!i(9770)(function(t){Array.from(t)})},{from:r})},2276:function(t,e,i){var n=i(3085),r=i(8180).indexOf,o=i(424),s=[].indexOf,a=!!s&&1/[1].indexOf(1,-0)<0,l=o("indexOf");n({target:"Array",proto:!0,forced:a||!l},{indexOf:function(t){return a?s.apply(this,arguments)||0:r(this,t,arguments.length>1?arguments[1]:void 0)}})},8118:function(t,e,i){i(3085)({target:"Array",stat:!0},{isArray:i(4770)})},8939:function(t,e,i){var n=i(101),r=i(7423),o=i(7771),s=i(3326),a=i(7218),l="Array Iterator",c=s.set,u=s.getterFor(l);t.exports=a(Array,"Array",function(t,e){c(this,{type:l,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){var n=i(3085),r=i(454).map;n({target:"Array",proto:!0,forced:!i(242)("map")},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},5818:function(t,e,i){var n=i(3085),r=i(4770),o=i(2091),s=i(5744),a=i(7739),l=i(4104),c=i(101),u=i(9361),h=i(8182),f=i(242)("slice"),d=h("species"),g=[].slice,p=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var i,n,h,f=c(this),v=l(f),m=a(t,v),y=a(void 0===e?v:e,v);if(r(f)&&(i=f.constructor,(o(i)&&(i===Array||r(i.prototype))||s(i)&&null===(i=i[d]))&&(i=void 0),i===Array||void 0===i))return g.call(f,m,y);for(n=new(void 0===i?Array:i)(p(y-m,0)),h=0;m<y;m++,h++)m in f&&u(n,h,f[m]);return n.length=h,n}})},2178:function(t,e,i){var n=i(3085),r=i(7739),o=i(1941),s=i(4104),a=i(1795),l=i(1321),c=i(9361),u=i(242)("splice"),h=Math.max,f=Math.min;n({target:"Array",proto:!0,forced:!u},{splice:function(t,e){var i,n,u,d,g,p,v=a(this),m=s(v),y=r(t,m),b=arguments.length;if(0===b?i=n=0:1===b?(i=0,n=m-y):(i=b-2,n=f(h(o(e),0),m-y)),m+i-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(u=l(v,n),d=0;d<n;d++)(g=y+d)in v&&c(u,d,v[g]);if(u.length=n,i<n){for(d=y;d<m-n;d++)p=d+i,(g=d+n)in v?v[p]=v[g]:delete v[p];for(d=m;d>m-n+i;d--)delete v[d-1]}else if(i>n)for(d=m-n;d>y;d--)p=d+i-1,(g=d+n-1)in v?v[p]=v[g]:delete v[p];for(d=0;d<i;d++)v[d+y]=arguments[d+2];return v.length=m-n+i,u}})},665:function(t,e,i){i(3085)({target:"Function",proto:!0},{bind:i(6782)})},8671:function(t,e,i){var n=i(8576);i(1284)(n.JSON,"JSON",!0)},8556:function(){},2666:function(t,e,i){var n=i(3085),r=i(2558);n({target:"Number",stat:!0,forced:Number.parseInt!=r},{parseInt:r})},3113:function(t,e,i){i(3085)({target:"Object",stat:!0,sham:!i(69)},{create:i(2853)})},297:function(t,e,i){var n=i(3085),r=i(69);n({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperty:i(2760).f})},9234:function(t,e,i){var n=i(3085),r=i(6192),o=i(1795),s=i(9341),a=i(4635);n({target:"Object",stat:!0,forced:r(function(){s(1)}),sham:!a},{getPrototypeOf:function(t){return s(o(t))}})},2647:function(t,e,i){var n=i(3085),r=i(1795),o=i(7653);n({target:"Object",stat:!0,forced:i(6192)(function(){o(1)})},{keys:function(t){return o(r(t))}})},3222:function(t,e,i){i(3085)({target:"Object",stat:!0},{setPrototypeOf:i(4469)})},6663:function(){},4859:function(t,e,i){var n=i(3085),r=i(15);n({global:!0,forced:parseFloat!=r},{parseFloat:r})},5706:function(t,e,i){var n=i(3085),r=i(2558);n({global:!0,forced:parseInt!=r},{parseInt:r})},7884:function(t,e,i){var n=i(3085),r=i(6235),o=i(9438),s=i(892),a=i(3442);n({target:"Promise",stat:!0},{allSettled:function(t){var e=this,i=o.f(e),n=i.resolve,l=i.reject,c=s(function(){var i=r(e.resolve),o=[],s=0,l=1;a(t,function(t){var r=s++,a=!1;o.push(void 0),l++,i.call(e,t).then(function(t){a||(a=!0,o[r]={status:"fulfilled",value:t},--l||n(o))},function(t){a||(a=!0,o[r]={status:"rejected",reason:t},--l||n(o))})}),--l||n(o)});return c.error&&l(c.value),i.promise}})},8885:function(t,e,i){var n=i(3085),r=i(6235),o=i(150),s=i(9438),a=i(892),l=i(3442),c="No one promise resolved";n({target:"Promise",stat:!0},{any:function(t){var e=this,i=s.f(e),n=i.resolve,u=i.reject,h=a(function(){var i=r(e.resolve),s=[],a=0,h=1,f=!1;l(t,function(t){var r=a++,l=!1;s.push(void 0),h++,i.call(e,t).then(function(t){l||f||(f=!0,n(t))},function(t){l||f||(l=!0,s[r]=t,--h||u(new(o("AggregateError"))(s,c)))})}),--h||u(new(o("AggregateError"))(s,c))});return h.error&&u(h.value),i.promise}})},1868:function(t,e,i){var n=i(3085),r=i(5546),o=i(4471),s=i(6192),a=i(150),l=i(6447),c=i(4743),u=i(9126),h=i(9482);if(n({target:"Promise",proto:!0,real:!0,forced:!!o&&s(function(){o.prototype.finally.call({then:function(){}},function(){})})},{finally:function(t){var e=c(this,a("Promise")),i=l(t);return this.then(i?function(i){return u(e,t()).then(function(){return i})}:t,i?function(i){return u(e,t()).then(function(){throw i})}:t)}}),!r&&l(o)){var f=a("Promise").prototype.finally;o.prototype.finally!==f&&h(o.prototype,"finally",f,{unsafe:!0})}},9021:function(t,e,i){var n,r,o,s,a=i(3085),l=i(5546),c=i(8576),u=i(150),h=i(4471),f=i(9482),d=i(533),g=i(4469),p=i(1284),v=i(3656),m=i(6235),y=i(6447),b=i(5744),x=i(6961),_=i(9516),C=i(3442),I=i(9770),M=i(4743),S=i(7160).set,w=i(2950),k=i(9126),T=i(3681),D=i(9438),A=i(892),E=i(3326),O=i(9245),j=i(8182),L=i(2957),P=i(224),N=i(4218),z=j("species"),R="Promise",B=E.get,F=E.set,Y=E.getterFor(R),H=h&&h.prototype,W=h,U=H,G=c.TypeError,X=c.document,Z=c.process,V=D.f,J=V,Q=!!(X&&X.createEvent&&c.dispatchEvent),K=y(c.PromiseRejectionEvent),q="unhandledrejection",$=!1,tt=O(R,function(){var t=_(W),e=t!==String(W);if(!e&&66===N)return!0;if(l&&!U.finally)return!0;if(N>=51&&/native code/.test(t))return!1;var i=new W(function(t){t(1)}),n=function(t){t(function(){},function(){})};return(i.constructor={})[z]=n,!($=i.then(function(){})instanceof n)||!e&&L&&!K}),et=tt||!I(function(t){W.all(t).catch(function(){})}),it=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},nt=function(t,e){if(!t.notified){t.notified=!0;var i=t.reactions;w(function(){for(var n=t.value,r=1==t.state,o=0;i.length>o;){var s,a,l,c=i[o++],u=r?c.ok:c.fail,h=c.resolve,f=c.reject,d=c.domain;try{u?(r||(2===t.rejection&&at(t),t.rejection=1),!0===u?s=n:(d&&d.enter(),s=u(n),d&&(d.exit(),l=!0)),s===c.promise?f(G("Promise-chain cycle")):(a=it(s))?a.call(s,h,f):h(s)):f(n)}catch(g){d&&!l&&d.exit(),f(g)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&ot(t)})}},rt=function(t,e,i){var n,r;Q?((n=X.createEvent("Event")).promise=e,n.reason=i,n.initEvent(t,!1,!0),c.dispatchEvent(n)):n={promise:e,reason:i},!K&&(r=c["on"+t])?r(n):t===q&&T("Unhandled promise rejection",i)},ot=function(t){S.call(c,function(){var e,i=t.facade,n=t.value;if(st(t)&&(e=A(function(){P?Z.emit("unhandledRejection",n,i):rt(q,i,n)}),t.rejection=P||st(t)?2:1,e.error))throw e.value})},st=function(t){return 1!==t.rejection&&!t.parent},at=function(t){S.call(c,function(){var e=t.facade;P?Z.emit("rejectionHandled",e):rt("rejectionhandled",e,t.value)})},lt=function(t,e,i){return function(n){t(e,n,i)}},ct=function(t,e,i){t.done||(t.done=!0,i&&(t=i),t.value=e,t.state=2,nt(t,!0))},ut=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=it(e);n?w(function(){var i={done:!1};try{n.call(e,lt(ut,i,t),lt(ct,i,t))}catch(r){ct(i,r,t)}}):(t.value=e,t.state=1,nt(t,!1))}catch(r){ct({done:!1},r,t)}}};if(tt&&(U=(W=function(t){x(this,W,R),m(t),n.call(this);var e=B(this);try{t(lt(ut,e),lt(ct,e))}catch(i){ct(e,i)}}).prototype,(n=function(t){F(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(U,{then:function(t,e){var i=Y(this),n=V(M(this,W));return n.ok=!y(t)||t,n.fail=y(e)&&e,n.domain=P?Z.domain:void 0,i.parent=!0,i.reactions.push(n),0!=i.state&&nt(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=lt(ut,e),this.reject=lt(ct,e)},D.f=V=function(t){return t===W||t===o?new r(t):J(t)},!l&&y(h)&&H!==Object.prototype)){s=H.then,$||(f(H,"then",function(t,e){var i=this;return new W(function(t,e){s.call(i,t,e)}).then(t,e)},{unsafe:!0}),f(H,"catch",U.catch,{unsafe:!0}));try{delete H.constructor}catch(ht){}g&&g(H,U)}a({global:!0,wrap:!0,forced:tt},{Promise:W}),p(W,R,!1,!0),v(R),o=u(R),a({target:R,stat:!0,forced:tt},{reject:function(t){var e=V(this);return e.reject.call(void 0,t),e.promise}}),a({target:R,stat:!0,forced:l||tt},{resolve:function(t){return k(l&&this===o?W:this,t)}}),a({target:R,stat:!0,forced:et},{all:function(t){var e=this,i=V(e),n=i.resolve,r=i.reject,o=A(function(){var i=m(e.resolve),o=[],s=0,a=1;C(t,function(t){var l=s++,c=!1;o.push(void 0),a++,i.call(e,t).then(function(t){c||(c=!0,o[l]=t,--a||n(o))},r)}),--a||n(o)});return o.error&&r(o.value),i.promise},race:function(t){var e=this,i=V(e),n=i.reject,r=A(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),s=i(1138),a=i(5744),l=i(2853),c=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),s(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(c.apply(t,n))}var r=i.prototype,u=l(a(r)?r:Object.prototype),g=Function.apply.call(t,u,e);return a(g)?g:u}})},1367:function(){},5454:function(t,e,i){var n=i(863).charAt,r=i(4845),o=i(3326),s=i(7218),a="String Iterator",l=o.set,c=o.getterFor(a);s(String,"String",function(t){l(this,{type:a,string:r(t),index:0})},function(){var t,e=c(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){var n=i(3085),r=i(4277).trim;n({target:"String",proto:!0,forced:i(6815)("trim")},{trim:function(){return r(this)}})},9781:function(t,e,i){i(1488)("asyncIterator")},492:function(){},6681:function(t,e,i){i(1488)("hasInstance")},9594:function(t,e,i){i(1488)("isConcatSpreadable")},3665:function(t,e,i){i(1488)("iterator")},6187:function(t,e,i){var n=i(3085),r=i(8576),o=i(150),s=i(5546),a=i(69),l=i(3045),c=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),x=i(774),_=i(2853),C=i(7653),I=i(2092),M=i(4052),S=i(4750),w=i(5141),k=i(2760),T=i(6007),D=i(9482),A=i(8717),E=i(9766),O=i(4535),j=i(2759),L=i(8182),P=i(9207),N=i(1488),z=i(1284),R=i(3326),B=i(454).forEach,F=E("hidden"),Y="Symbol",H="prototype",W=L("toPrimitive"),U=R.set,G=R.getterFor(Y),X=Object[H],Z=r.Symbol,V=o("JSON","stringify"),J=w.f,Q=k.f,K=M.f,q=T.f,$=A("symbols"),tt=A("op-symbols"),et=A("string-to-symbol-registry"),it=A("symbol-to-string-registry"),nt=A("wks"),rt=r.QObject,ot=!rt||!rt[H]||!rt[H].findChild,st=a&&c(function(){return 7!=_(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,at=function(t,e){var i=$[t]=_(Z[H]);return U(i,{type:Y,tag:t,description:e}),a||(i.description=e),i},lt=function(t,e,i){t===X&<(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=_(i,{enumerable:x(0,!1)})):(u(t,F)||Q(t,F,x(1,{})),t[F][n]=!0),st(t,n,i)):Q(t,n,i)},ct=function(t,e){p(t);var i=m(e),n=C(i).concat(dt(i));return B(n,function(e){a&&!ut.call(i,e)||lt(t,e,i[e])}),t},ut=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)},ht=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}},ft=function(t){var e=K(m(t)),i=[];return B(e,function(t){u($,t)||u(O,t)||i.push(t)}),i},dt=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(l||(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),st(this,e,x(1,t))};return a&&ot&&st(X,e,{configurable:!0,set:i}),at(e,t)},D(Z[H],"toString",function(){return G(this).tag}),D(Z,"withoutSetter",function(t){return at(j(t),t)}),T.f=ut,k.f=lt,w.f=ht,I.f=M.f=ft,S.f=dt,P.f=function(t){return at(L(t),t)},a&&(Q(Z[H],"description",{configurable:!0,get:function(){return G(this).description}}),s||D(X,"propertyIsEnumerable",ut,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:Z}),B(C(nt),function(t){N(t)}),n({target:Y,stat:!0,forced:!l},{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:!l,sham:!a},{create:function(t,e){return void 0===e?_(t):ct(_(t),e)},defineProperty:lt,defineProperties:ct,getOwnPropertyDescriptor:ht}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ft,getOwnPropertySymbols:dt}),n({target:"Object",stat:!0,forced:c(function(){S.f(1)})},{getOwnPropertySymbols:function(t){return S.f(v(t))}}),V&&n({target:"JSON",stat:!0,forced:!l||c(function(){var t=Z();return"[null]"!=V([t])||"{}"!=V({a:t})||"{}"!=V(Object(t))})},{stringify:function(t,e,i){for(var n,r=[t],o=1;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)}}),!Z[H][W]){var gt=Z[H].valueOf;D(Z[H],W,function(){return gt.apply(this,arguments)})}z(Z,Y),O[F]=!0},1250:function(t,e,i){i(1488)("matchAll")},9017:function(t,e,i){i(1488)("match")},9786:function(t,e,i){i(1488)("replace")},503:function(t,e,i){i(1488)("search")},6565:function(t,e,i){i(1488)("species")},9322:function(t,e,i){i(1488)("split")},3610:function(t,e,i){i(1488)("toPrimitive")},6886:function(t,e,i){i(1488)("toStringTag")},3514:function(t,e,i){i(1488)("unscopables")},177:function(t,e,i){i(1488)("asyncDispose")},9031:function(t,e,i){i(1488)("dispose")},6658:function(t,e,i){i(1488)("matcher")},1875:function(t,e,i){i(1488)("metadata")},8658:function(t,e,i){i(1488)("observable")},4592:function(t,e,i){i(1488)("patternMatch")},6680:function(t,e,i){i(1488)("replaceAll")},162:function(t,e,i){i(8939);var n=i(7365),r=i(8576),o=i(4696),s=i(8711),a=i(7771),l=i(8182)("toStringTag");for(var c in n){var u=r[c],h=u&&u.prototype;h&&o(h)!==l&&s(h,l,c),a[c]=a.Array}},2906:function(t,e,i){var n=i(3085),r=i(8576),o=i(6447),s=i(8989),a=[].slice,l=function(t){return function(e,i){var n=arguments.length>2,r=n?a.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:/MSIE .\./.test(s)},{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)})},9336:function(t,e,i){i(8939);var n=i(3085),r=i(150),o=i(4551),s=i(9482),a=i(533),l=i(1284),c=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),x=i(774),_=i(1669),C=i(8703),I=i(8182),M=r("fetch"),S=r("Request"),w=S&&S.prototype,k=r("Headers"),T=I("iterator"),D="URLSearchParams",A=D+"Iterator",E=u.set,O=u.getterFor(D),j=u.getterFor(A),L=/\+/g,P=Array(4),N=function(t){return P[t-1]||(P[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){for(;i;)e=e.replace(N(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)},W=function(t,e){if(e)for(var i,n,r=e.split("&"),o=0;o<r.length;)(i=r[o++]).length&&(n=i.split("="),t.push({key:R(n.shift()),value:R(n.join("="))}))},U=function(t){this.entries.length=0,W(this.entries,t)},G=function(t,e){if(t<e)throw TypeError("Not enough arguments")},X=c(function(t,e){E(this,{type:A,iterator:_(O(t).entries),kind:e})},"Iterator",function(){var t=j(this),e=t.kind,i=t.iterator.next(),n=i.value;return i.done||(i.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),i}),Z=function(){h(this,Z,D);var t,e,i,n,r,o,s,a,l,c=arguments.length>0?arguments[0]:void 0,u=[];if(E(this,{type:D,entries:u,updateURL:function(){},updateSearchParams:U}),void 0!==c)if(m(c))if(t=C(c))for(i=(e=_(c,t)).next;!(n=i.call(e)).done;){if((s=(o=(r=_(v(n.value))).next).call(r)).done||(a=o.call(r)).done||!o.call(r).done)throw TypeError("Expected sequence with length 2");u.push({key:y(s.value),value:y(a.value)})}else for(l in c)d(c,l)&&u.push({key:l,value:y(c[l])});else W(u,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:y(c))},V=Z.prototype;if(a(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);for(var e=O(this),i=e.entries,n=y(t),r=0;r<i.length;)i[r].key===n?i.splice(r,1):r++;e.updateURL()},get:function(t){G(arguments.length,1);for(var e=O(this).entries,i=y(t),n=0;n<e.length;n++)if(e[n].key===i)return e[n].value;return null},getAll:function(t){G(arguments.length,1);for(var e=O(this).entries,i=y(t),n=[],r=0;r<e.length;r++)e[r].key===i&&n.push(e[r].value);return n},has:function(t){G(arguments.length,1);for(var e=O(this).entries,i=y(t),n=0;n<e.length;)if(e[n++].key===i)return!0;return!1},set:function(t,e){G(arguments.length,1);for(var i,n=O(this),r=n.entries,o=!1,s=y(t),a=y(e),l=0;l<r.length;l++)(i=r[l]).key===s&&(o?r.splice(l--,1):(o=!0,i.value=a));o||r.push({key:s,value:a}),n.updateURL()},sort:function(){var t,e,i,n=O(this),r=n.entries,o=r.slice();for(r.length=0,i=0;i<o.length;i++){for(t=o[i],e=0;e<i;e++)if(r[e].key>t.key){r.splice(e,0,t);break}e===i&&r.push(t)}n.updateURL()},forEach:function(t){for(var e,i=O(this).entries,n=g(t,arguments.length>1?arguments[1]:void 0,3),r=0;r<i.length;)n((e=i[r++]).value,e.key,this)},keys:function(){return new X(this,"keys")},values:function(){return new X(this,"values")},entries:function(){return new X(this,"entries")}},{enumerable:!0}),s(V,T,V.entries,{name:"entries"}),s(V,"toString",function(){for(var t,e=O(this).entries,i=[],n=0;n<e.length;)t=e[n++],i.push(H(t.key)+"="+H(t.value));return i.join("&")},{enumerable:!0}),l(Z,D),n({global:!0,forced:!o},{URLSearchParams:Z}),!o&&f(k)){var J=function(t){if(m(t)){var e,i=t.body;if(p(i)===D)return(e=t.headers?new k(t.headers):new k).has("content-type")||e.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),b(t,{body:x(0,String(i)),headers:x(0,e)})}return t};if(f(M)&&n({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return M(t,arguments.length>1?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){i(5454);var n,r=i(3085),o=i(69),s=i(4551),a=i(8576),l=i(1187),c=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),x=a.URL,_=y.URLSearchParams,C=y.getState,I=b.set,M=b.getterFor("URL"),S=Math.floor,w=Math.pow,k="Invalid scheme",T="Invalid host",D="Invalid port",A=/[A-Za-z]/,E=/[\d+-.A-Za-z]/,O=/\d/,j=/^0x/i,L=/^[0-7]+$/,P=/^\d+$/,N=/^[\dA-Fa-f]+$/,z=/[\0\t\n\r #%/:<>?@[\\\]^|]/,R=/[\0\t\n\r #/:<>?@[\\\]^|]/,B=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,F=/[\t\n\r]/g,Y=function(t,e){var i,n,r;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return T;if(!(i=W(e.slice(1,-1))))return T;t.host=i}else if(K(t)){if(e=p(e),z.test(e))return T;if(null===(i=H(e)))return T;t.host=i}else{if(R.test(e))return T;for(i="",n=d(e),r=0;r<n.length;r++)i+=J(n[r],G);t.host=i}},H=function(t){var e,i,n,r,o,s,a,l=t.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(e=l.length)>4)return t;for(i=[],n=0;n<e;n++){if(""==(r=l[n]))return t;if(o=10,r.length>1&&"0"==r.charAt(0)&&(o=j.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)s=0;else{if(!(10==o?P:8==o?L:N).test(r))return t;s=parseInt(r,o)}i.push(s)}for(n=0;n<e;n++)if(s=i[n],n==e-1){if(s>=w(256,5-e))return null}else if(s>255)return null;for(a=i.pop(),n=0;n<i.length;n++)a+=i[n]*w(256,3-n);return a},W=function(t){var e,i,n,r,o,s,a,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,f=function(){return t.charAt(h)};if(":"==f()){if(":"!=t.charAt(1))return;h+=2,u=++c}for(;f();){if(8==c)return;if(":"!=f()){for(e=i=0;i<4&&N.test(f());)e=16*e+parseInt(f(),16),h++,i++;if("."==f()){if(0==i)return;if(h-=i,c>6)return;for(n=0;f();){if(r=null,n>0){if(!("."==f()&&n<4))return;h++}if(!O.test(f()))return;for(;O.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++}l[c]=256*l[c]+r,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;l[c++]=e}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(s=c-u,c=7;0!=c&&s>0;)a=l[c],l[c--]=l[u+s-1],l[u+--s]=a;else if(8!=c)return;return l},U=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=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}(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},G={},X=f({},G,{" ":1,'"':1,"<":1,">":1,"`":1}),Z=f({},X,{"#":1,"?":1,"{":1,"}":1}),V=f({},Z,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),J=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},K=function(t){return h(Q,t.scheme)},q=function(t){return""!=t.username||""!=t.password},$=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},tt=function(t,e){var i;return 2==t.length&&A.test(t.charAt(0))&&(":"==(i=t.charAt(1))||!e&&"|"==i)},et=function(t){var e;return t.length>1&&tt(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},it=function(t){var e=t.path,i=e.length;!i||"file"==t.scheme&&1==i&&tt(e[0],!0)||e.pop()},nt=function(t){return"."===t||"%2e"===t.toLowerCase()},rt=function(t){return".."===(t=t.toLowerCase())||"%2e."===t||".%2e"===t||"%2e%2e"===t},ot={},st={},at={},lt={},ct={},ut={},ht={},ft={},dt={},gt={},pt={},vt={},mt={},yt={},bt={},xt={},_t={},Ct={},It={},Mt={},St={},wt=function(t,e,i,r){var o,s,a,l,c=i||ot,u=0,f="",g=!1,p=!1,v=!1;for(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(B,"")),e=e.replace(F,""),o=d(e);u<=o.length;){switch(s=o[u],c){case ot:if(!s||!A.test(s)){if(i)return k;c=at;continue}f+=s.toLowerCase(),c=st;break;case st:if(s&&(E.test(s)||"+"==s||"-"==s||"."==s))f+=s.toLowerCase();else{if(":"!=s){if(i)return k;f="",c=at,u=0;continue}if(i&&(K(t)!=h(Q,f)||"file"==f&&(q(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=f,i)return void(K(t)&&Q[t.scheme]==t.port&&(t.port=null));f="","file"==t.scheme?c=yt:K(t)&&r&&r.scheme==t.scheme?c=lt:K(t)?c=ft:"/"==o[u+1]?(c=ct,u++):(t.cannotBeABaseURL=!0,t.path.push(""),c=It)}break;case at:if(!r||r.cannotBeABaseURL&&"#"!=s)return k;if(r.cannotBeABaseURL&&"#"==s){t.scheme=r.scheme,t.path=r.path.slice(),t.query=r.query,t.fragment="",t.cannotBeABaseURL=!0,c=St;break}c="file"==r.scheme?yt:ut;continue;case lt:if("/"!=s||"/"!=o[u+1]){c=ut;continue}c=dt,u++;break;case ct:if("/"==s){c=gt;break}c=Ct;continue;case ut:if(t.scheme=r.scheme,s==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("/"==s||"\\"==s&&K(t))c=ht;else if("?"==s)t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.query="",c=Mt;else{if("#"!=s){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,t.path=r.path.slice(),t.path.pop(),c=Ct;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="",c=St}break;case ht:if(!K(t)||"/"!=s&&"\\"!=s){if("/"!=s){t.username=r.username,t.password=r.password,t.host=r.host,t.port=r.port,c=Ct;continue}c=gt}else c=dt;break;case ft:if(c=dt,"/"!=s||"/"!=f.charAt(u+1))continue;u++;break;case dt:if("/"!=s&&"\\"!=s){c=gt;continue}break;case gt:if("@"==s){g&&(f="%40"+f),g=!0,a=d(f);for(var m=0;m<a.length;m++){var y=a[m];if(":"!=y||v){var b=J(y,V);v?t.password+=b:t.username+=b}else v=!0}f=""}else if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&K(t)){if(g&&""==f)return"Invalid authority";u-=d(f).length+1,f="",c=pt}else f+=s;break;case pt:case vt:if(i&&"file"==t.scheme){c=xt;continue}if(":"!=s||p){if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&K(t)){if(K(t)&&""==f)return T;if(i&&""==f&&(q(t)||null!==t.port))return;if(l=Y(t,f))return l;if(f="",c=_t,i)return;continue}"["==s?p=!0:"]"==s&&(p=!1),f+=s}else{if(""==f)return T;if(l=Y(t,f))return l;if(f="",c=mt,i==vt)return}break;case mt:if(!O.test(s)){if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&K(t)||i){if(""!=f){var x=parseInt(f,10);if(x>65535)return D;t.port=K(t)&&x===Q[t.scheme]?null:x,f=""}if(i)return;c=_t;continue}return D}f+=s;break;case yt:if(t.scheme="file","/"==s||"\\"==s)c=bt;else{if(!r||"file"!=r.scheme){c=Ct;continue}if(s==n)t.host=r.host,t.path=r.path.slice(),t.query=r.query;else if("?"==s)t.host=r.host,t.path=r.path.slice(),t.query="",c=Mt;else{if("#"!=s){et(o.slice(u).join(""))||(t.host=r.host,t.path=r.path.slice(),it(t)),c=Ct;continue}t.host=r.host,t.path=r.path.slice(),t.query=r.query,t.fragment="",c=St}}break;case bt:if("/"==s||"\\"==s){c=xt;break}r&&"file"==r.scheme&&!et(o.slice(u).join(""))&&(tt(r.path[0],!0)?t.path.push(r.path[0]):t.host=r.host),c=Ct;continue;case xt:if(s==n||"/"==s||"\\"==s||"?"==s||"#"==s){if(!i&&tt(f))c=Ct;else if(""==f){if(t.host="",i)return;c=_t}else{if(l=Y(t,f))return l;if("localhost"==t.host&&(t.host=""),i)return;f="",c=_t}continue}f+=s;break;case _t:if(K(t)){if(c=Ct,"/"!=s&&"\\"!=s)continue}else if(i||"?"!=s)if(i||"#"!=s){if(s!=n&&(c=Ct,"/"!=s))continue}else t.fragment="",c=St;else t.query="",c=Mt;break;case Ct:if(s==n||"/"==s||"\\"==s&&K(t)||!i&&("?"==s||"#"==s)){if(rt(f)?(it(t),"/"==s||"\\"==s&&K(t)||t.path.push("")):nt(f)?"/"==s||"\\"==s&&K(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&tt(f)&&(t.host&&(t.host=""),f=f.charAt(0)+":"),t.path.push(f)),f="","file"==t.scheme&&(s==n||"?"==s||"#"==s))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==s?(t.query="",c=Mt):"#"==s&&(t.fragment="",c=St)}else f+=J(s,Z);break;case It:"?"==s?(t.query="",c=Mt):"#"==s?(t.fragment="",c=St):s!=n&&(t.path[0]+=J(s,G));break;case Mt:i||"#"!=s?s!=n&&("'"==s&&K(t)?t.query+="%27":t.query+="#"==s?"%23":J(s,G)):(t.fragment="",c=St);break;case St:s!=n&&(t.fragment+=J(s,X))}u++}},kt=function(t){var e,i,n=u(this,kt,"URL"),r=arguments.length>1?arguments[1]:void 0,s=v(t),a=I(n,{type:"URL"});if(void 0!==r)if(r instanceof kt)e=M(r);else if(i=wt(e={},v(r)))throw TypeError(i);if(i=wt(a,s,null,e))throw TypeError(i);var l=a.searchParams=new _,c=C(l);c.updateSearchParams(a.query),c.updateURL=function(){a.query=String(l)||null},o||(n.href=Dt.call(n),n.origin=At.call(n),n.protocol=Et.call(n),n.username=Ot.call(n),n.password=jt.call(n),n.host=Lt.call(n),n.hostname=Pt.call(n),n.port=Nt.call(n),n.pathname=zt.call(n),n.search=Rt.call(n),n.searchParams=Bt.call(n),n.hash=Ft.call(n))},Tt=kt.prototype,Dt=function(){var t=M(this),e=t.scheme,i=t.username,n=t.password,r=t.host,o=t.port,s=t.path,a=t.query,l=t.fragment,c=e+":";return null!==r?(c+="//",q(t)&&(c+=i+(n?":"+n:"")+"@"),c+=U(r),null!==o&&(c+=":"+o)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==a&&(c+="?"+a),null!==l&&(c+="#"+l),c},At=function(){var t=M(this),e=t.scheme,i=t.port;if("blob"==e)try{return new kt(e.path[0]).origin}catch(n){return"null"}return"file"!=e&&K(t)?e+"://"+U(t.host)+(null!==i?":"+i:""):"null"},Et=function(){return M(this).scheme+":"},Ot=function(){return M(this).username},jt=function(){return M(this).password},Lt=function(){var t=M(this),e=t.host,i=t.port;return null===e?"":null===i?U(e):U(e)+":"+i},Pt=function(){var t=M(this).host;return null===t?"":U(t)},Nt=function(){var t=M(this).port;return null===t?"":String(t)},zt=function(){var t=M(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},Rt=function(){var t=M(this).query;return t?"?"+t:""},Bt=function(){return M(this).searchParams},Ft=function(){var t=M(this).fragment;return t?"#"+t:""},Yt=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(o&&l(Tt,{href:Yt(Dt,function(t){var e=M(this),i=v(t),n=wt(e,i);if(n)throw TypeError(n);C(e.searchParams).updateSearchParams(e.query)}),origin:Yt(At),protocol:Yt(Et,function(t){var e=M(this);wt(e,v(t)+":",ot)}),username:Yt(Ot,function(t){var e=M(this),i=d(v(t));if(!$(e)){e.username="";for(var n=0;n<i.length;n++)e.username+=J(i[n],V)}}),password:Yt(jt,function(t){var e=M(this),i=d(v(t));if(!$(e)){e.password="";for(var n=0;n<i.length;n++)e.password+=J(i[n],V)}}),host:Yt(Lt,function(t){var e=M(this);e.cannotBeABaseURL||wt(e,v(t),pt)}),hostname:Yt(Pt,function(t){var e=M(this);e.cannotBeABaseURL||wt(e,v(t),vt)}),port:Yt(Nt,function(t){var e=M(this);$(e)||(""==(t=v(t))?e.port=null:wt(e,t,mt))}),pathname:Yt(zt,function(t){var e=M(this);e.cannotBeABaseURL||(e.path=[],wt(e,v(t),_t))}),search:Yt(Rt,function(t){var e=M(this);""==(t=v(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",wt(e,t,Mt)),C(e.searchParams).updateSearchParams(e.query)}),searchParams:Yt(Bt),hash:Yt(Ft,function(t){var e=M(this);""!=(t=v(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",wt(e,t,St)):e.fragment=null})}),c(Tt,"toJSON",function(){return Dt.call(this)},{enumerable:!0}),c(Tt,"toString",function(){return Dt.call(this)},{enumerable:!0}),x){var Ht=x.createObjectURL,Wt=x.revokeObjectURL;Ht&&c(kt,"createObjectURL",function(t){return Ht.apply(x,arguments)}),Wt&&c(kt,"revokeObjectURL",function(t){return Wt.apply(x,arguments)})}m(kt,"URL"),r({global:!0,forced:!s,sham:!o},{URL:kt})},9801:function(){},3822:function(t,e,i){var n=i(2221);t.exports=n},1434:function(t,e,i){var n=i(5078);t.exports=n},6899:function(t,e,i){var n=i(98);t.exports=n},7710:function(t,e,i){var n=i(5739);i(162),t.exports=n},4486:function(t,e,i){var n=i(278);t.exports=n},4877:function(t,e,i){var n=i(1484);t.exports=n},7178:function(t,e,i){var n=i(7731);t.exports=n},5603:function(t,e,i){var n=i(3669);t.exports=n},1206:function(t,e,i){i(162);var n=i(6899),r=i(4696),o=Array.prototype,s={DOMTokenList:!0,NodeList:!0};t.exports=function(t){var e=t.forEach;return t===o||t instanceof Array&&e===o.forEach||s.hasOwnProperty(r(t))?n:e}},6174:function(t,e,i){var n=i(2604);t.exports=n},57:function(t,e,i){var n=i(263);t.exports=n},4741:function(t,e,i){var n=i(7663);t.exports=n},8368:function(t,e,i){var n=i(5063);t.exports=n},3739:function(t,e,i){var n=i(6813);t.exports=n},172:function(t,e,i){var n=i(6285);t.exports=n},4963:function(t,e,i){var n=i(3213);t.exports=n},7820:function(t,e,i){var n=i(3512);t.exports=n},8980:function(t,e,i){var n=i(8168);t.exports=n},5636:function(t,e,i){var n=i(8651);t.exports=n},6672:function(t,e,i){var n=i(3083);t.exports=n},5059:function(t,e,i){var n=i(2987);t.exports=n},3969:function(t,e,i){var n=i(2239);t.exports=n},6618:function(t,e,i){var n=i(3154);i(162),t.exports=n},5279:function(t,e,i){var n=i(6577);t.exports=n},9562:function(t,e,i){i(2906);var n=i(7545);t.exports=n.setTimeout},2285:function(t,e,i){var n=i(5008);i(162),t.exports=n},8535:function(t,e,i){var n=i(994);i(162),t.exports=n},652:function(t,e,i){var n=i(5668);t.exports=n},5668:function(t,e,i){i(4948),i(9801),i(9336);var n=i(7545);t.exports=n.URL},2534:function(t){t.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyBkaXNwbGF5PSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KPGRlZnMgaWQ9InR1aS1pbWFnZS1lZGl0b3Itc3ZnLWRlZmF1bHQtaWNvbnMiPgo8c3ltYm9sIGlkPSJpYy1hcHBseSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNNCAxMi4wMTFsNSA1TDIwLjAxMSA2Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1jYW5jZWwiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTYgNmwxMiAxMk0xOCA2TDYgMTgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWNyb3AiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIC8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik00IDBoMXYyMGExIDEgMCAwIDEtMS0xVjB6TTIwIDE3aC0xVjVoMXYxMnptMCAydjVoLTF2LTVoMXoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTUgMTloMTl2MUg1ek00Ljc2MiA0djFIMFY0aDQuNzYyek03IDRoMTJhMSAxIDAgMCAxIDEgMUg3VjR6Ii8+Cjwvc3ltYm9sPgo8IS0tIFRoaXMgaWNvbiBtYWRlIGJ5IFBpeGVsIHBlcmZlY3QgZnJvbSB3d3cuZmxhdGljb24uY29tIC0tPgo8c3ltYm9sIGlkPSJpYy1yZXNpemUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgc3Ryb2tlPSJub25lIiBmaWxsPSJub25lIi8+CiAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNIDE4Ljk4ODI4MSAzLjAxMTcxOSBDIDE4LjgwMDc4MSAyLjgyNDIxOSAxOC41IDIuODI0MjE5IDE4LjMxMjUgMy4wMTE3MTkgTCAxMS42MjEwOTQgOS43MDcwMzEgQyAxMS40Mjk2ODggOS44OTQ1MzEgMTEuNDI5Njg4IDEwLjE5NTMxMiAxMS42MjEwOTQgMTAuMzc4OTA2IEMgMTEuNzEwOTM4IDEwLjQ3MjY1NiAxMS44MzU5MzggMTAuNTE5NTMxIDExLjk1NzAzMSAxMC41MTk1MzEgQyAxMi4wNzgxMjUgMTAuNTE5NTMxIDEyLjIwMzEyNSAxMC40NzI2NTYgMTIuMjkyOTY5IDEwLjM3ODkwNiBMIDE4Ljk4ODI4MSAzLjY4NzUgQyAxOS4xNzU3ODEgMy41IDE5LjE3NTc4MSAzLjE5OTIxOSAxOC45ODgyODEgMy4wMTE3MTkgWiBNIDE4Ljk4ODI4MSAzLjAxMTcxOSAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTguNjUyMzQ0IDIuODY3MTg4IEMgMTguMzg2NzE5IDIuODY3MTg4IDE4LjE3MTg3NSAzLjA4MjAzMSAxOC4xNzE4NzUgMy4zNDc2NTYgTCAxOC4xNzE4NzUgOS4wODU5MzggQyAxOC4xNzE4NzUgOS4zNDc2NTYgMTguMzg2NzE5IDkuNTYyNSAxOC42NTIzNDQgOS41NjI1IEMgMTguOTE3OTY5IDkuNTYyNSAxOS4xMzI4MTIgOS4zNDc2NTYgMTkuMTMyODEyIDkuMDg1OTM4IEwgMTkuMTMyODEyIDMuMzQ3NjU2IEMgMTkuMTMyODEyIDMuMDgyMDMxIDE4LjkxNzk2OSAyLjg2NzE4OCAxOC42NTIzNDQgMi44NjcxODggWiBNIDE4LjY1MjM0NCAyLjg2NzE4OCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTguNjUyMzQ0IDIuODY3MTg4IEwgMTIuOTE0MDYyIDIuODY3MTg4IEMgMTIuNjUyMzQ0IDIuODY3MTg4IDEyLjQzNzUgMy4wODIwMzEgMTIuNDM3NSAzLjM0NzY1NiBDIDEyLjQzNzUgMy42MTMyODEgMTIuNjUyMzQ0IDMuODI4MTI1IDEyLjkxNDA2MiAzLjgyODEyNSBMIDE4LjY1MjM0NCAzLjgyODEyNSBDIDE4LjkxNzk2OSAzLjgyODEyNSAxOS4xMzI4MTIgMy42MTMyODEgMTkuMTMyODEyIDMuMzQ3NjU2IEMgMTkuMTMyODEyIDMuMDgyMDMxIDE4LjkxNzk2OSAyLjg2NzE4OCAxOC42NTIzNDQgMi44NjcxODggWiBNIDE4LjY1MjM0NCAyLjg2NzE4OCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMTAuMzc4OTA2IDExLjYyMTA5NCBDIDEwLjE5NTMxMiAxMS40MzM1OTQgOS44OTA2MjUgMTEuNDMzNTk0IDkuNzAzMTI1IDExLjYyMTA5NCBMIDMuMDA3ODEyIDE4LjMxNjQwNiBDIDIuODIwMzEyIDE4LjUgMi44MjAzMTIgMTguODA0Njg4IDMuMDA3ODEyIDE4Ljk5MjE4OCBDIDMuMTA1NDY5IDE5LjA4NTkzOCAzLjIyNjU2MiAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEMgMy40Njg3NSAxOS4xMzI4MTIgMy41ODk4NDQgMTkuMDg1OTM4IDMuNjgzNTk0IDE4Ljk5MjE4OCBMIDEwLjM3ODkwNiAxMi4yOTY4NzUgQyAxMC41NjY0MDYgMTIuMTA5Mzc1IDEwLjU2NjQwNiAxMS44MDQ2ODggMTAuMzc4OTA2IDExLjYyMTA5NCBaIE0gMTAuMzc4OTA2IDExLjYyMTA5NCAiLz4KICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0gMy4zNDc2NTYgMTIuNDM3NSBDIDMuMDgyMDMxIDEyLjQzNzUgMi44NjcxODggMTIuNjUyMzQ0IDIuODY3MTg4IDEyLjkxNDA2MiBMIDIuODY3MTg4IDE4LjY1MjM0NCBDIDIuODY3MTg4IDE4LjkxNzk2OSAzLjA4MjAzMSAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEMgMy42MTMyODEgMTkuMTMyODEyIDMuODI4MTI1IDE4LjkxNzk2OSAzLjgyODEyNSAxOC42NTIzNDQgTCAzLjgyODEyNSAxMi45MTQwNjIgQyAzLjgyODEyNSAxMi42NTIzNDQgMy42MTMyODEgMTIuNDM3NSAzLjM0NzY1NiAxMi40Mzc1IFogTSAzLjM0NzY1NiAxMi40Mzc1ICIvPgogIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTSA5LjA4NTkzOCAxOC4xNzE4NzUgTCAzLjM0NzY1NiAxOC4xNzE4NzUgQyAzLjA4MjAzMSAxOC4xNzE4NzUgMi44NjcxODggMTguMzg2NzE5IDIuODY3MTg4IDE4LjY1MjM0NCBDIDIuODY3MTg4IDE4LjkxNzk2OSAzLjA4MjAzMSAxOS4xMzI4MTIgMy4zNDc2NTYgMTkuMTMyODEyIEwgOS4wODU5MzggMTkuMTMyODEyIEMgOS4zNDc2NTYgMTkuMTMyODEyIDkuNTYyNSAxOC45MTc5NjkgOS41NjI1IDE4LjY1MjM0NCBDIDkuNTYyNSAxOC4zODY3MTkgOS4zNDc2NTYgMTguMTcxODc1IDkuMDg1OTM4IDE4LjE3MTg3NSBaIE0gOS4wODU5MzggMTguMTcxODc1ICIvPgogIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTSAyMC41NjI1IDAgTCAxLjQzNzUgMCBDIDAuNjQ0NTMxIDAgMCAwLjY0NDUzMSAwIDEuNDM3NSBMIDAgMjAuNTYyNSBDIDAgMjEuMzU1NDY5IDAuNjQ0NTMxIDIyIDEuNDM3NSAyMiBMIDIwLjU2MjUgMjIgQyAyMS4zNTU0NjkgMjIgMjIgMjEuMzU1NDY5IDIyIDIwLjU2MjUgTCAyMiAxLjQzNzUgQyAyMiAwLjY0NDUzMSAyMS4zNTU0NjkgMCAyMC41NjI1IDAgWiBNIDIxLjA0Mjk2OSAyMC41NjI1IEMgMjEuMDQyOTY5IDIwLjgyODEyNSAyMC44MjgxMjUgMjEuMDQyOTY5IDIwLjU2MjUgMjEuMDQyOTY5IEwgMS40Mzc1IDIxLjA0Mjk2OSBDIDEuMTcxODc1IDIxLjA0Mjk2OSAwLjk1NzAzMSAyMC44MjgxMjUgMC45NTcwMzEgMjAuNTYyNSBMIDAuOTU3MDMxIDEuNDM3NSBDIDAuOTU3MDMxIDEuMTcxODc1IDEuMTcxODc1IDAuOTU3MDMxIDEuNDM3NSAwLjk1NzAzMSBMIDIwLjU2MjUgMC45NTcwMzEgQyAyMC44MjgxMjUgMC45NTcwMzEgMjEuMDQyOTY5IDEuMTcxODc1IDIxLjA0Mjk2OSAxLjQzNzUgWiBNIDIxLjA0Mjk2OSAyMC41NjI1ICIvPgo8L3N5bWJvbD4KPCEtLSAgLS0+CjxzeW1ib2wgaWQ9ImljLWRlbGV0ZS1hbGwiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik01IDIzSDNhMSAxIDAgMCAxLTEtMVY2aDF2MTZoMnYxem0xNi0xMGgtMVY2aDF2N3pNOSAxM0g4di0zaDF2M3ptMyAwaC0xdi0zaDF2M3ptMyAwaC0xdi0zaDF2M3pNMTQuNzk0IDMuNzk0TDEzIDJoLTNMOC4yMDYgMy43OTRBLjk2My45NjMgMCAwIDEgOCAyLjVsLjcwMy0xLjA1NUExIDEgMCAwIDEgOS41MzUgMWgzLjkzYTEgMSAwIDAgMSAuODMyLjQ0NUwxNSAyLjVhLjk2NS45NjUgMCAwIDEtLjIwNiAxLjI5NHpNMTQuMTk3IDRIOC44MDNoNS4zOTR6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0wIDNoMjN2MUgwek0xMS4yODYgMjFIOC43MTRMOCAyM0g3bDEtMi44VjIwaC4wNzFMOS41IDE2aDFsMS40MjkgNEgxMnYuMmwxIDIuOGgtMWwtLjcxNC0yem0tLjM1Ny0xTDEwIDE3LjQgOS4wNzEgMjBoMS44NTh6TTIwIDIyaDN2MWgtNHYtN2gxdjZ6bS01IDBoM3YxaC00di03aDF2NnoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWRlbGV0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTMgNnYxNmgxN1Y2aDF2MTZhMSAxIDAgMCAxLTEgMUgzYTEgMSAwIDAgMS0xLTFWNmgxek0xNC43OTQgMy43OTRMMTMgMmgtM0w4LjIwNiAzLjc5NEEuOTYzLjk2MyAwIDAgMSA4IDIuNWwuNzAzLTEuMDU1QTEgMSAwIDAgMSA5LjUzNSAxaDMuOTNhMSAxIDAgMCAxIC44MzIuNDQ1TDE1IDIuNWEuOTY1Ljk2NSAwIDAgMS0uMjA2IDEuMjk0ek0xNC4xOTcgNEg4LjgwM2g1LjM5NHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTAgM2gyM3YxSDB6TTggMTBoMXY2SDh2LTZ6bTMgMGgxdjZoLTF2LTZ6bTMgMGgxdjZoLTF2LTZ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1kcmF3LWZyZWUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yLjUgMjAuOTI5QzIuNTk0IDEwLjk3NiA0LjMyMyA2IDcuNjg2IDZjNS44NzIgMCAyLjUyNCAxOSA3LjY5NyAxOXMxLjg5LTE0LjkyOSA2LjQxNC0xNC45MjkgMS4zNTcgMTAuODU4IDUuMTMgMTAuODU4YzEuODAyIDAgMi42NTctMi4yNjIgMi41NjYtNi43ODYiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWRyYXctbGluZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIgMTUuNWgyOCIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtZHJhdyIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIuNSAyMS41SDVjLjI0NSAwIC40OC0uMDU4LjY5MS0uMTY4bC4xMjQtLjA2NS4xNC4wMWMuNDI5LjAyOC44NS0uMTI3IDEuMTYtLjQzN0wyMi41NSA1LjQwNWEuNS41IDAgMCAwIDAtLjcwN2wtMy4yNDYtMy4yNDVhLjUuNSAwIDAgMC0uNzA3IDBMMy4xNjIgMTYuODg4YTEuNDk1IDEuNDk1IDAgMCAwLS40MzcgMS4xNTVsLjAxLjE0LS4wNjUuMTIzYy0uMTExLjIxMi0uMTcuNDQ4LS4xNy42OTR2Mi41eiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTYuNDE0IDMuNzA3bDMuODkgMy44OS0uNzA4LjcwNi0zLjg4OS0zLjg4OXoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWZpbHRlciIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTEyIDd2MUgyVjdoMTB6bTYgMGg0djFoLTRWN3pNMTIgMTZ2MWgxMHYtMUgxMnptLTYgMEgydjFoNHYtMXoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTguNSAyMGEzLjUgMy41IDAgMSAxIDAtNyAzLjUgMy41IDAgMCAxIDAgN3ptMC0xYTIuNSAyLjUgMCAxIDAgMC01IDIuNSAyLjUgMCAwIDAgMCA1ek0xNS41IDExYTMuNSAzLjUgMCAxIDEgMC03IDMuNSAzLjUgMCAwIDEgMCA3em0wLTFhMi41IDIuNSAwIDEgMCAwLTUgMi41IDIuNSAwIDAgMCAwIDV6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwLXJlc2V0IiB2aWV3Qm94PSIwIDAgMzEgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMzEgMEgwdjMyaDMxeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMjggMTZhOCA4IDAgMCAxLTggOEgzdi0xaDF2LTdIM2E4IDggMCAwIDEgOC04aDE3djFoLTF2N2gxek0xMSA5YTcgNyAwIDAgMC03IDd2N2gxNmE3IDcgMCAwIDAgNy03VjlIMTF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0yNCA1bDMuNSAzLjVMMjQgMTJNNyAyMGwtMy41IDMuNUw3IDI3Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwLXgiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGQ9Ik0zMiAzMkgwVjBoMzJ6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xNyAzMmgtMVYwaDF6TTI3LjE2NyAxMWwuNSAzaC0xLjAzbC0uNTQ2LTNoMS4wNzZ6bS0uNS0zaC0xLjEyMkwyNSA1aC01VjRoNS4xNTNhMSAxIDAgMCAxIC45ODYuODM2TDI2LjY2NyA4em0xLjUgOWwuNSAzaC0uOTRsLS41NDUtM2guOTg1em0xIDZsLjYzOSAzLjgzNkExIDEgMCAwIDEgMjguODE5IDI4SDI2di0xaDNsLS43MjYtNGguODk0ek0yMyAyOGgtM3YtMWgzdjF6TTEzIDR2MUg3TDMgMjdoMTB2MUgzLjE4YTEgMSAwIDAgMS0uOTg2LTEuMTY0bDMuNjY2LTIyQTEgMSAwIDAgMSA2Ljg0NyA0SDEzeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtZmxpcC15IiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMCAwdjMyaDMyVjB6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0wIDE2djFoMzJ2LTF6TTExIDI3LjE2N2wzIC41di0xLjAzbC0zLS41NDZ2MS4wNzZ6bS0zLS41di0xLjEyMkw1IDI1di01SDR2NS4xNTNhMSAxIDAgMCAwIC44MzYuOTg2TDggMjYuNjY3em05IDEuNWwzIC41di0uOTRsLTMtLjU0NXYuOTg1em02IDFsMy44MzYuNjM5QTEgMSAwIDAgMCAyOCAyOC44MlYyNmgtMXYzbC00LS43Mjd2Ljg5NHpNMjggMjN2LTNoLTF2M2gxek00IDEzaDFWN2wyMi00djEwaDFWMy4xOGExIDEgMCAwIDAtMS4xNjQtLjk4NmwtMjIgMy42NjdBMSAxIDAgMCAwIDQgNi44NDdWMTN6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1mbGlwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiAvPgogICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgc3Ryb2tlPSJub25lIiBkPSJNMTEgMGgxdjI0aC0xek0xOSAyMXYtMWgydi0yaDF2MmExIDEgMCAwIDEtMSAxaC0yem0tMiAwaC0zdi0xaDN2MXptNS01aC0xdi0zaDF2M3ptMC01aC0xVjhoMXYzem0wLTVoLTFWNGgtMlYzaDJhMSAxIDAgMCAxIDEgMXYyem0tNS0zdjFoLTNWM2gzek05IDN2MUgydjE2aDd2MUgyYTEgMSAwIDAgMS0xLTFWNGExIDEgMCAwIDEgMS0xaDd6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBkPSJNMCAwSDI0VjI0SDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNzQwIC0xNikgdHJhbnNsYXRlKDU0NyA4KSB0cmFuc2xhdGUoMTkzIDgpIi8+CiAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBzdHJva2U9Im5vbmUiIGQ9Ik0xMi41IDFDMTguMjk5IDEgMjMgNS43MDEgMjMgMTEuNVMxOC4yOTkgMjIgMTIuNSAyMmMtNS4yOSAwLTkuNjY1LTMuOTExLTEwLjM5NC04Ljk5OWgxLjAxMkMzLjgzOCAxNy41MzQgNy43NjQgMjEgMTIuNSAyMWM1LjI0NyAwIDkuNS00LjI1MyA5LjUtOS41UzE3Ljc0NyAyIDEyLjUgMkM4LjQ5IDIgNS4wNiA0LjQ4NSAzLjY2NiA4SDNoNHYxSDJWNGgxdjMuMDIyQzQuNjggMy40NjIgOC4zMDMgMSAxMi41IDF6bS41IDVsLS4wMDEgNS4yOTEgMi41MzcgMi41MzctLjcwOC43MDhMMTIuMjkyIDEySDEyVjZoMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC03NDAgLTE2KSB0cmFuc2xhdGUoNTQ3IDgpIHRyYW5zbGF0ZSgxOTMgOCkiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktY2hlY2siIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBzdHJva2U9IiM1NTU1NTUiIGQ9Ik00LjUgLTFMMS41IDIgNi41IDciIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02MCAtODA0KSB0cmFuc2xhdGUoNjAgODA0KSB0cmFuc2xhdGUoMiAzKSByb3RhdGUoLTkwIDQgMykiIC8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWNyb3AiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC04NCAtODA0KSB0cmFuc2xhdGUoODQgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDBoMXYxMGMtLjU1MiAwLTEtLjQ0OC0xLTFWMHpNMTAgOXYzSDlWOWgxek05IDJoMXY2SDlWMnoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC04NCAtODA0KSB0cmFuc2xhdGUoODQgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDlIMTJWMTBIMnpNOSAyYy41MTMgMCAuOTM2LjM4Ni45OTMuODgzTDEwIDNIM1YyaDZ6TTIgM0gwVjJoMnYxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTg0IC04MDQpIHRyYW5zbGF0ZSg4NCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8IS0tIFRoaXMgaWNvbiBtYWRlIGJ5IFBpeGVsIHBlcmZlY3QgZnJvbSB3d3cuZmxhdGljb24uY29tIC0tPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LXJlc2l6ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSA5LjQ5MjE4OCAxLjUwNzgxMiBDIDkuMzk4NDM4IDEuNDE0MDYyIDkuMjUgMS40MTQwNjIgOS4xNTYyNSAxLjUwNzgxMiBMIDUuODEyNSA0Ljg1MTU2MiBDIDUuNzE0ODQ0IDQuOTQ1MzEyIDUuNzE0ODQ0IDUuMDk3NjU2IDUuODEyNSA1LjE4NzUgQyA1Ljg1NTQ2OSA1LjIzNDM3NSA1LjkxNzk2OSA1LjI1NzgxMiA1Ljk3NjU2MiA1LjI1NzgxMiBDIDYuMDM5MDYyIDUuMjU3ODEyIDYuMTAxNTYyIDUuMjM0Mzc1IDYuMTQ4NDM4IDUuMTg3NSBMIDkuNDkyMTg4IDEuODQzNzUgQyA5LjU4NTkzOCAxLjc1IDkuNTg1OTM4IDEuNjAxNTYyIDkuNDkyMTg4IDEuNTA3ODEyIFogTSA5LjQ5MjE4OCAxLjUwNzgxMiAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gOS4zMjgxMjUgMS40MzM1OTQgQyA5LjE5NTMxMiAxLjQzMzU5NCA5LjA4NTkzOCAxLjUzOTA2MiA5LjA4NTkzOCAxLjY3MTg3NSBMIDkuMDg1OTM4IDQuNTQyOTY5IEMgOS4wODU5MzggNC42NzE4NzUgOS4xOTUzMTIgNC43ODEyNSA5LjMyODEyNSA0Ljc4MTI1IEMgOS40NjA5MzggNC43ODEyNSA5LjU2NjQwNiA0LjY3MTg3NSA5LjU2NjQwNiA0LjU0Mjk2OSBMIDkuNTY2NDA2IDEuNjcxODc1IEMgOS41NjY0MDYgMS41MzkwNjIgOS40NjA5MzggMS40MzM1OTQgOS4zMjgxMjUgMS40MzM1OTQgWiBNIDkuMzI4MTI1IDEuNDMzNTk0ICIvPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSA5LjMyODEyNSAxLjQzMzU5NCBMIDYuNDU3MDMxIDEuNDMzNTk0IEMgNi4zMjgxMjUgMS40MzM1OTQgNi4yMTg3NSAxLjUzOTA2MiA2LjIxODc1IDEuNjcxODc1IEMgNi4yMTg3NSAxLjgwNDY4OCA2LjMyODEyNSAxLjkxNDA2MiA2LjQ1NzAzMSAxLjkxNDA2MiBMIDkuMzI4MTI1IDEuOTE0MDYyIEMgOS40NjA5MzggMS45MTQwNjIgOS41NjY0MDYgMS44MDQ2ODggOS41NjY0MDYgMS42NzE4NzUgQyA5LjU2NjQwNiAxLjUzOTA2MiA5LjQ2MDkzOCAxLjQzMzU5NCA5LjMyODEyNSAxLjQzMzU5NCBaIE0gOS4zMjgxMjUgMS40MzM1OTQgIi8+CiAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNIDUuMTg3NSA1LjgxMjUgQyA1LjA5NzY1NiA1LjcxODc1IDQuOTQ1MzEyIDUuNzE4NzUgNC44NTE1NjIgNS44MTI1IEwgMS41MDM5MDYgOS4xNTYyNSBDIDEuNDEwMTU2IDkuMjUgMS40MTAxNTYgOS40MDIzNDQgMS41MDM5MDYgOS40OTYwOTQgQyAxLjU1NDY4OCA5LjU0Mjk2OSAxLjYxMzI4MSA5LjU2NjQwNiAxLjY3MTg3NSA5LjU2NjQwNiBDIDEuNzM0Mzc1IDkuNTY2NDA2IDEuNzk2ODc1IDkuNTQyOTY5IDEuODQzNzUgOS40OTYwOTQgTCA1LjE4NzUgNi4xNDg0MzggQyA1LjI4MTI1IDYuMDU0Njg4IDUuMjgxMjUgNS45MDIzNDQgNS4xODc1IDUuODEyNSBaIE0gNS4xODc1IDUuODEyNSAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gMS42NzE4NzUgNi4yMTg3NSBDIDEuNTM5MDYyIDYuMjE4NzUgMS40MzM1OTQgNi4zMjgxMjUgMS40MzM1OTQgNi40NTcwMzEgTCAxLjQzMzU5NCA5LjMyODEyNSBDIDEuNDMzNTk0IDkuNDYwOTM4IDEuNTM5MDYyIDkuNTY2NDA2IDEuNjcxODc1IDkuNTY2NDA2IEMgMS44MDQ2ODggOS41NjY0MDYgMS45MTQwNjIgOS40NjA5MzggMS45MTQwNjIgOS4zMjgxMjUgTCAxLjkxNDA2MiA2LjQ1NzAzMSBDIDEuOTE0MDYyIDYuMzI4MTI1IDEuODA0Njg4IDYuMjE4NzUgMS42NzE4NzUgNi4yMTg3NSBaIE0gMS42NzE4NzUgNi4yMTg3NSAiLz4KICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0gNC41NDI5NjkgOS4wODU5MzggTCAxLjY3MTg3NSA5LjA4NTkzOCBDIDEuNTM5MDYyIDkuMDg1OTM4IDEuNDMzNTk0IDkuMTk1MzEyIDEuNDMzNTk0IDkuMzI4MTI1IEMgMS40MzM1OTQgOS40NjA5MzggMS41MzkwNjIgOS41NjY0MDYgMS42NzE4NzUgOS41NjY0MDYgTCA0LjU0Mjk2OSA5LjU2NjQwNiBDIDQuNjcxODc1IDkuNTY2NDA2IDQuNzgxMjUgOS40NjA5MzggNC43ODEyNSA5LjMyODEyNSBDIDQuNzgxMjUgOS4xOTUzMTIgNC42NzE4NzUgOS4wODU5MzggNC41NDI5NjkgOS4wODU5MzggWiBNIDQuNTQyOTY5IDkuMDg1OTM4ICIvPgogICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTSAxMC4yODEyNSAwIEwgMC43MTg3NSAwIEMgMC4zMjAzMTIgMCAwIDAuMzIwMzEyIDAgMC43MTg3NSBMIDAgMTAuMjgxMjUgQyAwIDEwLjY3OTY4OCAwLjMyMDMxMiAxMSAwLjcxODc1IDExIEwgMTAuMjgxMjUgMTEgQyAxMC42Nzk2ODggMTEgMTEgMTAuNjc5Njg4IDExIDEwLjI4MTI1IEwgMTEgMC43MTg3NSBDIDExIDAuMzIwMzEyIDEwLjY3OTY4OCAwIDEwLjI4MTI1IDAgWiBNIDEwLjUyMzQzOCAxMC4yODEyNSBDIDEwLjUyMzQzOCAxMC40MTQwNjIgMTAuNDE0MDYyIDEwLjUyMzQzOCAxMC4yODEyNSAxMC41MjM0MzggTCAwLjcxODc1IDEwLjUyMzQzOCBDIDAuNTg1OTM4IDEwLjUyMzQzOCAwLjQ3NjU2MiAxMC40MTQwNjIgMC40NzY1NjIgMTAuMjgxMjUgTCAwLjQ3NjU2MiAwLjcxODc1IEMgMC40NzY1NjIgMC41ODU5MzggMC41ODU5MzggMC40NzY1NjIgMC43MTg3NSAwLjQ3NjU2MiBMIDEwLjI4MTI1IDAuNDc2NTYyIEMgMTAuNDE0MDYyIDAuNDc2NTYyIDEwLjUyMzQzOCAwLjU4NTkzOCAxMC41MjM0MzggMC43MTg3NSBaIE0gMTAuNTIzNDM4IDEwLjI4MTI1ICIvPgogIDwvZz4KPC9zeW1ib2w+CjwhLS0gIC0tPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWRyYXciIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDFIMTJWMTNIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNTYgLTgwNCkgdHJhbnNsYXRlKDE1NiA4MDMpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBkPSJNOS42MjIgMS41ODRsMS44MzUgMS42NTgtOC4zMSA4LjQwN0wuNSAxMi41VjExbDkuMTIyLTkuNDE2eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTE1NiAtODA0KSB0cmFuc2xhdGUoMTU2IDgwMykiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNNy42MjggMy43NTNMMTAuMzc4IDMuNzUzIDEwLjM3OCA0LjI1MyA3LjYyOCA0LjI1M3oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNTYgLTgwNCkgdHJhbnNsYXRlKDE1NiA4MDMpIHJvdGF0ZSg0NSA5LjAwMyA0LjAwMykiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktZmlsdGVyIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjc2IC04MDQpIHRyYW5zbGF0ZSgyNzYgODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0xMiAzdjFIOVYzaDN6TTcgNEgwVjNoN3YxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3NiAtODA0KSB0cmFuc2xhdGUoMjc2IDgwNCkiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNMTIgOHYxSDlWOGgzek03IDlIMFY4aDd2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNzYgLTgwNCkgdHJhbnNsYXRlKDI3NiA4MDQpIG1hdHJpeCgtMSAwIDAgMSAxMiAwKSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik04IDFjMS4xMDUgMCAyIC44OTUgMiAycy0uODk1IDItMiAyLTItLjg5NS0yLTIgLjg5NS0yIDItMnptMCAxYy0uNTUyIDAtMSAuNDQ4LTEgMXMuNDQ4IDEgMSAxIDEtLjQ0OCAxLTEtLjQ0OC0xLTEtMXpNNCA3YzEuMTA1IDAgMiAuODk1IDIgMnMtLjg5NSAyLTIgMi0yLS44OTUtMi0yIC44OTUtMiAyLTJ6bTAgMWMtLjU1MiAwLTEgLjQ0OC0xIDFzLjQ0OCAxIDEgMSAxLS40NDggMS0xLS40NDgtMS0xLTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjc2IC04MDQpIHRyYW5zbGF0ZSgyNzYgODA0KSIvPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS1mbGlwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTA4IC04MDQpIHRyYW5zbGF0ZSgxMDggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik02IDBMNyAwIDcgMTIgNiAxMnpNMTEgMTBWOWgxdjEuNWMwIC4yNzYtLjIyNC41LS41LjVIMTB2LTFoMXpNNSAxdjFIMXY4aDR2MUguNWMtLjI3NiAwLS41LS4yMjQtLjUtLjV2LTljMC0uMjc2LjIyNC0uNS41LS41SDV6bTcgNXYyaC0xVjZoMXptMC0zdjJoLTFWM2gxek05IDF2MUg3VjFoMnptMi41IDBjLjI3NiAwIC41LjIyNC41LjVWMmgtMlYxaDEuNXpNOSAxMUg3di0xaDJ2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDggLTgwNCkgdHJhbnNsYXRlKDEwOCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LWljb24iIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMDQgLTgwNCkgdHJhbnNsYXRlKDIwNCA4MDQpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS4xIiBkPSJNNiA5LjU2OEwyLjYwMSAxMSAyLjk3NSA3LjQ2NyAwLjUgNC44MiA0LjEzIDQuMDY4IDYgMSA3Ljg3IDQuMDY4IDExLjUgNC44MiA5LjAyNSA3LjQ2NyA5LjM5OSAxMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMDQgLTgwNCkgdHJhbnNsYXRlKDIwNCA4MDQpIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LW1hc2siIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNTIgLTgwNCkgdHJhbnNsYXRlKDI1MiA4MDQpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTAgMEgxMlYxMkgweiIvPgogICAgICAgICAgICA8Y2lyY2xlIGN4PSI2IiBjeT0iNiIgcj0iMi41IiBzdHJva2U9IiM0NDQiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTExLjUgMGMuMjc2IDAgLjUuMjI0LjUuNXYxMWMwIC4yNzYtLjIyNC41LS41LjVILjVjLS4yNzYgMC0uNS0uMjI0LS41LS41Vi41QzAgLjIyNC4yMjQgMCAuNSAwaDExek0xMSAxSDF2MTBoMTBWMXoiLz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oaXN0b3J5LXJvdGF0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGlkPSJyZm40cnlsZmZhIiBkPSJNNyAxMmMtLjMzNSAwLS42NjMtLjAyNS0uOTgzLS4wNzRDMy4xNzEgMTEuNDkyIDEgOS4yMDUgMSA2LjQ0NGMwLTEuMzYzLjUzNC0yLjYxMyAxLjQxNS0zLjU4Ii8+CiAgICAgICAgPG1hc2sgaWQ9IjZmOWduMmR5c2IiIHdpZHRoPSI2IiBoZWlnaHQ9IjkuMTM2IiB4PSIwIiB5PSIwIiBtYXNrVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94Ij4KICAgICAgICAgICAgPHVzZSB4bGluazpocmVmPSIjcmZuNHJ5bGZmYSIgc3Ryb2tlPSI0MzQzNDMiLz4KICAgICAgICA8L21hc2s+CiAgICA8L2RlZnM+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMzIgLTgwNCkgdHJhbnNsYXRlKDEzMiA4MDQpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTAgMC41SDEyVjEyLjVIMHoiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTYuNSAxQzkuNTM4IDEgMTIgMy40NjIgMTIgNi41YzAgMi4zNy0xLjUgNC4zOS0zLjYgNS4xNjNsLS40MDctLjkxNkM5Ljc0NCAxMC4xMyAxMSA4LjQ2MiAxMSA2LjUgMTEgNC4wMTUgOC45ODUgMiA2LjUgMmMtLjc3NyAwLTEuNTA5LjE5Ny0yLjE0Ny41NDRMNCAxLjc1bC0uMjA1LS4wNEM0LjU5NCAxLjI1OCA1LjUxNyAxIDYuNSAxeiIvPgogICAgICAgICAgICA8dXNlIHN0cm9rZT0iIzQzNDM0MyIgc3Ryb2tlLWRhc2hhcnJheT0iMiAxLjI1IiBzdHJva2Utd2lkdGg9IjEiIG1hc2s9InVybCgjNmY5Z24yZHlzYikiIHhsaW5rOmhyZWY9IiNyZm40cnlsZmZhIi8+CiAgICAgICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik00LjI3OSAwTDYgMS43NSA0LjI1IDMuNTcxIDMuNTQzIDIuODY0IDQuNTg2IDEuNzUgMy41NzIgMC43MDd6IiB0cmFuc2Zvcm09Im1hdHJpeCgtMSAwIDAgMSA5LjU0MyAwKSIvPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3Rvcnktc2hhcGUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyBmaWxsPSJub25lIiBzdHJva2U9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgPgogICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xODAgLTgwNCkgdHJhbnNsYXRlKDE4MCA4MDQpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTExLjUgNGMuMjc2IDAgLjUuMjI0LjUuNXY3YzAgLjI3Ni0uMjI0LjUtLjUuNWgtN2MtLjI3NiAwLS41LS4yMjQtLjUtLjVWOC44aDFWMTFoNlY1SDguMzQxbC0uNTY4LTFIMTEuNXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xODAgLTgwNCkgdHJhbnNsYXRlKDE4MCA4MDQpIi8+CiAgICAgICAgPHBhdGggc3Ryb2tlPSIjNDM0MzQzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik00LjUgMC41TDguNSA3LjYxMSAwLjUgNy42MTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTgwIC04MDQpIHRyYW5zbGF0ZSgxODAgODA0KSIvPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS10ZXh0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiID4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI4IC04MDQpIHRyYW5zbGF0ZSgyMjggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0yIDFoOGMuNTUyIDAgMSAuNDQ4IDEgMUgxYzAtLjU1Mi40NDgtMSAxLTF6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI4IC04MDQpIHRyYW5zbGF0ZSgyMjggODA0KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik0xIDFIMlYzSDF6TTEwIDFIMTFWM0gxMHpNNS41IDFMNi41IDEgNi41IDExIDUuNSAxMXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMjggLTgwNCkgdHJhbnNsYXRlKDIyOCA4MDQpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTQgMTBIOFYxMUg0eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIyOCAtODA0KSB0cmFuc2xhdGUoMjI4IDgwNCkiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktbG9hZCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8cGF0aCBkPSJNMCAwSDEyVjEySDB6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzI0IC04MDUpIHRyYW5zbGF0ZSgzMjQgODA1KSIvPgogICAgICAgIDxwYXRoIGZpbGw9IiM0MzQzNDMiIGQ9Ik01IDBjLjU1MiAwIDEgLjQ0OCAxIDF2MWg1LjVjLjI3NiAwIC41LjIyNC41LjV2OGMwIC4yNzYtLjIyNC41LS41LjVILjVjLS4yNzYgMC0uNS0uMjI0LS41LS41VjFjMC0uNTUyLjQ0OC0xIDEtMWg0em0wIDFIMXY5aDEwVjNINVYxeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyNCAtODA1KSB0cmFuc2xhdGUoMzI0IDgwNSkiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjNDM0MzQzIiBkPSJNMSAyTDUgMiA1IDMgMSAzeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyNCAtODA1KSB0cmFuc2xhdGUoMzI0IDgwNSkiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWhpc3RvcnktZGVsZXRlIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGZpbGw9IiM0MzQzNDMiPgogICAgICAgICAgICA8cGF0aCBkPSJNMiA5aDhWMWgxdjguNWMwIC4yNzYtLjIyNC41LS41LjVoLTljLS4yNzYgMC0uNS0uMjI0LS41LS41VjFoMXY4ek0wIDBIMTJWMUgweiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMwMCAtODA0KSB0cmFuc2xhdGUoMzAwIDgwNCkgdHJhbnNsYXRlKDAgMikiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTQgM0g1VjdINHpNNyAzSDhWN0g3eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMwMCAtODA0KSB0cmFuc2xhdGUoMzAwIDgwNCkgdHJhbnNsYXRlKDAgMikiLz4KICAgICAgICAgICAgPHBhdGggZD0iTTQgMWg0VjBoMXYxLjVjMCAuMjc2LS4yMjQuNS0uNS41aC01Yy0uMjc2IDAtLjUtLjIyNC0uNS0uNVYwaDF2MXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zMDAgLTgwNCkgdHJhbnNsYXRlKDMwMCA4MDQpIG1hdHJpeCgxIDAgMCAtMSAwIDIpIi8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaGlzdG9yeS1ncm91cCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ4IC04MDQpIHRyYW5zbGF0ZSgzNDggODA0KSI+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wIDBIMTJWMTJIMHoiLz4KICAgICAgICAgICAgPHBhdGggZmlsbD0iIzQzNDM0MyIgZD0iTTEgOXYyaDF2MUguNWMtLjI3NiAwLS41LS4yMjQtLjUtLjVWOWgxem0xMSAxdjEuNWMwIC4yNzYtLjIyNC41LS41LjVIOXYtMWgydi0xaDF6bS00IDF2MUg2di0xaDJ6bS0zIDB2MUgzdi0xaDJ6bTctNHYyaC0xVjdoMXpNMSA2djJIMFY2aDF6bTExLTJ2MmgtMVY0aDF6TTEgM3YySDBWM2gxem0xMC41LTNjLjI3NiAwIC41LjIyNC41LjVWM2gtMVYxaC0xVjBoMS41ek02IDB2MUg0VjBoMnptMyAwdjFIN1YwaDJ6TTAgLjVDMCAuMjI0LjIyNCAwIC41IDBIM3YxSDF2MUgwVi41ek05LjUgNGMuMjc2IDAgLjUuMjI0LjUuNXY1YzAgLjI3Ni0uMjI0LjUtLjUuNWgtNWMtLjI3NiAwLS41LS4yMjQtLjUtLjVWOC4zNTVjLjMxNy4wOTQuNjUyLjE0NSAxIC4xNDVWOWg0VjVoLS41YzAtLjM0OC0uMDUtLjY4My0uMTQ1LTFIOS41eiIvPgogICAgICAgICAgICA8Y2lyY2xlIGN4PSI1IiBjeT0iNSIgcj0iMi41IiBzdHJva2U9IiM0MzQzNDMiLz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1pY29uLWFycm93LTIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTIxLjc5MyAxOC41SDIuNXYtNWgxOC45MzVsLTcuNi04aDUuODcybDEwLjUgMTAuNS0xMC41IDEwLjVoLTUuOTE0bDgtOHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tYXJyb3ctMyIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMjUuMjg4IDE2LjQyTDE0LjIwOCAyNy41SDYuNzkybDExLjI5MS0xMS4yOTFMNi44MjYgNC41aDcuMzgxbDExLjY2MSAxMS42NjEtLjU4LjI1OHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tYXJyb3ciIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yLjUgMTEuNXY5aDE4djUuMjkzTDMwLjI5MyAxNiAyMC41IDYuMjA3VjExLjVoLTE4eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1idWJibGUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTIyLjIwNyAyNC41TDE2LjUgMzAuMjA3VjI0LjVIOEE2LjUgNi41IDAgMCAxIDEuNSAxOFY5QTYuNSA2LjUgMCAwIDEgOCAyLjVoMTZBNi41IDYuNSAwIDAgMSAzMC41IDl2OWE2LjUgNi41IDAgMCAxLTYuNSA2LjVoLTEuNzkzeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1oZWFydCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMTUuOTk2IDMwLjY3NWwxLjk4MS0xLjc5YzcuODk4LTcuMTc3IDEwLjM2NS05LjcxOCAxMi4xMzUtMTMuMDEyLjkyMi0xLjcxNiAxLjM3Ny0zLjM3IDEuMzc3LTUuMDc2IDAtNC42NS0zLjY0Ny04LjI5Ny04LjI5Ny04LjI5Ny0yLjMzIDAtNC44NiAxLjUyNy02LjgxNyAzLjgyNGwtLjM4LjQ0Ny0uMzgxLS40NDdDMTMuNjU4IDQuMDI3IDExLjEyNiAyLjUgOC43OTcgMi41IDQuMTQ3IDIuNS41IDYuMTQ3LjUgMTAuNzk3YzAgMS43MTQuNDYgMy4zNzUgMS4zODkgNS4wOTggMS43NzUgMy4yODggNC4yNiA1Ljg0MyAxMi4xMjMgMTIuOTc0bDEuOTg0IDEuODA2eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1sb2FkIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xNy4zMTQgMTguODY3bDEuOTUxLTIuNTMgNCA1LjE4NGgtMTdsNi41LTguODQgNC41NDkgNi4xODZ6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xOC4wMSA0YTExLjc5OCAxMS43OTggMCAwIDAgMCAxSDN2MjRoMjRWMTQuOTg2YTguNzM4IDguNzM4IDAgMCAwIDEgMFYyOWExIDEgMCAwIDEtMSAxSDNhMSAxIDAgMCAxLTEtMVY1YTEgMSAwIDAgMSAxLTFoMTUuMDF6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yNSAzaDF2OWgtMXoiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTTIyIDZsMy41LTMuNUwyOSA2Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1pY29uLWxvY2F0aW9uIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMTYgMzEuMjhDMjMuNjc1IDIzLjMwMiAyNy41IDE3LjE4MSAyNy41IDEzYzAtNi4zNTEtNS4xNDktMTEuNS0xMS41LTExLjVTNC41IDYuNjQ5IDQuNSAxM2MwIDQuMTgxIDMuODI1IDEwLjMwMiAxMS41IDE4LjI4eiIvPgogICAgPGNpcmNsZSBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGN4PSIxNiIgY3k9IjEzIiByPSI0LjUiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLWljb24tcG9seWdvbiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgZD0iTS41NzYgMTZMOC4yOSAyOS41aDE1LjQyTDMxLjQyNCAxNiAyMy43MSAyLjVIOC4yOUwuNTc2IDE2eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1zdGFyLTIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0xOS40NDYgMzEuNTkybDIuMjY1LTMuMjcyIDMuOTQ2LjI1LjYzNi0zLjk0IDMuNjY1LTEuNTA1LTEuMTItMy44MzIgMi42NTUtMi45NjItMi42NTYtMi45NjIgMS4xMi0zLjgzMi0zLjY2NC0xLjUwNS0uNjM2LTMuOTQxLTMuOTQ2LjI1LTIuMjY1LTMuMjcxTDE2IDMuMDI0IDEyLjU1NCAxLjA3IDEwLjI4OSA0LjM0bC0zLjk0Ni0uMjUtLjYzNiAzLjk0MS0zLjY2NSAxLjUwNSAxLjEyIDMuODMyTC41MDggMTYuMzNsMi42NTYgMi45NjItMS4xMiAzLjgzMiAzLjY2NCAxLjUwNC42MzYgMy45NDIgMy45NDYtLjI1IDIuMjY1IDMuMjdMMTYgMjkuNjM4bDMuNDQ2IDEuOTU1eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbi1zdGFyIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBkPSJNMjUuMjkyIDI5Ljg3OGwtMS43NzUtMTAuMzQ2IDcuNTE3LTcuMzI3LTEwLjM4OC0xLjUxTDE2IDEuMjgybC00LjY0NiA5LjQxMy0xMC4zODggMS41MSA3LjUxNyA3LjMyNy0xLjc3NSAxMC4zNDZMMTYgMjQuOTkzbDkuMjkyIDQuODg1eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtaWNvbiIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMTEuOTIzIDE5LjEzNkw1LjQyNCAyMmwuNzE1LTcuMDY1LTQuNzMxLTUuMjk2IDYuOTQtMS41MDNMMTEuOTIzIDJsMy41NzQgNi4xMzYgNi45NCAxLjUwMy00LjczMSA1LjI5NkwxOC40MiAyMnoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLW1hc2stbG9hZCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTguMDEgNGExMS43OTggMTEuNzk4IDAgMCAwIDAgMUgzdjI0aDI0VjE0Ljk4NmE4LjczOCA4LjczOCAwIDAgMCAxIDBWMjlhMSAxIDAgMCAxLTEgMUgzYTEgMSAwIDAgMS0xLTFWNWExIDEgMCAwIDEgMS0xaDE1LjAxek0xNSAyM2E2IDYgMCAxIDEgMC0xMiA2IDYgMCAwIDEgMCAxMnptMC0xYTUgNSAwIDEgMCAwLTEwIDUgNSAwIDAgMCAwIDEweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMjUgM2gxdjloLTF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIGQ9Ik0yMiA2bDMuNS0zLjVMMjkgNiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtbWFzayIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjQuNSIgc3Ryb2tlPSJpbmhlcml0IiBmaWxsPSJub25lIi8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yIDFoMjBhMSAxIDAgMCAxIDEgMXYyMGExIDEgMCAwIDEtMSAxSDJhMSAxIDAgMCAxLTEtMVYyYTEgMSAwIDAgMSAxLTF6bTAgMXYyMGgyMFYySDJ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1yZWRvIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgb3BhY2l0eT0iLjUiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIxIDZIOWE2IDYgMCAxIDAgMCAxMmgxMnYxSDlBNyA3IDAgMCAxIDkgNWgxMnYxeiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0ic3F1YXJlIiBkPSJNMTkgM2wyLjUgMi41TDE5IDgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJlc2V0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgb3BhY2l0eT0iLjUiIHN0cm9rZT0ibm9uZSIgZmlsbD0ibm9uZSIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMiAxM3YtMWE3IDcgMCAwIDEgNy03aDEzdjFoLTF2NWgxdjFhNyA3IDAgMCAxLTcgN0gydi0xaDF2LTVIMnptNy03YTYgNiAwIDAgMC02IDZ2NmgxMmE2IDYgMCAwIDAgNi02VjZIOXoiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iaW5oZXJpdCIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgZD0iTTE5IDNsMi41IDIuNUwxOSA4TTUgMTZsLTIuNSAyLjVMNSAyMSIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtcm90YXRlLWNsb2Nrd2lzZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTI5IDE3aC0uOTI0YzAgNi42MjctNS4zNzMgMTItMTIgMTItNi42MjggMC0xMi01LjM3My0xMi0xMkM0LjA3NiAxMC4zOTggOS40MDcgNS4wNDEgMTYgNVY0QzguODIgNCAzIDkuODIgMyAxN3M1LjgyIDEzIDEzIDEzIDEzLTUuODIgMTMtMTN6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0xNiAxLjVsNCAzLTQgMyIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNiA0aDR2MWgtNHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJvdGF0ZS1jb3VudGVyY2xvY2t3aXNlIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBkPSJNMyAxN2guOTI0YzAgNi42MjcgNS4zNzMgMTIgMTIgMTIgNi42MjggMCAxMi01LjM3MyAxMi0xMiAwLTYuNjAyLTUuMzMxLTExLjk2LTExLjkyNC0xMlY0YzcuMTggMCAxMyA1LjgyIDEzIDEzcy01LjgyIDEzLTEzIDEzUzMgMjQuMTggMyAxN3oiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNMTIgNGg0djFoLTR6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik0xNiAxLjVsLTQgMyA0IDMiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXJvdGF0ZSIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgLz4KICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIHN0cm9rZT0ibm9uZSIgZD0iTTguMzQ5IDIyLjI1NGExMC4wMDIgMTAuMDAyIDAgMCAxLTIuNzc4LTEuNzE5bC42NS0uNzZhOS4wMDIgOS4wMDIgMCAwIDAgMi40OTUgMS41NDhsLS4zNjcuOTMxem0yLjg3My43MDRsLjA3OC0uOTk3YTkgOSAwIDEgMC0uNTU3LTE3Ljg1MmwtLjE0LS45OUExMC4wNzYgMTAuMDc2IDAgMCAxIDEyLjE0NSAzYzUuNTIzIDAgMTAgNC40NzcgMTAgMTBzLTQuNDc3IDEwLTEwIDEwYy0uMzEyIDAtLjYyLS4wMTQtLjkyNC0uMDQyem0tNy41NTYtNC42NTVhOS45NDIgOS45NDIgMCAwIDEtMS4yNTMtMi45OTZsLjk3My0uMjM0YTguOTQ4IDguOTQ4IDAgMCAwIDEuMTI0IDIuNjkzbC0uODQ0LjUzN3ptLTEuNTAyLTUuOTFBOS45NDkgOS45NDkgMCAwIDEgMi44OCA5LjIzbC45MjUuMzgyYTguOTU0IDguOTU0IDAgMCAwLS42NDQgMi44NDRsLS45OTgtLjA2MnptMi4yMS01LjY4NmMuNjg3LS44NDggMS41MS0xLjU4IDIuNDM2LTIuMTY2bC41MjMuODUyYTkuMDQ4IDkuMDQ4IDAgMCAwLTIuMTg4IDEuOTVsLS43NzEtLjYzNnoiLz4KICAgIDxwYXRoIHN0cm9rZT0iaW5oZXJpdCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgZD0iTTEzIDFsLTIuNSAyLjVMMTMgNiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtc2hhcGUtY2lyY2xlIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPGNpcmNsZSBjeD0iMTYiIGN5PSIxNiIgcj0iMTQuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1zaGFwZS1yZWN0YW5nbGUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cmVjdCB3aWR0aD0iMjciIGhlaWdodD0iMjciIHg9IjIuNSIgeT0iMi41IiBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHJ4PSIxIi8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1zaGFwZS10cmlhbmdsZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTE2IDIuNWwxNS41IDI3SC41eiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtc2hhcGUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0xNC43MDYgOEgyMWExIDEgMCAwIDEgMSAxdjEyYTEgMSAwIDAgMS0xIDFIOWExIDEgMCAwIDEtMS0xdi00aDF2NGgxMlY5aC01LjcwNmwtLjU4OC0xeiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik04LjUgMS41bDcuNSAxM0gxeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdGV4dC1hbGlnbi1jZW50ZXIiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIgNWgyOHYxSDJ6TTggMTJoMTZ2MUg4ek0yIDE5aDI4djFIMnpNOCAyNmgxNnYxSDh6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWFsaWduLWxlZnQiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTIgNWgyOHYxSDJ6TTIgMTJoMTZ2MUgyek0yIDE5aDI4djFIMnpNMiAyNmgxNnYxSDJ6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWFsaWduLXJpZ2h0IiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJub25lIiBkPSJNMCAwaDMydjMySDB6Ii8+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9ImluaGVyaXQiIGQ9Ik0yIDVoMjh2MUgyek0xNCAxMmgxNnYxSDE0ek0yIDE5aDI4djFIMnpNMTQgMjZoMTZ2MUgxNHoiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXRleHQtYm9sZCIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNNyAyaDJ2Mkg3ek03IDI4aDJ2Mkg3eiIvPgogICAgPHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJpbmhlcml0IiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik05IDN2MTJoOWE2IDYgMCAxIDAgMC0xMkg5ek05IDE1djE0aDEwYTcgNyAwIDAgMCAwLTE0SDl6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0LWl0YWxpYyIgdmlld0JveD0iMCAwIDMyIDMyIj4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgzMnYzMkgweiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTUgMmg1djFoLTV6TTExIDI5aDV2MWgtNXpNMTcgM2gxbC00IDI2aC0xeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdGV4dC11bmRlcmxpbmUiIHZpZXdCb3g9IjAgMCAzMiAzMiI+CiAgICA8cGF0aCBzdHJva2U9Im5vbmUiIGZpbGw9Im5vbmUiIGQ9Ik0wIDBoMzJ2MzJIMHoiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTggMnYxNGE4IDggMCAxIDAgMTYgMFYyaDF2MTRhOSA5IDAgMCAxLTE4IDBWMmgxek0zIDI5aDI2djFIM3oiLz4KICAgIDxwYXRoIHN0cm9rZT0ibm9uZSIgZmlsbD0iaW5oZXJpdCIgZD0iTTUgMmg1djFINXpNMjIgMmg1djFoLTV6Ii8+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy10ZXh0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNNCAzaDE1YTEgMSAwIDAgMSAxIDFIM2ExIDEgMCAwIDEgMS0xek0zIDRoMXYxSDN6TTE5IDRoMXYxaC0xeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTEgM2gxdjE4aC0xeiIvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMTAgMjBoM3YxaC0zeiIvPgo8L3N5bWJvbD4KPHN5bWJvbCBpZD0iaWMtdW5kbyIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0yNCAwSDB2MjRoMjR6IiBvcGFjaXR5PSIuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJub25lIiAvPgogICAgPHBhdGggc3Ryb2tlPSJub25lIiBmaWxsPSJpbmhlcml0IiBkPSJNMyA2aDEyYTYgNiAwIDEgMSAwIDEySDN2MWgxMmE3IDcgMCAwIDAgMC0xNEgzdjF6Ii8+CiAgICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9ImluaGVyaXQiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIGQ9Ik01IDNMMi41IDUuNSA1IDgiLz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXpvb20taW4iIHZpZXdCb3g9IjAgMCAyNCAyNCI+CiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjI5IC0yOTApIHRyYW5zbGF0ZSgyMjkgMjkwKSI+CiAgICAgICAgPGNpcmNsZSBjeD0iMTAuNSIgY3k9IjEwLjUiIHI9IjkiIHN0cm9rZT0iaW5oZXJpdCIgZmlsbD0ibm9uZSIvPgogICAgICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIGQ9Ik0xOC44MjggMTUuODI4SDE5LjgyOFYyMi44MjhIMTguODI4eiIgdHJhbnNmb3JtPSJyb3RhdGUoLTQ1IDE5LjMyOCAxOS4zMjgpIi8+CiAgICAgICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgZD0iTTcgMTBIMTRWMTFIN3oiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBkPSJNMTAgN0gxMVYxNEgxMHoiLz4KICAgIDwvZz4KPC9zeW1ib2w+CjxzeW1ib2wgaWQ9ImljLXpvb20tb3V0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI2MyAtMjkwKSB0cmFuc2xhdGUoMjYzIDI5MCkiPgogICAgICAgIDxjaXJjbGUgY3g9IjEwLjUiIGN5PSIxMC41IiByPSI5IiBzdHJva2U9ImluaGVyaXQiIGZpbGw9Im5vbmUiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBkPSJNMTguODI4IDE1LjgyOEgxOS44MjhWMjIuODI4SDE4LjgyOHoiIHRyYW5zZm9ybT0icm90YXRlKC00NSAxOS4zMjggMTkuMzI4KSIvPgogICAgICAgIDxwYXRoIGZpbGw9ImluaGVyaXQiIGQ9Ik03IDEwSDE0VjExSDd6Ii8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8c3ltYm9sIGlkPSJpYy1oYW5kIiB2aWV3Qm94PSIwIDAgMjQgMjQiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik04LjY3MiAzLjM2YzEuMzI4IDAgMi4xMTQuNzggMi4yOSAxLjg2OWwuMDE0LjEwMS4wMjMuMDA2djEuMDQybC0uNjM4LS4xODVjLS4xODctLjA1NS0uMzIzLS4yMTEtLjM1NC0uMzk5TDEwIDUuNzEzYzAtLjgyNS0uNDItMS4zNTMtMS4zMjgtMS4zNTNDNy42OTUgNC4zNiA3IDUuMDQxIDcgNS43MTN2Ny45NDFjMCAuNDM5LS41MjQuNjY1LS44NDMuMzY0bC0xLjg2OC0xLjc2MWMtLjU5NS0uNTI4LTEuMzE2LS42MTctMS45MTgtLjIxNi0uNTIyLjM0OC0uNTYyIDEuMjAzLS4xOCAxLjhMNy43MzggMjJoMTEuMDEzbC4yODUtLjUxOGMxLjI0Ny0yLjMyNiAxLjg5Ny00LjI1OSAxLjk2LTUuNzg1bC4wMDQtLjIzOVY4LjAzNWMwLS42NTYtLjUtMS4xNy0xLTEuMTctLjUwMyAwLTEgLjQ1Ni0xIDEuMTcgMCAuMzMzLS4zMi41NzMtLjY0LjQ4TDE4IDguNDFWNy4zNjhsLjA4Ni4wMjYuMDQyLS4xMzZjLjI3OS0uODA1Ljk3OC0xLjMzMiAxLjczOC0xLjM4OEwyMCA1Ljg2NWMxLjA1NyAwIDIgLjk2NyAyIDIuMTd2Ny40MjNjMCAxLjkyOS0uODQ1IDQuMzUyLTIuNTIxIDcuMjktLjA5LjE1Ni0uMjU1LjI1Mi0uNDM1LjI1Mkg3LjQ3NGMtLjE2NiAwLS4zMjEtLjA4Mi0uNDE0LS4yMTlsLTUuNzA0LTguMzljLS42NTMtMS4wMTktLjU4NC0yLjQ4Ni40Ni0zLjE4MiAxLS42NjYgMi4yMTYtLjUxNiAzLjE0OC4zMUw2IDEyLjQ5NVY1LjcxM2MwLTEuMTggMS4wNTgtMi4yNjMgMi40OS0yLjM0OHoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yOTcgLTI5MCkgdHJhbnNsYXRlKDI5NyAyOTApIi8+CiAgICAgICAgPHBhdGggZmlsbD0iaW5oZXJpdCIgZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNMTIuNSAxLjVjMS4zMjUgMCAyLjQxIDEuMDMyIDIuNDk1IDIuMzM2TDE1IDR2Ny4yMmgtMVY0YzAtLjgyOC0uNjcyLTEuNS0xLjUtMS41LS43OCAwLTEuNDIuNTk1LTEuNDkzIDEuMzU2TDExIDR2Ny4yMmgtMVY0YzAtMS4zOCAxLjEyLTIuNSAyLjUtMi41eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI5NyAtMjkwKSB0cmFuc2xhdGUoMjk3IDI5MCkiLz4KICAgICAgICA8cGF0aCBmaWxsPSJpbmhlcml0IiBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNi41IDMuNWMxLjMyNSAwIDIuNDEgMS4wMzIgMi40OTUgMi4zMzZMMTkgNnY2LjNoLTFWNmMwLS44MjgtLjY3Mi0xLjUtMS41LTEuNS0uNzggMC0xLjQyLjU5NS0xLjQ5MyAxLjM1NkwxNSA2djIuNDRoLTFWNmMwLTEuMzggMS4xMi0yLjUgMi41LTIuNXoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yOTcgLTI5MCkgdHJhbnNsYXRlKDI5NyAyOTApIi8+CiAgICA8L2c+Cjwvc3ltYm9sPgo8L2RlZnM+Cjwvc3ZnPgo="},4858:function(t){t.exports=Ws},4960:function(){},6759:function(){},6272:function(){}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,i),o.exports}i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(ea){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var n={};return function(){i.d(n,{default:function(){return rl}});var t=i(9131),e=i.n(t),r=i(1899),o=i.n(r),s=i(6562),a=i.n(s),l=i(1734),c=i.n(l),u=i(8005),h=i.n(u),f=i(6065),d=i.n(f),g=i(4496),p=i.n(g);Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),"document"in self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(t){if("Element"in t){var i="classList",n="prototype",r=t.Element[n],s=Object,l=e()(String[n])||function(){return this.replace(/^\s+|\s+$/g,"")},u=o()(Array[n])||function(t){for(var e=0,i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1},h=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},f=function(t,e){if(""===e)throw new h("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(e))throw new h("INVALID_CHARACTER_ERR","The token must not contain space characters.");return u.call(t,e)},d=function(t){for(var e=l.call(t.getAttribute("class")||""),i=e?e.split(/\s+/):[],n=0,r=i.length;n<r;n++)this.push(i[n]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},g=d[n]=[],p=function(){return new d(this)};if(h[n]=Error[n],g.item=function(t){return this[t]||null},g.contains=function(t){return~f(this,t+"")},g.add=function(){var t,e=arguments,i=0,n=e.length,r=!1;do{~f(this,t=e[i]+"")||(this.push(t),r=!0)}while(++i<n);r&&this._updateClassName()},g.remove=function(){var t,e,i=arguments,n=0,r=i.length,o=!1;do{for(e=f(this,t=i[n]+"");~e;)a()(this).call(this,e,1),o=!0,e=f(this,t)}while(++n<r);o&&this._updateClassName()},g.toggle=function(t,e){var i=this.contains(t),n=i?!0!==e&&"remove":!1!==e&&"add";return n&&this[n](t),!0===e||!1===e?e:!i},g.replace=function(t,e){var i=f(t+"");~i&&(a()(this).call(this,i,1,e),this._updateClassName())},g.toString=function(){return this.join(" ")},c()){var v={get:p,enumerable:!0,configurable:!0};try{c()(r,i,v)}catch(m){void 0!==m.number&&-2146823252!==m.number||(v.enumerable=!1,c()(r,i,v))}}else s[n].__defineGetter__&&r.__defineGetter__(i,p)}}(self),function(){var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var i,n=arguments.length;for(i=0;i<n;i++)t=arguments[i],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:i.call(this,t)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(t,e){var i=this.toString().split(" "),n=o()(i).call(i,t+"");~n&&(i=h()(i).call(i,n),this.remove.apply(this,i),this.add(e),this.add.apply(this,h()(i).call(i,1)))}),t=null}()),function(){if("undefined"!=typeof window&&window.addEventListener){var t,e,i,n=d()(null),r=function(){clearTimeout(e),e=p()(t,100)},o=function(){},s=function(t){function e(t){var e;return void 0!==t.protocol?e=t:(e=document.createElement("a")).href=t,e.protocol.replace(/:/g,"")+e.host}var i,n,r;return window.XMLHttpRequest&&(i=new XMLHttpRequest,n=e(location),r=e(t),i=void 0===i.withCredentials&&""!==r&&r!==n?XDomainRequest||void 0:XMLHttpRequest),i},a="http://www.w3.org/1999/xlink";t=function(){var t,e,i,l,c,u,h,f,d,g,v=0;function m(){var t;0==(v-=1)&&(o(),window.addEventListener("resize",r,!1),window.addEventListener("orientationchange",r,!1),window.MutationObserver?((t=new MutationObserver(r)).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),o=function(){try{t.disconnect(),window.removeEventListener("resize",r,!1),window.removeEventListener("orientationchange",r,!1)}catch(e){}}):(document.documentElement.addEventListener("DOMSubtreeModified",r,!1),o=function(){document.documentElement.removeEventListener("DOMSubtreeModified",r,!1),window.removeEventListener("resize",r,!1),window.removeEventListener("orientationchange",r,!1)}))}function y(t){return function(){!0!==n[t.base]&&(t.useEl.setAttributeNS(a,"xlink:href","#"+t.hash),t.useEl.hasAttribute("href")&&t.useEl.setAttribute("href","#"+t.hash))}}function b(t){return function(){var e,i=document.body,n=document.createElement("x");t.onload=null,n.innerHTML=t.responseText,(e=n.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",i.insertBefore(e,i.firstChild)),m()}}function x(t){return function(){t.onerror=null,t.ontimeout=null,m()}}for(o(),d=document.getElementsByTagName("use"),c=0;c<d.length;c+=1){try{e=d[c].getBoundingClientRect()}catch(_){e=!1}t=(f=(l=d[c].getAttribute("href")||d[c].getAttributeNS(a,"href")||d[c].getAttribute("xlink:href"))&&l.split?l.split("#"):["",""])[0],i=f[1],u=e&&0===e.left&&0===e.right&&0===e.top&&0===e.bottom,e&&0===e.width&&0===e.height&&!u?(d[c].hasAttribute("href")&&d[c].setAttributeNS(a,"xlink:href",l),t.length&&(!0!==(g=n[t])&&p()(y({useEl:d[c],base:t,hash:i}),0),void 0===g&&void 0!==(h=s(t))&&(g=new h,n[t]=g,g.onload=b(g),g.onerror=x(g),g.ontimeout=x(g),g.open("GET",t),g.send(),v+=1))):u?t.length&&n[t]&&p()(y({useEl:d[c],base:t,hash:i}),0):void 0===n[t]?n[t]=!0:n[t].onload&&(n[t].abort(),delete n[t].onload,n[t]=!0)}d="",v+=1,m()},i=function(){window.removeEventListener("load",i,!1),e=p()(t,0)},"complete"!==document.readyState?window.addEventListener("load",i,!1):i()}}();var v=i(1845);function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var y=i(184),b=i(662),x=i(7172),_=i(711);function C(t,e){var i;if(t){if("string"==typeof t)return m(t,e);var n=_(i=Object.prototype.toString.call(t)).call(i,8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?x(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}function I(t){return function(t){if(v(t))return m(t)}(t)||function(t){if(void 0!==y&&null!=b(t)||null!=t["@@iterator"])return x(t)}(t)||C(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var M=i(7077);function S(t,e,i){return e in t?M(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),M(t,n.key,n)}}function T(t,e,i){return e&&k(t.prototype,e),i&&k(t,i),t}var D=i(4426),A=i.n(D),E=i(9406),O=i.n(E),j=i(8189),L=i.n(j),P=i(3972),N=i.n(P),z=i(2777),R=i(961),B=i.n(R),F=i(5695),Y=i.n(F),H=i(8592),W=i.n(H),U=i(9052),G=i.n(U),X=i(2560),Z=i.n(X),V=i(2461),J=i.n(V);function Q(t,e){return function(t){if(v(t))return t}(t)||function(t,e){var i=null==t?null:void 0!==y&&b(t)||t["@@iterator"];if(null!=i){var n,r,o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(n=i.next()).done)&&(o.push(n.value),!e||o.length!==e);s=!0);}catch(l){a=!0,r=l}finally{try{s||null==i.return||i.return()}finally{if(a)throw r}}return o}}(t,e)||C(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var K,q=i(6397),$=i.n(q),tt=i(7636),et=i.n(tt),it=i(789),nt=i.n(it),rt=i(4729),ot=i.n(rt),st=i(1610),at=i.n(st),lt=i(3053),ct=i.n(lt),ut=["zoomIn","zoomOut","hand"],ht=["history","undo","redo","reset"],ft=["delete","deleteAll"],dt=O()(K=[]).call(K,ut,ht,ft),gt="filter",pt="color",vt=["rect","circle","triangle"],mt="cropzone",yt="vintage",bt="sepia2",xt="removeColor",_t="colorFilter",Ct="removeWhite",It="blendColor",Mt="blend",St=Ni("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE","ZOOM","RESIZE"),wt={hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0,lockSkewingX:!0,lockSkewingY:!0},kt="clearObjects",Tt="loadImage",Dt="flip",At="rotate",Et="addObject",Ot="removeObject",jt="applyFilter",Lt="removeFilter",Pt="addIcon",Nt="changeIconColor",zt="addShape",Rt="changeShape",Bt="addText",Ft="changeText",Yt="changeTextStyle",Ht="addImageObject",Wt="resizeCanvasDimension",Ut="setObjectProperties",Gt="setObjectPosition",Xt="changeSelection",Zt="resize",Vt="objectActivated",Jt="objectMoved",Qt="objectScaled",Kt="objectRotated",qt="objectAdded",$t="objectModified",te="textEditing",ee="textChanged",ie="iconCreateResize",ne="iconCreateEnd",re="addText",oe="addObject",se="addObjectAfter",ae="mousedown",le="redoStackChanged",ce="undoStackChanged",ue="selectionCleared",he="selectionCreated",fe="executeCommand",de="afterUndo",ge="afterRedo",pe="zoomChanged",ve="handStarted",me="handStopped",ye="keydown",be="keyup",xe="inputBoxEditingStarted",_e="inputBoxEditingStopped",Ce="focus",Ie="blur",Me=".tui-colorpicker-palette-hex",Se="Load",we="Mask",ke="Mask",Te="Crop",De="Resize",Ae="Filter",Ee="Filter",Oe="Shape",je="Icon",Le="Text",Pe="Text",Ne="Delete",ze="Delete",Re=Ni("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON","ZOOM","RESIZE"),Be="text",Fe="crop",Ye="resize",He="shape",We="zoom",Ue="normal",Ge="zoom",Xe="hand",Ze=90,Ve=89,Je=67,Qe=86,Ke=16,qe=8,$e=46,ti=40,ei=38,ii=32,ni=48,ri=57,oi={borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1},si="The object is already added.",ai="The flipX and flipY setting values are not changed.",li="Invalid parameters.",ci="The executing command state is locked.",ui="The background image is empty.",hi="Invalid image loaded.",fi="The object is not in canvas.",di="The promise of redo command is reject.",gi="The promise of undo command is reject.",pi="Unsupported operation.",vi="Unsupported object type.",mi={"icon-arrow":"M40 12V0l24 24-24 24V36H0V12h40z","icon-arrow-2":'<g fill="#434343" fill-rule="evenodd"><path stroke="#434343" d="M21.793 18.5H2.5v-5h18.935l-7.6-8h5.872l10.5 10.5-10.5 10.5h-5.914l8-8z"/></g>',"icon-arrow-3":"M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ","icon-star":'\n<path fill="#1B499E" d="M15.832,6.936l6.732,20.789l-6.732-5.81l-6.396,5.81L15.832,6.936z M16.506,12.133v8.865l4.039,3.669\n\tL16.506,12.133z"/>\n<path fill="#1B499E" d="M14.598,2.621v2.274c-0.045,0.363,0.145,0.529,0.57,0.497V5.63h-1.413V5.392H13.8\n\tc0.289,0.017,0.434-0.11,0.434-0.379V2.218C14.112,2.155,13.96,2.116,13.778,2.1V1.862h1.185l2.392,2.582V2.621\n\tc0.047-0.395-0.137-0.569-0.547-0.521h-0.067V1.862h1.504v0.237h-0.068c-0.35,0-0.508,0.104-0.479,0.308v3.222h-0.319L14.598,2.621\n\tL14.598,2.621z"/>\n<g>\n\t<g>\n\t\t<path fill="#1B499E" d="M16.001,6.392c-6.627,0-12,5.373-12,12.001c0,6.625,5.373,11.998,12,11.998\n\t\t\tc6.627,0,11.998-5.373,11.998-11.998C27.999,11.764,22.628,6.392,16.001,6.392z M16.001,30.141c-6.49,0-11.75-5.262-11.75-11.748\n\t\t\tc0-6.491,5.26-11.751,11.75-11.751c6.488,0,11.748,5.26,11.748,11.751C27.749,24.879,22.489,30.141,16.001,30.141z"/>\n\t</g>\n</g>\n \n',"icon-star-2":'\n<g>\n\t<g>\n\t\t<g>\n\t\t\t<path fill="#1B499E" d="M15.97,4.167c-6.627,0-12,5.373-12,12c0,6.626,5.373,12,12,12c6.627,0,11.999-5.373,11.999-12\n\t\t\t\tC27.969,9.54,22.598,4.167,15.97,4.167z M15.97,27.917c-6.489,0-11.75-5.262-11.75-11.75c0-6.489,5.26-11.75,11.75-11.75\n\t\t\t\tc6.489,0,11.749,5.261,11.749,11.75C27.719,22.655,22.459,27.917,15.97,27.917z"/>\n\t\t</g>\n\t</g>\n\t<g>\n\t\t<g>\n\t\t\t<path fill="#1B499E" d="M15.971,2.167c-7.772,0-14.074,6.268-14.074,14s6.302,14.001,14.074,14.001\n\t\t\t\tc7.773,0,14.072-6.27,14.072-14.001S23.744,2.167,15.971,2.167z M15.971,29.875c-7.611,0-13.781-6.139-13.781-13.708\n\t\t\t\tc0-7.571,6.169-13.708,13.781-13.708S29.75,8.596,29.75,16.167C29.75,23.736,23.582,29.875,15.971,29.875z"/>\n\t\t</g>\n\t</g>\n\t<g>\n\t\t<path fill="#1B499E" stroke="#1B499E" stroke-width="0.5" d="M17.262,23.562c0,0.572-0.595,1.035-1.327,1.035l0,0\n\t\t\tc-0.732,0-1.326-0.463-1.326-1.035V7.105c0-0.573,0.594-1.996,1.326-1.996l0,0c0.732,0,1.327,1.422,1.327,1.996V23.562z"/>\n\t\t<path fill="#1B499E" stroke="#1B499E" stroke-width="0.5" d="M16.442,17.364c-0.262-0.172-0.237-0.669,0.054-1.115l0,0\n\t\t\tc0.292-0.445,0.74-0.668,1.002-0.497l7.525,4.928c0.262,0.172,0.676,0.959,0.385,1.402l0,0c-0.291,0.445-1.18,0.383-1.441,0.211\n\t\t\tL16.442,17.364z"/>\n\t\t<path fill="#1B499E" stroke="#1B499E" stroke-width="0.5" d="M15.497,17.362c0.262-0.17,0.237-0.667-0.054-1.113l0,0\n\t\t\tc-0.292-0.445-0.74-0.668-1.002-0.497l-7.524,4.926c-0.263,0.172-0.677,0.959-0.385,1.404l0,0\n\t\t\tc0.291,0.445,1.179,0.381,1.441,0.209L15.497,17.362z"/>\n\t\t<path fill="#1B499E" stroke="#1B499E" stroke-width="0.5" d="M15.515,24.007c0.08-0.104-0.02-0.293-0.222-0.422l0,0\n\t\t\tc-0.203-0.129-0.43-0.148-0.508-0.043l-2.258,3.035c-0.079,0.105-0.11,0.471,0.092,0.6l0,0c0.202,0.129,0.561-0.029,0.64-0.135\n\t\t\tL15.515,24.007z"/>\n\t\t<path fill="#1B499E" stroke="#1B499E" stroke-width="0.5" d="M16.477,24.007c-0.08-0.104,0.02-0.293,0.221-0.422l0,0\n\t\t\tc0.203-0.129,0.431-0.148,0.509-0.043l2.258,3.035c0.078,0.105,0.109,0.471-0.092,0.6l0,0c-0.203,0.129-0.561-0.029-0.641-0.135\n\t\t\tL16.477,24.007z"/>\n\t</g>\n</g>\n',"icon-polygon":'\n<g>\n\t<g>\n\t\t<g>\n\t\t\t<path fill="#19499C" d="M16.216,4c-6.627,0-12,5.373-12,12c0,6.626,5.373,12,12,12c6.626,0,11.998-5.373,11.998-12\n\t\t\t\tC28.214,9.373,22.843,4,16.216,4z M16.216,27.75c-6.49,0-11.75-5.262-11.75-11.75c0-6.489,5.26-11.75,11.75-11.75\n\t\t\t\tc6.488,0,11.748,5.261,11.748,11.75C27.964,22.488,22.704,27.75,16.216,27.75z"/>\n\t\t</g>\n\t</g>\n\t<g>\n\t\t<g>\n\t\t\t<path fill="#19499C" d="M16.216,2C8.444,2,2.142,8.268,2.142,16s6.302,14.001,14.074,14.001c7.773,0,14.072-6.27,14.072-14.001\n\t\t\t\tS23.989,2,16.216,2z M16.216,29.708C8.605,29.708,2.436,23.569,2.436,16c0-7.571,6.169-13.708,13.781-13.708\n\t\t\t\tc7.611,0,13.779,6.137,13.779,13.708C29.995,23.569,23.827,29.708,16.216,29.708z"/>\n\t\t</g>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<g>\n\t\t\t<path fill="#1B499E" d="M23.216,15.548h-5.25v-5.241h-1.75v5.241h-2.5l-2.75-1.75h-0.75V5.61l-1.671,1.47v6.717H8.215\n\t\t\t\tl-3.877,1.75l-0.123,0.75c0,6.628,5.373,12,12,12c6.375,0,11.574-4.975,11.962-11.25h-4.962V15.548z M12.512,23.621h-2.297v-1\n\t\t\t\th2.297V23.621z M23.317,19.494h2.297v1h-2.297V19.494z M18.466,24.621h-1v-1h1V24.621z M18.657,19.775h-2.299v-1h2.299V19.775z\n\t\t\t\t M22.966,23.621h-1v-1h1V23.621z"/>\n\t\t\t<path fill="#1B499E" d="M28.178,17.048h0.038v-0.75C28.216,16.551,28.193,16.799,28.178,17.048z"/>\n\t\t</g>\n\t</g>\n</g>\n',"icon-location":"M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z","icon-heart":"M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ","icon-bubble":"M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z"},yi={realTimeEvent:!0,min:-360,max:360,value:0},bi={min:5,max:30,value:12},xi={realTimeEvent:!0,min:2,max:300,value:3},_i={realTimeEvent:!0,min:10,max:100,value:50},Ci={tintOpacityRange:{realTimeEvent:!0,min:0,max:1,value:.7,useDecimal:!0},removewhiteDistanceRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},brightnessRange:{realTimeEvent:!0,min:-1,max:1,value:0,useDecimal:!0},noiseRange:{realTimeEvent:!0,min:0,max:1e3,value:100},pixelateRange:{realTimeEvent:!0,min:2,max:20,value:4},colorfilterThresholdRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},blurFilterRange:{value:.1}},Ii=0,Mi=0,Si=.5,wi=.5,ki={realTimeEvent:!0,min:32,max:4088,value:800},Ti="tui-image-editor-",Di=Math.min,Ai=Math.max,Ei=!1,Oi=0;function ji(t){return t.__fe_id||(Oi+=1,t.__fe_id=Oi),t.__fe_id}function Li(t){return"function"==typeof t}function Pi(t,e,i){if(e>i){var n=[i,e];e=n[0],i=n[1]}return Ai(e,Di(t,i))}function Ni(){for(var t={},e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return W()(i,function(e){t[e]=e}),t}function zi(t,e){var i,n={},r=e.length,o=0;for(o=0;o<r;o+=1)n[i=e[o]]=t[i];return n}function Ri(t){return $()(t,10)}function Bi(t){return t.replace(/-([a-z])/g,function(t,e){return e.toUpperCase()})}function Fi(){return!!(window.File&&window.FileList&&window.FileReader)}function Yi(t,e){var i,n,r,o;4===t.length&&(t=O()(o="".concat(t)).call(o,h()(t).call(t,1,4)));var s=$()(h()(t).call(t,1,3),16),a=$()(h()(t).call(t,3,5),16),l=$()(h()(t).call(t,5,7),16),c=e;return O()(i=O()(n=O()(r="rgba(".concat(s,", ")).call(r,a,", ")).call(n,l,", ")).call(i,c,")")}function Hi(t){W()(t,function(e,i){t[i]=null})}function Wi(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."===i.charAt(0)?O()(e=".".concat(Ti).concat(n)).call(e,h()(i).call(i,1)):O()(t="".concat(Ti).concat(n)).call(t,i)}function Ui(t,e){t.customProps=t.customProps||{},B()(t.customProps,e)}function Gi(t,e){var i={};return Z()(e)&&(e=[e]),W()(e,function(e){i[e]=t.customProps[e]}),i}function Xi(t,e){return o()(t).call(t,e)>=0}function Zi(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return at()(t,"type")||pt}function Vi(t){var e=nt()(t);return(void 0===e?{}:e).source?gt:pt}function Ji(t){return ct()(t.get("type"),vt)>=0}function Qi(t){if(Xi(vt,t))return"Shape";switch(t){case"i-text":return"Text";case"path":case"line":return"Draw";case"activeSelection":return"Group";default:return qi(t)}}function Ki(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.useAlpha,r=void 0===n||n,o=i.mode,s=bt,a=_t,l=Ct,c=Mt;switch(t){case yt:e=s;break;case xt:e=r?a:l;break;case It:e="add"===o?c:o;break;default:e=t}return qi(e)}function qi(t){return t.replace(/[a-z]/,function(t){return t.toUpperCase()})}var $i=Ni("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),tn="Should implement a method: ",en="Should set a component name",nn={UN_IMPLEMENTATION:function(t){return tn+t},NO_COMPONENT_NAME:function(){return en}},rn={types:B()({},$i),create:function(t){t=t.toLowerCase();for(var e=nn[t],i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}},on=rn.create,sn=rn.types,an=function(){function t(e,i){w(this,t),this.name=e.name,this.args=i,this.execute=e.execute,this.undo=e.undo,this.executeCallback=e.executeCallback||null,this.undoCallback=e.undoCallback||null,this.undoData={}}return T(t,[{key:"execute",value:function(){throw new Error(on(sn.UN_IMPLEMENTATION,"execute"))}},{key:"undo",value:function(){throw new Error(on(sn.UN_IMPLEMENTATION,"undo"))}},{key:"isRedo",get:function(){return J()(this.undoData).length>0}},{key:"setUndoData",value:function(t,e,i){return e&&(t=e),i?e||(e=t):(B()(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}(),ln={},cn={create:function(t){var e=ln[t];if(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return new an(e,n)}return null},register:function(t){ln[t.name]=t}},un=function(){function t(){w(this,t),this._undoStack=[],this._redoStack=[],this._isLocked=!1,this._isSilent=!1}return T(t,[{key:"_invokeExecution",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lock();var n=t.args;return n||(n=[]),t.execute.apply(t,I(n)).then(function(n){return e._isSilent||(e.pushUndoStack(t),e.fire(i?ge:fe,t)),e.unlock(),Li(t.executeCallback)&&t.executeCallback(n),n}).catch(function(t){return e.unlock(),L().reject(t)})}},{key:"_invokeUndo",value:function(t){var e=this;this.lock();var i=t.args;return i||(i=[]),t.undo.apply(t,I(i)).then(function(i){return e.pushRedoStack(t),e.fire(de,t),e.unlock(),Li(t.undoCallback)&&t.undoCallback(i),i}).catch(function(t){return e.unlock(),L().reject(t)})}},{key:"_fireRedoStackChanged",value:function(){this.fire(le,this._redoStack.length)}},{key:"_fireUndoStackChanged",value:function(){this.fire(ce,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<e;n++)i[n]=arguments[n];return this.execute.apply(this,O()(i).call(i,[this._isSilent])).then(function(){t._isSilent=!1})}},{key:"execute",value:function(){var t=this;if(this._isLocked)return L().reject(ci);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];var r=i[0];return Z()(r)&&(r=cn.create.apply(cn,i)),this._invokeExecution(r).then(function(e){return t.clearRedoStack(),e})}},{key:"undo",value:function(){var t,e,i=this._undoStack.pop(),n="";return i&&this._isLocked&&(this.pushUndoStack(i,!0),i=null),i?(this.isEmptyUndoStack()&&this._fireUndoStackChanged(),t=this._invokeUndo(i)):(n=gi,this._isLocked&&(n=O()(e="".concat(n," Because ")).call(e,ci)),t=L().reject(n)),t}},{key:"redo",value:function(){var t,e,i=this._redoStack.pop(),n="";return i&&this._isLocked&&(this.pushRedoStack(i,!0),i=null),i?(this.isEmptyRedoStack()&&this._fireRedoStackChanged(),t=this._invokeExecution(i,!0)):(n=di,this._isLocked&&(n=O()(e="".concat(n," Because ")).call(e,ci)),t=L().reject(n)),t}},{key:"pushUndoStack",value:function(t,e){this._undoStack.push(t),e||this._fireUndoStackChanged()}},{key:"pushRedoStack",value:function(t,e){this._redoStack.push(t),e||this._fireRedoStackChanged()}},{key:"isEmptyRedoStack",value:function(){return 0===this._redoStack.length}},{key:"isEmptyUndoStack",value:function(){return 0===this._undoStack.length}},{key:"clearUndoStack",value:function(){this.isEmptyUndoStack()||(this._undoStack=[],this._fireUndoStackChanged())}},{key:"clearRedoStack",value:function(){this.isEmptyRedoStack()||(this._redoStack=[],this._fireRedoStackChanged())}}]),t}();G().mixin(un);var hn=un,fn=i(5214),dn=i.n(fn),gn=i(899),pn=i.n(gn),vn={"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"},mn=i(2534),yn=function(){function t(e){var i,n,r,o;w(this,t),this.styles=this._changeToObject(B()({},vn,e)),i=this._styleMaker(),n=Q(document.getElementsByTagName("head"),1)[0],r=document.createElement("link"),o=encodeURIComponent(i),r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href","data:text/css;charset=UTF-8,".concat(o)),n.appendChild(r),this._loadDefaultSvgIcon()}return T(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(B()({},n,{borderLeft:"1px solid ".concat(n.color)})),horizontal:this._makeCssText(B()({},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)}return e}},{key:"_styleMaker",value:function(){var t,e,i,n,r,o,s,a,l,c,u,h,f,d,g,p,v,m,y,b,x,_,C,I,M,S,w,k,T,D,A,E,j,L,P,N,z,R,B,F,Y,H,W,U,G,X,Z,V,J,Q,K=this.getStyle("submenu.label"),q=this.getStyle("submenu.partition");return t={subMenuLabelActive:K.active,subMenuLabelNormal:K.normal,submenuPartitionVertical:q.vertical,submenuPartitionHorizontal:q.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")},A=t.subMenuLabelActive,E=t.subMenuLabelNormal,j=t.subMenuRangeTitle,L=t.submenuPartitionVertical,P=t.submenuPartitionHorizontal,N=t.submenuCheckbox,z=t.submenuRangePointer,R=t.submenuRangeValue,B=t.submenuColorpickerTitle,F=t.submenuColorpickerButton,Y=t.submenuRangeBar,H=t.submenuRangeSubbar,W=t.submenuDisabledRangePointer,U=t.submenuDisabledRangeBar,G=t.submenuDisabledRangeSubbar,X=t.submenuIconSize,Z=t.menuIconSize,V=t.biSize,J=t.menuIconStyle,Q=t.submenuIconStyle,O()(e=O()(i=O()(n=O()(r=O()(o=O()(s=O()(a=O()(l=O()(c=O()(u=O()(h=O()(f=O()(d=O()(g=O()(p=O()(v=O()(m=O()(y=O()(b=O()(x=O()(_=O()(C=O()(I=O()(M=O()(S=O()(w=O()(k=O()(T=O()(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(A,"\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,E,"\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n ")).call(T,j,"\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n ")).call(k,L,"\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,P,"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n ")).call(S,N,"\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(_,W,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n ")).call(x,G,"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n ")).call(b,U,"\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(c,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(l,J.hover.color,";\n stroke: ")).call(a,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(s,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")}},{key:"_changeToObject",value:function(t){var e={};return W()(t,function(t,i){var n=Q(i.match(/^(.+)\.([a-z]+)$/i),3),r=n[1],o=n[2];e[r]||(e[r]={}),e[r][o]=t}),e}},{key:"_makeCssText",value:function(t){var e=this,i=[];return W()(t,function(t,n){var r,s;o()(r=["backgroundImage"]).call(r,n)>-1&&"none"!==t&&(t="url(".concat(t,")")),i.push(O()(s="".concat(e._toUnderScore(n),": ")).call(s,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=mn.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"))[t],n=i.path,r=i.name;return n&&r?t:"".concat(t," use-default")}},{key:"_makeSvgIconPrefix",value:function(t,e){var i,n=(e?this.getStyle("submenu.icon"):this.getStyle("menu.icon"))[t],r=n.path,o=n.name;return r&&o?O()(i="".concat(r,"#")).call(i,o,"-"):"#"}},{key:"_makeSvgItem",value:function(t,e,i){var n=this;return pn()(t).call(t,function(t){var r,o,s=n._makeSvgIconPrefix(t,i),a=n._toUnderScore(e),l=n._makeIconClassName(t,i);return O()(r=O()(o='<use xlink:href="'.concat(s,"ic-")).call(o,a,'" class="')).call(r,l,'"/>')}).join("")}},{key:"makeMenSvgIconSet",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return O()(i='<svg class="svg_ic-'.concat(n?"submenu":"menu",'">')).call(i,this._makeSvgItem(t,e,n),"</svg>")}}]),t}(),bn=yn,xn=i(9146),_n=i.n(xn),Cn=i(6623),In=i(4230);function Mn(t,e){return(Mn=In||function(t,e){return t.__proto__=e,t})(t,e)}function Sn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Cn(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mn(t,e)}var wn=i(3742);function kn(t){return(kn="function"==typeof y&&"symbol"==typeof wn?function(t){return typeof t}:function(t){return t&&"function"==typeof y&&t.constructor===y&&t!==y.prototype?"symbol":typeof t})(t)}function Tn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Dn(t,e){if(e&&("object"===kn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Tn(t)}var An=i(9856);function En(t){return(En=In?An:function(t){return t.__proto__||An(t)})(t)}var On=i(6092),jn=i.n(On),Ln=i(4858),Pn=i.n(Ln),Nn=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],zn=function(){function t(e,i){var n=i.defaultColor,r=void 0===n?"#7e7e7e":n,o=i.toggleDirection,s=void 0===o?"up":o,a=i.usageStatistics;w(this,t),this.colorpickerElement=e,this.usageStatistics=a,this._show=!1,this._colorpickerElement=e,this._toggleDirection=s,this._makePickerButtonElement(r),this._makePickerLayerElement(e,e.getAttribute("title")),this._color=r,this.picker=Pn().create({container:this.pickerElement,preset:Nn,color:r,usageStatistics:this.usageStatistics}),this._addEvent()}return T(t,[{key:"destroy",value:function(){var t=this;this._removeEvent(),this.picker.destroy(),this.colorpickerElement.innerHTML="",W()(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:A()(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){for(var e=t;e!==document.body&&e;){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}();G().mixin(zn);var Rn=zn,Bn=/(-?)([0-9]*)[^0-9]*([0-9]*)/g,Fn=function(){function t(e){var i,n,r,o,s,a,l,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,t),this._value=c.value||0,this.rangeElement=e.slider,this.rangeInputElement=e.input,this._drawRangeElement(),this.rangeWidth=this._getRangeWidth(),this._min=c.min||0,this._max=c.max||100,this._useDecimal=c.useDecimal,this._absMax=-1*this._min+this._max,this.realTimeEvent=c.realTimeEvent||!1,this._userInputTimer=null,this.eventHandler={startChangingSlide:A()(i=this._startChangingSlide).call(i,this),stopChangingSlide:A()(n=this._stopChangingSlide).call(n,this),changeSlide:A()(r=this._changeSlide).call(r,this),changeSlideFinally:A()(o=this._changeSlideFinally).call(o,this),changeInput:A()(s=this._changeInput).call(s,this),changeInputFinally:A()(a=this._changeValueWithInput).call(a,this,!0),changeInputWithArrow:A()(l=this._changeValueWithInputKeyEvent).call(l,this)},this._addClickEvent(),this._addDragEvent(),this._addInputEvent(),this.value=c.value,this.trigger("change")}return T(t,[{key:"destroy",value:function(){var t=this;this._removeClickEvent(),this._removeDragEvent(),this._removeInputEvent(),this.rangeElement.innerHTML="",W()(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){var e=((t=this._useDecimal?t:Ri(t))-this._min)*this.rangeWidth/this._absMax;this.rangeWidth<e&&(e=this.rangeWidth),this.pointer.style.left="".concat(e,"px"),this.subbar.style.right="".concat(this.rangeWidth-e,"px"),this._value=t,this.rangeInputElement&&(this.rangeInputElement.value=t)}},{key:"trigger",value:function(t){this.fire(t,this._value)}},{key:"_getRangeWidth",value:function(){var t=function(t){return Ri(window.getComputedStyle(t,null).width)};return t(this.rangeElement)-t(this.pointer)}},{key:"_drawRangeElement",value:function(){this.rangeElement.classList.add("tui-image-editor-range"),this.bar=document.createElement("div"),this.bar.className="tui-image-editor-virtual-range-bar",this.subbar=document.createElement("div"),this.subbar.className="tui-image-editor-virtual-range-subbar",this.pointer=document.createElement("div"),this.pointer.className="tui-image-editor-virtual-range-pointer",this.bar.appendChild(this.subbar),this.bar.appendChild(this.pointer),this.rangeElement.appendChild(this.bar)}},{key:"_addInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInput),this.rangeInputElement.addEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_removeInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInput),this.rangeInputElement.removeEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_changeValueWithInputKeyEvent",value:function(t){var e,i=t.keyCode,n=t.target;if(!(o()(e=[ei,ti]).call(e,i)<0)){var r=Number(n.value);if(!((r=this._valueUpDownForKeyEvent(r,i))<this._min||r>this._max)){var s=Pi(r,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===ei?t+=i:e===ti&&(t-=i),t}},{key:"_changeInput",value:function(t){var e=this;clearTimeout(this._userInputTimer);var i=t.keyCode;i<ni||i>ri?t.preventDefault():this._userInputTimer=p()(function(){e._inputSetValue(t.target.value)},350)}},{key:"_inputSetValue",value:function(t){var e=this._useDecimal?Number(t):Ri(t);e=Pi(e,this._min,this.max),this.value=e,this.fire("change",e,!0)}},{key:"_changeValueWithInput",value:function(t,e){var i,n=e.keyCode,r=e.target;if(!(o()(i=[ei,ti]).call(i,n)>=0)){var s=this._filterForInputText(r.value),a=!s||isNaN(s);r.value=s,a||this._inputSetValue(s)}}},{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-this.firstPosition,i=this.firstLeft+e;i=(i=i>this.rangeWidth?this.rangeWidth:i)<0?0:i,this.pointer.style.left="".concat(i,"px"),this.subbar.style.right="".concat(this.rangeWidth-i,"px");var n=i/this.rangeWidth,r=this._absMax*n+this._min,o=this._useDecimal?r:Ri(r);this.value!==o&&(this.value=o,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/this.rangeWidth,i=this._absMax*e+this._min;this.pointer.style.left="".concat(e*this.rangeWidth,"px"),this.subbar.style.right="".concat((1-e)*this.rangeWidth,"px"),this.value=i,this.fire("change",i,!0)}}},{key:"_startChangingSlide",value:function(t){this.firstPosition=t.screenX,this.firstLeft=Ri(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(Bn,"$1$2$3")}}]),t}();G().mixin(Fn);var Yn=Fn,Hn=function(){function t(e,i){var n=i.locale,r=i.name,o=i.makeSvgIcon,s=i.menuBarPosition,a=i.templateHtml,l=i.usageStatistics;w(this,t),this.subMenuElement=e,this.menuBarPosition=s,this.toggleDirection="top"===s?"down":"up",this.colorPickerControls=[],this.usageStatistics=l,this.eventHandler={},this._makeSubMenuElement({locale:n,name:r,makeSvgIcon:o,templateHtml:a})}return T(t,[{key:"selector",value:function(t){return this.subMenuElement.querySelector(t)}},{key:"colorPickerChangeShow",value:function(t){var e;et()(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,s=document.createElement("div");s.className="tui-image-editor-menu-".concat(i),s.innerHTML=o({locale:e,iconStyle:n,makeSvgIcon:r}),this.subMenuElement.appendChild(s)}},{key:"_onStartEditingInputBox",value:function(){this.fire(xe)}},{key:"_onStopEditingInputBox",value:function(){this.fire(_e)}}]),t}();G().mixin(Hn);var Wn=Hn,Un=function(t){var e,i,n,r,o,s,a,l,c=t.locale,u=t.makeSvgIcon;return O()(e=O()(i=O()(n=O()(r=O()(o=O()(s=O()(a=O()(l='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-shape-button">\n <div class="tui-image-editor-button rect">\n <div>\n '.concat(u(["normal","active"],"shape-rectangle",!0),"\n </div>\n <label> ")).call(l,c.localize("Rectangle"),' </label>\n </div>\n <div class="tui-image-editor-button circle">\n <div>\n ')).call(a,u(["normal","active"],"shape-circle",!0),"\n </div>\n <label> ")).call(s,c.localize("Circle"),' </label>\n </div>\n <div class="tui-image-editor-button triangle">\n <div>\n ')).call(o,u(["normal","active"],"shape-triangle",!0),"\n </div>\n <label> ")).call(r,c.localize("Triangle"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-shape-color-button">\n <div class="tie-color-fill" title="')).call(n,c.localize("Fill"),'"></div>\n <div class="tie-color-stroke" title="')).call(i,c.localize("Stroke"),'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,c.localize("Stroke"),'</label>\n <div class="tie-stroke-range"></div>\n <input class="tie-stroke-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function Gn(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Xn={stroke:"#ffbb3b",fill:"",strokeWidth:3},Zn=function(t){Sn(i,t);var e=Gn(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"shape",makeSvgIcon:s,menuBarPosition:a,templateHtml:Un,usageStatistics:l})).type=null,r.options=Xn,r._els={shapeSelectButton:r.selector(".tie-shape-button"),shapeColorButton:r.selector(".tie-shape-color-button"),strokeRange:new Yn({slider:r.selector(".tie-stroke-range"),input:r.selector(".tie-stroke-range-value")},xi),fillColorpicker:new Rn(r.selector(".tie-color-fill"),{defaultColor:"",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),strokeColorpicker:new Rn(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(Me)),r.colorPickerInputBoxes.push(r._els.strokeColorpicker.colorpickerElement.querySelector(Me)),r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),Hi(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,s,a=this;this.eventHandler.shapeTypeSelected=A()(e=this._changeShapeHandler).call(e,this),this.actions=t,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",A()(i=this._changeStrokeRangeHandler).call(i,this)),this._els.fillColorpicker.on("change",A()(n=this._changeFillColorHandler).call(n,this)),this._els.strokeColorpicker.on("change",A()(r=this._changeStrokeColorHandler).call(r,this)),this._els.fillColorpicker.on("changeShow",A()(o=this.colorPickerChangeShow).call(o,this)),this._els.strokeColorpicker.on("changeShow",A()(s=this.colorPickerChangeShow).call(s,this)),jn()(this.colorPickerInputBoxes,function(t){var e,i;t.addEventListener(Ce,A()(e=a._onStartEditingInputBox).call(e,a)),t.addEventListener(Ie,A()(i=a._onStopEditingInputBox).call(i,a))},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(),jn()(this.colorPickerInputBoxes,function(e){var i,n;e.removeEventListener(Ce,A()(i=t._onStartEditingInputBox).call(i,t)),e.removeEventListener(Ie,A()(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=xi.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=Ri(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}(Wn),Vn=Zn,Jn=function(t){var e,i,n,r,o,s,a,l,c,u,h,f,d,g,p,v,m,y=t.locale,b=t.makeSvgIcon;return O()(e=O()(i=O()(n=O()(r=O()(o=O()(s=O()(a=O()(l=O()(c=O()(u=O()(h=O()(f=O()(d=O()(g=O()(p=O()(v=O()(m='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-crop-preset-button">\n <div class="tui-image-editor-button preset preset-none active">\n <div>\n '.concat(b(["normal","active"],"shape-rectangle",!0),"\n </div>\n <label> ")).call(m,y.localize("Custom"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-square">\n <div>\n ')).call(v,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(p,y.localize("Square"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-3-2">\n <div>\n ')).call(g,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(d,y.localize("3:2"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-4-3">\n <div>\n ')).call(f,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(h,y.localize("4:3"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-5-4">\n <div>\n ')).call(u,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(c,y.localize("5:4"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-7-5">\n <div>\n ')).call(l,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(a,y.localize("7:5"),' </label>\n </div>\n <div class="tui-image-editor-button preset preset-16-9">\n <div>\n ')).call(s,b(["normal","active"],"crop",!0),"\n </div>\n <label> ")).call(o,y.localize("16:9"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline">\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tie-crop-button action">\n <div class="tui-image-editor-button apply">\n ')).call(r,b(["normal","active"],"apply"),"\n <label>\n ")).call(n,y.localize("Apply"),'\n </label>\n </div>\n <div class="tui-image-editor-button cancel">\n ')).call(i,b(["normal","active"],"cancel"),"\n <label>\n ")).call(e,y.localize("Cancel"),"\n </label>\n </div>\n </li>\n </ul>\n")};function Qn(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Kn=function(t){Sn(i,t);var e=Qn(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"crop",makeSvgIcon:s,menuBarPosition:a,templateHtml:Jn,usageStatistics:l})).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 T(i,[{key:"destroy",value:function(){this._removeEvent(),Hi(this)}},{key:"addEvent",value:function(t){var e,i,n,r=A()(e=this._applyEventHandler).call(e,this),o=A()(i=this._cancelEventHandler).call(i,this),s=A()(n=this._cropzonePresetEventHandler).call(n,this);this.eventHandler={apply:r,cancel:o,cropzonePreset:s},this.actions=t,this._els.apply.addEventListener("click",r),this._els.cancel.addEventListener("click",o),this._els.preset.addEventListener("click",s)}},{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=Q(e.className.match(/preset-[^\s]+/),1)[0];this._setPresetButtonActive(e),this.actions.preset(i)}}},{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;W()(this._els.preset.querySelectorAll(".preset"),function(t){t.classList.remove("active")}),t&&t.classList.add("active")}}]),i}(Wn),qn=Kn,$n=function(t){var e,i,n,r,o,s,a=t.locale,l=t.makeSvgIcon;return O()(e=O()(i=O()(n=O()(r=O()(o=O()(s='\n <ul class="tui-image-editor-submenu-item">\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-range-wrap tui-image-editor-newline">\n <label class="range">'.concat(a.localize("Width"),' </label>\n <div class="tie-width-range"></div>\n <input class="tie-width-range-value tui-image-editor-range-value" value="0" /> <label>px</label>\n <div class="tui-image-editor-partition tui-image-editor-newline"></div>\n <label class="range">')).call(s,a.localize("Height"),'</label>\n <div class="tie-height-range"></div>\n <input class="tie-height-range-value tui-image-editor-range-value" value="0" /> <label>px</label>\n </div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-lock-aspect-ratio">\n <span>')).call(o,a.localize("Lock Aspect Ratio"),'</span>\n </label>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline"></li>\n <li class="tie-resize-button action">\n <div class="tui-image-editor-button apply">\n ')).call(r,l(["normal","active"],"apply"),"\n <label>\n ")).call(n,a.localize("Apply"),'\n </label>\n </div>\n <div class="tui-image-editor-button cancel">\n ')).call(i,l(["normal","active"],"cancel"),"\n <label>\n ")).call(e,a.localize("Cancel"),"\n </label>\n </div>\n </li>\n </ul>\n")};function tr(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var er=function(t){Sn(i,t);var e=tr(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"resize",makeSvgIcon:s,menuBarPosition:a,templateHtml:$n,usageStatistics:l})).status="active",r._lockState=!1,r._originalDimensions=null,r._els={widthRange:new Yn({slider:r.selector(".tie-width-range"),input:r.selector(".tie-width-range-value")},ki),heightRange:new Yn({slider:r.selector(".tie-height-range"),input:r.selector(".tie-height-range-value")},ki),lockAspectRatio:r.selector(".tie-lock-aspect-ratio"),apply:r.selector(".tie-resize-button .apply"),cancel:r.selector(".tie-resize-button .cancel")},r}return T(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=ki.max),t}},{key:"calcMinValue",value:function(t){return t<=0&&(t=ki.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(),Hi(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o;this._els.widthRange.on("change",A()(e=this._changeWidthRangeHandler).call(e,this)),this._els.heightRange.on("change",A()(i=this._changeHeightRangeHandler).call(i,this)),this._els.lockAspectRatio.addEventListener("change",A()(n=this._changeLockAspectRatio).call(n,this));var s=A()(r=this._applyEventHandler).call(r,this),a=A()(o=this._cancelEventHandler).call(o,this);this.eventHandler={apply:s,cancel:a},this.actions=t,this._els.apply.addEventListener("click",s),this._els.cancel.addEventListener("click",a)}},{key:"_changeWidthRangeHandler",value:function(t){this.actions.preview("width",Ri(t),this._lockState)}},{key:"_changeHeightRangeHandler",value:function(t){this.actions.preview("height",Ri(t),this._lockState)}},{key:"_changeLockAspectRatio",value:function(t){this._lockState=t.target.checked,this.actions.lockAspectRatio(this._lockState,ki.min,ki.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}(Wn),ir=er,nr=function(t){var e,i,n,r,o,s=t.locale,a=t.makeSvgIcon;return O()(e=O()(i=O()(n=O()(r=O()(o='\n <ul class="tie-flip-button tui-image-editor-submenu-item">\n <li>\n <div class="tui-image-editor-button flipX">\n <div>\n '.concat(a(["normal","active"],"flip-x",!0),"\n </div>\n <label>\n ")).call(o,s.localize("Flip X"),'\n </label>\n </div>\n <div class="tui-image-editor-button flipY">\n <div>\n ')).call(r,a(["normal","active"],"flip-y",!0),"\n </div>\n <label>\n ")).call(n,s.localize("Flip Y"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tui-image-editor-button resetFlip">\n <div>\n ')).call(i,a(["normal","active"],"flip-reset",!0),"\n </div>\n <label>\n ")).call(e,s.localize("Reset"),"\n </label>\n </div>\n </li>\n </ul>\n")};function rr(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var or=function(t){Sn(i,t);var e=rr(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"flip",makeSvgIcon:s,menuBarPosition:a,templateHtml:nr,usageStatistics:l})).flipStatus=!1,r._els={flipButton:r.selector(".tie-flip-button")},r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),Hi(this)}},{key:"addEvent",value:function(t){var e;this.eventHandler.changeFlip=A()(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"),W()(["flipX","flipY"],function(n){i.remove(n),t[n]&&(i.add(n),i.add("resetFlip"),e.flipStatus=!0)})})}}}]),i}(Wn),sr=function(t){var e,i,n=t.locale,r=t.makeSvgIcon;return O()(e=O()(i='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-rotate-button">\n <div class="tui-image-editor-button clockwise">\n <div>\n '.concat(r(["normal","active"],"rotate-clockwise",!0),'\n </div>\n <label> 30 </label>\n </div>\n <div class="tui-image-editor-button counterclockwise">\n <div>\n ')).call(i,r(["normal","active"],"rotate-counterclockwise",!0),'\n </div>\n <label> -30 </label>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,n.localize("Range"),'</label>\n <div class="tie-rotate-range"></div>\n <input class="tie-rotate-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function ar(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var lr=function(t){Sn(i,t);var e=ar(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"rotate",makeSvgIcon:s,menuBarPosition:a,templateHtml:sr,usageStatistics:l}))._value=0,r._els={rotateButton:r.selector(".tie-rotate-button"),rotateRange:new Yn({slider:r.selector(".tie-rotate-range"),input:r.selector(".tie-rotate-range-value")},yi)},r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.rotateRange.destroy(),Hi(this)}},{key:"setRangeBarAngle",value:function(t,e){var i=e;"rotate"===t&&(i=$()(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=A()(e=this._changeRotateForButton).call(e,this),this.actions=t,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",A()(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=Ri(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={clockwise:30,counterclockwise:-30}[this.getButtonType(e,["counterclockwise","clockwise"])],r=$()(i,10)+n;r>=-360&&r<=360&&this.actions.rotate(n)}}}]),i}(Wn),cr=function(t){var e,i,n,r,o,s,a,l,c,u,h,f,d,g=t.locale,p=t.makeSvgIcon;return O()(e=O()(i=O()(n=O()(r=O()(o=O()(s=O()(a=O()(l=O()(c=O()(u=O()(h=O()(f=O()(d='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-text-effect-button">\n <div class="tui-image-editor-button bold">\n <div>\n '.concat(p(["normal","active"],"text-bold",!0),"\n </div>\n <label> ")).call(d,g.localize("Bold"),' </label>\n </div>\n <div class="tui-image-editor-button italic">\n <div>\n ')).call(f,p(["normal","active"],"text-italic",!0),"\n </div>\n <label> ")).call(h,g.localize("Italic"),' </label>\n </div>\n <div class="tui-image-editor-button underline">\n <div>\n ')).call(u,p(["normal","active"],"text-underline",!0),"\n </div>\n <label> ")).call(c,g.localize("Underline"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-text-align-button">\n <div class="tui-image-editor-button left">\n <div>\n ')).call(l,p(["normal","active"],"text-align-left",!0),"\n </div>\n <label> ")).call(a,g.localize("Left"),' </label>\n </div>\n <div class="tui-image-editor-button center">\n <div>\n ')).call(s,p(["normal","active"],"text-align-center",!0),"\n </div>\n <label> ")).call(o,g.localize("Center"),' </label>\n </div>\n <div class="tui-image-editor-button right">\n <div>\n ')).call(r,p(["normal","active"],"text-align-right",!0),"\n </div>\n <label> ")).call(n,g.localize("Right"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-text-color" title="')).call(i,g.localize("Color"),'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,g.localize("Text size"),'</label>\n <div class="tie-text-range"></div>\n <input class="tie-text-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function ur(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var hr=function(t){Sn(i,t);var e=ur(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"text",makeSvgIcon:s,menuBarPosition:a,templateHtml:cr,usageStatistics:l})).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 Rn(r.selector(".tie-text-color"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),textRange:new Yn({slider:r.selector(".tie-text-range"),input:r.selector(".tie-text-range-value")},_i)},r.colorPickerInputBox=r._els.textColorpicker.colorpickerElement.querySelector(Me),r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),Hi(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,s,a=A()(e=this._setTextEffectHandler).call(e,this),l=A()(i=this._setTextAlignHandler).call(i,this);this.eventHandler={setTextEffect:a,setTextAlign:l},this.actions=t,this._els.textEffectButton.addEventListener("click",a),this._els.textAlignButton.addEventListener("click",l),this._els.textRange.on("change",A()(n=this._changeTextRnageHandler).call(n,this)),this._els.textColorpicker.on("change",A()(r=this._changeColorHandler).call(r,this)),this.colorPickerInputBox.addEventListener(Ce,A()(o=this._onStartEditingInputBox).call(o,this)),this.colorPickerInputBox.addEventListener(Ie,A()(s=this._onStopEditingInputBox).call(s,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(Ce,A()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(Ie,A()(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=nt()(t),i=t.fontSize,n=t.fontStyle,r=t.fontWeight,o=t.textDecoration,s=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(s))}},{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=Q(e.className.match(/(bold|italic|underline)/),1)[0],n={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[i];this.effect[i]=!this.effect[i],e.classList.toggle("active"),this.actions.changeTextStyle(n)}}},{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}(Wn),fr=hr,dr=function(t){var e,i,n,r=t.locale,o=t.makeSvgIcon;return O()(e=O()(i=O()(n='\n <ul class="tui-image-editor-submenu-item">\n <li>\n <div class="tui-image-editor-button">\n <div>\n <input type="file" accept="image/*" class="tie-mask-image-file">\n '.concat(o(["normal","active"],"mask-load",!0),"\n </div>\n <label> ")).call(n,r.localize("Load Mask Image"),' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tie-mask-apply tui-image-editor-newline apply" style="margin-top: 22px;margin-bottom: 5px">\n <div class="tui-image-editor-button apply">\n ')).call(i,o(["normal","active"],"apply"),"\n <label>\n ")).call(e,r.localize("Apply"),"\n </label>\n </div>\n </li>\n </ul>\n")};function gr(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var pr=function(t){Sn(i,t);var e=gr(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"mask",makeSvgIcon:s,menuBarPosition:a,templateHtml:dr,usageStatistics:l}))._els={applyButton:r.selector(".tie-mask-apply"),maskImageButton:r.selector(".tie-mask-image-file")},r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),Hi(this)}},{key:"addEvent",value:function(t){var e,i,n=A()(e=this._loadMaskFile).call(e,this),r=A()(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;Fi()||alert("This browser does not support file-api");var i=Q(t.target.files,1)[0];i&&(e=N().createObjectURL(i),this.actions.loadImageFromURL(e,i),this._els.applyButton.classList.add("active"))}}]),i}(Wn),vr=function(t){var e,i,n,r,o,s,a,l,c,u,h,f,d,g,p,v,m,y,b,x,_=t.locale,C=t.makeSvgIcon;return O()(e=O()(i=O()(n=O()(r=O()(o=O()(s=O()(a=O()(l=O()(c=O()(u=O()(h=O()(f=O()(d=O()(g=O()(p=O()(v=O()(m=O()(y=O()(b=O()(x='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-icon-add-button">\n <div class="tui-image-editor-button" data-icontype="icon-arrow">\n <div>\n '.concat(C(["normal","active"],"icon-arrow",!0),"\n </div>\n <label>\n ")).call(x,_.localize("Arrow"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-arrow-2">\n <div>\n ')).call(b,C(["normal","active"],"icon-arrow-2",!0),"\n </div>\n <label>\n ")).call(y,_.localize("Arrow-2"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-arrow-3">\n <div>\n ')).call(m,C(["normal","active"],"icon-arrow-3",!0),"\n </div>\n <label>\n ")).call(v,_.localize("Arrow-3"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-star">\n <div>\n ')).call(p,C(["normal","active"],"icon-star",!0),"\n </div>\n <label>\n ")).call(g,_.localize("Star-1"),'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-star-2">\n <div>\n ')).call(d,C(["normal","active"],"icon-star-2",!0),"\n </div>\n <label>\n ")).call(f,_.localize("Star-2"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-polygon">\n <div>\n ')).call(h,C(["normal","active"],"icon-polygon",!0),"\n </div>\n <label>\n ")).call(u,_.localize("Polygon"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-location">\n <div>\n ')).call(c,C(["normal","active"],"icon-location",!0),"\n </div>\n <label>\n ")).call(l,_.localize("Location"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-heart">\n <div>\n ')).call(a,C(["normal","active"],"icon-heart",!0),"\n </div>\n <label>\n ")).call(s,_.localize("Heart"),'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-bubble">\n <div>\n ')).call(o,C(["normal","active"],"icon-bubble",!0),"\n </div>\n <label>\n ")).call(r,_.localize("Bubble"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-icon-add-button">\n <div class="tui-image-editor-button" style="margin:0">\n <div>\n <input type="file" accept="image/*" class="tie-icon-image-file">\n ')).call(n,C(["normal","active"],"icon-load",!0),"\n </div>\n <label>\n ")).call(i,_.localize("Custom icon"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-icon-color" title="')).call(e,_.localize("Color"),'"></div>\n </li>\n </ul>\n')};function mr(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var yr=function(t){Sn(i,t);var e=mr(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"icon",makeSvgIcon:s,menuBarPosition:a,templateHtml:vr,usageStatistics:l})).iconType=null,r._iconMap={},r._els={registerIconButton:r.selector(".tie-icon-image-file"),addIconButton:r.selector(".tie-icon-add-button"),iconColorpicker:new Rn(r.selector(".tie-icon-color"),{defaultColor:"#ffbb3b",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics})},r.colorPickerInputBox=r._els.iconColorpicker.colorpickerElement.querySelector(Me),r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.iconColorpicker.destroy(),Hi(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o,s=A()(e=this._registerIconHandler).call(e,this),a=A()(i=this._addIconHandler).call(i,this);this.eventHandler={registerIcon:s,addIcon:a},this.actions=t,this._els.iconColorpicker.on("change",A()(n=this._changeColorHandler).call(n,this)),this._els.registerIconButton.addEventListener("change",s),this._els.addIconButton.addEventListener("click",a),this.colorPickerInputBox.addEventListener(Ce,A()(r=this._onStartEditingInputBox).call(r,this)),this.colorPickerInputBox.addEventListener(Ie,A()(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(Ce,A()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(Ie,A()(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;W()(mi,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;Fi||alert("This browser does not support file-api");var i=Q(t.target.files,1)[0];i&&(e=N().createObjectURL(i),this.actions.registerCustomIcon(e,i))}}]),i}(Wn),br=function(t){var e,i,n,r,o,s=t.locale,a=t.makeSvgIcon;return O()(e=O()(i=O()(n=O()(r=O()(o='\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-draw-line-select-button">\n <div class="tui-image-editor-button free">\n <div>\n '.concat(a(["normal","active"],"draw-free",!0),"\n </div>\n <label>\n ")).call(o,s.localize("Free"),'\n </label>\n </div>\n <div class="tui-image-editor-button line">\n <div>\n ')).call(r,a(["normal","active"],"draw-line",!0),"\n </div>\n <label>\n ")).call(n,s.localize("Straight"),'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-draw-color" title="')).call(i,s.localize("Color"),'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">')).call(e,s.localize("Range"),'</label>\n <div class="tie-draw-range"></div>\n <input class="tie-draw-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n')};function xr(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var _r=function(t){Sn(i,t);var e=xr(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon,a=n.menuBarPosition,l=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"draw",makeSvgIcon:s,menuBarPosition:a,templateHtml:br,usageStatistics:l}))._els={lineSelectButton:r.selector(".tie-draw-line-select-button"),drawColorPicker:new Rn(r.selector(".tie-draw-color"),{defaultColor:"#00a9ff",toggleDirection:r.toggleDirection,usageStatistics:r.usageStatistics}),drawRange:new Yn({slider:r.selector(".tie-draw-range"),input:r.selector(".tie-draw-range-value")},bi)},r.type=null,r.color=r._els.drawColorPicker.color,r.width=r._els.drawRange.value,r.colorPickerInputBox=r._els.drawColorPicker.colorpickerElement.querySelector(Me),r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),Hi(this)}},{key:"addEvent",value:function(t){var e,i,n,r,o;this.eventHandler.changeDrawType=A()(e=this._changeDrawType).call(e,this),this.actions=t,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",A()(i=this._changeDrawColor).call(i,this)),this._els.drawRange.on("change",A()(n=this._changeDrawRange).call(n,this)),this.colorPickerInputBox.addEventListener(Ce,A()(r=this._onStartEditingInputBox).call(r,this)),this.colorPickerInputBox.addEventListener(Ie,A()(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(Ce,A()(t=this._onStartEditingInputBox).call(t,this)),this.colorPickerInputBox.removeEventListener(Ie,A()(e=this._onStopEditingInputBox).call(e,this))}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:Yi(this.color,.7)})}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.stopDrawingMode(),this.actions.changeSelectableAll(!0),this._els.lineSelectButton.classList.remove("free"),this._els.lineSelectButton.classList.remove("line")}},{key:"changeStartMode",value:function(){this.type="free",this._els.lineSelectButton.classList.add("free"),this.setDrawMode()}},{key:"_changeDrawType",value:function(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}(Wn),Cr=i(9886),Ir=i.n(Cr),Mr=function(t){var e,i,n,r,o,s,a,l,c,u,h,f,d,g,p,v,m=t.locale;return O()(e=O()(i=O()(n=O()(r=O()(o=O()(s=O()(a=O()(l=O()(c=O()(u=O()(h=O()(f=O()(d=O()(g=O()(p=O()(v='\n <ul class="tui-image-editor-submenu-item">\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-wrap fixed-width">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-grayscale">\n <span>'.concat(m.localize("Grayscale"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-invert">\n <span>')).call(v,m.localize("Invert"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-sepia">\n <span>')).call(p,m.localize("Sepia"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-vintage">\n <span>')).call(g,m.localize("Sepia2"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-blur">\n <span>')).call(d,m.localize("Blur"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-sharpen">\n <span>')).call(f,m.localize("Sharpen"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-emboss">\n <span>')).call(h,m.localize("Emboss"),'</span>\n </label>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled" style="margin-bottom: 7px;">\n <div class="tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-remove-white">\n <span>')).call(u,m.localize("Remove White"),'</span>\n </label>\n </div>\n </div>\n <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n <label>')).call(c,m.localize("Distance"),'</label>\n <div class="tie-removewhite-distance-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-brightness">\n <span>')).call(l,m.localize("Brightness"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-brightness-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-noise">\n <span>')).call(a,m.localize("Noise"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-noise-range"></div>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-pixelate">\n <span>')).call(s,m.localize("Pixelate"),'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-pixelate-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-newline tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-color-filter">\n <span>')).call(o,m.localize("Color Filter"),'</span>\n </label>\n </div>\n </div>\n <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n <label>')).call(r,m.localize("Threshold"),'</label>\n <div class="tie-colorfilter-threshold-range"></div>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="filter-color-item">\n <div class="tie-filter-tint-color" title="')).call(n,m.localize("Tint"),'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-tint">\n <span></span>\n </label>\n </div>\n </div>\n <div class="filter-color-item">\n <div class="tie-filter-multiply-color" title="')).call(i,m.localize("Multiply"),'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-multiply">\n <span></span>\n </label>\n </div>\n </div>\n <div class="filter-color-item">\n <div class="tie-filter-blend-color" title="')).call(e,m.localize("Blend"),'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-blend">\n <span></span>\n </label>\n </div>\n </div>\n </li>\n </ul>\n')};function Sr(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var wr="130px",kr=["add","diff","subtract","multiply","screen","lighten","darken"],Tr=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],Dr={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"},Ar=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],Er=["filterBlendColor","filterMultiplyColor","filterTintColor"],Or=function(t){Sn(i,t);var e=Sr(i);function i(t,n){var r,o=n.locale,s=n.menuBarPosition,a=n.usageStatistics;return w(this,i),(r=e.call(this,t,{locale:o,name:"filter",menuBarPosition:s,templateHtml:Mr,usageStatistics:a})).selectBoxShow=!1,r.checkedMap={},r._makeControlElement(),r}return T(i,[{key:"destroy",value:function(){this._removeEvent(),this._destroyToolInstance(),Hi(this)}},{key:"_removeEvent",value:function(){var t,e=this;W()(Tr,function(t){var i=e.selector(".tie-".concat(t)),n=Bi(t);i.removeEventListener("change",e.eventHandler[n])}),W()(O()(t=[]).call(t,Ar,Er),function(t){e._els[t].off()}),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),jn()(this.colorPickerInputBoxes,function(t){var i,n;t.removeEventListener(Ce,A()(i=e._onStartEditingInputBox).call(i,e)),t.removeEventListener(Ie,A()(n=e._onStopEditingInputBox).call(n,e))},this)}},{key:"_destroyToolInstance",value:function(){var t,e=this;W()(O()(t=[]).call(t,Ar,Er),function(t){e._els[t].destroy()})}},{key:"addEvent",value:function(t){var e,i,n,r=this,o=t.applyFilter,s=function(t){var e;return A()(e=r._changeFilterState).call(e,r,o,t)},a=function(t){return function(e,i){return r._changeFilterState(o,t,i)}};this.eventHandler={changeBlendFilter:s("blend"),blandTypeClick:function(t){return t.stopPropagation()}},W()(Tr,function(t){var e=r.selector(".tie-".concat(t)),i=Bi(t);r.checkedMap[i]=e,r.eventHandler[i]=s(i),e.addEventListener("change",r.eventHandler[i])}),this._els.removewhiteDistanceRange.on("change",a("removeWhite")),this._els.colorfilterThresholdRange.on("change",a("colorFilter")),this._els.pixelateRange.on("change",a("pixelate")),this._els.noiseRange.on("change",a("noise")),this._els.brightnessRange.on("change",a("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",s("multiply")),this._els.filterTintColor.on("change",s("tint")),this._els.tintOpacity.on("change",a("tint")),this._els.filterMultiplyColor.on("changeShow",A()(e=this.colorPickerChangeShow).call(e,this)),this._els.filterTintColor.on("changeShow",A()(i=this.colorPickerChangeShow).call(i,this)),this._els.filterBlendColor.on("changeShow",A()(n=this.colorPickerChangeShow).call(n,this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),jn()(this.colorPickerInputBoxes,function(t){var e,i;t.addEventListener(Ce,A()(e=r._onStartEditingInputBox).call(e,r)),t.addEventListener(Ie,A()(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(){W()(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=Ir()(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=Dr[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=dn()(this._els.removewhiteDistanceRange.value);break;case"colorFilter":e.color="#FFFFFF",e.distance=dn()(this._els.colorfilterThresholdRange.value);break;case"pixelate":e.blocksize=Ri(this._els.pixelateRange.value);break;case"noise":e.noise=Ri(this._els.noiseRange.value);break;case"brightness":e.brightness=dn()(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}return e}},{key:"_makeControlElement",value:function(){this._els={removewhiteDistanceRange:new Yn({slider:this.selector(".tie-removewhite-distance-range")},Ci.removewhiteDistanceRange),brightnessRange:new Yn({slider:this.selector(".tie-brightness-range")},Ci.brightnessRange),noiseRange:new Yn({slider:this.selector(".tie-noise-range")},Ci.noiseRange),pixelateRange:new Yn({slider:this.selector(".tie-pixelate-range")},Ci.pixelateRange),colorfilterThresholdRange:new Yn({slider:this.selector(".tie-colorfilter-threshold-range")},Ci.colorfilterThresholdRange),filterTintColor:new Rn(this.selector(".tie-filter-tint-color"),{defaultColor:"#03bd9e",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterMultiplyColor:new Rn(this.selector(".tie-filter-multiply-color"),{defaultColor:"#515ce6",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterBlendColor:new Rn(this.selector(".tie-filter-blend-color"),{defaultColor:"#ffbb3b",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),blurRange:Ci.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(Me)),this.colorPickerInputBoxes.push(this._els.filterMultiplyColor.colorpickerElement.querySelector(Me)),this.colorPickerInputBoxes.push(this._els.filterBlendColor.colorpickerElement.querySelector(Me))}},{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=wr,new Yn({slider:n},Ci.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=wr,this._drawSelectOptionList(i,n),this._pickerWithSelectboxForAddEvent(i,n),i}},{key:"_drawSelectOptionList",value:function(t,e){var i=t.querySelectorAll("option");W()(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){W()(kr,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}(Wn),jr=Or,Lr=i(4383),Pr=i.n(Lr);function Nr(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var zr="selected-item",Rr="disabled-item",Br=function(t){Sn(i,t);var e=Nr(i);function i(t,n){var r,o=n.locale,s=n.makeSvgIcon;return w(this,i),r=e.call(this,t,{name:"history"}),t.classList.add("enabled"),r.locale=o,r.makeSvgIcon=s,r._eventHandler={},r._historyIndex=r.getListLength(),r}return T(i,[{key:"add",value:function(t){var e=t.name,i=t.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var n=function(t){var e,i,n,r=t.locale,o=t.makeSvgIcon,s=t.name,a=t.detail;return O()(e=O()(i=O()(n='\n <div class="tui-image-editor-history-item history">\n <div class="history-item-icon">\n '.concat(o(["normal","active"],"history-".concat(s.toLowerCase()),!0),"\n </div>\n <span>\n ")).call(n,r.localize(s),"\n ")).call(i,a?"(".concat(r.localize(a),")"):"",'\n </span>\n <div class="history-item-checkbox">\n ')).call(e,o(["normal"],"history-check",!0),"\n </div>\n </div>\n")}({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.closest(".".concat("history-item"));if(e){var i=Pr()(e.getAttribute("data-index"),10);if(i!==this._historyIndex){var n=Math.abs(i-this._historyIndex);i<this._historyIndex?this._actions.undo(n):this._actions.redo(n)}}}},{key:"_selectItem",value:function(t){for(var e=0;e<this.getListLength();e+=1)this.removeClass(e,zr),this.removeClass(e,Rr),e>t&&this.addClass(e,Rr);this.addClass(t,zr)}},{key:"destroy",value:function(){this.removeEvent(),Hi(this)}},{key:"addEvent",value:function(t){this._actions=t,this._addHistoryEventListener()}},{key:"removeEvent",value:function(){this._removeHistoryEventListener()}}]),i}(function(){function t(e,i){var n=i.name;w(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 T(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<e;n+=1)this.listElement.removeChild(i[n]);a()(i).call(i,t,e-t+1)}},{key:"getListLength",value:function(){return this.items.length}},{key:"addClass",value:function(t,e){this.items[t]&&this.items[t].classList.add(e)}},{key:"removeClass",value:function(t,e){this.items[t]&&this.items[t].classList.remove(e)}},{key:"toggleClass",value:function(t,e){this.items[t]&&this.items[t].classList.toggle(e)}}]),t}()),Fr=function(){function t(e){w(this,t),this._locale=e}return T(t,[{key:"localize",value:function(t){return this._locale[t]||t}}]),t}(),Yr={Shape:Vn,Crop:qn,Resize:ir,Flip:or,Rotate:lr,Text:fr,Mask:pr,Icon:yr,Draw:_r,Filter:jr},Hr="history",Wr="on",Ur="zoomIn",Gr="hand",Xr=function(){function t(e,i,n){w(this,t),this.options=this._initializeOption(i),this._actions=n,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new Fr(this.options.locale),this.theme=new bn(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 T(t,[{key:"destroy",value:function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",Hi(this)}},{key:"setUiDefaultSelectionStyle",value:function(t){return B()({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,s=r.height,a=this._editorElement.style,l=this.options.menuBarPosition;a.height="".concat(s,"px"),a.width="".concat(o,"px"),this._setEditorPosition(l),this._editorElementWrap.style.bottom="0px",this._editorElementWrap.style.top="0px",this._editorElementWrap.style.left="0px",this._editorElementWrap.style.width="100%";var c=this._selectedElement.classList;"top"===l&&this._selectedElement.offsetWidth<"1300"?c.add("tui-image-editor-top-optimization"):c.remove("tui-image-editor-top-optimization")}},{key:"toggleZoomButtonStatus",value:function(t){this._buttonElements[t].classList.toggle(Wr),t===Ur?this._buttonElements[Gr].classList.remove(Wr):this._buttonElements[Ur].classList.remove(Wr)}},{key:"offZoomInButtonStatus",value:function(){this._buttonElements[Ur].classList.remove(Wr)}},{key:"changeHandButtonStatus",value:function(t){this._buttonElements[Gr].classList[t?"add":"remove"](Wr)}},{key:"changeHelpButtonEnabled",value:function(t,e){this._buttonElements[t].classList[e?"add":"remove"]("enabled")}},{key:"_initializeOption",value:function(t){return B()({loadImage:{path:"",name:""},locale:{},menuIconPath:"",menu:["resize","crop","flip","rotate","draw","shape","icon","text","mask","filter"],initMenu:"",uiSize:{width:"100%",height:"100%"},menuBarPosition:"bottom"},t)}},{key:"_setUiSize",value:function(){var t=arguments.length>0&&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;W()(this.options.menu,function(e){var i,n=Yr[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:A()(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(fe,A()(t=this._addHistory).call(t,this)),this.on(de,A()(e=this._selectPrevHistory).call(e,this)),this.on(ge,A()(i=this._selectNextHistory).call(i,this))}},{key:"_attachZoomEvent",value:function(){var t=this;this.on(ve,function(){t.offZoomInButtonStatus(),t.changeHandButtonStatus(!0)}),this.on(me,function(){return t.changeHandButtonStatus(!1)})}},{key:"_makeUiElement",value:function(t){var e,i;i=t.nodeType?t:document.querySelector(t);var n,r=(n=i,function(t){return n.querySelector(t)});i.classList.add("tui-image-editor-container"),i.innerHTML=function(t){var e,i,n,r,o,s,a=t.locale,l=t.biImage,c=t.loadButtonStyle,u=t.downloadButtonStyle,h=t.menuBarPosition;return O()(e=O()(i=O()(n=O()(r=O()(o='\n <ul class="tui-image-editor-help-menu '.concat((s=h,"top"===s?"bottom":"left"===s?"right":"right"===s?"left":"top"),'"></ul>\n <div class="tui-image-editor-controls">\n <div class="tui-image-editor-controls-logo">\n <img src="')).call(o,l,'" />\n </div>\n <ul class="tui-image-editor-menu"></ul>\n\n <div class="tui-image-editor-controls-buttons">\n <div style="')).call(r,c,'">\n ')).call(n,a.localize("Load"),'\n <input type="file" class="tui-image-editor-load-btn" />\n </div>\n <button class="tui-image-editor-download-btn" style="')).call(i,u,'">\n ')).call(e,a.localize("Download"),"\n </button>\n </div>\n </div>\n")}({locale:this._locale,biImage:this.theme.getStyle("common.bi"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),menuBarPosition:this.options.menuBarPosition})+function(t){var e,i,n,r,o,s,a,l=t.locale,c=t.biImage,u=t.commonStyle,h=t.headerStyle,f=t.loadButtonStyle,d=t.downloadButtonStyle,g=t.submenuStyle;return O()(e=O()(i=O()(n=O()(r=O()(o=O()(s=O()(a='\n <div class="tui-image-editor-main-container" style="'.concat(u,'">\n <div class="tui-image-editor-header" style="')).call(a,h,'">\n <div class="tui-image-editor-header-logo">\n <img src="')).call(s,c,'" />\n </div>\n <div class="tui-image-editor-header-buttons">\n <div style="')).call(o,f,'">\n ')).call(r,l.localize("Load"),'\n <input type="file" class="tui-image-editor-load-btn" />\n </div>\n <button class="tui-image-editor-download-btn" style="')).call(n,d,'">\n ')).call(i,l.localize("Download"),'\n </button>\n </div>\n </div>\n <div class="tui-image-editor-main">\n <div class="tui-image-editor-submenu">\n <div class="tui-image-editor-submenu-style" style="')).call(e,g,'"></div>\n </div>\n <div class="tui-image-editor-wrap">\n <div class="tui-image-editor-size-wrap">\n <div class="tui-image-editor-align-wrap">\n <div class="tui-image-editor"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n')}({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=r(".tui-image-editor-main"),this._editorElementWrap=r(".tui-image-editor-wrap"),this._editorElement=r(".tui-image-editor"),this._helpMenuBarElement=r(".tui-image-editor-help-menu"),this._menuBarElement=r(".tui-image-editor-menu"),this._subMenuElement=r(".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 Br(this._buttonElements[Hr],{locale:this._locale,makeSvgIcon:A()(e=this.theme.makeMenSvgIconSet).call(e,this.theme)}),this._activateZoomMenus()}},{key:"_activateZoomMenus",value:function(){var t=this;W()(ut,function(e){t.changeHelpButtonEnabled(e,!0)})}},{key:"_makeHelpMenuWithPartition",value:function(){var t;return O()(t=[]).call(t,I(ut),[""],I(ht),[""],I(ft))}},{key:"_addHelpMenus",value:function(){var t=this,e=this._makeHelpMenuWithPartition();W()(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=Wi("item"),e.className=Wi("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"),s=this.theme.makeMenSvgIconSet(n,t);this._addTooltipAttribute(o,t),o.className=O()(e=O()(i="tie-btn-".concat(t," ")).call(i,Wi("item")," ")).call(e,r),o.innerHTML=s,"normal"===r?this._menuBarElement.appendChild(o):this._helpMenuBarElement.appendChild(o)}},{key:"_addHelpActionEvent",value:function(){var t=this;W()(dt,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;W()(dt,function(e){t._buttonElements[e].removeEventListener("click",t.eventHandler[e])})}},{key:"_addHistory",value:function(t){if(!function(t){return"string"==typeof t?Tt===t:Tt===t.name}(t)){var e="string"==typeof t?{name:t}:function(t){var e,i,n,r=Dt,o=At,s=Bt,a=jt,l=Lt,c=Rt,u=Nt,f=Yt,d=kt,g=Ht,p=Ot,v=Zt,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 a:n={name:Ae,detail:Ki(y[1],y[2])};break;case l:n={name:Ee,detail:"Remove"};break;case c:n={name:Oe,detail:"Change"};break;case u:n={name:je,detail:"Change"};break;case f:n={name:Pe,detail:"Change"};break;case p:n={name:Ne,detail:y[2]};break;case d:n={name:ze,detail:"All"};break;case g:n={name:ke,detail:"Add"};break;case s:n={name:Le};break;case v:n={name:De,detail:O()(i="".concat(~~y[1].width,"x")).call(i,~~y[1].height)};break;default:n={name:m}}return"mask"===y[1]&&(n={name:we,detail:"Apply"}),n}(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){t.target.closest(".".concat("tie-panel-history"))||this._buttonElements[Hr].classList.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()},W()(this._buttonElements.download,function(e){e.addEventListener("click",t.eventHandler.download)})}},{key:"_removeDownloadEvent",value:function(){var t=this;W()(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])},W()(this._buttonElements.load,function(e){e.addEventListener("change",t.eventHandler.loadImage)})}},{key:"_removeLoadEvent",value:function(){var t=this;W()(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(xe,function(){return e.fire(xe)}),this[t].on(_e,function(){return e.fire(_e)})}},{key:"_addMenuEvent",value:function(){var t=this;W()(this.options.menu,function(e){t._addMainMenuEvent(e),t._addSubMenuEvent(e)})}},{key:"_removeMainMenuEvent",value:function(){var t=this;W()(this.options.menu,function(e){t._buttonElements[e].removeEventListener("click",t.eventHandler[e]),t[e].off(xe),t[e].off(_e)})}},{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;W()(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=Wi("grid-visual"),i.innerHTML='<table>\n <tr><td class="dot left-top"></td><td></td><td class="dot right-top"></td></tr>\n <tr><td></td><td></td><td></td></tr>\n <tr><td class="dot left-bottom"></td><td></td><td class="dot right-bottom"></td></tr>\n </table>',this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(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;return{width:dn()(e),height:dn()(i)}}},{key:"_setEditorPosition",value:function(t){var e=this._getCanvasMaxDimension(),i=e.width,n=e.height,r=this._editorElement.style,o=0,s=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?s=i>this._editorElementWrap.offsetWidth-248?124-(i-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===t&&(s=i>this._editorElementWrap.scrollWidth-248?(i-this._editorElementWrap.scrollWidth)/2:-124)),r.top="".concat(o,"px"),r.left="".concat(s,"px")}}]),t}();G().mixin(Xr);var Zr=Xr,Vr=i(381),Jr=i.n(Vr),Qr=function(){function t(){w(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 T(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;r<n.palette.length;r+=1){var o=this.batchtracepaths(this.internodes(this.pathscan(this.layeringstep(n,r),e.pathomit),e),e.ltres,e.qtres);i.layers.push(o)}}else{var s=this.layering(n);e.layercontainerid&&this.drawLayers(s,this.specpalette,e.scale,e.layercontainerid);var a=this.batchpathscan(s,e.pathomit),l=this.batchinternodes(a,e);i={layers:this.batchtracelayers(l,e.ltres,e.qtres),palette:n.palette,width:t.width,height:t.height}}return i}},{key:"checkoptions",value:function(t){"string"==typeof(t=t||{})&&(t=t.toLowerCase(),t=this.optionpresets[t]?this.optionpresets[t]:{});for(var e=J()(this.optionpresets.default),i=0;i<e.length;i+=1)t.hasOwnProperty(e[i])||(t[e[i]]=this.optionpresets.default[e[i]]);return t}},{key:"colorquantization",value:function(t,e){var i,n,r,o,s,a,l,c,u=[],h=0,f=[],d=t.width*t.height;for(s=0;s<t.height+2;s+=1)for(u[s]=[],o=0;o<t.width+2;o+=1)u[s][o]=-1;for(c=e.pal?e.pal:0===e.colorsampling?this.generatepalette(e.numberofcolors):1===e.colorsampling?this.samplepalette(e.numberofcolors,t):this.samplepalette2(e.numberofcolors,t),e.blurradius>0&&(t=this.blur(t,e.blurradius,e.blurdelta)),l=0;l<e.colorquantcycles;l+=1){if(l>0)for(a=0;a<c.length;a+=1)f[a].n>0&&(c[a]={r:Math.floor(f[a].r/f[a].n),g:Math.floor(f[a].g/f[a].n),b:Math.floor(f[a].b/f[a].n),a:Math.floor(f[a].a/f[a].n)}),f[a].n/d<e.mincolorratio&&l<e.colorquantcycles-1&&(c[a]={r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())});for(o=0;o<c.length;o+=1)f[o]={r:0,g:0,b:0,a:0,n:0};for(s=0;s<t.height;s+=1)for(o=0;o<t.width;o+=1){for(h=4*(s*t.width+o),r=0,n=1024,a=0;a<c.length;a+=1)(i=Math.abs(c[a].r-t.data[h])+Math.abs(c[a].g-t.data[h+1])+Math.abs(c[a].b-t.data[h+2])+Math.abs(c[a].a-t.data[h+3]))<n&&(n=i,r=a);f[r].r+=t.data[h],f[r].g+=t.data[h+1],f[r].b+=t.data[h+2],f[r].a+=t.data[h+3],f[r].n+=1,u[s+1][o+1]=r}}return{array:u,palette:c}}},{key:"samplepalette",value:function(t,e){for(var i,n=[],r=0;r<t;r+=1)i=4*Math.floor(Math.random()*e.data.length/4),n.push({r:e.data[i],g:e.data[i+1],b:e.data[i+2],a:e.data[i+3]});return n}},{key:"samplepalette2",value:function(t,e){for(var i,n=[],r=Math.ceil(Math.sqrt(t)),o=Math.ceil(t/r),s=e.width/(r+1),a=e.height/(o+1),l=0;l<o;l+=1)for(var c=0;c<r&&n.length!==t;c+=1)i=4*Math.floor((l+1)*a*e.width+(c+1)*s),n.push({r:e.data[i],g:e.data[i+1],b:e.data[i+2],a:e.data[i+3]});return n}},{key:"generatepalette",value:function(t){var e,i,n,r=[];if(t<8)for(var o=Math.floor(255/(t-1)),s=0;s<t;s+=1)r.push({r:s*o,g:s*o,b:s*o,a:255});else{var a=Math.floor(Math.pow(t,1/3)),l=Math.floor(255/(a-1)),c=t-a*a*a;for(e=0;e<a;e+=1)for(i=0;i<a;i+=1)for(n=0;n<a;n+=1)r.push({r:e*l,g:i*l,b:n*l,a:255});for(e=0;e<c;e+=1)r.push({r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())})}return r}},{key:"layering",value:function(t){var e,i,n,r,o,s,a,l,c,u,h,f=[],d=0,g=t.array.length,p=t.array[0].length;for(h=0;h<t.palette.length;h+=1)for(f[h]=[],u=0;u<g;u+=1)for(f[h][u]=[],c=0;c<p;c+=1)f[h][u][c]=0;for(u=1;u<g-1;u+=1)for(c=1;c<p-1;c+=1)d=t.array[u][c],e=t.array[u-1][c-1]===d?1:0,i=t.array[u-1][c]===d?1:0,n=t.array[u-1][c+1]===d?1:0,r=t.array[u][c-1]===d?1:0,o=t.array[u][c+1]===d?1:0,s=t.array[u+1][c-1]===d?1:0,a=t.array[u+1][c]===d?1:0,l=t.array[u+1][c+1]===d?1:0,f[d][u+1][c+1]=1+2*o+4*l+8*a,r||(f[d][u+1][c]=2+4*a+8*s),i||(f[d][u][c+1]=0+2*n+4*o+8),e||(f[d][u][c]=0+2*i+4+8*r);return f}},{key:"layeringstep",value:function(t,e){var i,n,r=[],o=t.array.length,s=t.array[0].length;for(n=0;n<o;n+=1)for(r[n]=[],i=0;i<s;i+=1)r[n][i]=0;for(n=1;n<o;n+=1)for(i=1;i<s;i+=1)r[n][i]=(t.array[n-1][i-1]===e?1:0)+(t.array[n-1][i]===e?2:0)+(t.array[n][i-1]===e?8:0)+(t.array[n][i]===e?4:0);return r}},{key:"pathscan",value:function(t,e){for(var i,n=[],r=0,o=0,s=0,a=0,l=t[0].length,c=t.length,u=0,h=!0,f=!1,d=0;d<c;d+=1)for(var g=0;g<l;g+=1)if(4===t[d][g]||11===t[d][g])for(s=g,a=d,n[r]={},n[r].points=[],n[r].boundingbox=[s,a,s,a],n[r].holechildren=[],h=!1,o=0,f=11===t[d][g],u=1;!h;){if(n[r].points[o]={},n[r].points[o].x=s-1,n[r].points[o].y=a-1,n[r].points[o].t=t[a][s],s-1<n[r].boundingbox[0]&&(n[r].boundingbox[0]=s-1),s-1>n[r].boundingbox[2]&&(n[r].boundingbox[2]=s-1),a-1<n[r].boundingbox[1]&&(n[r].boundingbox[1]=a-1),a-1>n[r].boundingbox[3]&&(n[r].boundingbox[3]=a-1),i=this.pathscan_combined_lookup[t[a][s]][u],t[a][s]=i[0],u=i[1],s+=i[2],a+=i[3],s-1===n[r].points[0].x&&a-1===n[r].points[0].y)if(h=!0,n[r].points.length<e)n.pop();else{if(n[r].isholepath=!!f,f){for(var p=0,v=[-1,-1,l+1,c+1],m=0;m<r;m++)!n[m].isholepath&&this.boundingboxincludes(n[m].boundingbox,n[r].boundingbox)&&this.boundingboxincludes(v,n[m].boundingbox)&&(p=m,v=n[m].boundingbox);n[p].holechildren.push(r)}r+=1}o+=1}return n}},{key:"boundingboxincludes",value:function(t,e){return t[0]<e[0]&&t[1]<e[1]&&t[2]>e[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,s=0,a=0,l=0,c=0;for(i=0;i<t.length;i+=1)for(r[i]={},r[i].points=[],r[i].boundingbox=t[i].boundingbox,r[i].holechildren=t[i].holechildren,r[i].isholepath=t[i].isholepath,o=t[i].points.length,n=0;n<o;n+=1)s=(n+1)%o,a=(n+2)%o,l=(n-1+o)%o,c=(n-2+o)%o,e.rightangleenhance&&this.testrightangle(t[i],c,l,n,s,a)&&(r[i].points.length>0&&(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[s].x)/2,(t[i].points[n].y+t[i].points[s].y)/2)})),r[i].points.push({x:(t[i].points[n].x+t[i].points[s].x)/2,y:(t[i].points[n].y+t[i].points[s].y)/2,linesegment:this.getdirection((t[i].points[n].x+t[i].points[s].x)/2,(t[i].points[n].y+t[i].points[s].y)/2,(t[i].points[s].x+t[i].points[a].x)/2,(t[i].points[s].y+t[i].points[a].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){return t<i?e<n?1:e>n?7:0:t>i?e<n?3:e>n?5:4:e<n?2:e>n?6:8}},{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,s=0,a={segments:[]};for(a.boundingbox=t.boundingbox,a.holechildren=t.holechildren,a.isholepath=t.isholepath;s<t.points.length;){var l;for(n=t.points[s].linesegment,r=-1,o=s+1;(t.points[o].linesegment===n||t.points[o].linesegment===r||-1===r)&&o<t.points.length-1;)t.points[o].linesegment!==n&&-1===r&&(r=t.points[o].linesegment),o+=1;o===t.points.length-1&&(o=0),a.segments=O()(l=a.segments).call(l,this.fitseq(t,e,i,s,o)),s=o>0?o:t.points.length}return a}},{key:"fitseq",value:function(t,e,i,n,r){var o;if(r>t.points.length||r<0)return[];var s,a,l,c=n,u=0,h=!0,f=r-n;f<0&&(f+=t.points.length);for(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;v!=r;)(d=v-n)<0&&(d+=t.points.length),s=t.points[n].x+g*d,a=t.points[n].y+p*d,(l=(t.points[v].x-s)*(t.points[v].x-s)+(t.points[v].y-a)*(t.points[v].y-a))>e&&(h=!1),l>u&&(c=v,u=l),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=c;h=!0,u=0;var y=(m-n)/f,b=(1-y)*(1-y),x=2*(1-y)*y,_=y*y,C=(b*t.points[n].x+_*t.points[r].x-t.points[m].x)/-x,I=(b*t.points[n].y+_*t.points[r].y-t.points[m].y)/-x;for(v=n+1;v!=r;)x=2*(1-(y=(v-n)/f))*y,_=y*y,s=(b=(1-y)*(1-y))*t.points[n].x+x*C+_*t.points[r].x,a=b*t.points[n].y+x*I+_*t.points[r].y,(l=(t.points[v].x-s)*(t.points[v].x-s)+(t.points[v].y-a)*(t.points[v].y-a))>i&&(h=!1),l>u&&(c=v,u=l),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 O()(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,s,a=t.layers[e],l=a[i],c="";if(n.linefilter&&l.segments.length<3)return c;if(c=O()(r="<path ".concat(n.desc?O()(o='desc="l '.concat(e," p ")).call(o,i,'" '):"")).call(r,this.tosvgcolorstr(t.palette[e],n),'d="'),-1===n.roundcoords){var u;for(c+=O()(u="M ".concat(l.segments[0].x1*n.scale," ")).call(u,l.segments[0].y1*n.scale," "),s=0;s<l.segments.length;s++){var h,f,d;c+=O()(h=O()(f="".concat(l.segments[s].type," ")).call(f,l.segments[s].x2*n.scale," ")).call(h,l.segments[s].y2*n.scale," "),l.segments[s].hasOwnProperty("x3")&&(c+=O()(d="".concat(l.segments[s].x3*n.scale," ")).call(d,l.segments[s].y3*n.scale," "))}c+="Z "}else{var g;for(c+=O()(g="M ".concat(this.roundtodec(l.segments[0].x1*n.scale,n.roundcoords)," ")).call(g,this.roundtodec(l.segments[0].y1*n.scale,n.roundcoords)," "),s=0;s<l.segments.length;s++){var p,v,m;c+=O()(p=O()(v="".concat(l.segments[s].type," ")).call(v,this.roundtodec(l.segments[s].x2*n.scale,n.roundcoords)," ")).call(p,this.roundtodec(l.segments[s].y2*n.scale,n.roundcoords)," "),l.segments[s].hasOwnProperty("x3")&&(c+=O()(m="".concat(this.roundtodec(l.segments[s].x3*n.scale,n.roundcoords)," ")).call(m,this.roundtodec(l.segments[s].y3*n.scale,n.roundcoords)," "))}c+="Z "}for(var y=0;y<l.holechildren.length;y++){var b,x,_,C,I=a[l.holechildren[y]];if(-1===n.roundcoords)for(I.segments[I.segments.length-1].hasOwnProperty("x3")?c+=O()(b="M ".concat(I.segments[I.segments.length-1].x3*n.scale," ")).call(b,I.segments[I.segments.length-1].y3*n.scale," "):c+=O()(x="M ".concat(I.segments[I.segments.length-1].x2*n.scale," ")).call(x,I.segments[I.segments.length-1].y2*n.scale," "),s=I.segments.length-1;s>=0;s--){var M,S;c+="".concat(I.segments[s].type," "),I.segments[s].hasOwnProperty("x3")&&(c+=O()(S="".concat(I.segments[s].x2*n.scale," ")).call(S,I.segments[s].y2*n.scale," ")),c+=O()(M="".concat(I.segments[s].x1*n.scale," ")).call(M,I.segments[s].y1*n.scale," ")}else for(I.segments[I.segments.length-1].hasOwnProperty("x3")?c+=O()(_="M ".concat(this.roundtodec(I.segments[I.segments.length-1].x3*n.scale)," ")).call(_,this.roundtodec(I.segments[I.segments.length-1].y3*n.scale)," "):c+=O()(C="M ".concat(this.roundtodec(I.segments[I.segments.length-1].x2*n.scale)," ")).call(C,this.roundtodec(I.segments[I.segments.length-1].y2*n.scale)," "),s=I.segments.length-1;s>=0;s--){var w,k;c+="".concat(I.segments[s].type," "),I.segments[s].hasOwnProperty("x3")&&(c+=O()(k="".concat(this.roundtodec(I.segments[s].x2*n.scale)," ")).call(k,this.roundtodec(I.segments[s].y2*n.scale)," ")),c+=O()(w="".concat(this.roundtodec(I.segments[s].x1*n.scale)," ")).call(w,this.roundtodec(I.segments[s].y1*n.scale)," ")}c+="Z "}if(c+='" />',n.lcpr||n.qcpr){for(s=0;s<l.segments.length;s++){var T,D,A,E,j,L,P,N,z,R,B,F,Y,H,W,U,G;l.segments[s].hasOwnProperty("x3")&&n.qcpr&&(c+=O()(T=O()(D=O()(A='<circle cx="'.concat(l.segments[s].x2*n.scale,'" cy="')).call(A,l.segments[s].y2*n.scale,'" r="')).call(D,n.qcpr,'" fill="cyan" stroke-width="')).call(T,.2*n.qcpr,'" stroke="black" />'),c+=O()(E=O()(j=O()(L='<circle cx="'.concat(l.segments[s].x3*n.scale,'" cy="')).call(L,l.segments[s].y3*n.scale,'" r="')).call(j,n.qcpr,'" fill="white" stroke-width="')).call(E,.2*n.qcpr,'" stroke="black" />'),c+=O()(P=O()(N=O()(z=O()(R='<line x1="'.concat(l.segments[s].x1*n.scale,'" y1="')).call(R,l.segments[s].y1*n.scale,'" x2="')).call(z,l.segments[s].x2*n.scale,'" y2="')).call(N,l.segments[s].y2*n.scale,'" stroke-width="')).call(P,.2*n.qcpr,'" stroke="cyan" />'),c+=O()(B=O()(F=O()(Y=O()(H='<line x1="'.concat(l.segments[s].x2*n.scale,'" y1="')).call(H,l.segments[s].y2*n.scale,'" x2="')).call(Y,l.segments[s].x3*n.scale,'" y2="')).call(F,l.segments[s].y3*n.scale,'" stroke-width="')).call(B,.2*n.qcpr,'" stroke="cyan" />')),!l.segments[s].hasOwnProperty("x3")&&n.lcpr&&(c+=O()(W=O()(U=O()(G='<circle cx="'.concat(l.segments[s].x2*n.scale,'" cy="')).call(G,l.segments[s].y2*n.scale,'" r="')).call(U,n.lcpr,'" fill="white" stroke-width="')).call(W,.2*n.lcpr,'" stroke="black" />'))}for(y=0;y<l.holechildren.length;y++)for(I=a[l.holechildren[y]],s=0;s<I.segments.length;s++){var X,Z,V,J,Q,K,q,$,tt,et,it,nt,rt,ot,st,at,lt;I.segments[s].hasOwnProperty("x3")&&n.qcpr&&(c+=O()(X=O()(Z=O()(V='<circle cx="'.concat(I.segments[s].x2*n.scale,'" cy="')).call(V,I.segments[s].y2*n.scale,'" r="')).call(Z,n.qcpr,'" fill="cyan" stroke-width="')).call(X,.2*n.qcpr,'" stroke="black" />'),c+=O()(J=O()(Q=O()(K='<circle cx="'.concat(I.segments[s].x3*n.scale,'" cy="')).call(K,I.segments[s].y3*n.scale,'" r="')).call(Q,n.qcpr,'" fill="white" stroke-width="')).call(J,.2*n.qcpr,'" stroke="black" />'),c+=O()(q=O()($=O()(tt=O()(et='<line x1="'.concat(I.segments[s].x1*n.scale,'" y1="')).call(et,I.segments[s].y1*n.scale,'" x2="')).call(tt,I.segments[s].x2*n.scale,'" y2="')).call($,I.segments[s].y2*n.scale,'" stroke-width="')).call(q,.2*n.qcpr,'" stroke="cyan" />'),c+=O()(it=O()(nt=O()(rt=O()(ot='<line x1="'.concat(I.segments[s].x2*n.scale,'" y1="')).call(ot,I.segments[s].y2*n.scale,'" x2="')).call(rt,I.segments[s].x3*n.scale,'" y2="')).call(nt,I.segments[s].y3*n.scale,'" stroke-width="')).call(it,.2*n.qcpr,'" stroke="cyan" />')),!I.segments[s].hasOwnProperty("x3")&&n.lcpr&&(c+=O()(st=O()(at=O()(lt='<circle cx="'.concat(I.segments[s].x2*n.scale,'" cy="')).call(lt,I.segments[s].y2*n.scale,'" r="')).call(at,n.lcpr,'" fill="white" stroke-width="')).call(st,.2*n.lcpr,'" stroke="black" />'))}}return c}},{key:"getsvgstring",value:function(t,e){var i,n,r;e=this.checkoptions(e);for(var o=t.width*e.scale,s=t.height*e.scale,a=O()(i="<svg ".concat(e.viewbox?O()(n='viewBox="0 0 '.concat(o," ")).call(n,s,'" '):O()(r='width="'.concat(o,'" height="')).call(r,s,'" '),'version="1.1" xmlns="http://www.w3.org/2000/svg" desc="Created with imagetracer.js version ')).call(i,this.versionnumber,'" >'),l=0;l<t.layers.length;l+=1)for(var c=0;c<t.layers[l].length;c+=1)t.layers[l][c].isholepath||(a+=this.svgpathstring(t,l,c,e));return a+="</svg>"}},{key:"compareNumbers",value:function(t,e){return t-e}},{key:"torgbastr",value:function(t){var e,i,n;return O()(e=O()(i=O()(n="rgba(".concat(t.r,",")).call(n,t.g,",")).call(i,t.b,",")).call(e,t.a,")")}},{key:"tosvgcolorstr",value:function(t,e){var i,n,r,o,s,a,l;return O()(i=O()(n=O()(r=O()(o=O()(s=O()(a=O()(l='fill="rgb('.concat(t.r,",")).call(l,t.g,",")).call(a,t.b,')" stroke="rgb(')).call(s,t.r,",")).call(o,t.g,",")).call(r,t.b,')" stroke-width="')).call(n,e.strokewidth,'" opacity="')).call(i,t.a/255,'" ')}},{key:"appendSVGString",value:function(t,e){var i;e?(i=document.getElementById(e))||((i=document.createElement("div")).id=e,document.body.appendChild(i)):(i=document.createElement("div"),document.body.appendChild(i)),i.innerHTML+=t}},{key:"blur",value:function(t,e,i){var n,r,o,s,a,l,c,u,h,f={width:t.width,height:t.height,data:[]};if((e=Math.floor(e))<1)return t;e>5&&(e=5),(i=Math.abs(i))>1024&&(i=1024);var d=this.gks[e-1];for(r=0;r<t.height;r++)for(n=0;n<t.width;n++){for(a=0,l=0,c=0,u=0,h=0,o=-e;o<e+1;o++)n+o>0&&n+o<t.width&&(s=4*(r*t.width+n+o),a+=t.data[s]*d[o+e],l+=t.data[s+1]*d[o+e],c+=t.data[s+2]*d[o+e],u+=t.data[s+3]*d[o+e],h+=d[o+e]);s=4*(r*t.width+n),f.data[s]=Math.floor(a/h),f.data[s+1]=Math.floor(l/h),f.data[s+2]=Math.floor(c/h),f.data[s+3]=Math.floor(u/h)}var g=new Uint8ClampedArray(f.data);for(r=0;r<t.height;r++)for(n=0;n<t.width;n++){for(a=0,l=0,c=0,u=0,h=0,o=-e;o<e+1;o++)r+o>0&&r+o<t.height&&(a+=g[s=4*((r+o)*t.width+n)]*d[o+e],l+=g[s+1]*d[o+e],c+=g[s+2]*d[o+e],u+=g[s+3]*d[o+e],h+=d[o+e]);s=4*(r*t.width+n),f.data[s]=Math.floor(a/h),f.data[s+1]=Math.floor(l/h),f.data[s+2]=Math.floor(c/h),f.data[s+3]=Math.floor(u/h)}for(r=0;r<t.height;r++)for(n=0;n<t.width;n++)s=4*(r*t.width+n),Math.abs(f.data[s]-t.data[s])+Math.abs(f.data[s+1]-t.data[s+1])+Math.abs(f.data[s+2]-t.data[s+2])+Math.abs(f.data[s+3]-t.data[s+3])>i&&(f.data[s]=t.data[s],f.data[s+1]=t.data[s+1],f.data[s+2]=t.data[s+2],f.data[s+3]=t.data[s+3]);return f}},{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,t.getContext("2d").drawImage(n,0,0),e(t)}}},{key:"getImgdata",value:function(t){return t.getContext("2d").getImageData(0,0,t.width,t.height)}},{key:"drawLayers",value:function(t,e,i,n){var r,o,s,a,l,c;for(l in i=i||1,n?(c=document.getElementById(n))||((c=document.createElement("div")).id=n,document.body.appendChild(c)):(c=document.createElement("div"),document.body.appendChild(c)),t)if(t.hasOwnProperty(l)){r=t[l][0].length,o=t[l].length;var u=document.createElement("canvas");u.width=r*i,u.height=o*i;var h=u.getContext("2d");for(a=0;a<o;a+=1)for(s=0;s<r;s+=1)h.fillStyle=this.torgbastr(e[t[l][a][s]%e.length]),h.fillRect(s*i,a*i,i,i);c.appendChild(u)}}}],[{key:"tracerDefaultOption",value:function(){return{pathomit:100,ltres:.1,qtres:1,scale:1,strokewidth:5,viewbox:!1,linefilter:!0,desc:!1,rightangleenhance:!1,pal:[{r:0,g:0,b:0,a:255},{r:255,g:255,b:255,a:255}]}}}]),t}(),Kr={getActions:function(){return{main:this._mainAction(),shape:this._shapeAction(),crop:this._cropAction(),resize:this._resizeAction(),flip:this._flipAction(),rotate:this._rotateAction(),text:this._textAction(),mask:this._maskAction(),draw:this._drawAction(),icon:this._iconAction(),filter:this._filterAction(),history:this._historyAction()}},_mainAction:function(){var t=this,e=function(){"crop"===t.ui.submenu&&(t.stopDrawingMode(),t.ui.changeMenu("crop"))},i=function(e){var i,n;return i=e,"rotate"===t.ui.submenu&&t.ui.rotate.setRangeBarAngle("setAngle",i),n=e,"filter"===t.ui.submenu&&Jr()(t.ui).setFilterState(n),e},n=function(){Jr()(t.ui)&&Jr()(t.ui).initFilterCheckBoxState()};return B()({initLoadImage:function(i,n){return t.loadImageFromURL(i,n).then(function(n){e(),t.ui.initializeImgUrl=i,t.ui.resizeEditor({imageSize:n}),t.clearUndoStack(),t._invoker.fire(fe,Se)})},undo:function(){t.isEmptyUndoStack()||(e(),t.deactivateAll(),t.undo().then(i))},redo:function(){t.isEmptyRedoStack()||(e(),t.deactivateAll(),t.redo().then(i))},reset:function(){e(),t.loadImageFromURL(t.ui.initializeImgUrl,"resetImage").then(function(i){e(),n(),t.ui.resizeEditor({imageSize:i}),t.clearUndoStack(),t._initHistory()})},delete:function(){t.ui.changeHelpButtonEnabled("delete",!1),e(),t.removeActiveObject(),t.activeObjectId=null},deleteAll:function(){e(),t.clearObjects(),t.ui.changeHelpButtonEnabled("delete",!1),t.ui.changeHelpButtonEnabled("deleteAll",!1)},load:function(i){Fi()||alert("This browser does not support file-api"),t.ui.initializeImgUrl=N().createObjectURL(i),t.loadImageFromFile(i).then(function(i){e(),n(),t.clearUndoStack(),t.ui.activeMenuEvent(),t.ui.resizeEditor({imageSize:i}),t._clearHistory(),t._invoker.fire(fe,Se)}).catch(function(t){return L().reject(t)})},download:function(){var e,i,n=t.toDataURL(),r=t.getImageName();Fi()&&window.saveAs?(i=(e=function(t){var e,i,n,r="";e=t.replace(/data:(image\/.+);base64,/,function(t,e){return r=e,""});var o=(e=atob(e)).length;for(i=new Uint8Array(o),n=0;n<o;n+=1)i[n]=e.charCodeAt(n);return new Blob([i],{type:r})}(n)).type.split("/")[1],r.split(".").pop()!==i&&(r+=".".concat(i)),saveAs(e,r)):window.open().document.body.innerHTML="<img src='".concat(n,"'>")},history:function(e){t.ui.toggleHistoryMenu(e)},zoomIn:function(){var e;t.ui.toggleZoomButtonStatus("zoomIn"),t.deactivateAll(),e=t._graphics.getZoomMode(),t.stopDrawingMode(),e!==Ge?(t.startDrawingMode(Re.ZOOM),t._graphics.startZoomInMode()):t._graphics.endZoomInMode()},zoomOut:function(){t._graphics.zoomOut()},hand:function(){var e;t.ui.offZoomInButtonStatus(),t.ui.toggleZoomButtonStatus("hand"),t.deactivateAll(),e=t._graphics.getZoomMode(),t.stopDrawingMode(),e!==Xe?(t.startDrawingMode(Re.ZOOM),t._graphics.startHandMode()):t._graphics.endHandMode()}},this._commonAction())},_iconAction:function(){var t=this;return B()({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){(new Qr).imageToSVG(e,function(e){var n=Q(e.match(/path[^>]*d="([^"]*)"/),2)[1],r={};r[i.name]=n,t.registerIcons(r),t.addIcon(i.name,{left:100,top:100})},Qr.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var t=this;return B()({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 B()({loadImageFromURL:function(e,i){return t.loadImageFromURL(t.toDataURL(),"FilterImage").then(function(){t.addImageObject(e).then(function(){N().revokeObjectURL(i)}),t._invoker.fire(fe,we)})},applyFilter:function(){t.applyFilter("mask",{maskObjId:t.activeObjectId})}},this._commonAction())},_textAction:function(){var t=this;return B()({changeTextStyle:function(e,i){t.activeObjectId&&t.changeTextStyle(t.activeObjectId,e,i)}},this._commonAction())},_rotateAction:function(){var t=this;return B()({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 B()({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 B()({crop:function(){var e=t.getCropzoneRect();e&&!function(t){var e=t.left,i=t.top,n=t.width,r=t.height;return e===Ii&&i===Mi&&n===Si&&r===wi}(e)&&t.crop(e).then(function(){t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("crop"),t._invoker.fire(fe,Te)}).catch(function(t){return L().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)}}},this._commonAction())},_resizeAction:function(){var t=this;return B()({getCurrentDimensions:function(){return t._graphics.getCurrentDimensions()},preview:function(e,i,n){var r=t._graphics.getCurrentDimensions(),o=function(){return r.width/r.height},s={};switch(e){case"width":s.width=i,s.height=n?i/o():r.height;break;case"height":s.height=i,s.width=n?i*o():r.width;break;default:s=r}t._graphics.resize(s).then(function(){t.ui.resizeEditor()}),n&&(t.ui.resize.setWidthValue(s.width),t.ui.resize.setHeightValue(s.height))},lockAspectRatio:function(e,i,n){var r=t._graphics.getCurrentDimensions(),o=r.width,s=r.height,a=o/s;if(e)if(o>s){var l=n/a,c=i*a;t.ui.resize.setLimit({minWidth:c>i?c:i,minHeight:i,maxWidth:n,maxHeight:l<n?l:n})}else{var u=n*a,h=i/a;t.ui.resize.setLimit({minWidth:i,minHeight:h>i?h:i,maxWidth:u<n?u:n,maxHeight:n})}else t.ui.resize.setLimit({minWidth:i,minHeight:i,maxWidth:n,maxHeight:n})},resize:function(){var e=arguments.length>0&&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 L().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 B()({flip:function(e){return t[e]()}},this._commonAction())},_filterAction:function(){var t=this;return B()({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,n;t.activeObjectId=e.id,t.ui.changeHelpButtonEnabled("delete",!0),t.ui.changeHelpButtonEnabled("deleteAll",!0),"cropzone"===e.type?t.ui.crop.changeApplyButtonStatus(!0):o()(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:nt()(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()):o()(n=["i-text","text"]).call(n,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(nt()(e)))},addText:function(e){var i=t.ui.text,n=i.textColor,r=i.fontSize,o=i.fontStyle,s=i.fontWeight,a=i.underline;t.addText("Double Click",{position:e.originPosition,styles:{fill:n,fontSize:r,fontFamily:"Noto Sans",fontStyle:o,fontWeight:s,underline:a}}).then(function(){t.changeCursor("default")})},addObjectAfter:function(e){var i;"icon"===e.type?t.ui.icon.changeStandbyMode():o()(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,n;if(o()(i=["i-text","text"]).call(i,e.type)>-1)t.ui.text.fontSize=Ri(e.fontSize);else if(o()(n=["rect","circle","triangle"]).call(n,e.type)>=0){var r=e.width,s=e.height,a=t.ui.shape.getStrokeValue();r<a&&t.ui.shape.setStrokeValue(r),s<a&&t.ui.shape.setStrokeValue(s)}},selectionCleared:function(){t.activeObjectId=null,"text"===t.ui.submenu?t.changeCursor("text"):Xi(["draw","crop","resize"],t.ui.submenu)||t.stopDrawingMode()}})},_historyAction:function(){var t=this;return{undo:function(e){return t.undo(e)},redo:function(e){return t.redo(e)}}},_commonAction:function(){var t,e,i,n,r=this,o=Re.TEXT,s=Re.CROPPER,a=Re.SHAPE,l=Re.ZOOM,c=Re.RESIZE;return{modeChange:function(t){switch(t){case Be:r._changeActivateMode(o);break;case Fe:r.startDrawingMode(s);break;case He:r._changeActivateMode(a),r.setDrawingShape(r.ui.shape.type,r.ui.shape.options);break;case We:r.startDrawingMode(l);break;case Ye:r.startDrawingMode(c)}},deactivateAll:A()(t=this.deactivateAll).call(t,this),changeSelectableAll:A()(e=this.changeSelectableAll).call(e,this),discardSelection:A()(i=this.discardSelection).call(i,this),stopDrawingMode:A()(n=this.stopDrawingMode).call(n,this)}},mixin:function(t){B()(t.prototype,this)}},qr=i(602),$r=i.n(qr),to=i(5573),eo=i.n(to),io=function(){function t(e,i){w(this,t),this.name=e,this.graphics=i}return T(t,[{key:"fire",value:function(){for(var t=this.graphics,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this.graphics.fire.apply(t,i)}},{key:"setCanvasImage",value:function(t,e){this.graphics.setCanvasImage(t,e)}},{key:"getCanvasElement",value:function(){return this.graphics.getCanvasElement()}},{key:"getCanvas",value:function(){return this.graphics.getCanvas()}},{key:"getCanvasImage",value:function(){return this.graphics.getCanvasImage()}},{key:"getImageName",value:function(){return this.graphics.getImageName()}},{key:"getEditor",value:function(){return this.graphics.getEditor()}},{key:"getName",value:function(){return this.name}},{key:"setImageProperties",value:function(t,e){this.graphics.setImageProperties(t,e)}},{key:"setCanvasCssDimension",value:function(t){this.graphics.setCanvasCssDimension(t)}},{key:"setCanvasBackstoreDimension",value:function(t){this.graphics.setCanvasBackstoreDimension(t)}},{key:"adjustCanvasDimension",value:function(){this.graphics.adjustCanvasDimension()}},{key:"adjustCanvasDimensionBase",value:function(){this.graphics.adjustCanvasDimensionBase()}}]),t}(),no=io;function ro(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var oo={padding:0,crossOrigin:"Anonymous"},so=function(t){Sn(i,t);var e=ro(i);function i(t){return w(this,i),e.call(this,St.IMAGE_LOADER,t)}return T(i,[{key:"load",value:function(t,e){var i,n=this;if(t||e)i=this._setBackgroundImage(e).then(function(e){return n.setCanvasImage(t,e),n.adjustCanvasDimension(),e});else{var r=this.getCanvas();r.backgroundImage=null,r.renderAll(),i=new(L())(function(t){n.setCanvasImage("",null),t()})}return i}},{key:"_setBackgroundImage",value:function(t){var e=this;return t?new(L())(function(i,n){var r=e.getCanvas();r.setBackgroundImage(t,function(){var t=r.backgroundImage;t&&t.getElement()?i(t):n(hi)},oo)}):L().reject(ui)}}]),i}(no),ao=["tl","tr","mt","ml","mr","mb","bl","br"],lo=function(){};function co(t,e){return t>e?"width":"height"}var uo=z.fabric.util.createClass(z.fabric.Rect,{initialize:function(t,e,i){(e=B()(e,i)).type="cropzone",this.callSuper("initialize",e),this._addEventHandler(),this.canvas=t,this.options=e},canvasEventDelegation:function(t){var e,i="unregistered";return this.canvasEventTrigger[t]!==lo?i="registered":o()(e=[Jt,Qt]).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=(S(t={},Jt,lo),S(t,Qt,lo),t),this.on({moving:A()(e=this._onMoving).call(e,this),scaling:A()(i=this._onScaling).call(i,this)}),z.fabric.util.addListener(document,"keydown",A()(n=this._onKeyDown).call(n,this)),z.fabric.util.addListener(document,"keyup",A()(r=this._onKeyUp).call(r,this))},_renderCropzone:function(t){var e=this.flipX?-1:1,i=this.flipY?-1:1,n=e/this.scaleX,r=i/this.scaleY;t.scale(n,r),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:7}),this._strokeBorder(t,"rgb(255, 255, 255)",{lineDashWidth:7,lineDashOffset:7})),t.scale(1/n,1/r)},_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(),nt()(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,s=this.top,a=n/2,l=r/2,c=i.getHeight(),u=i.getWidth();return{x:pn()(t=[-(a+o),-a,a,a+(u-o-n)]).call(t,Math.ceil),y:pn()(e=[-(l+s),-l,l,l+(c-s-r)]).call(e,Math.ceil)}},_strokeBorder:function(t,e,i){var n=i.lineDashWidth,r=i.lineDashOffset,o=i.lineWidth,s=this.width/2,a=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(-s,-a),t.lineTo(s,-a),t.lineTo(s,a),t.lineTo(-s,a),t.lineTo(-s,-a),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=Pi(i,0,r),this.top=Pi(n,0,o),this.canvasEventTrigger[Jt](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[Qt](this)},_calcScalingSizeFromPointer:function(t,e){var i=function(t){return o()(ao).call(ao,t)>=0}(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,s=t.maxHeight,a=t.scaleTo;if(e=o?Pi(e,1,o):e,i=s?Pi(i,1,s):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"===a?i=e/this.presetRatio:e=i*this.presetRatio;var l=Math.min(o/e,s/i);if(l<=1){var c,u=Q(pn()(c=[e,i]).call(c,function(t){return t*l}),2);e=u[0],i=u[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,s=n.width,a=n.height;return{rectTop:r,rectLeft:o,rectWidth:s,rectHeight:a,rectRight:o+s,rectBottom:r+a,canvasWidth:e,canvasHeight:i}},_resizeCropZone:function(t,e){var i=t.x,n=t.y,r=this._getCropzoneRectInfo(),o=r.rectWidth,s=r.rectHeight,a=r.rectTop,l=r.rectLeft,c=r.rectBottom,u=r.rectRight,h=r.canvasWidth,f=r.canvasHeight,d={tl:{width:u-i,height:c-n,leftMaker:function(t){return u-t},topMaker:function(t){return c-t},maxWidth:u,maxHeight:c,scaleTo:co(l-i,a-n)},tr:{width:i-l,height:c-n,leftMaker:function(){return l},topMaker:function(t){return c-t},maxWidth:h-l,maxHeight:c,scaleTo:co(i-u,a-n)},mt:{width:o,height:c-n,leftMaker:function(){return l},topMaker:function(t){return c-t},maxWidth:h-l,maxHeight:c,scaleTo:"height"},ml:{width:u-i,height:s,leftMaker:function(t){return u-t},topMaker:function(){return a},maxWidth:u,maxHeight:f-a,scaleTo:"width"},mr:{width:i-l,height:s,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:h-l,maxHeight:f-a,scaleTo:"width"},mb:{width:o,height:n-a,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:h-l,maxHeight:f-a,scaleTo:"height"},bl:{width:u-i,height:n-a,leftMaker:function(t){return u-t},topMaker:function(){return a},maxWidth:u,maxHeight:f-a,scaleTo:co(l-i,n-c)},br:{width:i-l,height:n-a,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:h-l,maxHeight:f-a,scaleTo:co(i-u,n-c)}};return this.adjustRatioCropzoneSize(d[e])},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0},_onKeyDown:function(t){t.keyCode===Ke&&(this._withShiftKey=!0)},_onKeyUp:function(t){t.keyCode===Ke&&(this._withShiftKey=!1)}}),ho=uo;function fo(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var go={presetRatio:null,top:-10,left:-10,height:1,width:1},po=function(t){Sn(i,t);var e=fo(i);function i(t){var n,r,o,s,a,l;return w(this,i),(l=e.call(this,St.CROPPER,t))._cropzone=null,l._startX=null,l._startY=null,l._withShiftKey=!1,l._listeners={keydown:A()(n=l._onKeyDown).call(n,Tn(l)),keyup:A()(r=l._onKeyUp).call(r,Tn(l)),mousedown:A()(o=l._onFabricMouseDown).call(o,Tn(l)),mousemove:A()(s=l._onFabricMouseMove).call(s,Tn(l)),mouseup:A()(a=l._onFabricMouseUp).call(a,Tn(l))},l}return T(i,[{key:"start",value:function(){if(!this._cropzone){var t=this.getCanvas();t.forEachObject(function(t){t.evented=!1}),this._cropzone=new ho(t,B()({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",z.fabric.util.addListener(document,"keydown",this._listeners.keydown),z.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,z.fabric.util.removeListener(document,"keydown",this._listeners.keydown),z.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)>10&&(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(),s=this._startX,a=this._startY,l=Pi(t,0,s),c=Pi(e,0,a),u=Pi(t,s,r)-l,h=Pi(e,a,o)-c;return this._withShiftKey&&!i?(u>h?h=u:h>u&&(u=h),s>=t&&(l=s-u),a>=e&&(c=a-h)):i&&(h=u/i,s>=t&&(l=Pi(s-u,0,r)),a>=e&&(c=Pi(a-h,0,o)),c+h>o&&(u=(h=o-c)*i,s>=t&&(l=Pi(s-u,0,r)),a>=e&&(c=Pi(a-h,0,o)))),{left:l,top:c,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):go),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(),s=r>=o?r:o,a=function(t,e){return t>e?e/t:1},l=s*t,c=s,u=a(l,r),h=Q(pn()(e=[l,c]).call(e,function(t){return t*u}),2);l=h[0];var f=a(c=h[1],o),d=Q(pn()(i=[l,c]).call(i,function(t){return Number((t*f).toFixed(2))}),2);return l=d[0],{presetRatio:t,top:(o-(c=d[1]))/2,left:(r-l)/2,width:l,height:c}}},{key:"_onKeyDown",value:function(t){t.keyCode===Ke&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(t){t.keyCode===Ke&&(this._withShiftKey=!1)}}]),i}(no),vo=po;function mo(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var yo=function(t){Sn(i,t);var e=mo(i);function i(t){return w(this,i),e.call(this,St.FLIP,t)}return T(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?(B()(e,t),this.setImageProperties(e,!0),this._invertAngle(i,n),this._flipObjects(i,n),L().resolve({flipX:e.flipX,flipY:e.flipY,angle:this.getCanvasImage().angle})):L().reject(ai)}},{key:"_invertAngle",value:function(t,e){var i=this.getCanvasImage(),n=i.angle;t&&(n*=-1),e&&(n*=-1),i.rotate(dn()(n)).setCoords()}},{key:"_flipObjects",value:function(t,e){var i=this.getCanvas();t&&i.forEachObject(function(t){t.set({angle:dn()(-1*t.angle),flipX:!t.flipX,left:i.width-t.left}).setCoords()}),e&&i.forEachObject(function(t){t.set({angle:dn()(-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}(no);function bo(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var xo=function(t){Sn(i,t);var e=bo(i);function i(t){return w(this,i),e.call(this,St.ROTATION,t)}return T(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),L().resolve(t)}},{key:"_rotateForEachObject",value:function(t,e,i){var n=this.getCanvas(),r=t.x-e.x,o=t.y-e.y;n.forEachObject(function(e){var n=e.getCenterPoint(),s=z.fabric.util.degreesToRadians(i),a=z.fabric.util.rotatePoint(n,t,s);e.set({left:a.x-r,top:a.y-o,angle:(e.angle+i)%360}),e.setCoords()}),n.renderAll()}},{key:"rotate",value:function(t){var e=this.getCurrentAngle();return this.setAngle(e+t)}}]),i}(no);function _o(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Co=function(t){Sn(i,t);var e=_o(i);function i(t){var n;return w(this,i),(n=e.call(this,St.FREE_DRAWING,t)).width=12,n.oColor=new z.fabric.Color("rgba(0, 0, 0, 0.5)"),n}return T(i,[{key:"start",value:function(t){this.getCanvas().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 z.fabric.Color(t.color)),e.width=this.width,e.color=this.oColor.toRgba()}},{key:"end",value:function(){this.getCanvas().isDrawingMode=!1}}]),i}(no),Io=z.fabric.util.createClass(z.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={fromX:e.x1,fromY:e.y1,toX:e.x2,toY:e.y2};this.ctx=t,t.lineWidth=this.strokeWidth,this._renderBasicLinePath(i),this._drawDecoratorPath(i),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)}},_drawTrianglePath:function(t,e){var i=1.7*this.ctx.lineWidth;this._drawChevronPath(t,e,i),this.ctx.closePath()},_drawChevronPath:function(t,e,i){var n=this,r=e.fromX,o=e.fromY,s=e.toX,a=e.toY,l=this.ctx;i||(i=2.7*this.ctx.lineWidth);var c=Q("head"===t?[r,o]:[s,a],2),u=c[0],h=c[1],f=Q("head"===t?[s,a]:[r,o],2),d=f[0],g=f[1],p=180*Math.atan2(g-h,d-u)/Math.PI,v=function(t){return n.getRotatePosition(i,t,{x:u,y:h})};l.moveTo.apply(l,I(v(p+30))),l.lineTo(u,h),l.lineTo.apply(l,I(v(p-30)))},getRotatePosition:function(t,e,i){var n=e*Math.PI/180,r=i.x,o=i.y;return[t*Math.cos(n)+r,t*Math.sin(n)+o]}}),Mo=Io;function So(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var wo=function(t){Sn(i,t);var e=So(i);function i(t){var n,r,o,s;return w(this,i),(s=e.call(this,St.LINE,t))._width=12,s._oColor=new z.fabric.Color("rgba(0, 0, 0, 0.5)"),s._listeners={mousedown:A()(n=s._onFabricMouseDown).call(n,Tn(s)),mousemove:A()(r=s._onFabricMouseMove).call(r,Tn(s)),mouseup:A()(o=s._onFabricMouseUp).call(o,Tn(s))},s}return T(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 z.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 Mo(o,{stroke:this._oColor.toRgba(),strokeWidth:this._width,arrowType:this._arrowType,evented:!1}),this._line.set(oi),e.add(this._line),e.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup}),this.fire(oe,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(qt,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 B()({},t,{startPosition:{x:i,y:r},endPosition:{x:n,y:o}})}}]),i}(no),ko=wo;function To(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Do={fill:"#000000",left:0,top:0},Ao={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"tie-text-align-left",underline:!1},Eo=function(t){Sn(i,t);var e=To(i);function i(t){var n,r,o,s,a,l;return w(this,i),(l=e.call(this,St.TEXT,t))._defaultStyles=Do,l._isSelected=!1,l._selectedObj={},l._editingObj={},l._listeners={mousedown:A()(n=l._onFabricMouseDown).call(n,Tn(l)),select:A()(r=l._onFabricSelect).call(r,Tn(l)),selectClear:A()(o=l._onFabricSelectClear).call(o,Tn(l)),scaling:A()(s=l._onFabricScaling).call(s,Tn(l)),textChanged:A()(a=l._onFabricTextChanged).call(a,Tn(l))},l._textarea=null,l._ratio=1,l._lastClickTime=(new Date).getTime(),l._editingObjInfos={},l.isPrevEditing=!1,l}return T(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,s=r.y;t.set({left:o,top:s,originX:i,originY:n}),t.setCoords()}},{key:"add",value:function(t,e){var i=this;return new(L())(function(n){var r,o=i.getCanvas(),s=null,a=oi,l=i._defaultStyles;i._setInitPos(e.position),e.styles&&(l=B()(l,e.styles)),Ir()(e.autofocus)||(e.autofocus=!0),s=new z.fabric.IText(t,l),a=B()({},a,{originX:"left",originY:"top"}),s.set(a),s.on({mouseup:A()(r=i._onFabricMouseUp).call(r,i)}),o.add(s),e.autofocus&&(s.enterEditing(),s.selectAll()),o.getActiveObject()||o.setActiveObject(s),i.isPrevEditing=!0,n(i.graphics.createObjectProperties(s))})}},{key:"change",value:function(t,e){var i=this;return new(L())(function(n){t.set("text",e),i.getCanvas().renderAll(),n()})}},{key:"setStyle",value:function(t,e){var i=this;return new(L())(function(n){W()(e,function(i,n){t[n]===i&&"fontSize"!==n&&(e[n]=Ao[n]||"")},i),"textDecoration"in e&&B()(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=$()(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 s={id:ji(e),type:e.type,text:n};this.fire(ee,s)}}},{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(ee,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(re,{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(te),this._lastClickTime=i}},{key:"_isDoubleClick",value:function(t){return t-this._lastClickTime<500}}]),i}(no);function Oo(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var jo={arrow:"M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z",cancel:"M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z"},Lo=function(t){Sn(i,t);var e=Oo(i);function i(t){var n,r,o,s;return w(this,i),(s=e.call(this,St.ICON,t))._oColor="#000000",s._pathMap=jo,s._type=null,s._iconColor=null,s._handlers={mousedown:A()(n=s._onFabricMouseDown).call(n,Tn(s)),mousemove:A()(r=s._onFabricMouseMove).call(r,Tn(s)),mouseup:A()(o=s._onFabricMouseUp).call(o,Tn(s))},s}return T(i,[{key:"setStates",value:function(t,e){this._type=t,this._iconColor=e}},{key:"start",value:function(){var t=this.getCanvas();t.selection=!1,t.on("mouse:down",this._handlers.mousedown)}},{key:"end",value:function(){var t=this.getCanvas();t.selection=!0,t.off({"mouse:down":this._handlers.mousedown})}},{key:"add",value:function(t,e){var i=this;return new(L())(function(n,r){var o=i.getCanvas(),s=i._pathMap[t],a=oi,l=s?i._createIcon(s):null;i._icon=l,l||r(li),l.set(B()({type:"icon",fill:i._oColor},a,e,i.graphics.controlStyle)),o.add(l).setActiveObject(l),n(i.graphics.createObjectProperties(l))})}},{key:"registerPaths",value:function(t){var e=this;W()(t,function(t,i){e._pathMap[i]=t},this)}},{key:"setColor",value:function(t,e){this._oColor=t,e&&"icon"===e.get("type")&&(e.set({fill:this._oColor}),this.getCanvas().renderAll())}},{key:"getColor",value:function(t){return nt()(t)}},{key:"_createIcon",value:function(t){return new z.fabric.Path(t)}},{key:"_onFabricMouseDown",value:function(t){var e=this,i=this.getCanvas();this._startPoint=i.getPointer(t.e);var n=this._startPoint,r=n.x,o=n.y;this.add(this._type,{left:r,top:o,fill:this._iconColor}).then(function(){e.fire(oe,e.graphics.createObjectProperties(e._icon)),i.on("mouse:move",e._handlers.mousemove),i.on("mouse:up",e._handlers.mouseup)})}},{key:"_onFabricMouseMove",value:function(t){var e=this.getCanvas();if(this._icon){var i=e.getPointer(t.e),n=(i.x-this._startPoint.x)/this._icon.width,r=(i.y-this._startPoint.y)/this._icon.height;this._icon.set({scaleX:Math.abs(2*n),scaleY:Math.abs(2*r)}),this._icon.setCoords(),e.renderAll()}}},{key:"_onFabricMouseUp",value:function(){var t=this.getCanvas();this.fire(qt,this.graphics.createObjectProperties(this._icon)),this._icon=null,t.off("mouse:down",this._handlers.mousedown),t.off("mouse:move",this._handlers.mousemove),t.off("mouse:up",this._handlers.mouseup)}}]),i}(no),Po=z.fabric.util.createClass(z.fabric.Image.filters.BlendImage,{applyTo:function(t){if(this.mask){var e=t.canvasEl,i=e.width,n=e.height,r=this._createCanvasOfMask(i,n),o=e.getContext("2d"),s=r.getContext("2d"),a=o.getImageData(0,0,i,n);this._drawMask(s,e,o),this._mapData(s,a,i,n),t.imageData=a}},_createCanvasOfMask:function(t,e){var i=z.fabric.util.createCanvasElement();return i.width=t,i.height=e,i},_drawMask:function(t){var e=this.mask,i=e.getElement(),n=e.angle,r=e.left,o=e.scaleX,s=e.scaleY,a=e.top;t.save(),t.translate(r,a),t.rotate(n*Math.PI/180),t.scale(o,s),t.drawImage(i,-i.width/2,-i.height/2),t.restore()},_mapData:function(t,e,i,n){for(var r=e.data,o=e.height,s=r,a=e.width*o*4,l=t.getImageData(0,0,i,n).data,c=0;c<a;c+=4)s[c+3]=l[c]}}),No=z.fabric.util.createClass(z.fabric.Image.filters.Convolute,{type:"Sharpen",initialize:function(){this.matrix=[0,-1,0,-1,5,-1,0,-1,0]}}),zo=z.fabric.util.createClass(z.fabric.Image.filters.Convolute,{type:"Emboss",initialize:function(){this.matrix=[1,1,1,1,.7,-1,-1,-1,-1]}}),Ro=z.fabric.util.createClass(z.fabric.Image.filters.BaseFilter,{type:"ColorFilter",initialize:function(t){t||(t={}),this.color=t.color||"#FFFFFF",this.threshold=t.threshold||45,this.x=t.x||null,this.y=t.y||null},applyTo:function(t){var e,i,n=t.canvasEl,r=n.getContext("2d"),o=r.getImageData(0,0,n.width,n.height),s=o.data,a=this.threshold,l=z.fabric.Color.sourceFromHex(this.color);for(this.x&&this.y&&(l=this._getColor(o,this.x,this.y)),e=0,i=s.length;e<i;e+=4)this._isOutsideThreshold(s[e],l[0],a)||this._isOutsideThreshold(s[e+1],l[1],a)||this._isOutsideThreshold(s[e+2],l[2],a)||(s[e]=s[e+1]=s[e+2]=s[e+3]=0);r.putImageData(o,0,0)},_isOutsideThreshold:function(t,e,i){var n=t-e;return Math.abs(n)>i},_getColor:function(t,e,i){var n=[0,0,0,0],r=t.data,o=4*(t.width*i+e);return n[0]=r[o],n[1]=r[o+1],n[2]=r[o+2],n[3]=r[o+3],n}});function Bo(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Fo=z.fabric.Image.filters;Fo.Mask=Po,Fo.Sharpen=No,Fo.Emboss=zo,Fo.ColorFilter=Ro;var Yo,Ho,Wo,Uo=function(t){Sn(i,t);var e=Bo(i);function i(t){return w(this,i),e.call(this,St.FILTER,t)}return T(i,[{key:"add",value:function(t,e){var i=this;return new(L())(function(n,r){var o=i._getSourceImage(),s=i.getCanvas(),a=i._getFilter(o,t);a||(a=i._createFilter(o,t,e)),a||r(li),i._changeFilterValues(a,e),i._apply(o,function(){s.renderAll(),n({type:t,action:"add",options:e})})})}},{key:"remove",value:function(t){var e=this;return new(L())(function(i,n){var r=e._getSourceImage(),o=e.getCanvas(),s=e.getOptions(t);r.filters.length||n(pi),e._removeFilter(r,t),e._apply(r,function(){o.renderAll(),i({type:t,action:"remove",options:s})})})}},{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?B()({},i.options):null}},{key:"_changeFilterValues",value:function(t,e){W()(e,function(e,i){Y()(t[i])||(t[i]=e)}),W()(t.options,function(i,n){Y()(e[n])||(t.options[n]=e[n])})}},{key:"_apply",value:function(t,e){t.filters.push(),t.applyFilters()&&e()}},{key:"_getSourceImage",value:function(){return this.getCanvasImage()}},{key:"_createFilter",value:function(t,e,i){var n,r=this._getFabricFilterType(e),o=z.fabric.Image.filters[r];return o&&((n=new o(i)).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),s=t.filters.length;for(r=0;r<s;r+=1)if((n=t.filters[r]).type===o){i=n;break}}return i}},{key:"_removeFilter",value:function(t,e){var i,n=this._getFabricFilterType(e);t.filters=Jr()(i=t.filters).call(i,function(t){return t.type!==n})}},{key:"_getFabricFilterType",value:function(t){return t.charAt(0).toUpperCase()+h()(t).call(t,1)}}]),i}(no),Go=i(1801),Xo=i.n(Go),Zo={pixelate:"blocksize",blur:"blur"},Vo={x:"width",y:"height"},Jo=(Yo=Zo,Wo={},et()(Ho=J()(Yo)).call(Ho,function(t){Wo[Yo[t]]=t}),Wo),Qo=null;function Ko(t){return Q(Gi(t,"patternSourceCanvas").patternSourceCanvas.getObjects(),1)[0]}function qo(t){var e=t.angle,i=t.flipX,n=t.flipY,r=Ko(t),o=function(t){var e=is(t),i=Q(e,4),n=i[0],r=n.x,o=n.y,s=i[1],a=s.x,l=s.y,c=i[2],u=c.x,h=c.y,f=i[3],d=f.x,g=f.y,p=Math.min(r,a,u,d),v=Math.min(o,l,h,g),m=Math.max(r,a,u,d),y=Math.max(o,l,h,g);return{left:p,top:v,right:m,bottom:y,width:m-p,height:y-v}}(t),s=o.right,a=o.bottom,l=o.width,c=o.height,u=(l-t.width)/2,h=(c-t.height)/2,f=t.left-t.width/2-u,d=t.top-t.height/2-h,g=l/2-u,p=c/2-h,v=Math.max(l,c)+Math.max(u,h),m=function(t){var e=t.shapeObj,i=t.left,n=t.top,r=t.width,o=t.height,s=t.cropX,a=t.cropY,l=t.flipX,c=t.flipY,u=t.right,h=t.bottom,f=function(t,i,n,r){return function(t){var e=t.type,i=t.shapeObj,n=t.outDistance,r=t.left,o=t.top,s=t.flipX,a=t.flipY,l=is(i),c=function(t,e,i){var n=0,r=0;W()(e,function(e,i){e[t]<n&&(n=e[t],r=i)});var o=Q(i[r],2),s=o[0],a=o[1];return{startPointIndex:r,endPointIndex1:s,endPointIndex2:a}}(e,l,[[1,2],[0,3],[0,3],[1,2]]),u=function(t,e,i){var n,r=i.startPointIndex,o=i.endPointIndex1,s=i.endPointIndex2,a="x"===t?180:270;return pn()(n=[o,s]).call(n,function(t){var i=e[r],n=e[t],o=i.y-n.y,s=i.x-n.x;return 180*Math.atan2(o,s)/Math.PI-a})}(e,l,c),h=c.startPointIndex,f=function(t){var e=t.outDistance,i=t.startPointIndex,n=t.flipX,r=t.flipY,o=t.reatAngles,s=e*Math.cos(o[0]*Math.PI/180),a=e*Math.cos(o[1]*Math.PI/180),l=2===i||3===i,c={top:l?s:a,left:l?a:s};return function(t,e,i){return(!e&&i||!e&&!i)&&0===t||(e&&i||e&&!i)&&1===t||(!e&&!i||!e&&i)&&2===t||(e&&!i||e&&i)&&3===t}(i,n,r)&&(c.left=-1*c.left),function(t,e,i){return(e&&!i||!e&&!i)&&0===t||(!e&&!i||e&&!i)&&1===t||(e&&i||!e&&i)&&2===t||(!e&&i||e&&i)&&3===t}(i,n,r)&&(c.top=-1*c.top),c}({outDistance:n,startPointIndex:h,flipX:s,flipY:a,reatAngles:u});return[r+f.left,o+f.top]}({type:t,outDistance:i,shapeObj:e,flipX:l,flipY:c,left:n,top:r})},d=r,g=o,p=function(t,e){var i=e.left,n=e.top,r=e.width,o=e.height,s=e.cropX,a=e.cropY,l={width:r,height:o};return W()(["x","y"],function(e){var r="x"===e?s:a,o=l[Vo[e]],c=Qo[Vo[e]];if(o>c){var u=(o-c)/2;l[Vo[e]]=c;var h=Q(t(e,u,i,n),2);i=h[0],n=h[1]}if(r<0){var f=Q(t(e,r,i,n),2);i=f[0],n=f[1]}}),[i,n,l.width,l.height]}(f,{left:i,top:n,width:r,height:o,cropX:s,cropY:a}),v=Q(p,4);i=v[0],n=v[1],r=v[2],o=v[3];var m=function(t,e){var i=e.left,n=e.top,r=e.insideCanvasRealImageWidth,o=e.insideCanvasRealImageHeight,s=e.right,a=e.bottom,l=e.cropX,c=e.cropY,u=e.originalWidth,h=e.originalHeight,f=r,d=o,g=Qo,p=g.width,v=g.height;s>p&&l>0&&(f=u-Math.abs(s-p)),a>v&&c>0&&(d=h-Math.abs(a-v));var m={x:(r-f)/2,y:(o-d)/2};return W()(["x","y"],function(e){var r=m[e];if(r>0){var o=Q(t(e,r,i,n),2);i=o[0],n=o[1]}}),[i,n,f,d]}(f,{left:i,top:n,insideCanvasRealImageWidth:r,insideCanvasRealImageHeight:o,right:u,bottom:h,cropX:s,cropY:a,originalWidth:d,originalHeight:g}),y=Q(m,4);return i=y[0],n=y[1],r=y[2],o=y[3],[i,n,r,o]}({shapeObj:t,left:g,top:p,width:l,height:c,cropX:f,cropY:d,flipX:i,flipY:n,right:s,bottom:a}),y=Q(m,4);g=y[0],p=y[1],l=y[2],c=y[3],r.set({angle:i===n?-e:e,left:g,top:p,width:l,height:c,cropX:f,cropY:d,flipX:i,flipY:n}),Ui(r,{fillImageMaxSize:v})}function $o(t){var e;return pn()(e=t.filters).call(e,function(t){var e=Q(J()(t),1)[0];return S({},Jo[e],t[e])})}function ts(t,e,i){var n=ns(es(t),t.angle,e);i.add(n);var r={fill:new z.fabric.Pattern({source:i.getElement(),repeat:"no-repeat"})};return Ui(r,{patternSourceCanvas:i}),r}function es(t){return Qo&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])||(Qo=t.toCanvasElement()),Qo}function is(t){return[t.getPointByOrigin("left","top"),t.getPointByOrigin("right","top"),t.getPointByOrigin("left","bottom"),t.getPointByOrigin("right","bottom")]}function ns(t,e,i){var n,r=new z.fabric.Image(t);return W()(B().apply(void 0,O()(n=[{}]).call(n,I(i))),function(t,e){var i,n=(i=e).charAt(0).toUpperCase()+h()(i).call(i,1),o=new z.fabric.Image.filters[n](S({},Zo[e],t));r.filters.push(o)}),r.applyFilters(),Ui(r,{originalAngle:e,fillImageMaxSize:Math.max(r.width,r.height)}),Xo().adjustOriginToCenter(r),r}function rs(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var os=B()({strokeWidth:1,stroke:"#000000",fill:"#ffffff",width:1,height:1,rx:0,ry:0},{lockSkewingX:!0,lockSkewingY:!0,bringForward:!0,isRegular:!1});function ss(t,e,i){var n=nt()(t),r=Zi(nt()(t)),o=n;n.color&&(o=n.color);var s=null;if("filter"===r){var a=i();s=ts(e,Jr()(n),a)}else s={fill:o};return B()({},t,s)}var as=function(t){Sn(i,t);var e=rs(i);function i(t){var n,r,o,s,a,l;return w(this,i),(l=e.call(this,St.SHAPE,t))._shapeObj=null,l._type="rect",l._options=B()({},os),l._isSelected=!1,l._startPoint={},l._withShiftKey=!1,l._handlers={mousedown:A()(n=l._onFabricMouseDown).call(n,Tn(l)),mousemove:A()(r=l._onFabricMouseMove).call(r,Tn(l)),mouseup:A()(o=l._onFabricMouseUp).call(o,Tn(l)),keydown:A()(s=l._onKeyDown).call(s,Tn(l)),keyup:A()(a=l._onKeyUp).call(a,Tn(l))},l}return T(i,[{key:"start",value:function(){var t=this.getCanvas();this._isSelected=!1,t.defaultCursor="crosshair",t.selection=!1,t.uniformScaling=!0,t.on({"mouse:down":this._handlers.mousedown}),z.fabric.util.addListener(document,"keydown",this._handlers.keydown),z.fabric.util.addListener(document,"keyup",this._handlers.keyup)}},{key:"end",value:function(){var t=this.getCanvas();this._isSelected=!1,t.defaultCursor="default",t.selection=!0,t.uniformScaling=!1,t.off({"mouse:down":this._handlers.mousedown}),z.fabric.util.removeListener(document,"keydown",this._handlers.keydown),z.fabric.util.removeListener(document,"keyup",this._handlers.keyup)}},{key:"setStates",value:function(t,e){this._type=t,e&&(this._options=B()(this._options,e))}},{key:"add",value:function(t,e){var i=this;return new(L())(function(n){var r=i.getCanvas(),o=i._extendOptions(e),s=i._createInstance(t,o),a=i.graphics.createObjectProperties(s);i._bindEventOnShape(s),r.add(s).setActiveObject(s),i._resetPositionFillFilter(s),n(a)})}},{key:"change",value:function(t,e){var i=this;return new(L())(function(n,r){Ji(t)||r(vi);var o="filter"===Zi(nt()(e)),s=i.graphics,a=s.canvasImage,l=s.createStaticCanvas;t.set(o?ss(e,a,l):e),o&&i._resetPositionFillFilter(t),i.getCanvas().renderAll(),n()})}},{key:"makeFillPropertyForUserEvent",value:function(t){var e=Vi(t),i={};if(e===gt){var n=$o(Ko(t));i.type=e,i.filter=n}else i.type=pt,i.color=nt()(t)||"transparent";return i}},{key:"processForCopiedObject",value:function(t,e){if(this._bindEventOnShape(t),"filter"===Vi(t)){var i=$o(Ko(e)),n=this.graphics.createStaticCanvas();t.set(ts(this.graphics.canvasImage,i,n)),this._resetPositionFillFilter(t)}}},{key:"_createInstance",value:function(t,e){var i;switch(t){case"rect":i=new z.fabric.Rect(e);break;case"circle":i=new z.fabric.Ellipse(B()({type:"circle"},e));break;case"triangle":i=new z.fabric.Triangle(e);break;default:i={}}return i}},{key:"_extendOptions",value:function(t){var e=oi,i=this.graphics,n=i.canvasImage,r=i.createStaticCanvas;return ss(t=B()({},os,this._options,e,t),n,r)}},{key:"_bindEventOnShape",value:function(t){var e=this,i=this.getCanvas();t.on({added:function(){e._shapeObj=this,Xo().setOrigins(e._shapeObj)},selected:function(){e._isSelected=!0,e._shapeObj=this,i.uniformScaling=!0,i.defaultCursor="default",Xo().setOrigins(e._shapeObj)},deselected:function(){e._isSelected=!1,e._shapeObj=null,i.defaultCursor="crosshair",i.uniformScaling=!1},modified:function(){var t=e._shapeObj;Xo().adjustOriginToCenter(t),Xo().setOrigins(t)},modifiedInGroup:function(i){e._fillFilterRePositionInGroupSelection(t,i)},moving:function(){e._resetPositionFillFilter(this)},rotating:function(){e._resetPositionFillFilter(this)},scaling:function(t){var n=i.getPointer(t.e),r=e._shapeObj;i.setCursor("crosshair"),Xo().resize(r,n,!0),e._resetPositionFillFilter(this)}})}},{key:"_onFabricMouseDown",value:function(t){if(t.target||(this._isSelected=!1,this._shapeObj=!1),!this._isSelected&&!this._shapeObj){var e=this.getCanvas();this._startPoint=e.getPointer(t.e),e.on({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}}},{key:"_onFabricMouseMove",value:function(t){var e=this,i=this.getCanvas(),n=i.getPointer(t.e),r=this._startPoint.x,o=this._startPoint.y,s=r-n.x,a=o-n.y,l=this._shapeObj;l?(this._shapeObj.set({isRegular:this._withShiftKey}),Xo().resize(l,n),i.renderAll(),this._resetPositionFillFilter(l)):this.add(this._type,{left:r,top:o,width:s,height:a}).then(function(t){e.fire(oe,t)})}},{key:"_onFabricMouseUp",value:function(){var t=this,e=this.getCanvas(),i=this._startPoint.x,n=this._startPoint.y,r=this._shapeObj;r?r&&(Xo().adjustOriginToCenter(r),this.fire(qt,this.graphics.createObjectProperties(r))):this.add(this._type,{left:i,top:n,width:20,height:20}).then(function(e){t.fire(oe,e)}),e.off({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}},{key:"_onKeyDown",value:function(t){t.keyCode===Ke&&(this._withShiftKey=!0,this._shapeObj&&(this._shapeObj.isRegular=!0))}},{key:"_onKeyUp",value:function(t){t.keyCode===Ke&&(this._withShiftKey=!1,this._shapeObj&&(this._shapeObj.isRegular=!1))}},{key:"_resetPositionFillFilter",value:function(t){if("filter"===Vi(t)){var e=Gi(t,"patternSourceCanvas").patternSourceCanvas,i=Gi(Ko(t),"originalAngle").originalAngle;this.graphics.canvasImage.angle!==i&&function(t,e){var i=Gi(t,"patternSourceCanvas").patternSourceCanvas,n=Q(i.getObjects(),1)[0],r=$o(n);i.remove(n);var o=ns(es(e,!0),e.angle,r);i.add(o)}(t,this.graphics.canvasImage);var n=t.originX,r=t.originY;Xo().adjustOriginToCenter(t),t.width*=t.scaleX,t.height*=t.scaleY,t.rx*=t.scaleX,t.ry*=t.scaleY,t.scaleX=1,t.scaleY=1,qo(t),function(t,e){var i=e.originX,n=e.originY,r=t.getPointByOrigin(i,n),o=r.x,s=r.y;t.set({left:o,top:s,originX:i,originY:n}),t.setCoords()}(t,{originX:n,originY:r}),function(t){var e=Gi(Q(t.getObjects(),1)[0],"fillImageMaxSize").fillImageMaxSize;e=Math.max(1,e),t.setDimensions({width:e,height:e}),t.renderAll()}(e)}}},{key:"_fillFilterRePositionInGroupSelection",value:function(t,e){1===e.scaleX&&1===e.scaleY||e.addWithUpdate();var i=t.angle,n=t.left,r=t.top;z.fabric.util.addTransformToObject(t,e.calcTransformMatrix()),this._resetPositionFillFilter(t),t.set({angle:i,left:n,top:r})}}]),i}(no);function ls(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var cs={left:0,top:0,width:0,height:0,stroke:"#000000",strokeWidth:0,fill:"#000000",opacity:.4,evented:!1,selectable:!1,hoverCursor:"auto"},us=.0045,hs=.003,fs=.003,ds=.0066,gs=.0044,ps=.003,vs=pe,ms=re,ys=te,bs=$t,xs=ye,_s=be,Cs=ve,Is=me,Ms=function(t){Sn(i,t);var e=ls(i);function i(t){var n,r,o,s,a,l,c,u,h,f,d,g,p;w(this,i),(p=e.call(this,St.ZOOM,t)).zoomArea=null,p._startPoint=null,p._centerPoints=[],p.zoomLevel=1,p.zoomMode=Ue,p._listeners={startZoom:A()(n=p._onMouseDownWithZoomMode).call(n,Tn(p)),moveZoom:A()(r=p._onMouseMoveWithZoomMode).call(r,Tn(p)),stopZoom:A()(o=p._onMouseUpWithZoomMode).call(o,Tn(p)),startHand:A()(s=p._onMouseDownWithHandMode).call(s,Tn(p)),moveHand:A()(a=p._onMouseMoveWithHandMode).call(a,Tn(p)),stopHand:A()(l=p._onMouseUpWithHandMode).call(l,Tn(p)),zoomChanged:A()(c=p._changeScrollState).call(c,Tn(p)),keydown:A()(u=p._startHandModeWithSpaceBar).call(u,Tn(p)),keyup:A()(h=p._endHandModeWithSpaceBar).call(h,Tn(p))};var v=p.getCanvas();return p.aspectRatio=v.width/v.height,p._verticalScroll=new z.fabric.Rect(cs),p._horizontalScroll=new z.fabric.Rect(cs),v.on(vs,p._listeners.zoomChanged),p.graphics.on(ms,A()(f=p._startTextEditingHandler).call(f,Tn(p))),p.graphics.on(ys,A()(d=p._startTextEditingHandler).call(d,Tn(p))),p.graphics.on(bs,A()(g=p._stopTextEditingHandler).call(g,Tn(p))),p}return T(i,[{key:"attachKeyboardZoomEvents",value:function(){z.fabric.util.addListener(document,xs,this._listeners.keydown),z.fabric.util.addListener(document,_s,this._listeners.keyup)}},{key:"detachKeyboardZoomEvents",value:function(){z.fabric.util.removeListener(document,xs,this._listeners.keydown),z.fabric.util.removeListener(document,_s,this._listeners.keyup)}},{key:"_startTextEditingHandler",value:function(){this.isTextEditing=!0}},{key:"_stopTextEditingHandler",value:function(){this.isTextEditing=!1}},{key:"_startHandModeWithSpaceBar",value:function(t){this.withSpace||this.isTextEditing||t.keyCode===ii&&(this.withSpace=!0,this.startHandMode())}},{key:"_endHandModeWithSpaceBar",value:function(t){t.keyCode===ii&&(this.withSpace=!1,this.endHandMode())}},{key:"startZoomInMode",value:function(){if(!this.zoomArea){this.endHandMode(),this.zoomMode=Ge;var t=this.getCanvas();this._changeObjectsEventedState(!1),this.zoomArea=new z.fabric.Rect({left:0,top:0,width:.5,height:.5,stroke:"black",strokeWidth:1,fill:"transparent",hoverCursor:"zoom-in"}),t.discardActiveObject(),t.add(this.zoomArea),t.on("mouse:down",this._listeners.startZoom),t.selection=!1,t.defaultCursor="zoom-in"}}},{key:"endZoomInMode",value:function(){this.zoomMode=Ue;var t=this.getCanvas(),e=this._listeners,i=e.startZoom,n=e.moveZoom,r=e.stopZoom;t.selection=!0,t.defaultCursor="auto",t.off({"mouse:down":i,"mouse:move":n,"mouse:up":r}),this._changeObjectsEventedState(!0),t.remove(this.zoomArea),this.zoomArea=null}},{key:"start",value:function(){this.zoomArea=null,this._startPoint=null,this._startHandPoint=null}},{key:"end",value:function(){this.endZoomInMode(),this.endHandMode()}},{key:"startHandMode",value:function(){this.endZoomInMode(),this.zoomMode=Xe;var t=this.getCanvas();this._changeObjectsEventedState(!1),t.discardActiveObject(),t.off("mouse:down",this._listeners.startHand),t.on("mouse:down",this._listeners.startHand),t.selection=!1,t.defaultCursor="grab",t.fire(Cs)}},{key:"endHandMode",value:function(){this.zoomMode=Ue;var t=this.getCanvas();this._changeObjectsEventedState(!0),t.off("mouse:down",this._listeners.startHand),t.selection=!0,t.defaultCursor="auto",this._startHandPoint=null,t.fire(Is)}},{key:"_onMouseDownWithZoomMode",value:function(t){var e=t.target,i=t.e;if(!e){var n=this.getCanvas();n.selection=!1,this._startPoint=n.getPointer(i),this.zoomArea.set({width:0,height:0});var r=this._listeners,o=r.moveZoom,s=r.stopZoom;n.on({"mouse:move":o,"mouse:up":s})}}},{key:"_onMouseMoveWithZoomMode",value:function(t){var e=t.e,i=this.getCanvas(),n=i.getPointer(e),r=n.x,o=n.y,s=this.zoomArea,a=this._startPoint;Math.abs(r-a.x)+Math.abs(o-a.y)>10&&(i.remove(s),s.set(this._calcRectDimensionFromPoint(r,o)),i.add(s))}},{key:"_calcRectDimensionFromPoint",value:function(t,e){var i=this.getCanvas(),n=i.getWidth(),r=i.getHeight(),o=this._startPoint,s=o.x,a=o.y,l=Math.min,c=l(s,t),u=l(a,e);return{left:c,top:u,width:Pi(t,s,n)-c,height:Pi(e,a,r)-u}}},{key:"_onMouseUpWithZoomMode",value:function(){var t=this.zoomLevel,e=this.zoomArea,i=this._listeners,n=i.moveZoom,r=i.stopZoom,o=this.getCanvas(),s=this._getCenterPoint(),a=s.x,l=s.y;this._isMaxZoomLevel()||(this._centerPoints.push({x:a,y:l,prevZoomLevel:t,zoomLevel:t+1}),t+=1,o.zoomToPoint({x:a,y:l},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,s=o.x,a=o.y,l=this.aspectRatio;return n<10&&r<10?{x:s,y:a}:n>r?{x:e+l*r/2,y:i+r/2}:{x:e+n/2,y:i+n/l/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,s=o.length-1;s>=0&&!(o[s].zoomLevel<n);s-=1){var a=o.pop(),l=a.x,c=a.y,u=a.prevZoomLevel;r.zoomToPoint({x:l,y:c},u),this.zoomLevel=u}r.zoomToPoint({x:e,y:i},n),this._isDefaultZoomLevel(n)||this._centerPoints.push({x:e,y:i,zoomLevel:n,prevZoomLevel:this.zoomLevel}),this.zoomLevel=n,this._fireZoomChanged(r,n)}},{key:"zoomOut",value:function(){var t=this._centerPoints;if(t.length){var e=this.getCanvas(),i=t.pop(),n=i.x,r=i.y,o=i.prevZoomLevel;this._isDefaultZoomLevel(o)?e.setViewportTransform([1,0,0,1,0,0]):e.zoomToPoint({x:n,y:r},o),this.zoomLevel=o,this._fireZoomChanged(e,this.zoomLevel)}}},{key:"resetZoom",value:function(){var t=this.getCanvas();t.setViewportTransform([1,0,0,1,0,0]),this.zoomLevel=1,this._centerPoints=[],this._fireZoomChanged(t,this.zoomLevel)}},{key:"_isMaxZoomLevel",value:function(){return this.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,s=n.pop(),a=s.x,l=s.y,c=s.prevZoomLevel,u=a-e,h=l-i;r.zoomToPoint({x:a,y:l},c),r.zoomToPoint({x:u,y:h},o),n.push({x:u,y:h,prevZoomLevel:c,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<=1)){n.selection=!1,this._startHandPoint=n.getPointer(i);var r=this._listeners,o=r.moveHand,s=r.stopHand;n.on({"mouse:move":o,"mouse:up":s})}}}},{key:"_onMouseMoveWithHandMode",value:function(t){var e=t.e,i=this.getCanvas().getPointer(e),n=i.x,r=i.y,o=n-this._startHandPoint.x,s=r-this._startHandPoint.y;this._movePointOfZoom({x:o,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,s=e.tl,a=e.tr,l=e.bl,c=a.x-s.x,u=l.y-s.y,h=c*c/r,f=u*ds,d=Pi(s.x+s.x/r*c,s.x,a.x-h),g=u*gs,p=u*ps;this._horizontalScroll.set({left:d,top:l.y-f-g,width:h,height:f,rx:p,ry:p});var v=c*us,m=u*u/o,y=Pi(s.y+s.y/o*u,a.y,l.y-m),b=c*hs,x=c*fs;this._verticalScroll.set({left:a.x-v-b,top:y,width:v,height:m,rx:x,ry:x}),this._addScrollBar()}}},{key:"_changeObjectsEventedState",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.getCanvas().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 1===t}},{key:"_fireZoomChanged",value:function(t,e){t.fire(vs,{viewport:t.calcViewportBoundaries(),zoomLevel:e})}},{key:"mode",get:function(){return this.zoomMode}}]),i}(no),Ss=Ms,ws=rn.create,ks=rn.types,Ts=function(){function t(e){w(this,t),this.name=e}return T(t,[{key:"getName",value:function(){return this.name}},{key:"start",value:function(){throw new Error(ws(ks.UN_IMPLEMENTATION,"start"))}},{key:"end",value:function(){throw new Error(ws(ks.UN_IMPLEMENTATION,"stop"))}}]),t}();function Ds(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var As=function(t){Sn(i,t);var e=Ds(i);function i(){return w(this,i),e.call(this,Re.CROPPER)}return T(i,[{key:"start",value:function(t){t.getComponent(St.CROPPER).start()}},{key:"end",value:function(t){t.getComponent(St.CROPPER).end()}}]),i}(Ts);function Es(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Os=function(t){Sn(i,t);var e=Es(i);function i(){return w(this,i),e.call(this,Re.FREE_DRAWING)}return T(i,[{key:"start",value:function(t,e){t.getComponent(St.FREE_DRAWING).start(e)}},{key:"end",value:function(t){t.getComponent(St.FREE_DRAWING).end()}}]),i}(Ts);function js(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Ls=function(t){Sn(i,t);var e=js(i);function i(){return w(this,i),e.call(this,Re.LINE_DRAWING)}return T(i,[{key:"start",value:function(t,e){t.getComponent(St.LINE).start(e)}},{key:"end",value:function(t){t.getComponent(St.LINE).end()}}]),i}(Ts);function Ps(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Ns=function(t){Sn(i,t);var e=Ps(i);function i(){return w(this,i),e.call(this,Re.SHAPE)}return T(i,[{key:"start",value:function(t){t.getComponent(St.SHAPE).start()}},{key:"end",value:function(t){t.getComponent(St.SHAPE).end()}}]),i}(Ts);function zs(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Rs=function(t){Sn(i,t);var e=zs(i);function i(){return w(this,i),e.call(this,Re.TEXT)}return T(i,[{key:"start",value:function(t){t.getComponent(St.TEXT).start()}},{key:"end",value:function(t){t.getComponent(St.TEXT).end()}}]),i}(Ts);function Bs(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Fs=function(t){Sn(i,t);var e=Bs(i);function i(){return w(this,i),e.call(this,Re.ICON)}return T(i,[{key:"start",value:function(t){t.getComponent(St.ICON).start()}},{key:"end",value:function(t){t.getComponent(St.ICON).end()}}]),i}(Ts);function Ys(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Hs=function(t){Sn(i,t);var e=Ys(i);function i(){return w(this,i),e.call(this,Re.ZOOM)}return T(i,[{key:"start",value:function(t){t.getComponent(St.ZOOM).start()}},{key:"end",value:function(t){t.getComponent(St.ZOOM).end()}}]),i}(Ts),Ws=null;function Us(t){Ws=t}function Gs(t,e){var i,n;return i="activeSelection"===t.type?pn()(n=t.getObjects()).call(n,function(i){var n=i.angle,r=i.left,o=i.top,s=i.scaleX,a=i.scaleY,l=i.width,c=i.height;z.fabric.util.addTransformToObject(i,t.calcTransformMatrix());var u=e(i);return i.set({angle:n,left:r,top:o,width:l,height:c,scaleX:s,scaleY:a}),u}):[e(t)],i}function Xs(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}:B()({id:t},e)}function Zs(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Vs=function(t){Sn(i,t);var e=Zs(i);function i(t){var n;return w(this,i),(n=e.call(this,St.RESIZE,t))._dimensions=null,n._originalDimensions=null,n}return T(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,s=t.width,a=t.height,l={scaleX:s?s/i:r,scaleY:a?a/n:o};return r===l.scaleX&&o===l.scaleY||(e.set(l).setCoords(),this._dimensions={width:e.width*e.scaleX,height:e.height*e.scaleY}),this.adjustCanvasDimensionBase(),L().resolve()}},{key:"start",value:function(){var t=this.getCurrentDimensions();this.setOriginalDimensions(t)}},{key:"end",value:function(){}}]),i}(no);function Js(t){var e=function(){if("undefined"==typeof Reflect||!_n())return!1;if(_n().sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(_n()(Boolean,[],function(){})),!0}catch(ea){return!1}}();return function(){var i,n=En(t);if(e){var r=En(this).constructor;i=_n()(n,arguments,r)}else i=n.apply(this,arguments);return Dn(this,i)}}var Qs=function(t){Sn(i,t);var e=Js(i);function i(){return w(this,i),e.call(this,Re.RESIZE)}return T(i,[{key:"start",value:function(t){t.getComponent(St.RESIZE).start()}},{key:"end",value:function(t){t.getComponent(St.RESIZE).end()}}]),i}(Ts),Ks={cssOnly:!0},qs={backstoreOnly:!0},$s=function(){function t(e){var i,n,r,o,s,a,l,c,u,h,f,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=d.cssMaxWidth,p=d.cssMaxHeight;w(this,t),this.canvasImage=null,this.cssMaxWidth=g||1e3,this.cssMaxHeight=p||800,this.cropSelectionStyle={},this.targetObjectForCopyPaste=null,this.imageName="",this._objects={},this._canvas=null,this._drawingMode=Re.NORMAL,this._drawingModeMap={},this._componentMap={},this._handler={onMouseDown:A()(i=this._onMouseDown).call(i,this),onObjectAdded:A()(n=this._onObjectAdded).call(n,this),onObjectRemoved:A()(r=this._onObjectRemoved).call(r,this),onObjectMoved:A()(o=this._onObjectMoved).call(o,this),onObjectScaled:A()(s=this._onObjectScaled).call(s,this),onObjectModified:A()(a=this._onObjectModified).call(a,this),onObjectRotated:A()(l=this._onObjectRotated).call(l,this),onObjectSelected:A()(c=this._onObjectSelected).call(c,this),onPathCreated:A()(u=this._onPathCreated).call(u,this),onSelectionCleared:A()(h=this._onSelectionCleared).call(h,this),onSelectionCreated:A()(f=this._onSelectionCreated).call(f,this)},this._setObjectCachingToFalse(),this._setCanvasElement(e),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents(),this._attachZoomEvents()}return T(t,[{key:"destroy",value:function(){var t=this._canvas.wrapperEl;this._canvas.clear(),t.parentNode.removeChild(t),this._detachZoomEvents()}},{key:"_attachZoomEvents",value:function(){this.getComponent(St.ZOOM).attachKeyboardZoomEvents()}},{key:"_detachZoomEvents",value:function(){this.getComponent(St.ZOOM).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=[];$r()(t)?i=t:i.push(t),(e=this._canvas).add.apply(e,I(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,I(this._canvas.getObjects())),t&&i.clear(),n}},{key:"removeObjectById",value:function(t){var e=[],i=this._canvas,n=this.getObject(t);return n&&n.isType("group")&&!n.isEmpty()?(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;if("activeSelection"===e){var r=new z.fabric.Group(I(t.getObjects()),{left:i,top:n});return this._addFabricObject(r)}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 z.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(Re.NORMAL)){var t=this._getDrawingModeInstance(this.getDrawingMode());t&&t.end&&t.end(this),this._drawingMode=Re.NORMAL}}},{key:"zoom",value:function(t,e){var i=t.x,n=t.y;this.getComponent(St.ZOOM).zoom({x:i,y:n},e)}},{key:"getZoomMode",value:function(){return this.getComponent(St.ZOOM).mode}},{key:"startZoomInMode",value:function(){this.getComponent(St.ZOOM).startZoomInMode()}},{key:"endZoomInMode",value:function(){this.getComponent(St.ZOOM).endZoomInMode()}},{key:"zoomOut",value:function(){this.getComponent(St.ZOOM).zoomOut()}},{key:"startHandMode",value:function(){this.getComponent(St.ZOOM).startHandMode()}},{key:"endHandMode",value:function(){this.getComponent(St.ZOOM).endHandMode()}},{key:"resetZoom",value:function(){this.getComponent(St.ZOOM).resetZoom()}},{key:"toDataURL",value:function(t){var e=this.getComponent(St.CROPPER);e.changeVisibility(!1);var i=this._canvas&&this._canvas.toDataURL(t);return e.changeVisibility(!0),i}},{key:"setCanvasImage",value:function(t,e){e&&ji(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,Ks)}},{key:"setCanvasBackstoreDimension",value:function(t){this._canvas.setDimensions(t,qs)}},{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=A()(e=this._callbackAfterLoadingImageObject).call(e,this);return new(L())(function(e){z.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(St.CROPPER).getCropzoneRect()}},{key:"setCropzoneRect",value:function(t){this.getComponent(St.CROPPER).setCropzoneRect(t)}},{key:"getCroppedImageData",value:function(t){return this.getComponent(St.CROPPER).getCroppedImageData(t)}},{key:"setBrush",value:function(t){var e=this._drawingMode,i=St.FREE_DRAWING;e===Re.LINE_DRAWING&&(i=St.LINE),this.getComponent(i).setBrush(t)}},{key:"setDrawingShape",value:function(t,e){this.getComponent(St.SHAPE).setStates(t,e)}},{key:"setIconStyle",value:function(t,e){this.getComponent(St.ICON).setStates(t,e)}},{key:"registerPaths",value:function(t){this.getComponent(St.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(St.FILTER).hasFilter(t)}},{key:"setSelectionStyle",value:function(t){B()(oi,t)}},{key:"setObjectProperties",value:function(t,e){var i=this.getObject(t),n=B()({},e);return i.set(n),i.setCoords(),this.getCanvas().renderAll(),n}},{key:"getObjectProperties",value:function(t,e){var i=this.getObject(t),n={};return Z()(e)?n[e]=i[e]:$r()(e)?jn()(e,function(t){n[t]=i[t]}):eo()(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,s=e.originY;if(!i)return!1;var a=i.getPointByOrigin(o,s),l=i.getPointByOrigin("center","center"),c=l.x-a.x,u=l.y-a.y;return i.set({left:n+c,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 z.fabric.StaticCanvas;return t.set({enableRetinaScaling:!1}),t}},{key:"_getDrawingModeInstance",value:function(t){return this._drawingModeMap[t]}},{key:"_setObjectCachingToFalse",value:function(){z.fabric.Object.prototype.objectCaching=!1}},{key:"_setCanvasElement",value:function(t){var e,i;"CANVAS"!==(e=t.nodeType?t:document.querySelector(t)).nodeName.toUpperCase()&&(i=document.createElement("canvas"),e.appendChild(i)),this._canvas=new z.fabric.Canvas(i,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})}},{key:"_createDrawingModeInstances",value:function(){this._register(this._drawingModeMap,new As),this._register(this._drawingModeMap,new Os),this._register(this._drawingModeMap,new Ls),this._register(this._drawingModeMap,new Ns),this._register(this._drawingModeMap,new Rs),this._register(this._drawingModeMap,new Fs),this._register(this._drawingModeMap,new Hs),this._register(this._drawingModeMap,new Qs)}},{key:"_createComponents",value:function(){this._register(this._componentMap,new so(this)),this._register(this._componentMap,new vo(this)),this._register(this._componentMap,new yo(this)),this._register(this._componentMap,new xo(this)),this._register(this._componentMap,new Co(this)),this._register(this._componentMap,new ko(this)),this._register(this._componentMap,new Eo(this)),this._register(this._componentMap,new Lo(this)),this._register(this._componentMap,new Uo(this)),this._register(this._componentMap,new as(this)),this._register(this._componentMap,new Ss(this)),this._register(this._componentMap,new Vs(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&&i<n?(r=t*i,o=e*i):n<1&&n<i&&(r=t*n,o=e*n),{width:Math.floor(r),height:Math.floor(o)}}},{key:"_callbackAfterLoadingImageObject",value:function(t){var e=this.getCanvasImage().getCenterPoint();t.set(oi),t.set({left:e.x,top:e.y,crossOrigin:"Anonymous"}),this.getCanvas().add(t).setActiveObject(t)}},{key:"_attachCanvasEvents",value:function(){var t=this._canvas,e=this._handler;t.on({"mouse:down":e.onMouseDown,"object:added":e.onObjectAdded,"object:removed":e.onObjectRemoved,"object:moving":e.onObjectMoved,"object:scaling":e.onObjectScaled,"object:modified":e.onObjectModified,"object:rotating":e.onObjectRotated,"path:created":e.onPathCreated,"selection:cleared":e.onSelectionCleared,"selection:created":e.onSelectionCreated,"selection:updated":e.onObjectSelected})}},{key:"_onMouseDown",value:function(t){var e=this,i=t.e,n=t.target,r=this._canvas.getPointer(i);if(n){var o=n.type;Us(Gs(n,function(t){return Xs(e.getObjectId(t),t,"activeSelection"===o)}))}this.fire(ae,i,r)}},{key:"_onObjectAdded",value:function(t){var e=t.target;e.isType("cropzone")||this._addFabricObject(e)}},{key:"_onObjectRemoved",value:function(t){var e=t.target;this._removeFabricObject(ji(e))}},{key:"_onObjectMoved",value:function(t){var e=this;this._lazyFire(Jt,function(t){return e.createObjectProperties(t)},t.target)}},{key:"_onObjectScaled",value:function(t){var e=this;this._lazyFire(Qt,function(t){return e.createObjectProperties(t)},t.target)}},{key:"_onObjectModified",value:function(t){var e=t.target;if("activeSelection"===e.type){var i=e.getObjects();et()(i).call(i,function(t){return t.fire("modifiedInGroup",e)})}this.fire($t,e,this.getObjectId(e))}},{key:"_onObjectRotated",value:function(t){var e=this;this._lazyFire(Kt,function(t){return e.createObjectProperties(t)},t.target)}},{key:"_lazyFire",value:function(t,e,i){var n=this,r=i&&i.canvasEventDelegation?i.canvasEventDelegation(t):"none";"unregistered"===r&&i.canvasEventRegister(t,function(i){n.fire(t,e(i))}),"none"===r&&this.fire(t,e(i))}},{key:"_onObjectSelected",value:function(t){var e=t.target,i=this.createObjectProperties(e);this.fire(Vt,i)}},{key:"_onPathCreated",value:function(t){var e=t.path.getCenterPoint(),i=e.x,n=e.y;t.path.set(B()({left:i,top:n},oi));var r=this.createObjectProperties(t.path);this.fire(oe,r)}},{key:"_onSelectionCleared",value:function(){this.fire(ue)}},{key:"_onSelectionCreated",value:function(t){var e=t.target,i=this.createObjectProperties(e);this.fire(Vt,i),this.fire(he,t.target)}},{key:"discardSelection",value:function(){this._canvas.discardActiveObject(),this._canvas.renderAll()}},{key:"changeSelectableAll",value:function(t){this._canvas.forEachObject(function(e){e.selectable=t,e.hoverCursor=t?"move":"crosshair"})}},{key:"createObjectProperties",value:function(t){var e={id:ji(t),type:t.type};if(B()(e,zi(t,["left","top","width","height","fill","stroke","strokeWidth","opacity","angle"])),Xi(["i-text","text"],t.type))B()(e,this._createTextProperties(t,e));else if(Xi(["rect","triangle","circle"],t.type)){var i=this.getComponent(St.SHAPE);B()(e,{fill:i.makeFillPropertyForUserEvent(t)})}return e}},{key:"_createTextProperties",value:function(t){var e={};return B()(e,zi(t,["text","fontFamily","fontSize","fontStyle","textAlign","textDecoration","fontWeight"])),e}},{key:"_addFabricObject",value:function(t){var e=ji(t);return this._objects[e]=t,e}},{key:"_removeFabricObject",value:function(t){delete this._objects[t]}},{key:"resetTargetObjectForCopyPaste",value:function(){var t=this.getActiveObject();t&&(this.targetObjectForCopyPaste=t)}},{key:"pasteObject",value:function(){var t=this;if(!this.targetObjectForCopyPaste)return L().resolve([]);var e=this.targetObjectForCopyPaste,i="activeSelection"===e.type?e.getObjects():[e],n=null;return this.discardSelection(),this._cloneObject(i).then(function(e){if(e.length>1)n=t.getActiveSelectionFromObjects(e);else{var i=Q(e,1);n=i[0]}t.targetObjectForCopyPaste=n,t.setActiveObject(n)})}},{key:"_cloneObject",value:function(t){var e=this,i=pn()(t).call(t,function(t){return e._cloneObjectItem(t)});return L().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(oe,i),t})}},{key:"_copyFabricObjectForPaste",value:function(t){var e=this,i=function(t,e){return e?t-10:t+10};return this._copyFabricObject(t).then(function(t){var n=t.left,r=t.top,o=t.width,s=t.height,a=e.getCanvasSize(),l=a.width,c=a.height,u=n+o/2,h=r+s/2;return t.set(B()({left:i(n,u+10>l),top:i(r,h+10>c)},oi)),t})}},{key:"_copyFabricObject",value:function(t){var e=this;return new(L())(function(i){t.clone(function(n){var r=e.getComponent(St.SHAPE);Ji(n)&&r.processForCopiedObject(n,t),i(n)})})}},{key:"getCurrentDimensions",value:function(){return this.getComponent(St.RESIZE).getCurrentDimensions()}},{key:"getOriginalDimensions",value:function(){return this.getComponent(St.RESIZE).getOriginalDimensions()}},{key:"setOriginalDimensions",value:function(t){this.getComponent(St.RESIZE).setOriginalDimensions(t)}},{key:"resize",value:function(t){return this.getComponent(St.RESIZE).resize(t)}}]),t}();G().mixin($s);var ta=$s,ia=ae,na=Jt,ra=Qt,oa=Vt,sa=Kt,aa=qt,la=$t,ca=re,ua=oe,ha=te,fa=ee,da=ie,ga=ne,pa=ue,va=he,ma=se,ya=function(){function t(e,i){var n,r,o,s,a,l,c,u,h,f,d,g,p,v,m,y;if(w(this,t),i=B()({includeUI:!1,usageStatistics:!0},i),this.mode=null,this.activeObjectId=null,i.includeUI){var b=i.includeUI;b.usageStatistics=i.usageStatistics,this.ui=new Zr(e,b,this.getActions()),i=this.ui.setUiDefaultSelectionStyle(i)}this._invoker=new hn,this._graphics=new ta(this.ui?this.ui.getEditorArea():e,{cssMaxWidth:i.cssMaxWidth,cssMaxHeight:i.cssMaxHeight}),this._handlers={keydown:A()(n=this._onKeyDown).call(n,this),mousedown:A()(r=this._onMouseDown).call(r,this),objectActivated:A()(o=this._onObjectActivated).call(o,this),objectMoved:A()(s=this._onObjectMoved).call(s,this),objectScaled:A()(a=this._onObjectScaled).call(a,this),objectRotated:A()(l=this._onObjectRotated).call(l,this),objectAdded:A()(c=this._onObjectAdded).call(c,this),objectModified:A()(u=this._onObjectModified).call(u,this),createdPath:this._onCreatedPath,addText:A()(h=this._onAddText).call(h,this),addObject:A()(f=this._onAddObject).call(f,this),textEditing:A()(d=this._onTextEditing).call(d,this),textChanged:A()(g=this._onTextChanged).call(g,this),iconCreateResize:A()(p=this._onIconCreateResize).call(p,this),iconCreateEnd:A()(v=this._onIconCreateEnd).call(v,this),selectionCleared:A()(m=this._selectionCleared).call(m,this),selectionCreated:A()(y=this._selectionCreated).call(y,this)},this._attachInvokerEvents(),this._attachGraphicsEvents(),this._attachDomEvents(),this._setSelectionStyle(i.selectionStyle,{applyCropSelectionStyle:i.applyCropSelectionStyle,applyGroupSelectionStyle:i.applyGroupSelectionStyle}),i.usageStatistics&&(Ei||(Ei=!0,ot()("image-editor","UA-129999381-1"))),this.ui&&(this.ui.initCanvas(),this.setReAction(),this._attachColorPickerInputBoxEvents()),z.fabric.enableGLFiltering=!1}return T(t,[{key:"_attachColorPickerInputBoxEvents",value:function(){var t=this;this.ui.on(xe,function(){t.isColorPickerInputBoxEditing=!0}),this.ui.on(_e,function(){t.isColorPickerInputBoxEditing=!1})}},{key:"_detachColorPickerInputBoxEvents",value:function(){this.ui.off(xe),this.ui.off(_e)}},{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=ce,r=le,o=fe,s=de,a=ge,l=ve,c=me;if(this._invoker.on(n,A()(t=this.fire).call(t,this,n)),this._invoker.on(r,A()(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(s,function(t){return i.ui.fire(s,t)}),this._invoker.on(a,function(t){return i.ui.fire(a,t)}),u.on(l,function(){return i.ui.fire(l)}),u.on(c,function(){return i.ui.fire(c)})}}},{key:"_attachGraphicsEvents",value:function(){var t;this._graphics.on((S(t={},ia,this._handlers.mousedown),S(t,na,this._handlers.objectMoved),S(t,ra,this._handlers.objectScaled),S(t,sa,this._handlers.objectRotated),S(t,oa,this._handlers.objectActivated),S(t,aa,this._handlers.objectAdded),S(t,la,this._handlers.objectModified),S(t,ca,this._handlers.addText),S(t,ua,this._handlers.addObject),S(t,ha,this._handlers.textEditing),S(t,fa,this._handlers.textChanged),S(t,da,this._handlers.iconCreateResize),S(t,ga,this._handlers.iconCreateEnd),S(t,pa,this._handlers.selectionCleared),S(t,va,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;(e||n)&&(i===Je?this._graphics.resetTargetObjectForCopyPaste():i===Qe?(this._graphics.pasteObject(),this.clearRedoStack()):i===Ze?this.undo().catch(function(){}):i===Ve&&this.redo().catch(function(){}));var r=i===qe||i===$e,o=this._graphics.isReadyRemoveObject();!this.isColorPickerInputBoxEditing&&o&&r&&(t.preventDefault(),this.removeActiveObject())}},{key:"removeActiveObject",value:function(){var t=this._graphics.getActiveObjectIdForRemove();this.removeObject(t)}},{key:"_onMouseDown",value:function(t,e){this.fire(ae,t,e)}},{key:"_pushAddObjectCommand",value:function(t){var e=cn.create(Et,this._graphics,t);this._invoker.pushUndoStack(e)}},{key:"_pushModifyObjectCommand",value:function(t){var e=this,i=t.type,n=Gs(t,function(t){return Xs(e._graphics.getObjectId(t),t,"activeSelection"===i)}),r=cn.create(Xt,this._graphics,n);r.execute(this._graphics,n),this._invoker.pushUndoStack(r)}},{key:"_onObjectActivated",value:function(t){this.fire(Vt,t)}},{key:"_onObjectMoved",value:function(t){this.fire(Jt,t)}},{key:"_onObjectScaled",value:function(t){this.fire(Qt,t)}},{key:"_onObjectRotated",value:function(t){this.fire(Kt,t)}},{key:"getDrawingMode",value:function(){return this._graphics.getDrawingMode()}},{key:"clearObjects",value:function(){return this.execute(kt)}},{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),s=1;s<r;s++)o[s-1]=arguments[s];var a=O()(e=[this._graphics]).call(e,o);return(i=this._invoker).execute.apply(i,O()(n=[t]).call(n,I(a)))}},{key:"executeSilent",value:function(t){for(var e,i,n,r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];var a=O()(e=[this._graphics]).call(e,o);return(i=this._invoker).executeSilent.apply(i,O()(n=[t]).call(n,I(a)))}},{key:"undo",value:function(){for(var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=L().resolve(),n=0;n<e;n+=1)i=i.then(function(){return t._invoker.undo()});return i}},{key:"redo",value:function(){for(var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=L().resolve(),n=0;n<e;n+=1)i=i.then(function(){return t._invoker.redo()});return i}},{key:"zoom",value:function(t){var e=t.x,i=t.y,n=t.zoomLevel;this._graphics.zoom({x:e,y:i},n)}},{key:"resetZoom",value:function(){this._graphics.resetZoom()}},{key:"loadImageFromFile",value:function(t,e){if(!t)return L().reject(li);var i=N().createObjectURL(t);return e=e||t.name,this.loadImageFromURL(i,e).then(function(e){return N().revokeObjectURL(t),e})}},{key:"loadImageFromURL",value:function(t,e){return e&&t?this.execute(Tt,e,t):L().reject(li)}},{key:"addImageObject",value:function(t){return t?this.execute(Ht,t):L().reject(li)}},{key:"startDrawingMode",value:function(t,e){return this._graphics.startDrawingMode(t,e)}},{key:"stopDrawingMode",value:function(){this._graphics.stopDrawingMode()}},{key:"crop",value:function(t){var e=this._graphics.getCroppedImageData(t);return e?this.loadImageFromURL(e.url,e.imageName):L().reject(li)}},{key:"getCropzoneRect",value:function(){return this._graphics.getCropzoneRect()}},{key:"setCropzoneRect",value:function(t){this._graphics.setCropzoneRect(t)}},{key:"_flip",value:function(t){return this.execute(Dt,t)}},{key:"flipX",value:function(){return this._flip("flipX")}},{key:"flipY",value:function(){return this._flip("flipY")}},{key:"resetFlip",value:function(){return this._flip("reset")}},{key:"_rotate",value:function(t,e,i){return i?this.executeSilent(At,t,e):this.execute(At,t,e)}},{key:"rotate",value:function(t,e){return this._rotate("rotate",t,e)}},{key:"setAngle",value:function(t,e){return this._rotate("setAngle",t,e)}},{key:"setBrush",value:function(t){this._graphics.setBrush(t)}},{key:"setDrawingShape",value:function(t,e){this._graphics.setDrawingShape(t,e)}},{key:"setDrawingIcon",value:function(t,e){this._graphics.setIconStyle(t,e)}},{key:"addShape",value:function(t,e){return e=e||{},this._setPositions(e),this.execute(zt,t,e)}},{key:"changeShape",value:function(t,e,i){return this[i?"executeSilent":"execute"](Rt,t,e)}},{key:"addText",value:function(t,e){return t=t||"",e=e||{},this.execute(Bt,t,e)}},{key:"changeText",value:function(t,e){return e=e||"",this.execute(Ft,t,e)}},{key:"changeTextStyle",value:function(t,e,i){return this[i?"executeSilent":"execute"](Yt,t,e)}},{key:"_changeActivateMode",value:function(t){"ICON"!==t&&this.getDrawingMode()!==t&&this.startDrawingMode(t)}},{key:"_onTextChanged",value:function(t){this.fire(ee,t)}},{key:"_onIconCreateResize",value:function(t){this.fire(ie,t)}},{key:"_onIconCreateEnd",value:function(t){this.fire(ne,t)}},{key:"_onTextEditing",value:function(){this.fire(te)}},{key:"_onAddText",value:function(t){this.fire(re,{originPosition:t.originPosition,clientPosition:t.clientPosition})}},{key:"_onAddObject",value:function(t){var e=this._graphics.getObject(t.id);this._invoker.fire(fe,Qi(e.type)),this._pushAddObjectCommand(e)}},{key:"_onObjectAdded",value:function(t){this.fire(aa,t),this.fire(ma,t)}},{key:"_onObjectModified",value:function(t){t.type!==mt&&(this._invoker.fire(fe,Qi(t.type)),this._pushModifyObjectCommand(t))}},{key:"_selectionCleared",value:function(){this.fire(pa)}},{key:"_selectionCreated",value:function(t){this.fire(va,t)}},{key:"registerIcons",value:function(t){this._graphics.registerPaths(t)}},{key:"changeCursor",value:function(t){this._graphics.changeCursor(t)}},{key:"addIcon",value:function(t,e){return e=e||{},this._setPositions(e),this.execute(Pt,t,e)}},{key:"changeIconColor",value:function(t,e){return this.execute(Nt,t,e)}},{key:"removeObject",value:function(t){var e=this._graphics.getObject(t).type;return this.execute(Ot,t,Qi(e))}},{key:"hasFilter",value:function(t){return this._graphics.hasFilter(t)}},{key:"removeFilter",value:function(t){return this.execute(Lt,t)}},{key:"applyFilter",value:function(t,e,i){return this[i?"executeSilent":"execute"](jt,t,e)}},{key:"toDataURL",value:function(t){return this._graphics.toDataURL(t)}},{key:"getImageName",value:function(){return this._graphics.getImageName()}},{key:"clearUndoStack",value:function(){this._invoker.clearUndoStack()}},{key:"clearRedoStack",value:function(){this._invoker.clearRedoStack()}},{key:"isEmptyUndoStack",value:function(){return this._invoker.isEmptyUndoStack()}},{key:"isEmptyRedoStack",value:function(){return this._invoker.isEmptyRedoStack()}},{key:"resizeCanvasDimension",value:function(t){return t?this.execute(Wt,t):L().reject(li)}},{key:"destroy",value:function(){var t=this;this.stopDrawingMode(),this._detachDomEvents(),this._graphics.destroy(),this._graphics=null,this.ui&&(this._detachColorPickerInputBoxEvents(),this.ui.destroy()),W()(this,function(e,i){t[i]=null},this)}},{key:"_setPositions",value:function(t){var e=this._graphics.getCenter();Y()(t.left)&&(t.left=e.left),Y()(t.top)&&(t.top=e.top)}},{key:"setObjectProperties",value:function(t,e){return this.execute(Ut,t,e)}},{key:"setObjectPropertiesQuietly",value:function(t,e){this._graphics.setObjectProperties(t,e)}},{key:"getObjectProperties",value:function(t,e){return this._graphics.getObject(t)?this._graphics.getObjectProperties(t,e):null}},{key:"getCanvasSize",value:function(){return this._graphics.getCanvasSize()}},{key:"getObjectPosition",value:function(t,e,i){return this._graphics.getObjectPosition(t,e,i)}},{key:"setObjectPosition",value:function(t,e){return this.execute(Gt,t,e)}},{key:"resize",value:function(t){return this.execute(Zt,t)}}]),t}();Kr.mixin(ya),G().mixin(ya);var ba=ya,xa=St.ICON,_a={name:Pt,execute:function(t,e,i){var n=this;return t.getComponent(xa).add(e,i).then(function(e){return n.undoData.object=t.getObject(e.id),e})},undo:function(t){return t.remove(this.undoData.object),L().resolve()}};cn.register(_a);var Ca={name:Ht,execute:function(t,e){var i=this;return t.addImageObject(e).then(function(e){return i.undoData.object=t.getObject(e.id),e})},undo:function(t){return t.remove(this.undoData.object),L().resolve()}};cn.register(Ca);var Ia={name:Et,execute:function(t,e){return new(L())(function(i,n){t.contains(e)?n(si):(t.add(e),i(e))})},undo:function(t,e){return new(L())(function(i,n){t.contains(e)?(t.remove(e),i(e)):n(fi)})}};cn.register(Ia);var Ma=St.SHAPE,Sa={name:zt,execute:function(t,e,i){var n=this;return t.getComponent(Ma).add(e,i).then(function(e){var i=e.id;return n.undoData.object=t.getObject(i),e})},undo:function(t){return t.remove(this.undoData.object),L().resolve()}};cn.register(Sa);var wa=St.TEXT,ka={name:Bt,execute:function(t,e,i){var n=this,r=t.getComponent(wa);if(this.undoData.object){var o=this.undoData.object;return new(L())(function(e,i){t.contains(o)?i(di):(t.add(o),e(o))})}return r.add(e,i).then(function(e){var i=e.id,r=t.getObject(i);return n.undoData.object=r,Us(Gs(r,function(){return Xs(i,r,!1)})),e})},undo:function(t){return t.remove(this.undoData.object),L().resolve()}};cn.register(ka);var Ta=St.FILTER,Da=null,Aa={name:jt,execute:function(t,e,i,n){var r=t.getComponent(Ta);if("mask"===e){var o=t.getObject(i.maskObjId);if(!o||!o.isType("image"))return L().reject(li);B()(i,{mask:o}),t.remove(i.mask)}if(!this.isRedo){var s=function(t,e,i){var n={};return"mask"===t&&(n.object=i.mask),n.options=e,n}(e,r.getOptions(e),i);Da=this.setUndoData(s,Da,n)}return r.add(e,i)},undo:function(t,e){var i=t.getComponent(Ta);if("mask"===e){var n=this.undoData.object;return t.add(n),t.setActiveObject(n),i.remove(e)}return this.undoData.options?i.add(e,this.undoData.options):i.remove(e)}};cn.register(Aa);var Ea=St.ICON,Oa={name:Nt,execute:function(t,e,i){var n=this;return new(L())(function(r,o){var s=t.getComponent(Ea),a=t.getObject(e);a||o(fi),n.undoData.object=a,n.undoData.color=s.getColor(a),s.setColor(i,a),r()})},undo:function(t){var e=t.getComponent(Ea),i=this.undoData,n=i.object,r=i.color;return e.setColor(r,n),L().resolve()}};cn.register(Oa);var ja=St.SHAPE,La=null,Pa={name:Rt,execute:function(t,e,i,n){var r=t.getComponent(ja),o=t.getObject(e);if(!o)return L().reject(fi);if(!this.isRedo){var s=function(t,e){var i={object:e,options:{}};return eo()(t,function(t,n){i.options[n]=e[n]}),i}(i,o);La=this.setUndoData(s,La,n)}return r.change(o,i)},undo:function(t){var e=t.getComponent(ja),i=this.undoData,n=i.object,r=i.options;return e.change(n,r)}};cn.register(Pa);var Na=St.TEXT,za={name:Ft,execute:function(t,e,i){var n=t.getComponent(Na),r=t.getObject(e);return r?(this.undoData.object=r,this.undoData.text=n.getText(r),n.change(r,i)):L().reject(fi)},undo:function(t){var e=t.getComponent(Na),i=this.undoData,n=i.object,r=i.text;return e.change(n,r)}};cn.register(za);var Ra=St.TEXT,Ba=null,Fa={name:Yt,execute:function(t,e,i,n){var r=t.getComponent(Ra),o=t.getObject(e);if(!o)return L().reject(fi);if(!this.isRedo){var s=function(t,e){var i={object:e,styles:{}};return eo()(t,function(t,n){var r=e[n];i.styles[n]=r}),i}(i,o);Ba=this.setUndoData(s,Ba,n)}return r.setStyle(o,i)},undo:function(t){var e=t.getComponent(Ra),i=this.undoData,n=i.object,r=i.styles;return e.setStyle(n,r)}};cn.register(Fa);var Ya={name:kt,execute:function(t){var e=this;return new(L())(function(i){e.undoData.objects=t.removeAll(),i()})},undo:function(t){return t.add(this.undoData.objects),L().resolve()}};cn.register(Ya);var Ha=St.FLIP,Wa={name:Dt,execute:function(t,e){var i=t.getComponent(Ha);return this.undoData.setting=i.getCurrentSetting(),i[e]()},undo:function(t){return t.getComponent(Ha).set(this.undoData.setting)}};cn.register(Wa);var Ua=St.IMAGE_LOADER,Ga={name:Tt,execute:function(t,e,i){var n,r=t.getComponent(Ua),o=r.getCanvasImage(),s=o?o.width:0,a=o?o.height:0,l=Jr()(n=t.removeAll(!0)).call(n,function(t){return"cropzone"!==t.type});return et()(l).call(l,function(t){t.evented=!0}),this.undoData={name:r.getImageName(),image:o,objects:l},r.load(e,i).then(function(t){return{oldWidth:s,oldHeight:a,newWidth:t.width,newHeight:t.height}})},undo:function(t){var e=t.getComponent(Ua),i=this.undoData,n=i.objects,r=i.name,o=i.image;return t.removeAll(!0),t.add(n),e.load(r,o)}};cn.register(Ga);var Xa=St.FILTER,Za={name:Lt,execute:function(t,e){var i=t.getComponent(Xa);return this.undoData.options=i.getOptions(e),i.remove(e)},undo:function(t,e){var i=t.getComponent(Xa),n=this.undoData.options;return i.add(e,n)}};cn.register(Za);var Va={name:Ot,execute:function(t,e){var i=this;return new(L())(function(n,r){i.undoData.objects=t.removeObjectById(e),i.undoData.objects.length?n():r(fi)})},undo:function(t){return t.add(this.undoData.objects),L().resolve()}};cn.register(Va);var Ja={name:Wt,execute:function(t,e){var i=this;return new(L())(function(n){i.undoData.size={width:t.cssMaxWidth,height:t.cssMaxHeight},t.setCssMaxDimension(e),t.adjustCanvasDimension(),n()})},undo:function(t){return t.setCssMaxDimension(this.undoData.size),t.adjustCanvasDimension(),L().resolve()}};cn.register(Ja);var Qa=St.ROTATION,Ka=null,qa={name:At,execute:function(t,e,i,n){var r=t.getComponent(Qa);if(!this.isRedo){var o=function(t){return{angle:t.getCurrentAngle()}}(r);Ka=this.setUndoData(o,Ka,n)}return r[e](i)},undo:function(t){var e=t.getComponent(Qa),i=Q(this.args,3),n=i[1],r=i[2];return"setAngle"===n?e[n](this.undoData.angle):e.rotate(-r)}};cn.register(qa);var $a={name:Ut,execute:function(t,e,i){var n=this,r=t.getObject(e);return r?(this.undoData.props={},eo()(i,function(t,e){n.undoData.props[e]=r[e]}),t.setObjectProperties(e,i),L().resolve()):L().reject(fi)},undo:function(t,e){var i=this.undoData.props;return t.setObjectProperties(e,i),L().resolve()}};cn.register($a);var tl={name:Gt,execute:function(t,e,i){return t.getObject(e)?(this.undoData.objectId=e,this.undoData.props=t.getObjectProperties(e,["left","top"]),t.setObjectPosition(e,i),t.renderAll(),L().resolve()):L().reject(fi)},undo:function(t){var e=this.undoData,i=e.objectId,n=e.props;return t.setObjectProperties(i,n),t.renderAll(),L().resolve()}};cn.register(tl);var el={name:Xt,execute:function(t,e){return this.isRedo?et()(e).call(e,function(e){t.setObjectProperties(e.id,e)}):this.undoData=Ws,L().resolve()},undo:function(t){var e;return et()(e=this.undoData).call(e,function(e){t.setObjectProperties(e.id,e)}),L().resolve()}};cn.register(el);var il=St.RESIZE,nl={name:Zt,execute:function(t,e){var i=t.getComponent(il),n=i.getOriginalDimensions();return n||(n=i.getCurrentDimensions()),this.undoData.dimensions=n,i.resize(e)},undo:function(t){return t.getComponent(il).resize(this.undoData.dimensions)}};cn.register(nl);var rl=ba}(),n=n.default}()))),Vs={Crop:"裁剪",Rotate:"旋转",Flip:"翻转",Draw:"涂鸦",Shape:"形状标注",Icon:"图标标注",Text:"文字标注",Mask:"蒙版",Filter:"滤镜",Resize:"调整尺寸",Undo:"撤销",Redo:"重做",Delete:"删除",Save:"保存",Load:"加载图片",Download:"下载",Reset:"重置",Cancel:"取消",OK:"确定",Apply:"应用",Close:"关闭",Free:"自由裁剪",Original:"原始比例",Square:"正方形","4:3":"4:3","3:4":"3:4","16:9":"16:9","9:16":"9:16",Custom:"自定义比例",Width:"宽度",Height:"高度",Ratio:"比例","Lock ratio":"锁定比例","Unlock ratio":"解锁比例","Rotate CW":"顺时针旋转","Rotate CCW":"逆时针旋转","Flip X":"水平翻转","Flip Y":"垂直翻转",Rectangle:"矩形",Circle:"圆形",Triangle:"三角形",Line:"直线",Pen:"画笔",Eraser:"橡皮擦",Color:"颜色",Opacity:"透明度",Fill:"填充",Stroke:"描边",Font:"字体",Size:"大小",Align:"对齐",Left:"左对齐",Center:"居中",Right:"右对齐",Bold:"粗体",Italic:"斜体",Underline:"下划线","Text color":"文字颜色",Grayscale:"灰度",Sepia:"怀旧",Sepia2:"复古2",Invert:"反色",Brightness:"亮度",Contrast:"对比度",Saturation:"饱和度",Hue:"色相",Blur:"模糊",Sharpen:"锐化","Remove White":"去白底",Distance:"距离",Pixelate:"像素化","Color Filter":"色彩滤镜",Threshold:"阈值",Noise:"杂色/噪点","Image Loaded":"图片加载完成","Save image as":"保存图片为","Are you sure you want to reset?":"确定要重置所有编辑吗?","Failed to load image":"图片加载失败","Please select an image":"请选择一张图片","Image size is too large":"图片尺寸过大","Minimum size is":"最小尺寸为","Maximum size is":"最大尺寸为",Zoom:"缩放","Zoom In":"放大","Zoom Out":"缩小",Hand:"抓手",History:"历史记录","Delete All":"全部删除","Fit to canvas":"适配画布","Actual size":"实际尺寸","Custom size":"自定义尺寸","Background color":"背景颜色","File type":"文件类型",JPEG:"JPEG 格式",PNG:"PNG 格式",Quality:"质量",Duplicate:"复制","Bring to front":"移到顶层","Send to back":"移到底层","Blend mode":"混合模式",Arrow:"箭头","Arrow-2":"标注线","Arrow-3":"箭头3","Star-1":"指北针","Star-2":"空军基地",Polygon:"海军基地",Location:"定位",Heart:"爱心",Bubble:"气泡",DeleteAll:"删除全部",ZoomIn:"放大",ZoomOut:"缩小","Text size":"文字大小","Lock Aspect Ratio":"锁定纵横比"},Js={},Qs=Ns(li({__name:"index",setup(t){const e=ve(null),i=ve(null);let n=null,r=null;const o=ne({width:0,height:0}),s=ne({x:0,y:0}),a=ve(0),l=ve(null);Ii(()=>{if(e.value)try{n=new Zs(e.value,{includeUI:{loadImage:{path:"https://picsum.photos/800/600",name:"DefaultImage"},initMenu:"icon",menuBarPosition:"left",locale:Vs,theme:Js,uiSize:{width:"100%",height:"100%"}},selectionStyle:{cornerSize:20,rotatingPointOffset:70},usageStatistics:!0,cssMaxHeight:document.documentElement.clientWidth,cssMaxWidth:document.documentElement.clientHeight}),r=new Bs(n),n.resetZoom(),window.onresize=()=>{n.ui.resizeEditor()},u(),(()=>{const t=document.querySelectorAll(".tui-image-editor-menu-icon .tui-image-editor-submenu-item .tie-icon-add-button:first-child .tui-image-editor-button>div");t&&(t[3].innerHTML="<img src=\"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2016.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20width='32px'%20height='32px'%20viewBox='0%200%2032%2032'%20enable-background='new%200%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20fill='%238a8a8a'%20d='M15.832,6.936l6.732,20.789l-6.732-5.81l-6.396,5.81L15.832,6.936z%20M16.506,12.133v8.865l4.039,3.669%20L16.506,12.133z'/%3e%3cpath%20fill='%238a8a8a'%20d='M14.598,2.621v2.274c-0.045,0.363,0.145,0.529,0.57,0.497V5.63h-1.413V5.392H13.8%20c0.289,0.017,0.434-0.11,0.434-0.379V2.218C14.112,2.155,13.96,2.116,13.778,2.1V1.862h1.185l2.392,2.582V2.621%20c0.047-0.395-0.137-0.569-0.547-0.521h-0.067V1.862h1.504v0.237h-0.068c-0.35,0-0.508,0.104-0.479,0.308v3.222h-0.319L14.598,2.621%20L14.598,2.621z'/%3e%3cg%3e%3cg%3e%3cpath%20fill='%238a8a8a'%20d='M16.001,6.392c-6.627,0-12,5.373-12,12.001c0,6.625,5.373,11.998,12,11.998%20c6.627,0,11.998-5.373,11.998-11.998C27.999,11.764,22.628,6.392,16.001,6.392z%20M16.001,30.141c-6.49,0-11.75-5.262-11.75-11.748%20c0-6.491,5.26-11.751,11.75-11.751c6.488,0,11.748,5.26,11.748,11.751C27.749,24.879,22.489,30.141,16.001,30.141z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"/>",t[4].innerHTML="<img src=\"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2016.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20width='32px'%20height='32px'%20viewBox='0%200%2032%2032'%20enable-background='new%200%200%2032%2032'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20fill='none'%20stroke='%238a8a8a'%20stroke-width='0.5'%20d='M15.97,4.167c-6.627,0-12,5.373-12,12c0,6.626,5.373,12,12,12c6.627,0,11.999-5.373,11.999-12%20C27.969,9.54,22.598,4.167,15.97,4.167z%20M15.97,27.917c-6.489,0-11.75-5.262-11.75-11.75c0-6.489,5.26-11.75,11.75-11.75%20c6.489,0,11.749,5.261,11.749,11.75C27.719,22.655,22.459,27.917,15.97,27.917z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20fill='none'%20stroke='%238a8a8a'%20stroke-width='0.5'%20d='M15.971,2.167c-7.772,0-14.074,6.268-14.074,14s6.302,14.001,14.074,14.001%20c7.773,0,14.072-6.27,14.072-14.001S23.744,2.167,15.971,2.167z%20M15.971,29.875c-7.611,0-13.781-6.139-13.781-13.708%20c0-7.571,6.169-13.708,13.781-13.708S29.75,8.596,29.75,16.167C29.75,23.736,23.582,29.875,15.971,29.875z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cpath%20fill='none'%20stroke='%238a8a8a'%20stroke-width='0.5'%20d='M17.262,23.562c0,0.572-0.595,1.035-1.327,1.035l0,0%20c-0.732,0-1.326-0.463-1.326-1.035V7.105c0-0.573,0.594-1.996,1.326-1.996l0,0c0.732,0,1.327,1.422,1.327,1.996V23.562z'/%3e%3cpath%20fill='none'%20stroke='%238a8a8a'%20stroke-width='0.5'%20d='M16.442,17.364c-0.262-0.172-0.237-0.669,0.054-1.115l0,0%20c0.292-0.445,0.74-0.668,1.002-0.497l7.525,4.928c0.262,0.172,0.676,0.959,0.385,1.402l0,0c-0.291,0.445-1.18,0.383-1.441,0.211%20L16.442,17.364z'/%3e%3cpath%20fill='none'%20stroke='%238a8a8a'%20stroke-width='0.5'%20d='M15.497,17.362c0.262-0.17,0.237-0.667-0.054-1.113l0,0%20c-0.292-0.445-0.74-0.668-1.002-0.497l-7.524,4.926c-0.263,0.172-0.677,0.959-0.385,1.404l0,0%20c0.291,0.445,1.179,0.381,1.441,0.209L15.497,17.362z'/%3e%3cpath%20fill='none'%20stroke='%238a8a8a'%20stroke-width='0.5'%20d='M15.515,24.007c0.08-0.104-0.02-0.293-0.222-0.422l0,0%20c-0.203-0.129-0.43-0.148-0.508-0.043l-2.258,3.035c-0.079,0.105-0.11,0.471,0.092,0.6l0,0c0.202,0.129,0.561-0.029,0.64-0.135%20L15.515,24.007z'/%3e%3cpath%20fill='none'%20stroke='%238a8a8a'%20stroke-width='0.5'%20d='M16.477,24.007c-0.08-0.104,0.02-0.293,0.221-0.422l0,0%20c0.203-0.129,0.431-0.148,0.509-0.043l2.258,3.035c0.078,0.105,0.109,0.471-0.092,0.6l0,0c-0.203,0.129-0.561-0.029-0.641-0.135%20L16.477,24.007z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"/>",t[5].innerHTML="<img src=\"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2016.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20width='32px'%20height='32px'%20viewBox='0%200%2032%2032'%20enable-background='new%200%200%2032%2032'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20fill='%238a8a8a'%20d='M16.216,4c-6.627,0-12,5.373-12,12c0,6.626,5.373,12,12,12c6.626,0,11.998-5.373,11.998-12%20C28.214,9.373,22.843,4,16.216,4z%20M16.216,27.75c-6.49,0-11.75-5.262-11.75-11.75c0-6.489,5.26-11.75,11.75-11.75%20c6.488,0,11.748,5.261,11.748,11.75C27.964,22.488,22.704,27.75,16.216,27.75z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20fill='%238a8a8a'%20d='M16.216,2C8.444,2,2.142,8.268,2.142,16s6.302,14.001,14.074,14.001c7.773,0,14.072-6.27,14.072-14.001%20S23.989,2,16.216,2z%20M16.216,29.708C8.605,29.708,2.436,23.569,2.436,16c0-7.571,6.169-13.708,13.781-13.708%20c7.611,0,13.779,6.137,13.779,13.708C29.995,23.569,23.827,29.708,16.216,29.708z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20fill='%238a8a8a'%20d='M23.216,15.548h-5.25v-5.241h-1.75v5.241h-2.5l-2.75-1.75h-0.75V5.61l-1.671,1.47v6.717H8.215%20l-3.877,1.75l-0.123,0.75c0,6.628,5.373,12,12,12c6.375,0,11.574-4.975,11.962-11.25h-4.962V15.548z%20M12.512,23.621h-2.297v-1%20h2.297V23.621z%20M23.317,19.494h2.297v1h-2.297V19.494z%20M18.466,24.621h-1v-1h1V24.621z%20M18.657,19.775h-2.299v-1h2.299V19.775z%20M22.966,23.621h-1v-1h1V23.621z'/%3e%3cpath%20fill='%238a8a8a'%20d='M28.178,17.048h0.038v-0.75C28.216,16.551,28.193,16.799,28.178,17.048z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"/>")})(),(()=>{const t=document.querySelector(".tui-image-editor-menu-text .tui-image-editor-submenu-item");t?.insertAdjacentHTML("afterbegin",'<li class="tie-text-effect-button">\n <div class="tui-image-editor-button title">\n <div>\n <span class="text-icon" >🏷️</span>\n </div>\n <label> 标题 </label>\n </div>\n <div class="tui-image-editor-button date">\n <div>\n <span class="text-icon">🕒</span>\n </div>\n <label> 时间 </label>\n </div>\n <div class="tui-image-editor-button attached">\n <div>\n <span class="text-icon">📋</span>\n </div>\n <label> 附图标签 </label>\n </div>\n </li>'),t?.addEventListener("click",function(t){const e=t.target.closest(".tui-image-editor-button");e&&(e.classList.contains("title")?f():e.classList.contains("date")?d():e.classList.contains("attached")&&g())})})(),(()=>{const t=document.querySelector(".tui-image-editor-menu-shape .tui-image-editor-submenu-item");t?.insertAdjacentHTML("afterbegin",'<li class="tie-shape-button">\n <div class="tui-image-editor-button comparison">\n <div>\n <span class="text-icon gray" > ▢ </span>\n </div>\n <label> 对比拉框 </label>\n </div>\n <div class="tui-image-editor-button calibration">\n <div>\n <span class="text-icon gray"> ⬚ </span>\n </div>\n <label> 标定目标 </label>\n </div>\n </li>'),t?.addEventListener("click",function(t){const e=t.target.closest(".tui-image-editor-button");e&&(e.classList.contains("comparison")?p():e.classList.contains("calibration")?v():e.classList.contains("attached"))})})(),(()=>{const t=document.querySelector(".tui-image-editor-menu-resize"),e=document.querySelector(".tui-image-editor-menu-resize .tui-image-editor-submenu-item .tui-image-editor-submenu-align"),i=document.createElement("li");i.className="tui-image-editor-submenu-align tui-image-editor-submenu-A4",i.innerHTML='\n <div class="tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-lock-aspect-ratio tie-lock-aspect-a4">\n <span>开启 A4-横版</span>\n </label>\n </div>\n </div>\n ',e?.parentNode&&e.parentNode.insertBefore(i,e.nextSibling),t?.addEventListener("click",function(t){if(t.target.closest(".tui-image-editor-submenu-A4"))if(document.querySelector(".tie-lock-aspect-a4").checked){n.getCanvasSize();const t=1754,e=1240;n.resize({width:t,height:e}).then(()=>{}).catch(()=>{})}else n.resize({width:800,height:600}).then(()=>{}).catch(()=>{})})})(),i.value&&i.value.addEventListener("mousemove",h),c("专题图工具已就绪","success")}catch(t){c("初始化失败,请刷新页面重试","error")}else c("编辑器容器未找到","error")}),ki(()=>{if(n)try{n.destroy(),n=null,r=null}catch(t){}i.value&&i.value.removeEventListener("mousemove",h)});const c=(t,e="info")=>{l.value={message:t,type:e}},u=()=>{if(r&&n){const t=n.getCanvasSize();o.width=t.width,o.height=t.height}},h=t=>{if(!i.value)return;const e=i.value.getBoundingClientRect();s.x=Math.round(t.clientX-e.left),s.y=Math.round(t.clientY-e.top)},f=async()=>{if(r)try{await r.addTitle("专题图标题"),a.value=(await r.getAllElements()).length,c("标题添加成功","success")}catch(t){c("添加标题失败","error")}else c("专题图工具未初始化","error")},d=async()=>{if(r)try{await r.addTimestamp(),a.value=(await r.getAllElements()).length,c("时间戳添加成功","success")}catch(t){c("添加时间戳失败","error")}else c("专题图工具未初始化","error")},g=async()=>{if(r)try{await r.addFigureLabel("附图"),a.value=(await r.getAllElements()).length,c("附图标签添加成功","success")}catch(t){c("添加附图标签失败","error")}else c("专题图工具未初始化","error")},p=async()=>{if(r)try{await r.addComparisonBox(400,400,150,100),a.value=(await r.getAllElements()).length,c("对比拉框添加成功","success")}catch(t){c("添加对比拉框失败","error")}else c("专题图工具未初始化","error")},v=async()=>{if(r)try{await r.addCalibrationTarget(500,500,120,120),a.value=(await r.getAllElements()).length,c("标定目标添加成功","success")}catch(t){c("添加标定目标失败","error")}else c("专题图工具未初始化","error")};return(t,n)=>(Yn(),Gn("div",{ref_key:"editorContainer",ref:i,class:"editor-container"},[Qn("div",{ref_key:"editorRef",ref:e,class:"image-editor-wrapper"},null,512)],512))}}),[["__scopeId","data-v-0a96a66f"]]),Ks=li({__name:"MapPluginView",setup:t=>(t,e)=>(Yn(),Gn("div",null,[Kn(Qs)]))});const qs=Ns({},[["render",function(t,e){return Yn(),Gn("div",null,"测试")}]]),$s=function(t){const e=xs(t.routes,t),i=t.parseQuery||qo,n=t.stringifyQuery||$o,r=t.history,o=es(),s=es(),a=es(),l=me(Yo);let c=Yo;qr&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=eo.bind(null,t=>""+t),h=eo.bind(null,Oo),f=eo.bind(null,jo);function d(t,o){if(o=to({},o||l.value),"string"==typeof t){const n=Po(i,t,o.path),s=e.resolve({path:n.path},o),a=r.createHref(n.fullPath);return to(n,s,{params:f(s.params),hash:jo(n.hash),redirectedFrom:void 0,href:a})}let s;if(null!=t.path)s=to({},t,{path:Po(i,t.path,o.path).path});else{const e=to({},t.params);for(const t in e)null==e[t]&&delete e[t];s=to({},t,{params:h(e)}),o.params=h(o.params)}const a=e.resolve(s,o),c=t.hash||"";a.params=u(f(a.params));const d=function(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}(n,to({},t,{hash:(g=c,Do(g).replace(So,"{").replace(ko,"}").replace(Io,"^")),path:a.path}));var g;const p=r.createHref(d);return to({fullPath:d,hash:c,query:n===$o?ts(t.query):t.query||{}},a,{redirectedFrom:void 0,href:p})}function g(t){return"string"==typeof t?Po(i,t,l.value.path):to({},t)}function p(t,e){if(c!==t)return ao(oo.NAVIGATION_CANCELLED,{from:e,to:t})}function v(t){return y(t)}function m(t,e){const i=t.matched[t.matched.length-1];if(i&&i.redirect){const{redirect:n}=i;let r="function"==typeof n?n(t,e):n;return"string"==typeof r&&(r=r.includes("?")||r.includes("#")?r=g(r):{path:r},r.params={}),to({query:t.query,hash:t.hash,params:null!=r.path?{}:t.params},r)}}function y(t,e){const i=c=d(t),r=l.value,o=t.state,s=t.force,a=!0===t.replace,u=m(i,r);if(u)return y(to(g(u),{state:"object"==typeof u?to({},o,u.state):o,force:s,replace:a}),e||i);const h=i;let f;return h.redirectedFrom=e,!s&&function(t,e,i){const n=e.matched.length-1,r=i.matched.length-1;return n>-1&&n===r&&zo(e.matched[n],i.matched[r])&&Ro(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}(n,r,i)&&(f=ao(oo.NAVIGATION_DUPLICATED,{to:h,from:r}),E(r,r,!0,!1)),(f?Promise.resolve(f):_(h,r)).catch(t=>lo(t)?lo(t,oo.NAVIGATION_GUARD_REDIRECT)?t:A(t):D(t,h,r)).then(t=>{if(t){if(lo(t,oo.NAVIGATION_GUARD_REDIRECT))return y(to({replace:a},g(t.to),{state:"object"==typeof t.to?to({},o,t.to.state):o,force:s}),e||h)}else t=I(h,r,!0,a,o);return C(h,r,t),t})}function b(t,e){const i=p(t,e);return i?Promise.reject(i):Promise.resolve()}function x(t){const e=L.values().next().value;return e&&"function"==typeof e.runWithContext?e.runWithContext(t):t()}function _(t,e){let i;const[n,r,a]=function(t,e){const i=[],n=[],r=[],o=Math.max(e.matched.length,t.matched.length);for(let s=0;s<o;s++){const o=e.matched[s];o&&(t.matched.find(t=>zo(t,o))?n.push(o):i.push(o));const a=t.matched[s];a&&(e.matched.find(t=>zo(t,a))||r.push(a))}return[i,n,r]}(t,e);i=ns(n.reverse(),"beforeRouteLeave",t,e);for(const o of n)o.leaveGuards.forEach(n=>{i.push(is(n,t,e))});const l=b.bind(null,t,e);return i.push(l),N(i).then(()=>{i=[];for(const n of o.list())i.push(is(n,t,e));return i.push(l),N(i)}).then(()=>{i=ns(r,"beforeRouteUpdate",t,e);for(const n of r)n.updateGuards.forEach(n=>{i.push(is(n,t,e))});return i.push(l),N(i)}).then(()=>{i=[];for(const n of a)if(n.beforeEnter)if(no(n.beforeEnter))for(const r of n.beforeEnter)i.push(is(r,t,e));else i.push(is(n.beforeEnter,t,e));return i.push(l),N(i)}).then(()=>(t.matched.forEach(t=>t.enterCallbacks={}),i=ns(a,"beforeRouteEnter",t,e,x),i.push(l),N(i))).then(()=>{i=[];for(const n of s.list())i.push(is(n,t,e));return i.push(l),N(i)}).catch(t=>lo(t,oo.NAVIGATION_CANCELLED)?t:Promise.reject(t))}function C(t,e,i){a.list().forEach(n=>x(()=>n(t,e,i)))}function I(t,e,i,n,o){const s=p(t,e);if(s)return s;const a=e===Yo,c=qr?history.state:{};i&&(n||a?r.replace(t.fullPath,to({scroll:a&&c&&c.scroll},o)):r.push(t.fullPath,o)),l.value=t,E(t,e,i,a),A()}let M;function S(){M||(M=r.listen((t,e,i)=>{if(!P.listening)return;const n=d(t),o=m(n,P.currentRoute.value);if(o)return void y(to(o,{replace:!0,force:!0}),n).catch(io);c=n;const s=l.value;var a,u;qr&&(a=Jo(s.fullPath,i.delta),u=Zo(),Qo.set(a,u)),_(n,s).catch(t=>lo(t,oo.NAVIGATION_ABORTED|oo.NAVIGATION_CANCELLED)?t:lo(t,oo.NAVIGATION_GUARD_REDIRECT)?(y(to(g(t.to),{force:!0}),n).then(t=>{lo(t,oo.NAVIGATION_ABORTED|oo.NAVIGATION_DUPLICATED)&&!i.delta&&i.type===Ho.pop&&r.go(-1,!1)}).catch(io),Promise.reject()):(i.delta&&r.go(-i.delta,!1),D(t,n,s))).then(t=>{(t=t||I(n,s,!1))&&(i.delta&&!lo(t,oo.NAVIGATION_CANCELLED)?r.go(-i.delta,!1):i.type===Ho.pop&&lo(t,oo.NAVIGATION_ABORTED|oo.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),C(n,s,t)}).catch(io)}))}let w,k=es(),T=es();function D(t,e,i){A(t);const n=T.list();return n.length&&n.forEach(n=>n(t,e,i)),Promise.reject(t)}function A(t){return w||(w=!t,S(),k.list().forEach(([e,i])=>t?i(t):e()),k.reset()),t}function E(e,i,n,r){const{scrollBehavior:o}=t;if(!qr||!o)return Promise.resolve();const s=!n&&function(t){const e=Qo.get(t);return Qo.delete(t),e}(Jo(e.fullPath,0))||(r||!n)&&history.state&&history.state.scroll||null;return Fe().then(()=>o(e,i,s)).then(t=>t&&Vo(t)).catch(t=>D(t,e,i))}const O=t=>r.go(t);let j;const L=new Set,P={currentRoute:l,listening:!0,addRoute:function(t,i){let n,r;return Ko(t)?(n=e.getRecordMatcher(t),r=i):r=t,e.addRoute(r,n)},removeRoute:function(t){const i=e.getRecordMatcher(t);i&&e.removeRoute(i)},clearRoutes:e.clearRoutes,hasRoute:function(t){return!!e.getRecordMatcher(t)},getRoutes:function(){return e.getRoutes().map(t=>t.record)},resolve:d,options:t,push:v,replace:function(t){return v(to(g(t),{replace:!0}))},go:O,back:()=>O(-1),forward:()=>O(1),beforeEach:o.add,beforeResolve:s.add,afterEach:a.add,onError:T.add,isReady:function(){return w&&l.value!==Yo?Promise.resolve():new Promise((t,e)=>{k.add([t,e])})},install(t){t.component("RouterLink",Ts),t.component("RouterView",Os),t.config.globalProperties.$router=P,Object.defineProperty(t.config.globalProperties,"$route",{enumerable:!0,get:()=>xe(l)}),qr&&!j&&l.value===Yo&&(j=!0,v(r.location).catch(t=>{}));const e={};for(const n in Yo)Object.defineProperty(e,n,{get:()=>l.value[n],enumerable:!0});t.provide(ho,P),t.provide(fo,re(e)),t.provide(go,l);const i=t.unmount;L.add(t),t.unmount=function(){L.delete(t),L.size<1&&(c=Yo,M&&M(),M=null,l.value=Yo,j=!1,w=!1),i()}}};function N(t){return t.reduce((t,e)=>t.then(()=>x(e)),Promise.resolve())}return P}({history:function(t){const e=ss(t=Uo(t)),i=function(t,e,i,n){let r=[],o=[],s=null;const a=({state:o})=>{const a=rs(t,location),l=i.value,c=e.value;let u=0;if(o){if(i.value=a,e.value=o,s&&s===l)return void(s=null);u=c?o.position-c.position:0}else n(a);r.forEach(t=>{t(i.value,l,{delta:u,type:Ho.pop,direction:u?u>0?Wo.forward:Wo.back:Wo.unknown})})};function l(){if("hidden"===document.visibilityState){const{history:t}=window;if(!t.state)return;t.replaceState(to({},t.state,{scroll:Zo()}),"")}}return window.addEventListener("popstate",a),window.addEventListener("pagehide",l),document.addEventListener("visibilitychange",l),{pauseListeners:function(){s=i.value},listen:function(t){r.push(t);const e=()=>{const e=r.indexOf(t);e>-1&&r.splice(e,1)};return o.push(e),e},destroy:function(){for(const t of o)t();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",l),document.removeEventListener("visibilitychange",l)}}}(t,e.state,e.location,e.replace),n=to({location:"",base:t,go:function(t,e=!0){e||i.pauseListeners(),history.go(t)},createHref:Xo.bind(null,t)},e,i);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>e.state.value}),n}("./"),routes:[{path:"/",name:"home",component:Rs},{path:"/map-plugin",name:"mapPlugin",component:Ks},{path:"/test",name:"test",component:qs}]}),ta=((...t)=>{const e=(Vr||(Vr=kn(Zr))).createApp(...t),{mount:i}=e;return e.mount=t=>{const n=function(t){if(m(t)){return document.querySelector(t)}return t}(t);if(!n)return;const r=e._component;v(r)||r.render||r.template||(r.template=n.innerHTML),1===n.nodeType&&(n.textContent="");const o=i(n,!1,function(t){if(t instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&t instanceof MathMLElement)return"mathml"}(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e})(zs);ta.use(function(){const t=new J(!0),e=t.run(()=>ve({}));let i=[],n=[];const r=fe({install(t){r._a=t,t.provide(Jr,r),t.config.globalProperties.$pinia=r,n.forEach(t=>i.push(t)),n=[]},use(t){return this._a?i.push(t):n.push(t),this},_p:i,_a:null,_e:t,_s:new Map,state:e});return r}()),ta.use($s),ta.mount("#app");
|