66 lines
138 KiB
JavaScript
66 lines
138 KiB
JavaScript
|
/**
|
|||
|
* @license almond 0.3.0 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
|||
|
* Available via the MIT or new BSD license.
|
|||
|
* see: http://github.com/jrburke/almond for details
|
|||
|
*/
|
|||
|
|
|||
|
// ┌────────────────────────────────────────────────────────────────────┐ \\
|
|||
|
// │ Raphaël 2.1.2 - JavaScript Vector Library │ \\
|
|||
|
// ├────────────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
|||
|
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
|
|||
|
// ├────────────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
|
|||
|
// └────────────────────────────────────────────────────────────────────┘ \\
|
|||
|
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
|||
|
//
|
|||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|||
|
// you may not use this file except in compliance with the License.
|
|||
|
// You may obtain a copy of the License at
|
|||
|
//
|
|||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|||
|
//
|
|||
|
// Unless required by applicable law or agreed to in writing, software
|
|||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
|
// See the License for the specific language governing permissions and
|
|||
|
// limitations under the License.
|
|||
|
// ┌────────────────────────────────────────────────────────────┐ \\
|
|||
|
// │ Eve 0.4.2 - JavaScript Events Library │ \\
|
|||
|
// ├────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
|
|||
|
// └────────────────────────────────────────────────────────────┘ \\
|
|||
|
|
|||
|
// ┌─────────────────────────────────────────────────────────────────────┐ \\
|
|||
|
// │ "Raphaël 2.1.2" - JavaScript Vector Library │ \\
|
|||
|
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
|||
|
// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\
|
|||
|
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
|
|||
|
// └─────────────────────────────────────────────────────────────────────┘ \\
|
|||
|
|
|||
|
// ┌─────────────────────────────────────────────────────────────────────┐ \\
|
|||
|
// │ Raphaël - JavaScript Vector Library │ \\
|
|||
|
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ SVG Module │ \\
|
|||
|
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
|||
|
// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\
|
|||
|
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
|
|||
|
// └─────────────────────────────────────────────────────────────────────┘ \\
|
|||
|
|
|||
|
// ┌─────────────────────────────────────────────────────────────────────┐ \\
|
|||
|
// │ Raphaël - JavaScript Vector Library │ \\
|
|||
|
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ VML Module │ \\
|
|||
|
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
|||
|
// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
|||
|
// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\
|
|||
|
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
|
|||
|
// └─────────────────────────────────────────────────────────────────────┘ \\
|
|||
|
|
|||
|
var requirejs,require,define;if(function(t){function e(t,e){return v.call(t,e)}function r(t,e){var r,n,i,a,s,o,c,h,u,l,f,p=e&&e.split("/"),d=g.map,x=d&&d["*"]||{};if(t&&"."===t.charAt(0))if(e){for(p=p.slice(0,p.length-1),t=t.split("/"),s=t.length-1,g.nodeIdCompat&&m.test(t[s])&&(t[s]=t[s].replace(m,"")),t=p.concat(t),u=0;u<t.length;u+=1)if("."===(f=t[u]))t.splice(u,1),u-=1;else if(".."===f){if(1===u&&(".."===t[2]||".."===t[0]))break;u>0&&(t.splice(u-1,2),u-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((p||x)&&d){for(r=t.split("/"),u=r.length;u>0;u-=1){if(n=r.slice(0,u).join("/"),p)for(l=p.length;l>0;l-=1)if((i=d[p.slice(0,l).join("/")])&&(i=i[n])){a=i,o=u;break}if(a)break;!c&&x&&x[n]&&(c=x[n],h=u)}!a&&c&&(a=c,o=h),a&&(r.splice(0,o,a),t=r.join("/"))}return t}function n(e,r){return function(){var n=y.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),u.apply(t,n.concat([e,r]))}}function i(t){return function(e){return r(e,t)}}function a(t){return function(e){p[t]=e}}function s(r){if(e(d,r)){var n=d[r];delete d[r],x[r]=!0,h.apply(t,n)}if(!e(p,r)&&!e(x,r))throw new Error("No "+r);return p[r]}function o(t){var e,r=t?t.indexOf("!"):-1;return r>-1&&(e=t.substring(0,r),t=t.substring(r+1,t.length)),[e,t]}function c(t){return function(){return g&&g.config&&g.config[t]||{}}}var h,u,l,f,p={},d={},g={},x={},v=Object.prototype.hasOwnProperty,y=[].slice,m=/\.js$/;l=function(t,e){var n,a=o(t),c=a[0];return t=a[1],c&&(c=r(c,e),n=s(c)),c?t=n&&n.normalize?n.normalize(t,i(e)):r(t,e):(t=r(t,e),a=o(t),c=a[0],t=a[1],c&&(n=s(c))),{f:c?c+"!"+t:t,n:t,pr:c,p:n}},f={require:function(t){return n(t)},exports:function(t){var e=p[t];return void 0!==e?e:p[t]={}},module:function(t){return{id:t,uri:"",exports:p[t],config:c(t)}}},h=function(r,i,o,c){var h,u,g,v,y,m,b=[],_=typeof o;if(c=c||r,"undefined"===_||"function"===_){for(i=!i.length&&o.length?["require","exports","module"]:i,y=0;y<i.length;y+=1)if(v=l(i[y],c),"require"===(u=v.f))b[y]=f.require(r);else if("exports"===u)b[y]=f.exports(r),m=!0;else if("module"===u)h=b[y]=f.module(r);else if(e(p,u)||e(d,u)||e(x,u))b[y]=s(u);else{if(!v.p)throw new Error(r+" missing "+u);v.p.load(v.n,n(c,!0),a(u),{}),b[y]=p[u]}g=o?o.apply(p[r],b):void 0,r&&(h&&h.exports!==t&&h.exports!==p[r]?p[r]=h.exports:g===t&&m||(p[r]=g))}else r&&(p[r]=o)},requirejs=require=u=function(e,r,n,i,a){if("string"==typeof e)return f[e]?f[e](r):s(l(e,r).f);if(!e.splice){if(g=e,g.deps&&u(g.deps,g.callback),!r)return;r.splice?(e=r,r=n,n=null):e=t}return r=r||function(){},"function"==typeof n&&(n=i,i=a),i?h(t,e,r,n):setTimeout(function(){h(t,e,r,n)},4),u},u.config=function(t){return u(t)},requirejs._defined=p,define=function(t,r,n){r.splice||(n=r,r=[]),e(p,t)||e(d,t)||(d[t]=[t,r,n])},define.amd={jQuery:!0}}(),define("libs/almond",function(){}),"function"!=typeof define)var define=require("amdefine")(module);if(define("Kit",[],function(){function t(e,a){return e._Set?e:(a||(e=n(e)),e.contains=function(t,n){return!!~r(e,t,n)},e.indexOf=function(t,n){return r(e,t,n)},e.toArray=function(){return i(e)},e.union=function(r){r=t(r);for(var n=e.length+r.length,a=new e.constructor(n),s=0,o=0,c=0;c<n;c++)e[s]===r[o]?(a[c]=e[s++],o++,n--):e[s]<r[o]?a[c]=e[s++]:a[c]=r[o++];return a.length=n,t(a.length===n?a:i(a,n),!0)},e.inspect=e.toArray,e._Set=!0,e)}function e(t,e){return t<e?E:t===e?C:k}function r(t,r,n){var i,a,s=0,o=t.length,c=o-1;if(o<1)return-1;if(n=n||e,1===o)return n(r,t[s])===C?s:-1;if(n(r,t[s])===E||n(r,t[c])===k)return-1;do{if(i=s+(c-s+1>>1),(a=n(r,t[i]))===C)return i;a===E?c=i-1:s=i+1}while(s<=c);return-1}function n(t){var e=t.length;if(e<=1)return t;for(var r,n,a,s=1,o=e/3|0;s<o;)s=3*s+1;for(;s>0;){for(r=s;r<e;r++)for(n=r;n>=s&&t[n]<t[n-s];n-=s)a=t[n],t[n]=t[n-s],t[n-s]=a;s=s/3|0}var c=t[0];for(r=1,n=1;r<e;r++)t[r]!==c&&(c=t[n++]=t[r]);return t.length=n,t.length===n?t:i(t,n)}function i(t,e){e=void 0===e?t.length:e;for(var r=new t.constructor(e),n=e;n--;)r[n]=t[n];return r}function a(t){for(var e,r={},n=0,i=0,a=t.length;n<a;n++)e=t[n],r.hasOwnProperty(e)||(r[e]=1,t[i++]=e);return t.length=i,t}function s(
|
|||
|
action:!t.nonCapture&&function(e,r,n){e.unshift({type:v,num:t.num,index:n})}}];e=r;var i=c(t.sub,e);n=n.concat(i.trans);var a=[l()];return n.push({from:i.accepts,to:a,charset:!1,action:!t.nonCapture&&function(e,r,n){e.unshift({type:y,num:t.num,index:n})}}),{accepts:a,trans:n}}function s(t,e){var r=[l()],n=t.num;return{accepts:r,trans:[{from:e,to:r,charset:!1,assert:function(t,e,r,i,a){var s=u(t,n,a);return void 0===s&&(s=""),a.slice(r,r+s.length)===s&&s.length}}]}}function o(t,e){var r=[],n=[];return t.branches.forEach(function(t){var i=c(t,e);r=r.concat(i.trans),n=n.concat(i.accepts)}),{trans:r,accepts:n}}function h(t,e){function n(t){var e=r(c(t.sub,["start"]));return function(t,r,n,i,a){return e.input(a,n,null,t).acceptable}}function i(t,e){return!!(a(t-1,e)^a(t,e))}function a(t,e){return-1!==t&&t!==e.length&&/\w/.test(e[t])}function s(t,e,r,n,i){return 0===r||"\n"===i[r-1]}function o(t,e,r,n,i){return 0===r}function h(t,e,r,n,i){return r===i.length||"\n"===e}function u(t,e,r,n,i){return r===i.length}var f;switch(t.assertionType){case AssertBegin:f=t.multiline?s:o;break;case AssertEnd:f=t.multiline?h:u;break;case AssertWordBoundary:f=function(t,e,r,n,a){return i(r,a)};break;case AssertNonWordBoundary:f=function(t,e,r,n,a){return!i(r,a)};break;case AssertLookahead:f=n(t);break;case AssertNegativeLookahead:f=function(t){var e=n(t);return function(){return!e.apply(this,arguments)}}(t)}return function(t,e,r){var n=[l()];return{accepts:n,trans:[{from:e,to:n,charset:!1,assert:r}]}}(t,e,f)}return{assert:h,choice:o,backref:s,group:a,empty:i,charset:e,dot:n,exact:t}}();return n}),"function"!=typeof define)var define=require("amdefine")(module);if(define("visualize",["./Kit","./parse"],function(t,e){function r(t,e){if(e=e||"normal",S[t]&&S[t][e])return S[t][e];y.attr({"font-size":t,"font-weight":e});var r=y.getBBox();return S[t]=S[t]||{},S[t][e]={width:r.width/((y.attr("text").length-1)/2),height:r.height/2}}function n(t){y=t.text(-1e3,-1e3,"XgfTlM|.q\nXgfTlM|.q").attr({"font-family":E,"font-size":m})}function i(t,e,i){i.clear(),i.setSize(0,0);var o=i.rect(0,0,0,0);o.attr("fill",w),o.attr("stroke",w),n(i),C=!!~e.indexOf("m");var c=d(t.tree);c.unshift(x("/",B.delimiter)),c.unshift(x("RegExp: ")),c.push(x("/",B.delimiter)),e&&c.push(x(e,B.flags));var h=r(m,"bold"),u=k,l=h.height/2+k,f=0,p=0;f=c.reduce(function(t,e){return e.x=t,e.y=l,t+e.text.length*h.width},u),f+=k,p=h.height+2*k,c=i.add(c),i.setSize(f,h.height+2*k);var g=a(t.tree,0,0);p=Math.max(g.height+3*k+h.height,p),f=Math.max(g.width+2*k,f),i.setSize(f,p),o.attr("width",f),o.attr("height",p),s(g.items,k,2*k+h.height-g.y),i.add(g.items)}function a(t,e,r){return t.unshift({type:"startPoint"}),t.push({type:"endPoint"}),o(t,e,r)}function s(t,e,r){t.forEach(function(t){t._translate?t._translate(e,r):(t.x+=e,t.y+=r)})}function o(t,e,r){var n=[],i=[],a=0,s=0,o=e,c=r,h=r;if(!t.length)return A.empty(null,e,r);t.forEach(function(t){var e;e=t.repeat?A.repeat(t,o,r):A[t.type](t,o,r),n.push(e),o+=e.width+_,a+=e.width,c=Math.min(c,e.y),h=Math.max(h,e.y+e.height),i=i.concat(e.items)}),s=h-c,n.reduce(function(t,e){a+=_;var n=u(t.lineOutX,r,e.lineInX);return i.push(n),e});var l=n[0].lineInX,f=n[n.length-1].lineOutX;return{items:i,width:a,height:s,x:e,y:c,lineInX:l,lineOutX:f}}function c(e,n,i,a,s){e=t.toPrint(e);var o=r(m),c=e.length*o.width,h=o.height+12,u=c+12,l={type:"rect",x:n,y:i-h/2,width:u,height:h,stroke:"none",fill:a||"transparent"},f={type:"text",x:n+u/2,y:i,text:e,"font-size":m,"font-family":E,fill:s||"black"};return{text:f,rect:l,items:[l,f],width:u,height:h,x:n,y:l.y,lineInX:n,lineOutX:n+u}}function h(t,e,n,i){var a,s=r(b),o=n.split("\n"),c=o.length*s.height;a=o.length>1?Math.max.apply(Math,o.map(function(t){return t.length})):n.length,a*=s.width;return{label:{type:"text",x:t,y:e-c/2-4,text:n,"font-size":b,"font-family":E,fill:i||"#444"},x:t-a/2,y:e-c-4,width:a,height:c+4}}function u(t,e,r){return{type:"path",x:t,y:e,path:["M",t,e,"H",r],"stroke-linecap":"butt","stroke-linejoin":"round",stroke:"#333","stroke-width":2,_translate:function(t,e){var r=this.path;r[1]+=t,r[2]+=e,r[
|
|||
|
n=J((o=h[3].charAt(2))+o,16),e=J((o=h[3].charAt(1))+o,16)),h[4]&&(c=h[4][F](nt),e=Z(c[0]),"%"==c[0].slice(-1)&&(e*=2.55),n=Z(c[1]),"%"==c[1].slice(-1)&&(n*=2.55),i=Z(c[2]),"%"==c[2].slice(-1)&&(i*=2.55),"rgba"==h[1].toLowerCase().slice(0,4)&&(a=Z(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100)),h[5]?(c=h[5][F](nt),e=Z(c[0]),"%"==c[0].slice(-1)&&(e*=2.55),n=Z(c[1]),"%"==c[1].slice(-1)&&(n*=2.55),i=Z(c[2]),"%"==c[2].slice(-1)&&(i*=2.55),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(e/=360),"hsba"==h[1].toLowerCase().slice(0,4)&&(a=Z(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),r.hsb2rgb(e,n,i,a)):h[6]?(c=h[6][F](nt),e=Z(c[0]),"%"==c[0].slice(-1)&&(e*=2.55),n=Z(c[1]),"%"==c[1].slice(-1)&&(n*=2.55),i=Z(c[2]),"%"==c[2].slice(-1)&&(i*=2.55),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(e/=360),"hsla"==h[1].toLowerCase().slice(0,4)&&(a=Z(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),r.hsl2rgb(e,n,i,a)):(h={r:e,g:n,b:i,toString:s},h.hex="#"+(16777216|i|n<<8|e<<16).toString(16).slice(1),r.is(a,"finite")&&(h.opacity=a),h)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:s}},r),r.hsb=a(function(t,e,n){return r.hsb2rgb(t,e,n).hex}),r.hsl=a(function(t,e,n){return r.hsl2rgb(t,e,n).hex}),r.rgb=a(function(t,e,r){return"#"+(16777216|r|e<<8|t<<16).toString(16).slice(1)}),r.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},r=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),r.hex},r.getColor.reset=function(){delete this.start},r.parsePathString=function(t){if(!t)return null;var e=kt(t);if(e.arr)return At(e.arr);var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},i=[];return r.is(t,W)&&r.is(t[0],W)&&(i=At(t)),i.length||M(t).replace(st,function(t,e,r){var a=[],s=e.toLowerCase();if(r.replace(ct,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(i.push([e][O](a.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)i.push([e][O](a));else for(;a.length>=n[s]&&(i.push([e][O](a.splice(0,n[s]))),n[s]););}),i.toString=r._path2string,e.arr=At(i),i},r.parseTransformString=a(function(t){if(!t)return null;var e=[];return r.is(t,W)&&r.is(t[0],W)&&(e=At(t)),e.length||M(t).replace(ot,function(t,r,n){var i=[];L.call(r);n.replace(ct,function(t,e){e&&i.push(+e)}),e.push([r][O](i))}),e.toString=r._path2string,e});var kt=function(t){var e=kt.ps=kt.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var r in e)e[k](r)&&r!=t&&!--e[r].sleep&&delete e[r]}),e[t]};r.findDotsAtSegment=function(t,e,r,n,i,a,s,o,c){var h=1-c,u=G(h,3),l=G(h,2),f=c*c,p=f*c,d=u*t+3*l*c*r+3*h*c*c*i+p*s,g=u*e+3*l*c*n+3*h*c*c*a+p*o,x=t+2*c*(r-t)+f*(i-2*r+t),v=e+2*c*(n-e)+f*(a-2*n+e),y=r+2*c*(i-r)+f*(s-2*i+r),m=n+2*c*(a-n)+f*(o-2*a+n),b=h*t+c*r,_=h*e+c*n,w=h*i+c*s,E=h*a+c*o,C=90-180*z.atan2(x-y,v-m)/q;return(x>y||v<m)&&(C+=180),{x:d,y:g,m:{x:x,y:v},n:{x:y,y:m},start:{x:b,y:_},end:{x:w,y:E},alpha:C}},r.bezierBBox=function(t,e,n,i,a,s,o,c){r.is(t,"array")||(t=[t,e,n,i,a,s,o,c]);var h=Mt.apply(null,t);return{x:h.min.x,y:h.min.y,x2:h.max.x,y2:h.max.y,width:h.max.x-h.min.x,height:h.max.y-h.min.y}},r.isPointInsideBBox=function(t,e,r){return e>=t.x&&e<=t.x2&&r>=t.y&&r<=t.y2},r.isBBoxIntersect=function(t,e){var n=r.isPointInsideBBox;return n(e,t.x,t.y)||n(e,t.x2,t.y)||n(e,t.x,t.y2)||n(e,t.x2,t.y2)||n(t,e.x,e.y)||n(t,e.x2,e.y)||n(t,e.x,e.y2)||n(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)},r.pathIntersection=function(t,e){return p(t,e)},r.pathIntersectionNumber=function(t,e){return p(t,e,1)},r.isPointInsidePath=function(t,e,n){var i=r.pathBBox(t);return r.isPointInsideBBox(i,e,n)&&p(t,[["M",e,n],["H",i.x2+10]],1)%2==1},r._removedFactory=function(t){return function(){e("raphael.log",null,"Raphaël: you are calling to method “"+t+"” of removed object",t)}};var St=r.pathBBox=function(t){var e=kt(t);if(e.bbox)return n(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=Ft(t);for(var r,i=0,a=0,s=[],o=[],c=0,h=t.length;c<h;c++)if(r=t[c],"M"==r[0])i=r[1],a=r[2],s.push(i),o.push(a);else{var u=Mt(i,a,r[1],r[2],r[3],r[4],r[5],r[6]);s=s[O](u.min.x,u.ma
|
|||
|
for(var e=0,r=this.length;e<r;e++)if(this[e]==t)return this.splice(e,1),!0},fe.animate=function(t,e,n,i){(r.is(n,"function")||!n)&&(i=n||null);var a,s,o=this.items.length,c=o,h=this;if(!o)return this;i&&(s=function(){!--o&&i.call(h)}),n=r.is(n,"string")?n:s;var u=r.animation(t,e,n,s);for(a=this.items[--c].animate(u);c--;)this.items[c]&&!this.items[c].removed&&this.items[c].animateWith(a,u,u),this.items[c]&&!this.items[c].removed||o--;return this},fe.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},fe.getBBox=function(){for(var t=[],e=[],r=[],n=[],i=this.items.length;i--;)if(!this.items[i].removed){var a=this.items[i].getBBox();t.push(a.x),e.push(a.y),r.push(a.x+a.width),n.push(a.y+a.height)}return t=U[N](0,t),e=U[N](0,e),r=j[N](0,r),n=j[N](0,n),{x:t,y:e,x2:r,y2:n,width:r-t,height:n-e}},fe.clone=function(t){t=this.paper.set();for(var e=0,r=this.items.length;e<r;e++)t.push(this.items[e].clone());return t},fe.toString=function(){return"Raphaël‘s set"},fe.glow=function(t){var e=this.paper.set();return this.forEach(function(r,n){var i=r.glow(t);null!=i&&i.forEach(function(t,r){e.push(t)})}),e},fe.isPointInside=function(t,e){var r=!1;return this.forEach(function(n){if(n.isPointInside(t,e))return r=!0,!1}),r},r.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},r=t.face["font-family"];for(var n in t.face)t.face[k](n)&&(e.face[n]=t.face[n]);if(this.fonts[r]?this.fonts[r].push(e):this.fonts[r]=[e],!t.svg){e.face["units-per-em"]=J(t.face["units-per-em"],10);for(var i in t.glyphs)if(t.glyphs[k](i)){var a=t.glyphs[i];if(e.glyphs[i]={w:a.w,k:{},d:a.d&&"M"+a.d.replace(/[mlcxtrv]/g,function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"})+"z"},a.k)for(var s in a.k)a[k](s)&&(e.glyphs[i].k[s]=a.k[s])}}return t},_.getFont=function(t,e,n,i){if(i=i||"normal",n=n||"normal",e=+e||{normal:400,bold:700,lighter:300,bolder:800}[e]||400,r.fonts){var a=r.fonts[t];if(!a){var s=new RegExp("(^|\\s)"+t.replace(/[^\w\d\s+!~.:_-]/g,R)+"(\\s|$)","i");for(var o in r.fonts)if(r.fonts[k](o)&&s.test(o)){a=r.fonts[o];break}}var c;if(a)for(var h=0,u=a.length;h<u&&(c=a[h],c.face["font-weight"]!=e||c.face["font-style"]!=n&&c.face["font-style"]||c.face["font-stretch"]!=i);h++);return c}},_.print=function(t,e,n,i,a,s,o,c){s=s||"middle",o=j(U(o||0,1),-1),c=j(U(c||1,3),1);var h,u=M(n)[F](R),l=0,f=0,p=R;if(r.is(i,"string")&&(i=this.getFont(i)),i){h=(a||16)/i.face["units-per-em"];for(var d=i.face.bbox[F](w),g=+d[0],x=d[3]-d[1],v=0,y=+d[1]+("baseline"==s?x+ +i.face.descent:x/2),m=0,b=u.length;m<b;m++){if("\n"==u[m])l=0,E=0,f=0,v+=x*c;else{var _=f&&i.glyphs[u[m-1]]||{},E=i.glyphs[u[m]];l+=f?(_.w||i.w)+(_.k&&_.k[u[m]]||0)+i.w*o:0,f=1}E&&E.d&&(p+=r.transformPath(E.d,["t",l*h,v*h,"s",h,h,g,y,"t",(t-g)/h,(e-y)/h]))}}return this.path(p).attr({fill:"#000",stroke:"none"})},_.add=function(t){if(r.is(t,"array"))for(var e,n=this.set(),i=0,a=t.length;i<a;i++)e=t[i]||{},E[k](e.type)&&n.push(this[e.type]().attr(e));return n},r.format=function(t,e){var n=r.is(e,W)?[0][O](e):arguments;return t&&r.is(t,"string")&&n.length-1&&(t=t.replace(C,function(t,e){return null==n[++e]?R:n[e]})),t||R},r.fullfill=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,r=function(t,r,n){var i=n;return r.replace(e,function(t,e,r,n,a){e=e||n,i&&(e in i&&(i=i[e]),"function"==typeof i&&a&&(i=i()))}),i=(null==i||i==n?t:i)+""};return function(e,n){return String(e).replace(t,function(t,e){return r(t,e,n)})}}(),r.ninja=function(){return A.was?S.win.Raphael=A.is:delete Raphael,r},r.st=fe,function(t,e,n){function i(){/in/.test(t.readyState)?setTimeout(i,9):r.eve("raphael.DOMload")}null==t.readyState&&t.addEventListener&&(t.addEventListener("DOMContentLoaded",n=function(){t.removeEventListener("DOMContentLoaded",n,!1),t.readyState="complete"},!1),t.readyState="loading"),i()}(document),e.on("raphael.DOMload",function(){b=!0}),function(){if(r.svg){var t="hasOwnProperty",e=String,n=parseFloat,i=parseInt,a=Math,s=a.max,o=a.abs,c=a.pow,h=/[, ]+/,u=r.eve,l="",f=" ",p="
|
|||
|
return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},B.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),r.eve.unbind("raphael.*.*."+this.id),r._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var t in this)this[t]="function"==typeof this[t]?r._removedFactory(t):null;this.removed=!0}},B.attr=function(e,n){if(this.removed)return this;if(null==e){var i={};for(var a in this.attrs)this.attrs[t](a)&&(i[a]=this.attrs[a]);return i.gradient&&"none"==i.fill&&(i.fill=i.gradient)&&delete i.gradient,i.transform=this._.transform,i}if(null==n&&r.is(e,"string")){if("fill"==e&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var s=e.split(h),o={},c=0,l=s.length;c<l;c++)e=s[c],e in this.attrs?o[e]=this.attrs[e]:r.is(this.paper.customAttributes[e],"function")?o[e]=this.paper.customAttributes[e].def:o[e]=r._availableAttrs[e];return l-1?o:o[s[0]]}if(this.attrs&&null==n&&r.is(e,"array")){for(o={},c=0,l=e.length;c<l;c++)o[e[c]]=this.attr(e[c]);return o}var f;null!=n&&(f={},f[e]=n),null==n&&r.is(e,"object")&&(f=e);for(var p in f)u("raphael.attr."+p+"."+this.id,this,f[p]);if(f){for(p in this.paper.customAttributes)if(this.paper.customAttributes[t](p)&&f[t](p)&&r.is(this.paper.customAttributes[p],"function")){var d=this.paper.customAttributes[p].apply(this,[].concat(f[p]));this.attrs[p]=f[p];for(var g in d)d[t](g)&&(f[g]=d[g])}f.text&&"text"==this.type&&(this.textpath.string=f.text),k(this,f)}return this},B.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&r._tofront(this,this.paper),this},B.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),r._toback(this,this.paper)),this)},B.insertAfter=function(t){return this.removed?this:(t.constructor==r.st.constructor&&(t=t[t.length-1]),t.node.nextSibling?t.node.parentNode.insertBefore(this.node,t.node.nextSibling):t.node.parentNode.appendChild(this.node),r._insertafter(this,t,this.paper),this)},B.insertBefore=function(t){return this.removed?this:(t.constructor==r.st.constructor&&(t=t[0]),t.node.parentNode.insertBefore(this.node,t.node),r._insertbefore(this,t,this.paper),this)},B.blur=function(t){var e=this.node.runtimeStyle,n=e.filter;return n=n.replace(g,f),0!=+t?(this.attrs.blur=t,e.filter=n+l+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+t||1.5)+")",e.margin=r.format("-{0}px 0 0 -{0}px",a(+t||1.5))):(e.filter=n,e.margin=0,delete this.attrs.blur),this},r._engine.path=function(t,e){var r=N("shape");r.style.cssText=v,r.coordsize=y+l+y,r.coordorigin=e.coordorigin;var n=new A(r,e),i={fill:"none",stroke:"#000"};t&&(i.path=t),n.type="path",n.path=[],n.Path=f,k(n,i),e.canvas.appendChild(r);var a=N("skew");return a.on=!0,r.appendChild(a),n.skew=a,n.transform(f),n},r._engine.rect=function(t,e,n,i,a,s){var o=r._rectPath(e,n,i,a,s),c=t.path(o),h=c.attrs;return c.X=h.x=e,c.Y=h.y=n,c.W=h.width=i,c.H=h.height=a,h.r=s,h.path=o,c.type="rect",c},r._engine.ellipse=function(t,e,r,n,i){var a=t.path();a.attrs;return a.X=e-n,a.Y=r-i,a.W=2*n,a.H=2*i,a.type="ellipse",k(a,{cx:e,cy:r,rx:n,ry:i}),a},r._engine.circle=function(t,e,r,n){var i=t.path();i.attrs;return i.X=e-n,i.Y=r-n,i.W=i.H=2*n,i.type="circle",k(i,{cx:e,cy:r,r:n}),i},r._engine.image=function(t,e,n,i,a,s){var o=r._rectPath(n,i,a,s),c=t.path(o).attr({stroke:"none"}),h=c.attrs,u=c.node,l=u.getElementsByTagName("fill")[0];return h.src=e,c.X=h.x=n,c.Y=h.y=i,c.W=h.width=a,c.H=h.height=s,h.path=o,c.type="image",l.parentNode==u&&u.removeChild(l),l.rotate=!0,l.src=e,l.type="tile",c._.fillpos=[n,i],c._.fillsize=[a,s],u.appendChild(l),E(c,1,1,0,0,0),c},r._engine.text=function(t,n,i,s){var o=N("shape"),c=N("path"),h=N("textpath");n=n||0,i=i||0,s=s||"",c.v=r.format("m{0},{1}l{2},{1}",a(n*y),a(i*y),a(n*y)+1),c.textpathok=!0,h.string=e(s),h.on=!0,o.style.cssText=v,o.coordsize=y
|