UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

1 lines 142 kB
module.exports=function(r){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={exports:{},id:t,loaded:!1};return r[t].call(e.exports,e,e.exports,o),e.loaded=!0,e.exports}return o.m=r,o.c=n,o.p="",o(0)}({0:function(t,e,r){t.exports=r(955)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},955:function(t,e,r){var n;r(3),r=[r(956),r(957),r(958)],void 0===(e="function"==typeof(n=function(){var v=window.kendo.jQuery;window.kendo=window.kendo||{};var t,e=kendo.drawing.util,f=e.extendStatic,a=kendo.Class,s=kendo.util,r,p=kendo.support.browser,d=e.createPromise,c=e.promiseAll,n=function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;e.prototype.observers=function t(){this._observers=this._observers||[];return this._observers};e.prototype.addObserver=function t(e){if(!this._observers)this._observers=[e];else this._observers.push(e);return this};e.prototype.removeObserver=function t(e){var r=this.observers();var n=r.indexOf(e);if(n!==-1)r.splice(n,1);return this};e.prototype.trigger=function t(e,r){var n=this._observers;if(n&&!this._suspended)for(var o=0;o<n.length;o++){var i=n[o];if(i[e])i[e](r)}return this};e.prototype.optionsChange=function t(e){if(e===void 0)e={};e.element=this;this.trigger("optionsChange",e)};e.prototype.geometryChange=function t(){this.trigger("geometryChange",{element:this})};e.prototype.suspend=function t(){this._suspended=(this._suspended||0)+1;return this};e.prototype.resume=function t(){this._suspended=Math.max((this._suspended||0)-1,0);return this};e.prototype._observerField=function t(e,r){if(this[e])this[e].removeObserver(this);this[e]=r;r.addObserver(this)};return e}(a);function h(t,e){t.push.apply(t,e);return t}var o={1:"i",10:"x",100:"c",2:"ii",20:"xx",200:"cc",3:"iii",30:"xxx",300:"ccc",4:"iv",40:"xl",400:"cd",5:"v",50:"l",500:"d",6:"vi",60:"lx",600:"dc",7:"vii",70:"lxx",700:"dcc",8:"viii",80:"lxxx",800:"dccc",9:"ix",90:"xc",900:"cm",1e3:"m"};function L(t){var e=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1];var r="";while(t>0)if(t<e[0])e.shift();else{r+=o[e[0]];t-=e[0]}return r}var u="undefined";function l(t){return typeof t!==u}var y=1;function g(){return"kdef"+y++}var m=Math.PI/180,x=Number.MAX_VALUE,w=-Number.MAX_VALUE;function I(t){return t/m}var b=String.fromCharCode;function _(t){var e="";for(var r=0;r<t.length;r++){var n=t.charCodeAt(r);if(55296<=n&&n<=56319){var o=n;var i=t.charCodeAt(++r);if(!isNaN(i))n=(o-55296)*1024+(i-56320)+65536}if(n<128)e+=b(n);else if(n<2048){e+=b(192|n>>>6);e+=b(128|n&63)}else if(n<65536){e+=b(224|n>>>12);e+=b(128|n>>>6&63);e+=b(128|n&63)}else if(n<1114111){e+=b(240|n>>>18);e+=b(128|n>>>12&63);e+=b(128|n>>>6&63);e+=b(128|n&63)}}return e}var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function T(t){var e="";var r=0;var n=_(t);while(r<n.length){var o=n.charCodeAt(r++);var i=n.charCodeAt(r++);var a=n.charCodeAt(r++);var s=o>>2;var h=(o&3)<<4|i>>4;var p=(i&15)<<2|a>>6;var c=a&63;if(isNaN(i))p=c=64;else if(isNaN(a))c=64;e=e+C.charAt(s)+C.charAt(h)+C.charAt(p)+C.charAt(c)}return e}function k(t){if(l((t.x||{}).location))return{x:t.x.location,y:t.y.location};return{x:t.pageX||t.clientX||0,y:t.pageY||t.clientY||0}}function M(t){if(t===void 0)t={};return t.touch?t.touch.initialTouch:t.target}function S(t){return t===""||t===null||t==="none"||t==="transparent"||!l(t)}function E(t){if(t)return t[t.length-1]}function A(t,e,r){return Math.max(Math.min(t,r),e)}function P(t,a){if(t.length<2)return t.slice();function i(t,e){var r=[],n=0,o=0,i=0;while(n<t.length&&o<e.length)if(a(t[n],e[o])<=0)r[i++]=t[n++];else r[i++]=e[o++];if(n<t.length)r.push.apply(r,t.slice(n));if(o<e.length)r.push.apply(r,e.slice(o));return r}return function t(e){if(e.length<=1)return e;var r=Math.floor(e.length/2);var n=e.slice(0,r);var o=e.slice(r);n=t(n);o=t(o);return i(n,o)}(t)}var D=Date.now||function(){return(new Date).getTime()};function q(t){return t*m}function G(t){if(t)return Math.pow(10,t);return 1}function R(t,e){var r=G(e);return Math.round(t*r)/r}function $(t,e){return l(t)?t:e}function H(t,e){for(var r in e){var n=r.trim().split(" ");for(var o=0;o<n.length;o++)t.addEventListener(n[o],e[r],false)}}function U(t){var e=t.getBoundingClientRect();var r=document.documentElement;return{top:e.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:e.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)}}function X(t,e){var r={};var n=window.getComputedStyle(t)||{};var o=Array.isArray(e)?e:[e];for(var i=0;i<o.length;i++){var a=o[i];r[a]=n[a]}return r}function V(t){if(isNaN(t))return t;return t+"px"}function Y(t,e){if(e){var r=e.width;var n=e.height;if(l(r))t.style.width=V(r);if(l(n))t.style.height=V(n)}else{var o=X(t,["width","height"]);return{width:parseInt(o.width,10),height:parseInt(o.height,10)}}}function W(t,e){if(e===void 0)e={};for(var r in e){var n=r.trim().split(" ");for(var o=0;o<n.length;o++)t.removeEventListener(n[o],e[r],false)}}function Z(t){var e=X(t,["paddingLeft","paddingTop"]);var r=e.paddingLeft;var n=e.paddingTop;return{top:parseFloat(n),left:parseFloat(r)}}var i=function(a){function c(t,e,r,n,o,i){if(t===void 0)t=0;if(e===void 0)e=0;if(r===void 0)r=0;if(n===void 0)n=0;if(o===void 0)o=0;if(i===void 0)i=0;a.call(this);this.a=t;this.b=e;this.c=r;this.d=n;this.e=o;this.f=i}f(c,a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;c.fn=c.prototype;c.fn.init=c.fn.constructor;c.prototype.multiplyCopy=function t(e){return new c(this.a*e.a+this.c*e.b,this.b*e.a+this.d*e.b,this.a*e.c+this.c*e.d,this.b*e.c+this.d*e.d,this.a*e.e+this.c*e.f+this.e,this.b*e.e+this.d*e.f+this.f)};c.prototype.invert=function t(){var e=this;var r=e.a;var n=e.b;var o=e.c;var i=e.d;var a=e.e;var s=e.f;var p=r*i-n*o;if(p===0)return null;return new c(i/p,-n/p,-o/p,r/p,(o*s-i*a)/p,(n*a-r*s)/p)};c.prototype.clone=function t(){return new c(this.a,this.b,this.c,this.d,this.e,this.f)};c.prototype.equals=function t(e){if(!e)return false;return this.a===e.a&&this.b===e.b&&this.c===e.c&&this.d===e.d&&this.e===e.e&&this.f===e.f};c.prototype.round=function t(e){this.a=R(this.a,e);this.b=R(this.b,e);this.c=R(this.c,e);this.d=R(this.d,e);this.e=R(this.e,e);this.f=R(this.f,e);return this};c.prototype.toArray=function t(e){var r=[this.a,this.b,this.c,this.d,this.e,this.f];if(l(e))for(var n=0;n<r.length;n++)r[n]=R(r[n],e);return r};c.prototype.toString=function t(e,r){if(r===void 0)r=",";return this.toArray(e).join(r)};c.translate=function t(e,r){return new c(1,0,0,1,e,r)};c.unit=function t(){return new c(1,0,0,1,0,0)};c.rotate=function t(e,r,n){var o=new c;o.a=Math.cos(q(e));o.b=Math.sin(q(e));o.c=-o.b;o.d=o.a;o.e=r-r*o.a+n*o.b||0;o.f=n-n*o.a-r*o.b||0;return o};c.scale=function t(e,r){return new c(e,0,0,r,0,0)};return c}(a),J=(i.IDENTITY=i.unit(),/matrix\((.*)\)/);function K(t){var e=t.match(J);if(e===null||e.length!==2)return i.unit();var r=e[1].split(",").map(function(t){return parseFloat(t)});return new(Function.prototype.bind.apply(i,[null].concat(r)))}function Q(t){var e=getComputedStyle(t).transform;if(e==="none")return i.unit();return K(e)}function tt(t){if(!t)return i.unit();var e=Q(t);var r=t.parentElement;while(r){var n=Q(r);e=e.multiplyCopy(n);r=r.parentElement}e.b=e.c=e.e=e.f=0;return e}var et={append:h,arabicToRoman:L,createPromise:d,defined:l,definitionId:g,deg:I,encodeBase64:T,eventCoordinates:k,eventElement:M,isTransparent:S,last:E,limitValue:A,mergeSort:P,now:D,promiseAll:c,rad:q,round:R,valueOrDefault:$,bindEvents:H,elementOffset:U,elementSize:Y,elementStyles:X,unbindEvents:W,elementPadding:Z,elementScale:tt,DEG_TO_RAD:m,MAX_NUM:x,MIN_NUM:w},rt={}.toString,nt=function(i){function h(t,e){var r=this;if(e===void 0)e="";i.call(this);this.prefix=e;for(var n in t){var o=t[n];o=r._wrap(o,n);r[n]=o}}f(h,i);h.prototype=Object.create(i&&i.prototype);h.prototype.constructor=h;h.fn=h.prototype;h.fn.init=h.fn.constructor;h.prototype.get=function t(e){var r=e.split(".");var n=this;while(r.length&&n){var o=r.shift();n=n[o]}return n};h.prototype.set=function t(e,r){var n=this.get(e);if(n!==r){this._set(e,this._wrap(r,e));this.optionsChange({field:this.prefix+e,value:r})}};h.prototype._set=function c(t,e){var r=this;var n=t.indexOf(".")>=0;var o=this;var i=t;if(n){var a=i.split(".");var s=this.prefix;while(a.length>1){i=a.shift();s+=i+".";var p=o[i];if(!p){p=new h({},s);p.addObserver(r);o[i]=p}o=p}i=a[0]}o._clear(i);o[i]=e};h.prototype._clear=function t(e){var r=this[e];if(r&&r.removeObserver)r.removeObserver(this)};h.prototype._wrap=function t(e,r){var n=rt.call(e);var o=e;if(o!==null&&l(o)&&n==="[object Object]"){if(!(e instanceof h)&&!(e instanceof a))o=new h(o,this.prefix+r+".");o.addObserver(this)}return o};return h}(n);function ot(e){return function(t){if(this[e]!==t){this[e]=t;this.geometryChange()}return this}}function it(t){return function(){return this[t]}}function at(t,e){for(var r=0;r<e.length;r++){var n=e[r];var o=n.charAt(0).toUpperCase()+n.substring(1,n.length);t["set"+o]=ot(n);t["get"+o]=it(n)}}var st=function(t,e){var r=function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;return e}(t);at(r.prototype,e);return r};function pt(t){if(t&&typeof t.matrix==="function")return t.matrix();return t}var B=function(r){function a(t,e){r.call(this);this.x=t||0;this.y=e||0}f(a,r);a.prototype=Object.create(r&&r.prototype);a.prototype.constructor=a;a.fn=a.prototype;a.fn.init=a.fn.constructor;var t={ZERO:{}};a.prototype.equals=function t(e){return e&&e.x===this.x&&e.y===this.y};a.prototype.clone=function t(){return new a(this.x,this.y)};a.prototype.rotate=function t(e,r){var n=a.create(r)||a.ZERO;return this.transform(i.rotate(e,n.x,n.y))};a.prototype.translate=function t(e,r){this.x+=e;this.y+=r;this.geometryChange();return this};a.prototype.translateWith=function t(e){return this.translate(e.x,e.y)};a.prototype.move=function t(e,r){this.x=this.y=0;return this.translate(e,r)};a.prototype.scale=function t(e,r){if(r===void 0)r=e;this.x*=e;this.y*=r;this.geometryChange();return this};a.prototype.scaleCopy=function t(e,r){return this.clone().scale(e,r)};a.prototype.transform=function t(e){var r=pt(e);var n=this;var o=n.x;var i=n.y;this.x=r.a*o+r.c*i+r.e;this.y=r.b*o+r.d*i+r.f;this.geometryChange();return this};a.prototype.transformCopy=function t(e){var r=this.clone();if(e)r.transform(e);return r};a.prototype.distanceTo=function t(e){var r=this.x-e.x;var n=this.y-e.y;return Math.sqrt(r*r+n*n)};a.prototype.round=function t(e){this.x=R(this.x,e);this.y=R(this.y,e);this.geometryChange();return this};a.prototype.toArray=function t(e){var r=l(e);var n=r?R(this.x,e):this.x;var o=r?R(this.y,e):this.y;return[n,o]};a.prototype.toString=function t(e,r){if(r===void 0)r=" ";var n=this;var o=n.x;var i=n.y;if(l(e)){o=R(o,e);i=R(i,e)}return o+r+i};a.create=function t(e,r){if(l(e)){if(e instanceof a)return e;else if(arguments.length===1&&e.length===2)return new a(e[0],e[1]);return new a(e,r)}};a.min=function t(){var e=arguments;var r=x;var n=x;for(var o=0;o<arguments.length;o++){var i=e[o];r=Math.min(i.x,r);n=Math.min(i.y,n)}return new a(r,n)};a.max=function t(){var e=arguments;var r=w;var n=w;for(var o=0;o<arguments.length;o++){var i=e[o];r=Math.max(i.x,r);n=Math.max(i.y,n)}return new a(r,n)};a.minPoint=function t(){return new a(w,w)};a.maxPoint=function t(){return new a(x,x)};t.ZERO.get=function(){return new a(0,0)};Object.defineProperties(a,t);return a}(st(n,["x","y"])),ct=function(r){function n(t,e){r.call(this);this.width=t||0;this.height=e||0}f(n,r);n.prototype=Object.create(r&&r.prototype);n.prototype.constructor=n;n.fn=n.prototype;n.fn.init=n.fn.constructor;var t={ZERO:{}};n.prototype.equals=function t(e){return e&&e.width===this.width&&e.height===this.height};n.prototype.clone=function t(){return new n(this.width,this.height)};n.prototype.toArray=function t(e){var r=l(e);var n=r?R(this.width,e):this.width;var o=r?R(this.height,e):this.height;return[n,o]};n.create=function t(e,r){if(l(e)){if(e instanceof n)return e;else if(arguments.length===1&&e.length===2)return new n(e[0],e[1]);return new n(e,r)}};t.ZERO.get=function(){return new n(0,0)};Object.defineProperties(n,t);return n}(st(n,["width","height"])),N=function(n){function a(t,e,r){if(t===void 0)t=new B;if(e===void 0)e=new ct;if(r===void 0)r=0;n.call(this);this.setOrigin(t);this.setSize(e);this.setCornerRadius(r)}f(a,n);a.prototype=Object.create(n&&n.prototype);a.prototype.constructor=a;a.fn=a.prototype;a.fn.init=a.fn.constructor;a.prototype.clone=function t(){return new a(this.origin.clone(),this.size.clone())};a.prototype.equals=function t(e){return e&&e.origin.equals(this.origin)&&e.size.equals(this.size)};a.prototype.setOrigin=function t(e){this._observerField("origin",B.create(e));this.geometryChange();return this};a.prototype.getOrigin=function t(){return this.origin};a.prototype.setCornerRadius=function t(e){this.cornerRadius=Array.isArray(e)?e:[e,e];this.geometryChange();return this};a.prototype.getCornerRadius=function t(){return this.cornerRadius};a.prototype.setSize=function t(e){this._observerField("size",ct.create(e));this.geometryChange();return this};a.prototype.getSize=function t(){return this.size};a.prototype.width=function t(){return this.size.width};a.prototype.height=function t(){return this.size.height};a.prototype.topLeft=function t(){return this.origin.clone()};a.prototype.bottomRight=function t(){return this.origin.clone().translate(this.width(),this.height())};a.prototype.topRight=function t(){return this.origin.clone().translate(this.width(),0)};a.prototype.bottomLeft=function t(){return this.origin.clone().translate(0,this.height())};a.prototype.center=function t(){return this.origin.clone().translate(this.width()/2,this.height()/2)};a.prototype.bbox=function t(e){var r=this.topLeft().transformCopy(e);var n=this.topRight().transformCopy(e);var o=this.bottomRight().transformCopy(e);var i=this.bottomLeft().transformCopy(e);return a.fromPoints(r,n,o,i)};a.prototype.transformCopy=function t(e){return a.fromPoints(this.topLeft().transform(e),this.bottomRight().transform(e))};a.prototype.expand=function t(e,r){if(r===void 0)r=e;this.size.width+=2*e;this.size.height+=2*r;this.origin.translate(-e,-r);return this};a.prototype.expandCopy=function t(e,r){return this.clone().expand(e,r)};a.prototype.containsPoint=function t(e){var r=this.origin;var n=this.bottomRight();return!(e.x<r.x||e.y<r.y||n.x<e.x||n.y<e.y)};a.prototype._isOnPath=function t(e,r){var n=this.expandCopy(r,r);var o=this.expandCopy(-r,-r);return n.containsPoint(e)&&!o.containsPoint(e)};a.fromPoints=function t(){var e=B.min.apply(null,arguments);var r=B.max.apply(null,arguments);var n=new ct(r.x-e.x,r.y-e.y);return new a(e,n)};a.union=function t(e,r){return a.fromPoints(B.min(e.topLeft(),r.topLeft()),B.max(e.bottomRight(),r.bottomRight()))};a.intersect=function t(e,r){var n={left:e.topLeft().x,top:e.topLeft().y,right:e.bottomRight().x,bottom:e.bottomRight().y};var o={left:r.topLeft().x,top:r.topLeft().y,right:r.bottomRight().x,bottom:r.bottomRight().y};if(n.left<=o.right&&o.left<=n.right&&n.top<=o.bottom&&o.top<=n.bottom)return a.fromPoints(new B(Math.max(n.left,o.left),Math.max(n.top,o.top)),new B(Math.min(n.right,o.right),Math.min(n.bottom,o.bottom)))};return a}(n),ht=function(e){function r(t){if(t===void 0)t=i.unit();e.call(this);this._matrix=t}f(r,e);r.prototype=Object.create(e&&e.prototype);r.prototype.constructor=r;r.fn=r.prototype;r.fn.init=r.fn.constructor;r.prototype.clone=function t(){return new r(this._matrix.clone())};r.prototype.equals=function t(e){return e&&e._matrix.equals(this._matrix)};r.prototype.translate=function t(e,r){this._matrix=this._matrix.multiplyCopy(i.translate(e,r));this._optionsChange();return this};r.prototype.scale=function t(e,r,n){if(r===void 0)r=e;if(n===void 0)n=null;var o=n;if(o){o=B.create(o);this._matrix=this._matrix.multiplyCopy(i.translate(o.x,o.y))}this._matrix=this._matrix.multiplyCopy(i.scale(e,r));if(o)this._matrix=this._matrix.multiplyCopy(i.translate(-o.x,-o.y));this._optionsChange();return this};r.prototype.rotate=function t(e,r){var n=B.create(r)||B.ZERO;this._matrix=this._matrix.multiplyCopy(i.rotate(e,n.x,n.y));this._optionsChange();return this};r.prototype.multiply=function t(e){var r=pt(e);this._matrix=this._matrix.multiplyCopy(r);this._optionsChange();return this};r.prototype.matrix=function t(e){if(e){this._matrix=e;this._optionsChange();return this}return this._matrix};r.prototype._optionsChange=function t(){this.optionsChange({field:"transform",value:this})};return r}(n);function O(t){if(t===null)return null;if(t instanceof ht)return t;return new ht(t)}var ft=function(e){function t(t){e.call(this);this._initOptions(t)}f(t,e);t.prototype=Object.create(e&&e.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;var r={nodeType:{}};r.nodeType.get=function(){return"Rect"};t.prototype._initOptions=function t(e){if(e===void 0)e={};var r=e.clip;var n=e.transform;if(n)e.transform=O(n);if(r&&!r.id)r.id=g();this.options=new nt(e);this.options.addObserver(this)};t.prototype.transform=function t(e){if(l(e))this.options.set("transform",O(e));else return this.options.get("transform")};t.prototype.parentTransform=function t(){var e=this;var r;while(e.parent){e=e.parent;var n=e.transform();if(n)r=n.matrix().multiplyCopy(r||i.unit())}if(r)return O(r)};t.prototype.currentTransform=function t(e){if(e===void 0)e=this.parentTransform();var r=this.transform();var n=pt(r);var o=pt(e);var i;if(n&&o)i=o.multiplyCopy(n);else i=n||o;if(i)return O(i)};t.prototype.visible=function t(e){if(l(e)){this.options.set("visible",e);return this}return this.options.get("visible")!==false};t.prototype.clip=function t(e){var r=this.options;if(l(e)){if(e&&!e.id)e.id=g();r.set("clip",e);return this}return r.get("clip")};t.prototype.opacity=function t(e){if(l(e)){this.options.set("opacity",e);return this}return $(this.options.get("opacity"),1)};t.prototype.clippedBBox=function t(e){var r=this._clippedBBox(e);if(r){var n=this.clip();return n?N.intersect(r,n.bbox(e)):r}};t.prototype.containsPoint=function t(e,r){if(this.visible()){var n=this.currentTransform(r);var o=e;if(n)o=e.transformCopy(n.matrix().invert());return this._hasFill()&&this._containsPoint(o)||this._isOnPath&&this._hasStroke()&&this._isOnPath(o)}return false};t.prototype._hasFill=function t(){var e=this.options.fill;return e&&!S(e.color)};t.prototype._hasStroke=function t(){var e=this.options.stroke;return e&&e.width>0&&!S(e.color)};t.prototype._clippedBBox=function t(e){return this.bbox(e)};Object.defineProperties(t.prototype,r);return t}(n);function ut(t,e,r,n){var o=0;var i=0;if(n){o=Math.atan2(n.c*r,n.a*e);if(n.b!==0)i=Math.atan2(n.d*r,n.b*e)}return{x:o,y:i}}var lt=Math.PI/2,vt=function(r){function e(t,e){if(t===void 0)t=new B;if(e===void 0)e=0;r.call(this);this.setCenter(t);this.setRadius(e)}f(e,r);e.prototype=Object.create(r&&r.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;e.prototype.setCenter=function t(e){this._observerField("center",B.create(e));this.geometryChange();return this};e.prototype.getCenter=function t(){return this.center};e.prototype.equals=function t(e){return e&&e.center.equals(this.center)&&e.radius===this.radius};e.prototype.clone=function t(){return new e(this.center.clone(),this.radius)};e.prototype.pointAt=function t(e){return this._pointAt(q(e))};e.prototype.bbox=function c(t){var e=this;var r=ut(this.center,this.radius,this.radius,t);var n=B.maxPoint();var o=B.minPoint();for(var i=0;i<4;i++){var a=e._pointAt(r.x+i*lt).transformCopy(t);var s=e._pointAt(r.y+i*lt).transformCopy(t);var p=new B(a.x,s.y);n=B.min(n,p);o=B.max(o,p)}return N.fromPoints(n,o)};e.prototype._pointAt=function t(e){var r=this;var n=r.center;var o=r.radius;return new B(n.x+o*Math.cos(e),n.y+o*Math.sin(e))};e.prototype.containsPoint=function t(e){var r=this;var n=r.center;var o=r.radius;var i=Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)<=Math.pow(o,2);return i};e.prototype._isOnPath=function t(e,r){var n=this;var o=n.center;var i=n.radius;var a=o.distanceTo(e);return i-r<=a&&a<=i+r};return e}(st(n,["radius"])),dt="Gradient",yt=function(t){return function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;e.prototype.fill=function t(e,r){var n=this.options;if(l(e)){if(e&&e.nodeType!==dt){var o={color:e};if(l(r))o.opacity=r;n.set("fill",o)}else n.set("fill",e);return this}return n.get("fill")};e.prototype.stroke=function t(e,r,n){if(l(e)){this.options.set("stroke.color",e);if(l(r))this.options.set("stroke.width",r);if(l(n))this.options.set("stroke.opacity",n);return this}return this.options.get("stroke")};return e}(t)},gt=i.IDENTITY.toString(),mt=function(t){return function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;e.prototype.bbox=function t(e){var r=pt(this.currentTransform(e));var n=r?r.toString():gt;var t;if(this._bboxCache&&this._matrixHash===n)t=this._bboxCache.clone();else{t=this._bbox(r);this._bboxCache=t?t.clone():null;this._matrixHash=n}var o=this.options.get("stroke.width");if(o&&t)t.expand(o/2);return t};e.prototype.geometryChange=function t(){delete this._bboxCache;this.trigger("geometryChange",{element:this})};return e}(t)};function xt(t){var e="_"+t;return function(t){if(l(t)){this._observerField(e,t);this.geometryChange();return this}return this[e]}}function wt(t,e){for(var r=0;r<e.length;r++)t[e[r]]=xt(e[r])}var bt=function(t,e){if(e===void 0)e=["geometry"];var r=function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;return e}(t);wt(r.prototype,e);return r},_t="#000",Ct=function(r){function t(t,e){if(t===void 0)t=new vt;if(e===void 0)e={};r.call(this,e);this.geometry(t);if(!l(this.options.stroke))this.stroke(_t)}f(t,r);t.prototype=Object.create(r&&r.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;var e={nodeType:{}};e.nodeType.get=function(){return"Circle"};t.prototype.rawBBox=function t(){return this._geometry.bbox()};t.prototype._bbox=function t(e){return this._geometry.bbox(e)};t.prototype._containsPoint=function t(e){return this.geometry().containsPoint(e)};t.prototype._isOnPath=function t(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)};Object.defineProperties(t.prototype,e);return t}(yt(mt(bt(ft)))),Tt=10;function kt(t,e,r){if(r===void 0)r=Tt;return R(Math.abs(t-e),r)===0}function Ot(t,e,r){return t<e||kt(t,e,r)}function Mt(t,e,r,n){var o=e.x-t.x;var i=n.x-r.x;var a=e.y-t.y;var s=n.y-r.y;var p=t.x-r.x;var h=t.y-r.y;var f=o*s-i*a;var u=(o*h-a*p)/f;var c=(i*h-s*p)/f;if(u>=0&&u<=1&&c>=0&&c<=1)return new B(t.x+c*o,t.y+c*a)}var St=45,Et=Math.pow,At,Pt=function(r){function c(t,e){if(t===void 0)t=new B;if(e===void 0)e={};r.call(this);this.setCenter(t);this.radiusX=e.radiusX;this.radiusY=e.radiusY||e.radiusX;this.startAngle=e.startAngle;this.endAngle=e.endAngle;this.anticlockwise=e.anticlockwise||false;this.xRotation=e.xRotation}f(c,r);c.prototype=Object.create(r&&r.prototype);c.prototype.constructor=c;c.fn=c.prototype;c.fn.init=c.fn.constructor;c.prototype.clone=function t(){return new c(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})};c.prototype.setCenter=function t(e){this._observerField("center",B.create(e));this.geometryChange();return this};c.prototype.getCenter=function t(){return this.center};c.prototype.pointAt=function t(e){var r=this.center;var n=q(e);return new B(r.x+this.radiusX*Math.cos(n),r.y+this.radiusY*Math.sin(n))};c.prototype.curvePoints=function t(){var h=this;var e=this.startAngle;var f=this.anticlockwise?-1:1;var t=[this.pointAt(e)];var r=this._arcInterval();var n=r.endAngle-r.startAngle;var o=Math.ceil(n/St);var u=n/o;var i=e;var a;if(this.xRotation)a=O().rotate(this.xRotation,this.center);for(var s=1;s<=o;s++){var p=i+f*u;var c=h._intervalCurvePoints(i,p,a);t.push(c.cp1,c.cp2,c.p2);i=p}return t};c.prototype.bbox=function h(t){var e=this;var r=this._arcInterval();var n=r.startAngle;var o=r.endAngle;var f=ut(this.center,this.radiusX,this.radiusY,t);var u=I(f.x);var l=I(f.y);var v=this.pointAt(o).transformCopy(t);var i=jt(u,n);var a=jt(l,n);var s=this.pointAt(n).transformCopy(t);var p=B.min(s,v);var c=B.max(s,v);while(i<o||a<o){var d=void 0;if(i<o){d=e.pointAt(i).transformCopy(t);i+=90}var y=void 0;if(a<o){y=e.pointAt(a).transformCopy(t);a+=90}s=new B(d.x,y.y);p=B.min(p,s);c=B.max(c,s)}return N.fromPoints(p,c)};c.prototype._arcInterval=function t(){var e=this;var r=e.startAngle;var n=e.endAngle;var o=e.anticlockwise;if(o){var i=r;r=n;n=i}if(r>n||o&&r===n)n+=360;return{startAngle:r,endAngle:n}};c.prototype._intervalCurvePoints=function h(t,e,r){var n=this.pointAt(t);var o=this.pointAt(e);var i=this._derivativeAt(t);var a=this._derivativeAt(e);var s=(q(e)-q(t))/3;var p=new B(n.x+s*i.x,n.y+s*i.y);var c=new B(o.x-s*a.x,o.y-s*a.y);if(r){n.transform(r);o.transform(r);p.transform(r);c.transform(r)}return{p1:n,cp1:p,cp2:c,p2:o}};c.prototype._derivativeAt=function t(e){var r=q(e);return new B(-this.radiusX*Math.sin(r),this.radiusY*Math.cos(r))};c.prototype.containsPoint=function t(e){var r=this._arcInterval();var h=r.endAngle-r.startAngle;var n=this;var o=n.center;var i=n.radiusX;var a=n.radiusY;var s=o.distanceTo(e);var f=Math.atan2(e.y-o.y,e.x-o.x);var u=i*a/Math.sqrt(Et(i,2)*Et(Math.sin(f),2)+Et(a,2)*Et(Math.cos(f),2));var l=this.pointAt(this.startAngle).round(Tt);var v=this.pointAt(this.endAngle).round(Tt);var p=Mt(o,e.round(Tt),l,v);var t;if(h<180)t=p&&Ot(o.distanceTo(p),s)&&Ot(s,u);else{var c=Nt(o.x,o.y,i,a,e.x,e.y);if(c!==360)c=(360+c)%360;var d=r.startAngle<=c&&c<=r.endAngle;t=d&&Ot(s,u)||!d&&(!p||p.equals(e))}return t};c.prototype._isOnPath=function t(e,r){var n=this._arcInterval();var o=this.center;var i=Nt(o.x,o.y,this.radiusX,this.radiusY,e.x,e.y);if(i!==360)i=(360+i)%360;var a=n.startAngle<=i&&i<=n.endAngle;return a&&this.pointAt(i).distanceTo(e)<=r};c.fromPoints=function t(e,r,n,o,i,a,s){var p=zt({x1:e.x,y1:e.y,x2:r.x,y2:r.y,rx:n,ry:o,largeArc:i,swipe:a,rotation:s});return new c(p.center,{startAngle:p.startAngle,endAngle:p.endAngle,radiusX:p.radiusX,radiusY:p.radiusY,xRotation:p.xRotation,anticlockwise:a===0})};return c}(st(n,["radiusX","radiusY","startAngle","endAngle","anticlockwise"]));function Nt(t,e,r,n,o,i){var a=R((o-t)/r,3);var s=R((i-e)/n,3);return R(I(Math.atan2(s,a)))}function zt(t){var h=t.x1;var f=t.y1;var u=t.x2;var l=t.y2;var e=t.rx;var r=t.ry;var v=t.largeArc;var d=t.swipe;var n=t.rotation;if(n===void 0)n=0;var y=q(n);var o=Math.cos(y);var g=Math.sin(y);var m=o*(h-u)/2+g*(f-l)/2;var x=-g*(h-u)/2+o*(f-l)/2;var w=v!==d?1:-1;var b=Math.pow(m,2);var _=Math.pow(x,2);var i=Math.pow(e,2);var a=Math.pow(r,2);var C=b/i+_/a;if(C>1){C=Math.sqrt(b/i+_/a);e=C*e;i=Math.pow(e,2);r=C*r;a=Math.pow(r,2)}var T=w*Math.sqrt((i*a-i*_-a*b)/(i*_+a*b));if(isNaN(T))T=0;var k=T*(e*x)/r;var O=-T*(r*m)/e;var M=o*k-g*O+(h+u)/2;var S=g*k+o*O+(f+l)/2;var s=(m-k)/e;var p=(x-O)/r;var E=-(m+k)/e;var A=-(x+O)/r;var P=(p>=0?1:-1)*I(Math.acos(s/Math.sqrt(s*s+p*p)));var N=R((s*E+p*A)/(Math.sqrt(s*s+p*p)*Math.sqrt(E*E+A*A)),10);var c=(s*A-p*E>=0?1:-1)*I(Math.acos(N));if(!d&&c>0)c-=360;if(d&&c<0)c+=360;var z=P+c;var j=z>=0?1:-1;z=Math.abs(z)%360*j;return{center:new B(M,S),startAngle:P,endAngle:z,radiusX:e,radiusY:r,xRotation:n}}function jt(t,e){var r=t;while(r<e)r+=90;return r}var Rt=[].push,Bt=[].pop,Ft=[].splice,Lt=[].shift,It=[].slice,Dt=[].unshift,qt=function(e){function t(t){if(t===void 0)t=[];e.call(this);this.length=0;this._splice(0,t.length,t)}f(t,e);t.prototype=Object.create(e&&e.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;t.prototype.elements=function t(e){if(e){this._splice(0,this.length,e);this._change();return this}return this.slice(0)};t.prototype.push=function t(){var e=arguments;var r=Rt.apply(this,e);this._add(e);return r};t.prototype.slice=function t(){return It.call(this)};t.prototype.pop=function t(){var e=this.length;var r=Bt.apply(this);if(e)this._remove([r]);return r};t.prototype.splice=function t(e,r){var n=It.call(arguments,2);var o=this._splice(e,r,n);this._change();return o};t.prototype.shift=function t(){var e=this.length;var r=Lt.apply(this);if(e)this._remove([r]);return r};t.prototype.unshift=function t(){var e=arguments;var r=Dt.apply(this,e);this._add(e);return r};t.prototype.indexOf=function t(e){var r=this;var n=this.length;for(var o=0;o<n;o++)if(r[o]===e)return o;return-1};t.prototype._splice=function t(e,r,n){var o=Ft.apply(this,[e,r].concat(n));this._clearObserver(o);this._setObserver(n);return o};t.prototype._add=function t(e){this._setObserver(e);this._change()};t.prototype._remove=function t(e){this._clearObserver(e);this._change()};t.prototype._setObserver=function t(e){var r=this;for(var n=0;n<e.length;n++)e[n].addObserver(r)};t.prototype._clearObserver=function t(e){var r=this;for(var n=0;n<e.length;n++)e[n].removeObserver(r)};t.prototype._change=function t(){};return t}(n),Gt=function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;e.prototype._change=function t(){this.geometryChange()};return e}(qt);function $t(t,e,r){var n=I(Math.atan2(e.y-t.y,e.x-t.x));var o=r.transformCopy(O().rotate(-n,t));return o.x<t.x}function Ht(t,e,r){var n=1-t;return Math.pow(n,3)*r[0][e]+3*Math.pow(n,2)*t*r[1][e]+3*Math.pow(t,2)*n*r[2][e]+Math.pow(t,3)*r[3][e]}function Ut(t,e){return[-t[0][e]+3*t[1][e]-3*t[2][e]+t[3][e],3*(t[0][e]-2*t[1][e]+t[2][e]),3*(-t[0][e]+t[1][e]),t[0][e]]}var Xt=function(r){function i(t,e){if(t===void 0)t=0;if(e===void 0)e=0;r.call(this);this.real=t;this.img=e}f(i,r);i.prototype=Object.create(r&&r.prototype);i.prototype.constructor=i;i.fn=i.prototype;i.fn.init=i.fn.constructor;i.prototype.add=function t(e){return new i(R(this.real+e.real,Tt),R(this.img+e.img,Tt))};i.prototype.addConstant=function t(e){return new i(this.real+e,this.img)};i.prototype.negate=function t(){return new i(-this.real,-this.img)};i.prototype.multiply=function t(e){return new i(this.real*e.real-this.img*e.img,this.real*e.img+this.img*e.real)};i.prototype.multiplyConstant=function t(e){return new i(this.real*e,this.img*e)};i.prototype.nthRoot=function t(e){var r=Math.atan2(this.img,this.real);var n=Math.sqrt(Math.pow(this.img,2)+Math.pow(this.real,2));var o=Math.pow(n,1/e);return new i(o*Math.cos(r/e),o*Math.sin(r/e))};i.prototype.equals=function t(e){return this.real===e.real&&this.img===e.img};i.prototype.isReal=function t(){return this.img===0};return i}(a);function Vt(t){return t<0?-1:1}function Yt(t,e,r){var n=Math.sqrt(Math.pow(e,2)-4*t*r);return[(-e+n)/(2*t),(-e-n)/(2*t)]}function Wt(t,e,r,h){if(t===0)return Yt(e,r,h);var f=(3*t*r-Math.pow(e,2))/(3*Math.pow(t,2));var n=(2*Math.pow(e,3)-9*t*e*r+27*Math.pow(t,2)*h)/(27*Math.pow(t,3));var o=Math.pow(f/3,3)+Math.pow(n/2,2);var u=new Xt(0,1);var i=-e/(3*t);var a,s,p,l,v,d,y;if(o<0){a=new Xt(-n/2,Math.sqrt(-o)).nthRoot(3);s=new Xt(-n/2,-Math.sqrt(-o)).nthRoot(3)}else{a=-n/2+Math.sqrt(o);a=new Xt(Vt(a)*Math.pow(Math.abs(a),1/3));s=-n/2-Math.sqrt(o);s=new Xt(Vt(s)*Math.pow(Math.abs(s),1/3))}p=a.add(s);d=a.add(s).multiplyConstant(-1/2);y=a.add(s.negate()).multiplyConstant(Math.sqrt(3)/2);l=d.add(u.multiply(y));v=d.add(u.negate().multiply(y));var c=[];if(p.isReal())c.push(R(p.real+i,Tt));if(l.isReal())c.push(R(l.real+i,Tt));if(v.isReal())c.push(R(v.real+i,Tt));return c}function Zt(t,e,r,n,o){var i=Ut(t,n);var a=Wt(i[0],i[1],i[2],i[3]-e[n]);var s;for(var p=0;p<a.length;p++)if(0<=a[p]&&a[p]<=1){s=Ht(a[p],r,t);if(Math.abs(s-e[r])<=o)return true}}function Jt(t,e,r){var n=Ut(t,"x");var o=Wt(n[0],n[1],n[2],n[3]-e.x);var i,a;var s=0;for(var p=0;p<o.length;p++){i=Ht(o[p],"y",t);a=kt(i,e.y)||i>e.y;if(a&&((o[p]===0||o[p]===1)&&r.bottomRight().x>e.x||0<o[p]&&o[p]<1))s++}return s}function Kt(t,e,r){var n;if(t.x!==e.x){var o=Math.min(t.x,e.x);var i=Math.max(t.x,e.x);var a=Math.min(t.y,e.y);var s=Math.max(t.y,e.y);var p=o<=r.x&&r.x<i;if(a===s)n=r.y<=a&&p;else n=p&&(s-a)*((t.x-e.x)*(t.y-e.y)>0?r.x-o:i-r.x)/(i-o)+a-r.y>=0}return n?1:0}function Qt(t){var e="_"+t;return function(t){if(l(t)){this._observerField(e,B.create(t));this.geometryChange();return this}return this[e]}}function te(t,e){for(var r=0;r<e.length;r++)t[e[r]]=Qt(e[r])}var ee=function(t,e){var r=function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;return e}(t);te(r.prototype,e);return r},re,ne=function(n){function t(t,e,r){n.call(this);this.anchor(t||new B);this.controlIn(e);this.controlOut(r)}f(t,n);t.prototype=Object.create(n&&n.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;t.prototype.bboxTo=function t(e,r){var n=this.anchor().transformCopy(r);var o=e.anchor().transformCopy(r);var i;if(this.controlOut()&&e.controlIn())i=this._curveBoundingBox(n,this.controlOut().transformCopy(r),e.controlIn().transformCopy(r),o);else i=this._lineBoundingBox(n,o);return i};t.prototype._lineBoundingBox=function t(e,r){return N.fromPoints(e,r)};t.prototype._curveBoundingBox=function c(t,e,r,n){var o=[t,e,r,n];var i=this._curveExtremesFor(o,"x");var a=this._curveExtremesFor(o,"y");var s=oe([i.min,i.max,t.x,n.x]);var p=oe([a.min,a.max,t.y,n.y]);return N.fromPoints(new B(s.min,p.min),new B(s.max,p.max))};t.prototype._curveExtremesFor=function t(e,r){var n=this._curveExtremes(e[0][r],e[1][r],e[2][r],e[3][r]);return{min:Ht(n.min,r,e),max:Ht(n.max,r,e)}};t.prototype._curveExtremes=function h(t,e,r,f){var n=t-3*e+3*r-f;var o=-2*(t-2*e+r);var u=t-e;var i=Math.sqrt(o*o-4*n*u);var a=0;var s=1;if(n===0){if(o!==0)a=s=-u/o}else if(!isNaN(i)){a=(-o+i)/(2*n);s=(-o-i)/(2*n)}var p=Math.max(Math.min(a,s),0);if(p<0||p>1)p=0;var c=Math.min(Math.max(a,s),1);if(c>1||c<0)c=1;return{min:p,max:c}};t.prototype._intersectionsTo=function t(e,r){var n;if(this.controlOut()&&e.controlIn())n=Jt([this.anchor(),this.controlOut(),e.controlIn(),e.anchor()],r,this.bboxTo(e));else n=Kt(this.anchor(),e.anchor(),r);return n};t.prototype._isOnCurveTo=function h(t,e,r,n){var f=this.bboxTo(t).expand(r,r);if(f.containsPoint(e)){var o=this.anchor();var i=this.controlOut();var a=t.controlIn();var s=t.anchor();if(n==="start"&&o.distanceTo(e)<=r)return!$t(o,i,e);else if(n==="end"&&s.distanceTo(e)<=r)return!$t(s,a,e);var p=[o,i,a,s];if(Zt(p,e,"x","y",r)||Zt(p,e,"y","x",r))return true;var c=O().rotate(45,e);var u=[o.transformCopy(c),i.transformCopy(c),a.transformCopy(c),s.transformCopy(c)];return Zt(u,e,"x","y",r)||Zt(u,e,"y","x",r)}};t.prototype._isOnLineTo=function t(e,r,n){var o=this.anchor();var i=e.anchor();var a=I(Math.atan2(i.y-o.y,i.x-o.x));var s=new N([o.x,o.y-n/2],[o.distanceTo(i),n]);return s.containsPoint(r.transformCopy(O().rotate(-a,o)))};t.prototype._isOnPathTo=function t(e,r,n,o){var i;if(this.controlOut()&&e.controlIn())i=this._isOnCurveTo(e,r,n/2,o);else i=this._isOnLineTo(e,r,n);return i};return t}(ee(n,["anchor","controlIn","controlOut"]));function oe(t){var e=t.length;var r=x;var n=w;for(var o=0;o<e;o++){n=Math.max(n,t[o]);r=Math.min(r,t[o])}return{min:r,max:n}}var ie={l:function(t,e){var r=e.parameters;var n=e.position;for(var o=0;o<r.length;o+=2){var i=new B(r[o],r[o+1]);if(e.isRelative)i.translateWith(n);t.lineTo(i.x,i.y);n.x=i.x;n.y=i.y}},c:function(t,e){var r=e.parameters;var n=e.position;for(var o=0;o<r.length;o+=6){var i=new B(r[o],r[o+1]);var a=new B(r[o+2],r[o+3]);var s=new B(r[o+4],r[o+5]);if(e.isRelative){a.translateWith(n);i.translateWith(n);s.translateWith(n)}t.curveTo(i,a,s);n.x=s.x;n.y=s.y}},v:function(t,e){var r=e.isRelative?0:e.position.x;ae(e.parameters,true,r);this.l(t,e)},h:function(t,e){var r=e.isRelative?0:e.position.y;ae(e.parameters,false,r);this.l(t,e)},a:function(t,e){var r=e.parameters;var n=e.position;for(var o=0;o<r.length;o+=7){var i=r[o];var a=r[o+1];var s=r[o+2];var p=r[o+3];var h=r[o+4];var c=new B(r[o+5],r[o+6]);if(e.isRelative)c.translateWith(n);if(n.x!==c.x||n.y!==c.y){t.arcTo(c,i,a,p,h,s);n.x=c.x;n.y=c.y}}},s:function(t,e){var r=e.parameters;var n=e.position;var o=e.previousCommand;var i;if(o==="s"||o==="c")i=E(E(t.paths).segments).controlIn();for(var a=0;a<r.length;a+=4){var s=new B(r[a],r[a+1]);var p=new B(r[a+2],r[a+3]);var c=void 0;if(e.isRelative){s.translateWith(n);p.translateWith(n)}if(i)c=se(i,n);else c=n.clone();i=s;t.curveTo(c,s,p);n.x=p.x;n.y=p.y}},q:function(t,e){var r=e.parameters;var n=e.position;for(var o=0;o<r.length;o+=4){var i=new B(r[o],r[o+1]);var a=new B(r[o+2],r[o+3]);if(e.isRelative){i.translateWith(n);a.translateWith(n)}var s=ce(n,i,a);t.curveTo(s.controlOut,s.controlIn,a);n.x=a.x;n.y=a.y}},t:function(t,e){var r=e.parameters;var n=e.position;var o=e.previousCommand;var i;if(o==="q"||o==="t"){var a=E(E(t.paths).segments);i=a.controlIn().clone().translateWith(n.scaleCopy(-1/3)).scale(3/2)}for(var s=0;s<r.length;s+=2){var p=new B(r[s],r[s+1]);if(e.isRelative)p.translateWith(n);if(i)i=se(i,n);else i=n.clone();var c=ce(n,i,p);t.curveTo(c.controlOut,c.controlIn,p);n.x=p.x;n.y=p.y}}};function ae(t,e,r){var n=e?0:1;for(var o=0;o<t.length;o+=2)t.splice(o+n,0,r)}function se(t,e){if(t&&e)return e.scaleCopy(2).translate(-t.x,-t.y)}var pe=1/3;function ce(t,e,r){var n=e.clone().scale(2/3);return{controlOut:n.clone().translateWith(t.scaleCopy(pe)),controlIn:n.translateWith(r.scaleCopy(pe))}}var he=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,fe=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g,ue="m",le="z";function ve(t){var r=[];t.replace(fe,function(t,e){r.push(parseFloat(e))});return r}function de(s,t){var p=new B;var c;t.replace(he,function(t,e,r,n){var o=e.toLowerCase();var i=o===e;var a=ve(r.trim());if(o===ue){if(i){p.x+=a[0];p.y+=a[1]}else{p.x=a[0];p.y=a[1]}s.moveTo(p.x,p.y);if(a.length>2){o="l";a.splice(0,2)}}if(ie[o]){ie[o](s,{parameters:a,position:p,isRelative:i,previousCommand:c});if(n&&n.toLowerCase()===le)s.close()}else if(o!==ue)throw new Error("Error while parsing SVG path. Unsupported command: "+o);c=o});return s}function ye(t,e,r){var n;for(var o=0;o<t.length;o++){var i=t[o];if(i.visible()){var a=e?i.bbox(r):i.rawBBox();if(a)if(n)n=N.union(n,a);else n=a}}return n}function ge(t,e){var r;for(var n=0;n<t.length;n++){var o=t[n];if(o.visible()){var i=o.clippedBBox(e);if(i)if(r)r=N.union(r,i);else r=i}}return r}var z=function(e){function u(t){e.call(this,t);this.segments=new Gt;this.segments.addObserver(this);if(!l(this.options.stroke)){this.stroke("#000");if(!l(this.options.stroke.lineJoin))this.options.set("stroke.lineJoin","miter")}}f(u,e);u.prototype=Object.create(e&&e.prototype);u.prototype.constructor=u;u.fn=u.prototype;u.fn.init=u.fn.constructor;var t={nodeType:{}};u.parse=function t(e,r){return me.parse(e,r)};t.nodeType.get=function(){return"Path"};u.prototype.moveTo=function t(e,r){this.suspend();this.segments.elements([]);this.resume();this.lineTo(e,r);return this};u.prototype.lineTo=function t(e,r){var n=l(r)?new B(e,r):e;var o=new ne(n);this.segments.push(o);return this};u.prototype.curveTo=function t(e,r,n){if(this.segments.length>0){var o=E(this.segments);var i=new ne(n,r);this.suspend();o.controlOut(e);this.resume();this.segments.push(i)}return this};u.prototype.arc=function t(e,r,n,o,i){if(this.segments.length>0){var a=E(this.segments);var s=a.anchor();var p=q(e);var c=new B(s.x-n*Math.cos(p),s.y-o*Math.sin(p));var t=new Pt(c,{startAngle:e,endAngle:r,radiusX:n,radiusY:o,anticlockwise:i});this._addArcSegments(t)}return this};u.prototype.arcTo=function c(t,e,r,n,o,i){if(this.segments.length>0){var a=E(this.segments);var s=a.anchor();var p=Pt.fromPoints(s,B.create(t),e,r,n,o,i);this._addArcSegments(p)}return this};u.prototype._addArcSegments=function t(e){var r=this;this.suspend();var n=e.curvePoints();for(var o=1;o<n.length;o+=3)r.curveTo(n[o],n[o+1],n[o+2]);this.resume();this.geometryChange()};u.prototype.close=function t(){this.options.closed=true;this.geometryChange();return this};u.prototype.rawBBox=function t(){return this._bbox()};u.prototype._containsPoint=function t(e){var r=this.segments;var n=r.length;var o=0;var i,a;for(var s=1;s<n;s++){i=r[s-1];a=r[s];o+=i._intersectionsTo(a,e)}if(this.options.closed||!r[0].anchor().equals(r[n-1].anchor()))o+=Kt(r[0].anchor(),r[n-1].anchor(),e);return o%2!==0};u.prototype._isOnPath=function t(e,r){var n=this.segments;var o=n.length;var i=r||this.options.stroke.width;if(o>1){if(n[0]._isOnPathTo(n[1],e,i,"start"))return true;for(var a=2;a<=o-2;a++)if(n[a-1]._isOnPathTo(n[a],e,i))return true;if(n[o-2]._isOnPathTo(n[o-1],e,i,"end"))return true}return false};u.prototype._bbox=function t(e){var r=this.segments;var n=r.length;var o;if(n===1){var i=r[0].anchor().transformCopy(e);o=new N(i,ct.ZERO)}else if(n>0)for(var a=1;a<n;a++){var s=r[a-1].bboxTo(r[a],e);if(o)o=N.union(o,s);else o=s}return o};u.fromRect=function h(t,f){var e=new u(f);var r=t.cornerRadius;var n=r[0];var o=r[1];if(n===0&&o===0)e.moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close();else{var i=t.origin;var a=i.x;var s=i.y;var p=t.width();var c=t.height();n=A(n,0,p/2);o=A(o,0,c/2);e.moveTo(a+n,s).lineTo(a+p-n,s).arcTo([a+p,s+o],n,o,false).lineTo(a+p,s+c-o).arcTo([a+p-n,s+c],n,o,false).lineTo(a+n,s+c).arcTo([a,s+c-o],n,o,false).lineTo(a,s+o).arcTo([a+n,s],n,o,false)}return e};u.fromPoints=function t(e,r){if(e){var n=new u(r);for(var o=0;o<e.length;o++){var i=B.create(e[o]);if(i)if(o===0)n.moveTo(i);else n.lineTo(i)}return n}};u.fromArc=function t(e,r){var n=new u(r);var o=e.startAngle;var i=e.pointAt(o);n.moveTo(i.x,i.y);n.arc(o,e.endAngle,e.radiusX,e.radiusY,e.anticlockwise);return n};Object.defineProperties(u.prototype,t);return u}(yt(mt(ft))),me=function(e){function o(t){e.call(this,t);this.paths=new Gt;this.paths.addObserver(this);if(!l(this.options.stroke))this.stroke("#000")}f(o,e);o.prototype=Object.create(e&&e.prototype);o.prototype.constructor=o;o.fn=o.prototype;o.fn.init=o.fn.constructor;var t={nodeType:{}};o.parse=function t(e,r){var n=new o(r);return de(n,e)};t.nodeType.get=function(){return"MultiPath"};o.prototype.moveTo=function t(e,r){var n=new z;n.moveTo(e,r);this.paths.push(n);return this};o.prototype.lineTo=function t(e,r){if(this.paths.length>0)E(this.paths).lineTo(e,r);return this};o.prototype.curveTo=function t(e,r,n){if(this.paths.length>0)E(this.paths).curveTo(e,r,n);return this};o.prototype.arc=function t(e,r,n,o,i){if(this.paths.length>0)E(this.paths).arc(e,r,n,o,i);return this};o.prototype.arcTo=function t(e,r,n,o,i,a){if(this.paths.length>0)E(this.paths).arcTo(e,r,n,o,i,a);return this};o.prototype.close=function t(){if(this.paths.length>0)E(this.paths).close();return this};o.prototype._bbox=function t(e){return ye(this.paths,true,e)};o.prototype.rawBBox=function t(){return ye(this.paths,false)};o.prototype._containsPoint=function t(e){var r=this.paths;for(var n=0;n<r.length;n++)if(r[n]._containsPoint(e))return true;return false};o.prototype._isOnPath=function t(e){var r=this.paths;var n=this.options.stroke.width;for(var o=0;o<r.length;o++)if(r[o]._isOnPath(e,n))return true;return false};o.prototype._clippedBBox=function t(e){return ge(this.paths,this.currentTransform(e))};Object.defineProperties(o.prototype,t);return o}(yt(mt(ft))),xe="#000",we=function(r){function t(t,e){if(t===void 0)t=new Pt;if(e===void 0)e={};r.call(this,e);this.geometry(t);if(!l(this.options.stroke))this.stroke(xe)}f(t,r);t.prototype=Object.create(r&&r.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;var e={nodeType:{}};e.nodeType.get=function(){return"Arc"};t.prototype._bbox=function t(e){return this._geometry.bbox(e)};t.prototype.rawBBox=function t(){return this.geometry().bbox()};t.prototype.toPath=function t(){var e=new z;var r=this.geometry().curvePoints();if(r.length>0){e.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;n+=3)e.curveTo(r[n],r[n+1],r[n+2])}return e};t.prototype._containsPoint=function t(e){return this.geometry().containsPoint(e)};t.prototype._isOnPath=function t(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)};Object.defineProperties(t.prototype,e);return t}(yt(mt(bt(ft)))),be="12px sans-serif",_e="#000",Ce=function(n){function t(t,e,r){if(e===void 0)e=new B;if(r===void 0)r={};n.call(this,r);this.content(t);this.position(e);if(!this.options.font)this.options.font=be;if(!l(this.options.fill))this.fill(_e)}f(t,n);t.prototype=Object.create(n&&n.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;var e={nodeType:{}};e.nodeType.get=function(){return"Text"};t.prototype.content=function t(e){if(l(e)){this.options.set("content",e);return this}return this.options.get("content")};t.prototype.measure=function t(){var e=s.measureText(this.content(),{font:this.options.get("font")});return e};t.prototype.rect=function t(){var e=this.measure();var r=this.position().clone();return new N(r,[e.width,e.height])};t.prototype.bbox=function t(e){var r=pt(this.currentTransform(e));return this.rect().bbox(r)};t.prototype.rawBBox=function t(){return this.rect().bbox()};t.prototype._containsPoint=function t(e){return this.rect().containsPoint(e)};Object.defineProperties(t.prototype,e);return t}(yt(ee(ft,["position"]))),Te=function(n){function t(t,e,r){if(e===void 0)e=new N;if(r===void 0)r={};n.call(this,r);this.src(t);this.rect(e)}f(t,n);t.prototype=Object.create(n&&n.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;var e={nodeType:{}};e.nodeType.get=function(){return"Image"};t.prototype.src=function t(e){if(l(e)){this.options.set("src",e);return this}return this.options.get("src")};t.prototype.bbox=function t(e){var r=pt(this.currentTransform(e));return this._rect.bbox(r)};t.prototype.rawBBox=function t(){return this._rect.bbox()};t.prototype._containsPoint=function t(e){return this._rect.containsPoint(e)};t.prototype._hasFill=function t(){return this.src()};Object.defineProperties(t.prototype,e);return t}(bt(ft,["rect"])),ke=function(t,i){return function(t){function e(){t.apply(this,arguments)}f(e,t);e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.fn=e.prototype;e.fn.init=e.fn.constructor;e.prototype.traverse=function t(e){var r=this[i];for(var n=0;n<r.length;n++){var o=r[n];if(o.traverse)o.traverse(e);else e(o)}return this};return e}(t)},Oe=function(e){function t(t){e.call(this,t);this.children=[]}f(t,e);t.prototype=Object.create(e&&e.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;var r={nodeType:{}};r.nodeType.get=function(){return"Group"};t.prototype.childrenChange=function t(e,r,n){this.trigger("childrenChange",{action:e,items:r,index:n})};t.prototype.append=function t(){h(this.children,arguments);this._reparent(arguments,this);this.childrenChange("add",arguments);return this};t.prototype.insert=function t(e,r){this.children.splice(e,0,r);r.parent=this;this.childrenChange("add",[r],e);return this};t.prototype.insertAt=function t(e,r){return this.insert(r,e)};t.prototype.remove=function t(e){var r=this.children.indexOf(e);if(r>=0){this.children.splice(r,1);e.parent=null;this.childrenChange("remove",[e],r)}return this};t.prototype.removeAt=function t(e){if(0<=e&&e<this.children.length){var r=this.children[e];this.children.splice(e,1);r.parent=null;this.childrenChange("remove",[r],e)}return this};t.prototype.clear=function t(){var e=this.children;this.children=[];this._reparent(e,null);this.childrenChange("remove",e,0);return this};t.prototype.bbox=function t(e){return ye(this.children,true,this.currentTransform(e))};t.prototype.rawBBox=function t(){return ye(this.children,false)};t.prototype._clippedBBox=function t(e){return ge(this.children,this.currentTransform(e))};t.prototype.currentTransform=function t(e){return ft.prototype.currentTransform.call(this,e)||null};t.prototype.containsPoint=function t(e,r){if(this.visible()){var n=this.children;var o=this.currentTransform(r);for(var i=0;i<n.length;i++)if(n[i].containsPoint(e,o))return true}return false};t.prototype._reparent=function t(e,r){var n=this;for(var o=0;o<e.length;o++){var i=e[o];var a=i.parent;if(a&&a!==n&&a.remove)a.remove(i);i.parent=r}};Object.defineProperties(t.prototype,r);return t}(ke(ft,"children"));function Me(t,e,r){var n=r.transform()||O();var o=n.matrix();o.e+=t.x-e.origin.x;o.f+=t.y-e.origin.y;n.matrix(o);r.transform(n)}function Se(t,e,r,n,o){var i;if(r==="start")i=e.origin[n];else if(r==="end")i=e.origin[n]+e.size[o]-t;else i=e.origin[n]+(e.size[o]-t)/2;return i}function Ee(t,e,r,n,o){var i;if(r==="start")i=e.origin[n]+e.size[o]-t;else if(r==="end")i=e.origin[n];else i=e.origin[n]+(e.size[o]-t)/2;return i}var Ae={alignContent:"start",justifyContent:"start",alignItems:"start",spacing:0,orientation:"horizontal",lineSpacing:0,wrap:true,revers:false},Pe=function(t,e){t.forEach(e)},Ne=function(t,e){var r=t.length;for(var n=r-1;n>=0;n--)e(t[n],n)},ze=function(r){function t(t,e){r.call(this,v.extend({},Ae,e));this._rect=t;this._fieldMap={}}f(t,r);t.prototype=Object.create(r&&r.prototype);t.prototype.constructor=t;t.fn=t.prototype;t.fn.init=t.fn.constructor;t.prototype.rect=function t(e){if(e){this._rect=e;return this}return this._rect};t.prototype._initMap=function t(){var e=this.options;var r=this._fieldMap;if(e.orientation==="horizontal"){r.sizeField="width";r.groupsSizeField="height";r.groupAxis="x";r.groupsAxis="y"}else{r.sizeField="height";r.groupsSizeField="width";r.groupAxis="y";r.groupsAxis="x"}if(e.reverse){this.forEach=Ne;this.justifyAlign=Ee}else{this.forEach=Pe;this.justifyAlign=Se}};t.prototype.reflow=function h(){var f=this;if(!this._r