react-design-editor
Version:
Design Editor Tools with React.js + ant.design + fabric.js
11 lines • 3.11 MB
JavaScript
"use strict";var t=Object.defineProperty,e=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),i=require("react-dom");var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),n}var s,c={exports:{}},u={};var l,h,f={};
/** @license React v16.14.0
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/function d(){return l||(l=1,t=f,"production"!==process.env.NODE_ENV&&function(){var e=n,i=60103,r=60106;t.Fragment=60107;var a=60108,o=60114,s=60109,c=60110,u=60112,l=60113,h=60120,f=60115,d=60116,g=60121,p=60122,b=60117,v=60129,m=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;i=w("react.element"),r=w("react.portal"),t.Fragment=w("react.fragment"),a=w("react.strict_mode"),o=w("react.profiler"),s=w("react.provider"),c=w("react.context"),u=w("react.forward_ref"),l=w("react.suspense"),h=w("react.suspense_list"),f=w("react.memo"),d=w("react.lazy"),g=w("react.block"),p=w("react.server.block"),b=w("react.fundamental"),w("react.scope"),w("react.opaque.id"),v=w("react.debug_trace_mode"),w("react.offscreen"),m=w("react.legacy_hidden")}var y="function"==typeof Symbol&&Symbol.iterator,x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];!function(t,e,n){var i=x.ReactDebugCurrentFrame,r="";if(M){var a=T(M.type),o=M._owner;r+=function(t,e,n){var i="";if(e){var r=e.fileName,a=r.replace(S,"");if(/^index\./.test(a)){var o=r.match(S);if(o){var s=o[1];s&&(a=s.replace(S,"")+"/"+a)}}i=" (at "+a+":"+e.lineNumber+")"}else n&&(i=" (created by "+n+")");return"\n in "+(t||"Unknown")+i}(a,M._source,o&&T(o.type))}""!==(r+=i.getStackAddendum())&&(e+="%s",n=n.concat([r]));var s=n.map((function(t){return""+t}));s.unshift("Warning: "+e),Function.prototype.apply.call(console[t],console,s)}("error",t,n)}var S=/^(.*)[\\\/]/,k=1;function T(e){if(null==e)return null;if("number"==typeof e.tag&&_("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case t.Fragment:return"Fragment";case r:return"Portal";case o:return"Profiler";case a:return"StrictMode";case l:return"Suspense";case h:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return"Context.Consumer";case s:return"Context.Provider";case u:return p=e,b=e.render,v="ForwardRef",m=b.displayName||b.name||"",p.displayName||(""!==m?v+"("+m+")":v);case f:return T(e.type);case g:return T(e.render);case d:var n=(i=e)._status===k?i._result:null;if(n)return T(n)}var i,p,b,v,m;return null}var C={};x.ReactDebugCurrentFrame;var M=null;function E(t){M=t}var I,A,P=x.ReactCurrentOwner,O=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};function D(t,e,n,r,a){var o,s={},c=null,u=null;for(o in void 0!==n&&(c=""+n),function(t){if(O.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}(e)&&(c=""+e.key),function(t){if(O.call(t,"ref")){var e=Object.getOwnPropertyDescriptor(t,"ref").get;if(e&&e.isReactWarning)return!1}return void 0!==t.ref}(e)&&(u=e.ref,function(t){"string"==typeof t.ref&&P.current}(e)),e)O.call(e,o)&&!L.hasOwnProperty(o)&&(s[o]=e[o]);if(t&&t.defaultProps){var l=t.defaultProps;for(o in l)void 0===s[o]&&(s[o]=l[o])}if(c||u){var h="function"==typeof t?t.displayName||t.name||"Unknown":t;c&&function(t,e){var n=function(){I||(I=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};n.isReactWarning=!0,Object.defineProperty(t,"key",{get:n,configurable:!0})}(s,h),u&&function(t,e){var n=function(){A||(A=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};n.isReactWarning=!0,Object.defineProperty(t,"ref",{get:n,configurable:!0})}(s,h)}return function(t,e,n,r,a,o,s){var c={$$typeof:i,type:t,key:e,ref:n,props:s,_owner:o,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(t,c,u,a,r,P.current,s)}var j,N=x.ReactCurrentOwner;function R(t){M=t}function F(t){return"object"==typeof t&&null!==t&&t.$$typeof===i}function B(){if(N.current){var t=T(N.current.type);if(t)return"\n\nCheck the render method of `"+t+"`."}return""}x.ReactDebugCurrentFrame,j=!1;var z={};function H(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var n=function(t){var e=B();if(!e){var n="string"==typeof t?t:t.displayName||t.name;n&&(e="\n\nCheck the top-level render call using <"+n+">.")}return e}(e);if(!z[n]){z[n]=!0;var i="";t&&t._owner&&t._owner!==N.current&&(i=" It was passed a child from "+T(t._owner.type)+"."),R(t),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,i),R(null)}}}function G(t,e){if("object"==typeof t)if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];F(i)&&H(i,e)}else if(F(t))t._store&&(t._store.validated=!0);else if(t){var r=function(t){if(null===t||"object"!=typeof t)return null;var e=y&&t[y]||t["@@iterator"];return"function"==typeof e?e:null}(t);if("function"==typeof r&&r!==t.entries)for(var a,o=r.call(t);!(a=o.next()).done;)F(a.value)&&H(a.value,e)}}function V(t){var e,n=t.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)e=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==u&&n.$$typeof!==f)return;e=n.propTypes}if(e){var i=T(n);!function(t,e,n,i,r){var a=Function.call.bind(Object.prototype.hasOwnProperty);for(var o in t)if(a(t,o)){var s=void 0;try{if("function"!=typeof t[o]){var c=Error((i||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}s=t[o](e,o,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){s=u}!s||s instanceof Error||(E(r),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",i||"React class",n,o,typeof s),E(null)),s instanceof Error&&!(s.message in C)&&(C[s.message]=!0,E(r),_("Failed %s type: %s",n,s.message),E(null))}}(e,t.props,"prop",i,t)}else void 0===n.PropTypes||j||(j=!0,_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $(e,n,r,w,y,x){var S=function(e){return"string"==typeof e||"function"==typeof e||e===t.Fragment||e===o||e===v||e===a||e===l||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===f||e.$$typeof===s||e.$$typeof===c||e.$$typeof===u||e.$$typeof===b||e.$$typeof===g||e[0]===p)}(e);if(!S){var k,C="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),C+=B(),null===e?k="null":Array.isArray(e)?k="array":void 0!==e&&e.$$typeof===i?(k="<"+(T(e.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):k=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",k,C)}var M=D(e,n,r,y,x);if(null==M)return M;if(S){var E=n.children;if(void 0!==E)if(w)if(Array.isArray(E)){for(var I=0;I<E.length;I++)G(E[I],e);Object.freeze&&Object.freeze(E)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else G(E,e)}return e===t.Fragment?function(t){for(var e=Object.keys(t.props),n=0;n<e.length;n++){var i=e[n];if("children"!==i&&"key"!==i){R(t),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),R(null);break}}null!==t.ref&&(R(t),_("Invalid attribute `ref` supplied to `React.Fragment`."),R(null))}(M):V(M),M}var W=function(t,e,n){return $(t,e,n,!1)},U=function(t,e,n){return $(t,e,n,!0)};t.jsx=W,t.jsxs=U}()),f;var t}var g=(h||(h=1,"production"===process.env.NODE_ENV?c.exports=function(){if(s)return u;s=1;var t=n,e=60103;if(u.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;e=i("react.element"),u.Fragment=i("react.fragment")}var r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,o={key:!0,ref:!0,__self:!0,__source:!0};function c(t,n,i){var s,c={},u=null,l=null;for(s in void 0!==i&&(u=""+i),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(l=n.ref),n)a.call(n,s)&&!o.hasOwnProperty(s)&&(c[s]=n[s]);if(t&&t.defaultProps)for(s in n=t.defaultProps)void 0===c[s]&&(c[s]=n[s]);return{$$typeof:e,type:t,key:u,ref:l,props:c,_owner:r.current}}return u.jsx=c,u.jsxs=c,u}():c.exports=d()),c.exports),p={};const b=o(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var v;var m=(v||(v=1,function(t){
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
var e,n,i,r,a,o,s,c,u,l,h,f,d,g,p,v,m,w,y,x,_,S=S||{version:"4.6.0"};if(t.fabric=S,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?S.document=document:S.document=document.implementation.createHTMLDocument(""),S.window=window;else{var k=new b.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;S.document=k.document,S.jsdomImplForWrapper=b.implForWrapper,S.nodeCanvas=b.Canvas,S.window=k,DOMParser=S.window.DOMParser}function T(t,e){var n=t.canvas,i=e.targetCanvas,r=i.getContext("2d");r.translate(0,i.height),r.scale(1,-1);var a=n.height-i.height;r.drawImage(n,0,a,i.width,i.height,0,0,i.width,i.height)}function C(t,e){var n=e.targetCanvas.getContext("2d"),i=e.destinationWidth,r=e.destinationHeight,a=i*r*4,o=new Uint8Array(this.imageBuffer,0,a),s=new Uint8ClampedArray(this.imageBuffer,0,a);t.readPixels(0,0,i,r,t.RGBA,t.UNSIGNED_BYTE,o);var c=new ImageData(s,i,r);n.putImageData(c,0,0)}S.isTouchSupported="ontouchstart"in S.window||"ontouchstart"in S.document||S.window&&S.window.navigator&&S.window.navigator.maxTouchPoints>0,S.isLikelyNode="undefined"!=typeof Buffer&&"undefined"==typeof window,S.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],S.DPI=96,S.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",S.commaWsp="(?:\\s+,?\\s*|,\\s*)",S.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,S.reNonWord=/[ \n\.,;!\?\-]/,S.fontPaths={},S.iMatrix=[1,0,0,1,0,0],S.svgNS="http://www.w3.org/2000/svg",S.perfLimitSizeTotal=2097152,S.maxCacheSideLimit=4096,S.minCacheSideLimit=256,S.charWidthsCache={},S.textureSize=2048,S.disableStyleCopyPaste=!1,S.enableGLFiltering=!0,S.devicePixelRatio=S.window.devicePixelRatio||S.window.webkitDevicePixelRatio||S.window.mozDevicePixelRatio||1,S.browserShadowBlurConstant=1,S.arcToSegmentsCache={},S.boundsOfCurveCache={},S.cachesBoundsOfCurve=!0,S.forceGLPutImageData=!1,S.initFilterBackend=function(){return S.enableGLFiltering&&S.isWebglSupported&&S.isWebglSupported(S.textureSize)?(console.log("max texture size: "+S.maxTextureSize),new S.WebglFilterBackend({tileSize:S.textureSize})):S.Canvas2dFilterBackend?new S.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=S),function(){function t(t,e){if(this.__eventListeners[t]){var n=this.__eventListeners[t];e?n[n.indexOf(e)]=!1:S.util.array.fill(n,!1)}}function e(t,e){var n=function(){e.apply(this,arguments),this.off(t,n)}.bind(this);this.on(t,n)}S.Observable={fire:function(t,e){if(!this.__eventListeners)return this;var n=this.__eventListeners[t];if(!n)return this;for(var i=0,r=n.length;i<r;i++)n[i]&&n[i].call(this,e||{});return this.__eventListeners[t]=n.filter((function(t){return!1!==t})),this},on:function(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var n in t)this.on(n,t[n]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this},once:function(t,n){if(1===arguments.length)for(var i in t)e.call(this,i,t[i]);else e.call(this,t,n);return this},off:function(e,n){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 i in e)t.call(this,i,e[i]);else t.call(this,e,n);return this}}}(),S.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,n){var i=this._objects;return n?i[e]=t:i.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var t,e=this._objects,n=!1,i=0,r=arguments.length;i<r;i++)-1!==(t=e.indexOf(arguments[i]))&&(n=!0,e.splice(t,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[i]));return this.renderOnAddRemove&&n&&this.requestRenderAll(),this},forEachObject:function(t,e){for(var n=this.getObjects(),i=0,r=n.length;i<r;i++)t.call(e,n[i],i,n);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)}},S.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof S.Gradient||this.set(e,new S.Gradient(t))},_initPattern:function(t,e,n){!t||!t.source||t instanceof S.Pattern?n&&n():this.set(e,new S.Pattern(t,n))},_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]}},e=t,n=Math.sqrt,i=Math.atan2,r=Math.pow,a=Math.PI/180,o=Math.PI/2,S.util={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/o){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/o){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){var n=t.indexOf(e);return-1!==n&&t.splice(n,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,n){var i=new S.Point(t.x-e.x,t.y-e.y),r=S.util.rotateVector(i,n);return new S.Point(r.x,r.y).addEquals(e)},rotateVector:function(t,e){var n=S.util.sin(e),i=S.util.cos(e);return{x:t.x*i-t.y*n,y:t.x*n+t.y*i}},transformPoint:function(t,e,n){return n?new S.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new S.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 n=0;n<t.length;n++)t[n]=S.util.transformPoint(t[n],e);var i=[t[0].x,t[1].x,t[2].x,t[3].x],r=S.util.array.min(i),a=S.util.array.max(i)-r,o=[t[0].y,t[1].y,t[2].y,t[3].y],s=S.util.array.min(o);return{left:r,top:s,width:a,height:S.util.array.max(o)-s}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),n=[e*t[3],-e*t[1],-e*t[2],e*t[0]],i=S.util.transformPoint({x:t[4],y:t[5]},n,!0);return n[4]=-i.x,n[5]=-i.y,n},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var n=/\D{0,2}$/.exec(t),i=parseFloat(t);switch(e||(e=S.Text.DEFAULT_SVG_FONT_SIZE),n[0]){case"mm":return i*S.DPI/25.4;case"cm":return i*S.DPI/2.54;case"in":return i*S.DPI;case"pt":return i*S.DPI/72;case"pc":return i*S.DPI/72*12;case"em":return i*e;default:return i}},falseFunction:function(){return!1},getKlass:function(t,e){return t=S.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),S.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 S;var n,i=t.split("."),r=i.length,a=e||S.window;for(n=0;n<r;++n)a=a[i[n]];return a},loadImage:function(t,e,n,i){if(t){var r=S.util.createImage(),a=function(){e&&e.call(n,r,!1),r=r.onload=r.onerror=null};r.onload=a,r.onerror=function(){S.log("Error loading "+r.src),e&&e.call(n,null,!0),r=r.onload=r.onerror=null},0!==t.indexOf("data")&&null!=i&&(r.crossOrigin=i),"data:image/svg"===t.substring(0,14)&&(r.onload=null,S.util.loadImageInDom(r,a)),r.src=t}else e&&e.call(n,t)},loadImageInDom:function(t,e){var n=S.document.createElement("div");n.style.width=n.style.height="1px",n.style.left=n.style.top="-100%",n.style.position="absolute",n.appendChild(t),S.document.querySelector("body").appendChild(n),t.onload=function(){e(),n.parentNode.removeChild(n),n=null}},enlivenObjects:function(t,e,n,i){var r=[],a=0,o=(t=t||[]).length;function s(){++a===o&&e&&e(r.filter((function(t){return t})))}o?t.forEach((function(t,e){t&&t.type?S.util.getKlass(t.type,n).fromObject(t,(function(n,a){a||(r[e]=n),i&&i(t,n,a),s()})):s()})):e&&e(r)},enlivenPatterns:function(t,e){function n(){++r===a&&e&&e(i)}var i=[],r=0,a=(t=t||[]).length;a?t.forEach((function(t,e){t&&t.source?new S.Pattern(t,(function(t){i[e]=t,n()})):(i[e]=t,n())})):e&&e(i)},groupSVGElements:function(t,e,n){var i;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)),i=new S.Group(t,e),void 0!==n&&(i.sourcePath=n),i)},populateWithProperties:function(t,e,n){if(n&&"[object Array]"===Object.prototype.toString.call(n))for(var i=0,r=n.length;i<r;i++)n[i]in t&&(e[n[i]]=t[n[i]])},drawDashedLine:function(t,e,r,a,o,s){var c=a-e,u=o-r,l=n(c*c+u*u),h=i(u,c),f=s.length,d=0,g=!0;for(t.save(),t.translate(e,r),t.moveTo(0,0),t.rotate(h),e=0;l>e;)(e+=s[d++%f])>l&&(e=l),t[g?"lineTo":"moveTo"](e,0),g=!g;t.restore()},createCanvasElement:function(){return S.document.createElement("canvas")},copyCanvasElement:function(t){var e=S.util.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,n){return t.toDataURL("image/"+e,n)},createImage:function(){return S.document.createElement("img")},multiplyTransformMatrices:function(t,e,n){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],n?0:t[0]*e[4]+t[2]*e[5]+t[4],n?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var e=i(t[1],t[0]),o=r(t[0],2)+r(t[1],2),s=n(o),c=(t[0]*t[3]-t[2]*t[1])/s,u=i(t[0]*t[2]+t[1]*t[3],o);return{angle:e/a,scaleX:s,scaleY:c,skewX:u/a,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){if(!t.angle)return S.iMatrix.concat();var e=S.util.degreesToRadians(t.angle),n=S.util.cos(e),i=S.util.sin(e);return[n,i,-i,n,0,0]},calcDimensionsMatrix:function(t){var e=void 0===t.scaleX?1:t.scaleX,n=void 0===t.scaleY?1:t.scaleY,i=[t.flipX?-e:e,0,0,t.flipY?-n:n,0,0],r=S.util.multiplyTransformMatrices,a=S.util.degreesToRadians;return t.skewX&&(i=r(i,[1,0,Math.tan(a(t.skewX)),1],!0)),t.skewY&&(i=r(i,[1,Math.tan(a(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],n=S.util.multiplyTransformMatrices;return t.angle&&(e=n(e,S.util.calcRotateMatrix(t))),(1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY)&&(e=n(e,S.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,n,i){i>0&&(e>i?e-=i:e=0,n>i?n-=i:n=0);var r,a=!0,o=t.getImageData(e,n,2*i||1,2*i||1),s=o.data.length;for(r=3;r<s&&0!=(a=o.data[r]<=0);r+=4);return o=null,a},parsePreserveAspectRatioAttribute:function(t){var e,n="meet",i=t.split(" ");return i&&i.length&&("meet"!==(n=i.pop())&&"slice"!==n?(e=n,n="meet"):i.length&&(e=i.pop())),{meetOrSlice:n,alignX:"none"!==e?e.slice(1,4):"none",alignY:"none"!==e?e.slice(5,8):"none"}},clearFabricFontCache:function(t){(t=(t||"").toLowerCase())?S.charWidthsCache[t]&&delete S.charWidthsCache[t]:S.charWidthsCache={}},limitDimsByArea:function(t,e){var n=Math.sqrt(e*t),i=Math.floor(e/n);return{x:Math.floor(n),y:i}},capValue:function(t,e,n){return Math.max(t,Math.min(e,n))},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 S.util.toFixed(t,S.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(t,e){var n=S.util.invertTransform(e),i=S.util.multiplyTransformMatrices(n,t.calcOwnMatrix());S.util.applyTransformToObject(t,i)},addTransformToObject:function(t,e){S.util.applyTransformToObject(t,S.util.multiplyTransformMatrices(e,t.calcOwnMatrix()))},applyTransformToObject:function(t,e){var n=S.util.qrDecompose(e),i=new S.Point(n.translateX,n.translateY);t.flipX=!1,t.flipY=!1,t.set("scaleX",n.scaleX),t.set("scaleY",n.scaleY),t.skewX=n.skewX,t.skewY=n.skewY,t.angle=n.angle,t.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(t,e,n){var i=t/2,r=e/2,a=[{x:-i,y:-r},{x:i,y:-r},{x:-i,y:r},{x:i,y:r}],o=S.util.calcDimensionsMatrix(n),s=S.util.makeBoundingBoxFromPoints(a,o);return{x:s.width,y:s.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},n={m:"l",M:"L"};function i(t,e,n,i,r,a,o,s,c,u,l){var h=S.util.cos(t),f=S.util.sin(t),d=S.util.cos(e),g=S.util.sin(e),p=n*r*d-i*a*g+o,b=i*r*d+n*a*g+s;return["C",u+c*(-n*r*f-i*a*h),l+c*(-i*r*f+n*a*h),p+c*(n*r*g+i*a*d),b+c*(i*r*g-n*a*d),p,b]}function r(t,e,n,r,o,s,c){var u=Math.PI,l=c*u/180,h=S.util.sin(l),f=S.util.cos(l),d=0,g=0,p=-f*t*.5-h*e*.5,b=-f*e*.5+h*t*.5,v=(n=Math.abs(n))*n,m=(r=Math.abs(r))*r,w=b*b,y=p*p,x=v*m-v*w-m*y,_=0;if(x<0){var k=Math.sqrt(1-x/(v*m));n*=k,r*=k}else _=(o===s?-1:1)*Math.sqrt(x/(v*w+m*y));var T=_*n*b/r,C=-_*r*p/n,M=f*T-h*C+.5*t,E=h*T+f*C+.5*e,I=a(1,0,(p-T)/n,(b-C)/r),A=a((p-T)/n,(b-C)/r,(-p-T)/n,(-b-C)/r);0===s&&A>0?A-=2*u:1===s&&A<0&&(A+=2*u);for(var P=Math.ceil(Math.abs(A/u*2)),O=[],L=A/P,D=8/3*Math.sin(L/4)*Math.sin(L/4)/Math.sin(L/2),j=I+L,N=0;N<P;N++)O[N]=i(I,j,f,h,n,r,M,E,D,d,g),d=O[N][5],g=O[N][6],I=j,j+=L;return O}function a(t,e,n,i){var r=Math.atan2(e,t),a=Math.atan2(i,n);return a>=r?a-r:2*Math.PI-(r-a)}function o(e,n,i,r,a,o,s,c){var u;if(S.cachesBoundsOfCurve&&(u=t.call(arguments),S.boundsOfCurveCache[u]))return S.boundsOfCurveCache[u];var l,h,f,d,g,p,b,v,m=Math.sqrt,w=Math.min,y=Math.max,x=Math.abs,_=[],k=[[],[]];h=6*e-12*i+6*a,l=-3*e+9*i-9*a+3*s,f=3*i-3*e;for(var T=0;T<2;++T)if(T>0&&(h=6*n-12*r+6*o,l=-3*n+9*r-9*o+3*c,f=3*r-3*n),x(l)<1e-12){if(x(h)<1e-12)continue;0<(d=-f/h)&&d<1&&_.push(d)}else(b=h*h-4*f*l)<0||(0<(g=(-h+(v=m(b)))/(2*l))&&g<1&&_.push(g),0<(p=(-h-v)/(2*l))&&p<1&&_.push(p));for(var C,M,E,I=_.length,A=I;I--;)C=(E=1-(d=_[I]))*E*E*e+3*E*E*d*i+3*E*d*d*a+d*d*d*s,k[0][I]=C,M=E*E*E*n+3*E*E*d*r+3*E*d*d*o+d*d*d*c,k[1][I]=M;k[0][A]=e,k[1][A]=n,k[0][A+1]=s,k[1][A+1]=c;var P=[{x:w.apply(null,k[0]),y:w.apply(null,k[1])},{x:y.apply(null,k[0]),y:y.apply(null,k[1])}];return S.cachesBoundsOfCurve&&(S.boundsOfCurveCache[u]=P),P}function s(t,e,n){for(var i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],u=r(n[6]-t,n[7]-e,i,a,s,c,o),l=0,h=u.length;l<h;l++)u[l][1]+=t,u[l][2]+=e,u[l][3]+=t,u[l][4]+=e,u[l][5]+=t,u[l][6]+=e;return u}function c(t,e,n,i){return Math.sqrt((n-t)*(n-t)+(i-e)*(i-e))}function u(t,e,n,i,r,a,o,s){return function(c){var u,l=(u=c)*u*u,h=function(t){return 3*t*t*(1-t)}(c),f=function(t){return 3*t*(1-t)*(1-t)}(c),d=function(t){return(1-t)*(1-t)*(1-t)}(c);return{x:o*l+r*h+n*f+t*d,y:s*l+a*h+i*f+e*d}}}function l(t,e,n,i,r,a,o,s){return function(c){var u=1-c,l=3*u*u*(n-t)+6*u*c*(r-n)+3*c*c*(o-r),h=3*u*u*(i-e)+6*u*c*(a-i)+3*c*c*(s-a);return Math.atan2(h,l)}}function h(t,e,n,i,r,a){return function(o){var s,c=(s=o)*s,u=function(t){return 2*t*(1-t)}(o),l=function(t){return(1-t)*(1-t)}(o);return{x:r*c+n*u+t*l,y:a*c+i*u+e*l}}}function f(t,e,n,i,r,a){return function(o){var s=1-o,c=2*s*(n-t)+2*o*(r-n),u=2*s*(i-e)+2*o*(a-i);return Math.atan2(u,c)}}function d(t,e,n){var i,r,a={x:e,y:n},o=0;for(r=1;r<=100;r+=1)i=t(r/100),o+=c(a.x,a.y,i.x,i.y),a=i;return o}function g(t,e){for(var n,i,r,a=0,o=0,s=t.iterator,u={x:t.x,y:t.y},l=.01,h=t.angleFinder;o<e&&a<=1&&l>1e-4;)n=s(a),r=a,(i=c(u.x,u.y,n.x,n.y))+o>e?a-=l/=2:(u=n,a+=l,o+=i);return n.angle=h(r),n}function p(t){for(var e,n,i,r,a=0,o=t.length,s=0,g=0,p=0,b=0,v=[],m=0;m<o;m++){switch(i={x:s,y:g,command:(e=t[m])[0]},e[0]){case"M":i.length=0,p=s=e[1],b=g=e[2];break;case"L":i.length=c(s,g,e[1],e[2]),s=e[1],g=e[2];break;case"C":n=u(s,g,e[1],e[2],e[3],e[4],e[5],e[6]),r=l(s,g,e[1],e[2],e[3],e[4],e[5],e[6]),i.iterator=n,i.angleFinder=r,i.length=d(n,s,g),s=e[5],g=e[6];break;case"Q":n=h(s,g,e[1],e[2],e[3],e[4]),r=f(s,g,e[1],e[2],e[3],e[4]),i.iterator=n,i.angleFinder=r,i.length=d(n,s,g),s=e[3],g=e[4];break;case"Z":case"z":i.destX=p,i.destY=b,i.length=c(s,g,p,b),s=p,g=b}a+=i.length,v.push(i)}return v.push({length:a,x:s,y:g}),v}S.util.joinPath=function(t){return t.map((function(t){return t.join(" ")})).join(" ")},S.util.parsePath=function(t){var i,r,a,o,s,c=[],u=[],l=S.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+h+")"+S.commaWsp,d="([01])"+S.commaWsp+"?",g=new RegExp(f+"?"+f+"?"+f+d+d+f+"?("+h+")","g");if(!t||!t.match)return c;for(var p,b=0,v=(s=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;b<v;b++){o=(i=s[b]).slice(1).trim(),u.length=0;var m=i.charAt(0);if(p=[m],"a"===m.toLowerCase())for(var w;w=g.exec(o);)for(var y=1;y<w.length;y++)u.push(w[y]);else for(;a=l.exec(o);)u.push(a[0]);y=0;for(var x=u.length;y<x;y++)r=parseFloat(u[y]),isNaN(r)||p.push(r);var _=e[m.toLowerCase()],k=n[m]||m;if(p.length-1>_)for(var T=1,C=p.length;T<C;T+=_)c.push([m].concat(p.slice(T,T+_))),m=k;else c.push(p)}return c},S.util.makePathSimpler=function(t){var e,n,i,r,a,o,c=0,u=0,l=t.length,h=0,f=0,d=[];for(n=0;n<l;++n){switch(i=!1,(e=t[n].slice(0))[0]){case"l":e[0]="L",e[1]+=c,e[2]+=u;case"L":c=e[1],u=e[2];break;case"h":e[1]+=c;case"H":e[0]="L",e[2]=u,c=e[1];break;case"v":e[1]+=u;case"V":e[0]="L",u=e[1],e[1]=c,e[2]=u;break;case"m":e[0]="M",e[1]+=c,e[2]+=u;case"M":c=e[1],u=e[2],h=e[1],f=e[2];break;case"c":e[0]="C",e[1]+=c,e[2]+=u,e[3]+=c,e[4]+=u,e[5]+=c,e[6]+=u;case"C":a=e[3],o=e[4],c=e[5],u=e[6];break;case"s":e[0]="S",e[1]+=c,e[2]+=u,e[3]+=c,e[4]+=u;case"S":"C"===r?(a=2*c-a,o=2*u-o):(a=c,o=u),c=e[3],u=e[4],e[0]="C",e[5]=e[3],e[6]=e[4],e[3]=e[1],e[4]=e[2],e[1]=a,e[2]=o,a=e[3],o=e[4];break;case"q":e[0]="Q",e[1]+=c,e[2]+=u,e[3]+=c,e[4]+=u;case"Q":a=e[1],o=e[2],c=e[3],u=e[4];break;case"t":e[0]="T",e[1]+=c,e[2]+=u;case"T":"Q"===r?(a=2*c-a,o=2*u-o):(a=c,o=u),e[0]="Q",c=e[1],u=e[2],e[1]=a,e[2]=o,e[3]=c,e[4]=u;break;case"a":e[0]="A",e[6]+=c,e[7]+=u;case"A":i=!0,d=d.concat(s(c,u,e)),c=e[6],u=e[7];break;case"z":case"Z":c=h,u=f}i||d.push(e),r=e[0]}return d},S.util.getSmoothPathFromPoints=function(t,e){var n,i=[],r=new S.Point(t[0].x,t[0].y),a=new S.Point(t[1].x,t[1].y),o=t.length,s=1,c=0,u=o>2;for(e=e||0,u&&(s=t[2].x<a.x?-1:t[2].x===a.x?0:1,c=t[2].y<a.y?-1:t[2].y===a.y?0:1),i.push(["M",r.x-s*e,r.y-c*e]),n=1;n<o;n++){if(!r.eq(a)){var l=r.midPointFrom(a);i.push(["Q",r.x,r.y,l.x,l.y])}r=t[n],n+1<t.length&&(a=t[n+1])}return u&&(s=r.x>t[n-2].x?1:r.x===t[n-2].x?0:-1,c=r.y>t[n-2].y?1:r.y===t[n-2].y?0:-1),i.push(["L",r.x+s*e,r.y+c*e]),i},S.util.getPathSegmentsInfo=p,S.util.getBoundsOfCurve=o,S.util.getPointOnPath=function(t,e,n){n||(n=p(t));for(var i=0;e-n[i].length>0&&i<n.length-2;)e-=n[i].length,i++;var r,a=n[i],o=e/a.length,s=a.command,c=t[i];switch(s){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(r=new S.Point(a.x,a.y).lerp(new S.Point(a.destX,a.destY),o)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),r;case"L":return(r=new S.Point(a.x,a.y).lerp(new S.Point(c[1],c[2]),o)).angle=Math.atan2(c[2]-a.y,c[1]-a.x),r;case"C":case"Q":return g(a,e)}},S.util.transformPath=function(t,e,n){return n&&(e=S.util.multiplyTransformMatrices(e,[1,0,0,1,-n.x,-n.y])),t.map((function(t){for(var n=t.slice(0),i={},r=1;r<t.length-1;r+=2)i.x=t[r],i.y=t[r+1],i=S.util.transformPoint(i,e),n[r]=i.x,n[r+1]=i.y;return n}))},S.util.fromArcToBeizers=s,S.util.getBoundsOfArc=function(t,e,n,i,a,s,c,u,l){for(var h,f=0,d=0,g=[],p=r(u-t,l-e,n,i,s,c,a),b=0,v=p.length;b<v;b++)h=o(f,d,p[b][1],p[b][2],p[b][3],p[b][4],p[b][5],p[b][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[b][5],d=p[b][6];return g},S.util.drawArc=function(t,e,n,i){s(e,n,i=i.slice(0).unshift("X")).forEach((function(e){t.bezierCurveTo.apply(t,e.slice(1))}))}}(),function(){var t=Array.prototype.slice;function e(t,e,n){if(t&&0!==t.length){var i=t.length-1,r=e?t[i][e]:t[i];if(e)for(;i--;)n(t[i][e],r)&&(r=t[i][e]);else for(;i--;)n(t[i],r)&&(r=t[i]);return r}}S.util.array={fill:function(t,e){for(var n=t.length;n--;)t[n]=e;return t},invoke:function(e,n){for(var i=t.call(arguments,2),r=[],a=0,o=e.length;a<o;a++)r[a]=i.length?e[a][n].apply(e[a],i):e[a][n].call(e[a]);return r},min:function(t,n){return e(t,n,(function(t,e){return t<e}))},max:function(t,n){return e(t,n,(function(t,e){return t>=e}))}}}(),function(){function t(e,n,i){if(i)if(!S.isLikelyNode&&n instanceof Element)e=n;else if(n instanceof Array){e=[];for(var r=0,a=n.length;r<a;r++)e[r]=t({},n[r],i)}else if(n&&"object"==typeof n)for(var o in n)"canvas"===o||"group"===o?e[o]=null:n.hasOwnProperty(o)&&(e[o]=t({},n[o],i));else e=n;else for(var o in n)e[o]=n[o];return e}S.util.object={extend:t,clone:function(e,n){return t({},e,n)}},S.util.object.extend(S.util,S.Observable)}(),function(){function t(t,e){var n=t.charCodeAt(e);if(isNaN(n))return"";if(n<55296||n>57343)return t.charAt(e);if(55296<=n&&n<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var i=t.charCodeAt(e+1);if(56320>i||i>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}S.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 n,i=0,r=[];for(i=0;i<e.length;i++)!1!==(n=t(e,i))&&r.push(n);return r}}}(),function(){var t=Array.prototype.slice,e=function(){},n=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),i=function(t,e,i){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 n=this.constructor.superclass;this.constructor.superclass=i;var r=e[t].apply(this,arguments);if(this.constructor.superclass=n,"initialize"!==t)return r}}(r):t.prototype[r]=e[r],n&&(e.toString!==Object.prototype.toString&&(t.prototype.toString=e.toString),e.valueOf!==Object.prototype.valueOf&&(t.prototype.valueOf=e.valueOf))};function r(){}function a(e){for(var n=null,i=this;i.constructor.superclass;){var r=i.constructor.superclass.prototype[e];if(i[e]!==r){n=r;break}i=i.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,t.call(arguments,1)):n.call(this):console.log("tried to callSuper "+e+", method not found in prototype chain",this)}S.util.createClass=function(){var n=null,o=t.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof o[0]&&(n=o.shift()),s.superclass=n,s.subclasses=[],n&&(r.prototype=n.prototype,s.prototype=new r,n.subclasses.push(s));for(var c=0,u=o.length;c<u;c++)i(s,o[c],n);return s.prototype.initialize||(s.prototype.initialize=e),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),s=!!S.document.createElement("div").attachEvent,c=["touchstart","touchmove","touchend"],S.util.addListener=function(t,e,n,i){t&&t.addEventListener(e,n,!s&&i)},S.util.removeListener=function(t,e,n,i){t&&t.removeEventListener(e,n,!s&&i)},S.util.getPointer=function(t){var e=t.target,n=S.util.getScrollLeftTop(e),i=function(t){var e=t.changedTouches;return e&&e[0]?e[0]:t}(t);return{x:i.clientX+n.left,y:i.clientY+n.top}},S.util.isTouchEvent=function(t){return c.indexOf(t.type)>-1||"touch"===t.pointerType},u=S.document.createElement("div"),l="string"==typeof u.style.opacity,h="string"==typeof u.style.filter,f=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,d=function(t){return t},l?d=function(t,e){return t.style.opacity=e,t}:h&&(d=function(t,e){var n=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(n.zoom=1),f.test(n.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",n.filter=n.filter.replace(f,e)):n.filter+=" alpha(opacity="+100*e+")",t}),S.util.setStyle=function(t,e){var n=t.style;if(!n)return t;if("string"==typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?d(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var i in e)"opacity"===i?d(t,e[i]):n["float"===i||"cssFloat"===i?void 0===n.styleFloat?"cssFloat":"styleFloat":i]=e[i];return t},function(){var t,e,n,i,r=Array.prototype.slice,a=function(t){return r.call(t,0)};try{t=a(S.document.childNodes)instanceof Array}catch(c){}function o(t,e){var n=S.document.createElement(t);for(var i in e)"class"===i?n.className=e[i]:"for"===i?n.htmlFor=e[i]:n.setAttribute(i,e[i]);return n}function s(t){for(var e=0,n=0,i=S.document.documentElement,r=S.document.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===S.document?(e=r.scrollLeft||i.scrollLeft||0,n=r.scrollTop||i.scrollTop||0):(e+=t.scrollLeft||0,n+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:n}}t||(a=function(t){for(var e=new Array(t.length),n=t.length;n--;)e[n]=t[n];return e}),e=S.document.defaultView&&S.document.defaultView.getComputedStyle?function(t,e){var n=S.document.defaultView.getComputedStyle(t,null);return n?n[e]:void 0}:function(t,e){var n=t.style[e];return!n&&t.currentStyle&&(n=t.currentStyle[e]),n},n=S.document.documentElement.style,i="userSelect"in n?"userSelect":"MozUserSelect"in n?"MozUserSelect":"WebkitUserSelect"in n?"WebkitUserSelect":"KhtmlUserSelect"in n?"KhtmlUserSelect":"",S.util.makeElementUnselectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=S.util.falseFunction),i?t.style[i]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},S.util.makeElementSelectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=null),i?t.style[i]="":"string"==typeof t.unselectable&&(t.unselectable=""),t},S.util.setImageSmoothing=function(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e},S.util.getById=function(t){return"string"==typeof t?S.document.getElementById(t):t},S.util.toArray=a,S.util.addClass=function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},S.util.makeElement=o,S.util.wrapElement=function(t,e,n){return"string"==typeof e&&(e=o(e,n)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},S.util.getScrollLeftTop=s,S.util.getElementOffset=function(t){var n,i,r=t&&t.ownerDocument,a={left:0,top:0},o={left:0,top:0},c={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return o;for(var u in c)o[c[u]]+=parseInt(e(t,u),10)||0;return n=r.documentElement,void 0!==t.getBoundingClientRect&&(a=t.getBoundingClientRect()),i=s(t),{left:a.left+i.left-(n.clientLeft||0)+o.left,top:a.top+i.top-(n.clientTop||0)+o.top}},S.util.getNodeCanvas=function(t){var e=S.jsdomImplForWrapper(t);return e._canvas||e._image},S.util.cleanUpJsdomNode=function(t){if(S.isLikelyNode){var e=S.jsdomImplForWrapper(t);e&&(e._image=null,e._canvas=null,e._currentSrc=null,e._attributes=null,e._classList=null)}}}(),function(){function t(){}S.util.request=function(e,n){n||(n={});var i=n.method?n.method.toUpperCase():"GET",r=n.onComplete||function(){},a=new S.window.XMLHttpRequest,o=n.body||n.parameters;return a.onreadystatechange=function(){4===a.readyState&&(r(a),a.onreadystatechange=t)},"GET"===i&&(o=null,"string"==typeof n.parameters&&(e=function(t,e){return t+(/\?/.test(t)?"&":"?")+e}(e,n.parameters))),a.open(i,e,!0),"POST"!==i&&"PUT"!==i||a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(o),a}}(),S.log=console.log,S.warn=console.warn,function(){function t(){return!1}function e(t,e,n,i){return-n*Math.cos(t/i*(Math.PI/2))+n+e}var n=S.window.requestAnimationFrame||S.window.webkitRequestAnimationFrame||S.window.mozRequestAnimationFrame||S.window.oRequestAnimationFrame||S.window.msRequestAnimationFrame||function(t){return S.window.setTimeout(t,1e3/60)},i=S.window.cancelAnimationFrame||S.window.clearTimeout;function r(){return n.apply(S.window,arguments)}S.util.animate=function(n){var i=!1;return r((function(a){n||(n={});var o,s=a||+new Date,c=n.duration||500,u=s+c,l=n.onChange||t,h=n.abort||t,f=n.onComplete||t,d=n.easing||e,g="startValue"in n?n.startValue:0,p="endValue"in n?n.endValue:100,b=n.byValue||p-g;n.onStart&&n.onStart(),function t(e){var n=(o=e||+new Date)>u?c:o-s,a=n/c,v=d(n,g,b,c),m=Math.abs((v-g)/b);if(!i){if(!h(v,m,a))return o>u?(l(p,1,1),void f(p,1,1)):(l(v,m,a),void r(t));f(p,1,1)}}(s)})),function(){i=!0}},S.util.requestAnimFrame=r,S.util.cancelAnimFrame=function(){return i.apply(S.window,arguments)}}(),function(){function t(t,e,n){var i="rgba("+parseInt(t[0]+n*(e[0]-t[0]),10)+","+parseInt(t[1]+n*(e[1]-t[1]),10)+","+parseInt(t[2]+n*(e[2]-t[2]),10);return i+=","+(t&&e?parseFloat(t[3]+n*(e[3]-t[3])):1),i+=")"}S.util.animateColor=function(e,n,i,r){var a=new S.Color(e).getSource(),o=new S.Color(n).getSource(),s=r.onComplete,c=r.onChange;return r=r||{},S.util.animate(S.util.object.extend(r,{duration:i||500,startValue:a,endValue:o,byValue:o,easing:function(e,n,i,a){return t(n,i,r.colorEasing?r.colorEasing(e,a):1-Math.cos(e/a*(Math.PI/2)))},onComplete:function(e,n,i){if(s)return s(t(o,o,0),n,i)},onChange:function(e,n,i){if(c){if(Array.isArray(e))return c(t(e,e,0),n,i);c(e,n,i)}}}))}}(),function(){function t(t,e,n,i){return t<Math.abs(e)?(t=e,i=n/4):i=0===e&&0===t?n/(2*Math.PI)*Math.asin(1):n/(2*Math.PI)*Math.asin(e/t),{a:t,c:e,p:n,s:i}}function e(t,e,n){return t.a*Math.pow(2,10*(e-=1))*Math.sin((e*n-t.s)*(2*Math.PI)/t.p)}function n(t,e,n,r){return n-i(r-t,0,n,r)+e}function i(t,e,n,i){return(t/=i)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e}S.util.ease={easeInQuad:function(t,e,n,i){return n*(t/=i)*t+e},easeOutQuad:function(t,e,n,i){return-n*(t/=i)*(t-2)+e},easeInOutQuad:function(t,e,n,i){return(t/=i/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,n,i){return n*(t/=i)*t*t+e},easeOutCubic:function(t,e,n,i){return n*((t=t/i-1)*t*t+1)+e},easeInOutCubic:function(t,e,n,i){return(t/=i/2)<1?n/2*t*t*t+e:n/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,n,i){return n*(t/=i)*t*t*t+e},easeOutQuart:function(t,e,n,i){return-n*((t=t/i-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,n,i){return(t/=i/2)<1?n/2*t*t*t*t+e:-n/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,n,i){return n*(t/=i)*t*t*t*t+e},easeOutQuint:function(t,e,n,i){return n*((t=t/i-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,n,i){return(t/=i/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,n,i){return-n*Math.cos(t/i*(Math.PI/2))+n+e},easeOutSine:function(t,e,n,i){return n*Math.sin(t/i*(Math.PI/2))+e},easeInOutSine:function(t,e,n,i){return-n/2*(Math.cos(Math.PI*t/i)-1)+e},easeInExpo:function(t,e,n,i){return 0===t?e:n*Math.pow(2,10*(t/i-1))+e},easeOutExpo:function(t,e,n,i){return t===i?e+n:n*(1-Math.pow(2,-10*t/i))+e},easeInOutExpo:function(t,e,n,i){return 0===t?e:t===i?e+n:(t/=i/2)<1?n/2*Math.pow(2,10*(t-1))+e:n/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,n,i){return-n*(Math.sqrt(1-(t/=i)*t)-1)+e},easeOutCirc:function(t,e,n,i){return n*Math.sqrt(1-(t=t/i-1)*t)+e},easeInOutCirc:function(t,e,n,i){return(t/=i/2)<1?-n/2*(Math.sqrt(1-t*t)-1)+e:n/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(n,i,r,a){var o=0;return 0===n?i:1===(n/=a)?i+r:(o||(o=.3*a),-e(t(r,r,o,1.70158),n,a)+i)},easeOutElastic:function(e,n,i,r){var a=0;if(0===e)return n;if(1===(e/=r))return n+i;a||(a=.3*r);var o=t(i,i,a,1.70158);return o.a*Math.pow(2,-10*e)*Math.sin((e*r-o.s)*(2*Math.PI)/o.p)+o.c+n},easeInOutElastic:function(n,i,r,a){var o=0;if(0===n)return i;if(2==(n/=a/2))return i+r;o||(o=a*(.3*1.5));var s=t(r,r,o,1.70158);return n<1?-.5*e(s,n,a)+i:s.a*Math.pow(2,-10*(n-=1))*Math.sin((n*a-s.s)*(2*Math.PI)/s.p)*.5+s.c+i},easeInBack:function(t,e,n,i,r){return void 0===r&&(r=1.70158),n*(t/=i)*t*((r+1)*t-r)+e},easeOutBack:function(t,e,n,i,r){return void 0===r&&(r=1.70158),n*((t=t/i-1)*t*((r+1)*t+r)+1)+e},easeInOutBack:function(t,e,n,i,r){return void 0===r&&(r=1.70158),(t/=i/2)<1?n/2*(t*t*((1+(r*=1.525))*t-r))+e:n/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},easeInBounce:n,easeOutBounce:i,easeInOutBounce:function(t,e,r,a){return t<a/2?.5*n(2*t,0,r,a)+e:.5*i(2*t-a,0,r,a)+.5*r+e}}}(),function(t){var e=t.fabric||(t.fabric={}),n=e.util.object.extend,i=e.util.object.clone,r=e.util.toFixed,a=e.util.parseUnit,o=e.util.multiplyTransformMatrices,s={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"},c={stroke:"strokeOpacity",fill:"fillOpacity"},u="font-size",l="clip-path";function h(t){return t in s?s[t]:t}function f(t,n,i,r){var s,c="[object Array]"===Object.prototype.toString.call(n);if("fill"!==t&&"stroke"!==t||"none"!==n){if("strokeUniform"===t)return"non-scaling-stroke"===n;if("strokeDashArray"===t)n="none"===n?null:n.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)n=i&&i.transformMatrix?o(i.transformMatrix,e.parseTransformAttribute(n)):e.parseTransformAttribute(n);else if("visible"===t)n="none"!==n&&"hidden"!==n,i&&!1===i.visible&&(n=!1);else if("opacity"===t)n=parseFloat(n),i&&void 0!==i.opacity&&(n*=i.opacity);else if("textAnchor"===t)n="start"===n?"left":"end"===n?"right":"center";else if("charSpacing"===t)s=a(n,r)/r*1e3;else if("paintFirst"===t){var u=n.indexOf("fill"),l=n.indexOf("stroke");n="fill",(u>-1&&l>-1&&l<u||-1===u&&l>-1)&&(n="stroke")}else{if("href"===t||"xlink:href"===t||"font"===t)return n;if("imageSmoothing"===t)return"optimizeQuality"===n;s=c?n.map(a):a(n,r)}}else n="";return!c&&isNaN(s)?n:s}function d(t){return new RegExp("^("+t.join("|")+")\\b","i")}function g(t,e){var n,i,r,a,o=[];for(r=0,a=e.length;r<a;r++)n=e[r],i=t.getElementsByTagName(n),o=o.concat(Array.prototype.slice.call(i));return o}function p(t,e){var n,i=!0;return(n=b(t,e.pop()))&&e.length&&(i=function(t,e){for(var n,i=!0;t.parentNode&&1===t.parentNode.nodeType&&e.length;)i&&(n=e.pop()),i=b(t=t.parentNode,n);return 0===e.length}(t,e)),n&&i&&0===e.length}function b(t,e){var n,i,r=t.nodeName,a=t.getAttribute("class"),o=t.getAttribute("id");if(n=new RegExp("^"+r,"i"),e=e.replace(n,""),o&&e.length&&(n=new RegExp("#"+o+"(?![a-zA-Z\\-]+)","i"),e=e.replace(n,"")),a&&e.length)for(i=(a=a.split(" ")).length;i--;)n=new RegExp("\\."+a[i]+"(?![a-zA-Z\\-]+)","i"),e=e.replace(n,"");return 0===e.length}function v(t,e){var n;if(t.getElementById&&(n=t.getElementById(e)),n)return n;var i,r,a,o=t.getElementsByTagName("*");for(r=0,a=o.length;r<a;r++)if(e===(i=o[r]).getAttribute("id"))return i}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,n,i){t[i]=Math.tan(e.util.degreesToRadians(n[0]))}var n=e.iMatrix,i=e.reNum,r=e.commaWsp,a="(?:(?:(matrix)\\s*\\(\\s*("+i+")"+r+"("+i+")"+r+"("+i+")"+r+"("+i+")"+r+"("+i+")"+r+"("+i+")\\s*\\))|(?:(translate)\\s*\\(\\s*("+i+")(?:"+r+"("+i+"))?\\s*\\))|(?:(scale)\\s*\\(\\s*("+i+")(?:"+r+"("+i+"))?\\s*\\))|(?:(rotate)\\s*\\(\\s*("+i+")(?:"+r+"("+i+")"+r+"("+i+"))?\\s*\\))|(?:(skewX)\\s*\\(\\s*("+i+")\\s*\\))|(?:(skewY)\\s*\\(\\s*("+i+")\\s*\\)))",o=new RegExp("^\\s*(?:(?:"+a+"(?:"+r+"*"+a+")*)?)\\s*$"),s=new RegExp(a,"g");return function(i){var r=n.concat(),c=[];if(!i||i&&!o.test(i))return r;i.replace(s,(function(i){var o=new RegExp(a).exec(i).filter((function(t){return!!t})),s=o[1],u=o.slice(2).map(parseFloat);switch(s){case"translate":!function(t,e){t[4]=e[0],2===e.length&&(t[5]=e[1])}(r,u);break;case"rotate":u[0]=e.util.degreesToRadians(u[0]),function(t,n){var i=e.util.cos(n[0]),r=e.util.sin(n[0]),a=0,o=0;3===n.length&&(a=n[1],o=n[2]),t[0]=i,t[1]=r,t[2]=-r,t[3]=i,t[4]=a-(i*a-r*o),t[5]=o-(r*a+i*o)}(r,u);break;case"scale":!function(t,e){var n=e[0],i=2===e.length?e[1]:e[0];t[0]=n,t[3]=i}(r,u);break;case"skewX":t(r,u,2);break;case"skewY":t(r,u,1);break;case"matrix":r=u}c.push(r.concat()),r=n.concat()}));for(var u=c[0];c.length>1;)c.shift(),u=e.util.multiplyTransformMatrices(u,c[0]);return u}}();var m=new RegExp("^\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*$");function w(t){if(!e.svgViewBoxElementsRegEx.test(t.nodeName))return{};var n,i,r,o,s,c,u=t.getAttribute("viewBox"),l=1,h=1,f=t.getAttribute("width"),d=t.getAttribute("height"),g=t.getAttribute("x")||0,p=t.getAttribute("y")||0,b=t.getAttribute("preserveAspectRatio")||"",v=!u||!(u=u.match(m)),w=!f||!d||"100%"===f||"100%"===d,y=v&&w,x={},_="",S=0,k=0;if(x.width=0,x.height=0,x.toBeParsed=y,v&&(g||p)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(_=" translate("+a(g)+" "+a(p)+") ",s=(t.getAttribute("transform")||"")+_,t.setAttribute("transform",s),t.removeAttribute("x"),t.removeAttribute("y")),y)return x;if(v)return x.width=a(f),x.height=a(d),x;if(n=-parseFloat(u[1]),i=-parseFloat(u[2]),r=parseFloat(u[3]),o=parseFloat(u[4]),x.minX=n,x.minY=i,x.viewBoxWidth=r,x.viewBoxHeight=o,w?(x.width=r,x.height=o):(x.width=a(f),x.height=a(d),l=x.width/r,h=x.height/o),