text: /*! kjua v1.6.3 - https://github.com/werthdavid/kjua */
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("kjua",[],e):"object"==typeof exports?exports.kjua=e():t.kjua=e()}("undefined"!=typeof self?self:this,function(){return function(n){var i={};function r(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){var i=n(1),o=i.create_canvas,a=i.canvas_to_img,h=i.dpr,u=n(3),l=n(4),c=n(6),f=n(9);t.exports=function(t){var e=Object.assign({},u,t),n=l(e.text,e.ecLevel,e.minVersion,e.quiet,e);if("svg"===e.render)return f(n.svgText,e);var i=e.ratio||h,r=o(e.size,i),s=r.getContext("2d");return s.scale(i,i),c(n,s,e),"image"===e.render?a(r):r}},function(a,t,e){(function(t){function i(t){return s.createElement(t)}function n(t,e){return t.getAttribute(e)}function r(t,e,n){return t.setAttribute(e,n)}var e=t.window,s=e.document,o=e.devicePixelRatio||1;a.exports={create_canvas:function(t,e){var n=i("canvas");return r(n,"width",t*e),r(n,"height",t*e),n.style.width="".concat(t,"px"),n.style.height="".concat(t,"px"),n},canvas_to_img:function(t){var e=i("img");return r(e,"crossorigin","anonymous"),r(e,"src",t.toDataURL("image/png")),r(e,"width",n(t,"width")),r(e,"height",n(t,"height")),e.style.width=t.style.width,e.style.height=t.style.height,e},calc_image_pos:function(t){var e=t.size,n=t.image.naturalWidth||1,i=t.image.naturalHeight||1,r=.01*t.mSize,s=r*n/i;return{x:(1-s)*t.mPosX*.01*e,y:(1-r)*t.mPosY*.01*e,iw:s*e,ih:r*e}},dpr:o}}).call(this,e(2))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports={render:"image",crisp:!1,minVersion:1,ecLevel:"L",size:200,ratio:null,fill:"#333",back:"#fff",text:"no text",rounded:0,quiet:0,mode:"plain",mSize:30,mPosX:50,mPosY:50,label:"no label",fontname:"sans",fontcolor:"#333",fontoutline:!0,image:null}},function(t,e,n){function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c=/code length overflow/i,f=n(5);f.stringToBytes=f.stringToBytesFuncs["UTF-8"];t.exports=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"L",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,r=function(o,a){for(var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,h=3<arguments.length?arguments[3]:void 0,u=t=Math.max(1,t);u<=40;u+=1)try{var e=function(){var n=f(u,a);n.addData(o),n.make();var i=n.getModuleCount(),t=void 0;if("svg"===h.render){var e=i+2*h.quiet,r=h.size/e,s=0;h.crisp&&(r=Math.floor(r),s=Math.floor((h.size-r*e)/2)),t="svg"===h.render?n.createSvgTag(r,r*h.quiet+s,!0):void 0}return{v:{text:o,level:a,version:u,moduleCount:i,isDark:function(t,e){return 0<=t&&t<i&&0<=e&&e<i&&n.isDark(t,e)},svgText:t}}}();if("object"===l(e))return e.v}catch(t){if(!(u<40&&c.test(t)))throw new Error(t)}return null}(t,e,n,4<arguments.length?arguments[4]:void 0);if(r){var s=r.isDark;r.moduleCount+=2*i,r.isDark=function(t,e){return s(t-i,e-i)}}return r}},function(t,e,n){var i,r,s,o=function(){function s(t,e){function o(t,e){l=function(t){for(var e=new Array(t),n=0;n<t;n+=1){e[n]=new Array(t);for(var i=0;i<t;i+=1)e[n][i]=null}return e}(c=4*a+17),n(0,0),n(c-7,0),n(0,c-7),s(),r(),p(t,e),7<=a&&f(t),null==i&&(i=m(a,h,u)),g(i,e)}var a=t,h=v[e],l=null,c=0,i=null,u=[],d={},n=function(t,e){for(var n=-1;n<=7;n+=1)if(!(t+n<=-1||c<=t+n))for(var i=-1;i<=7;i+=1)e+i<=-1||c<=e+i||(l[t+n][e+i]=0<=n&&n<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=i&&i<=4)},r=function(){for(var t=8;t<c-8;t+=1)null==l[t][6]&&(l[t][6]=t%2==0);for(var e=8;e<c-8;e+=1)null==l[6][e]&&(l[6][e]=e%2==0)},s=function(){for(var t=y.getPatternPosition(a),e=0;e<t.length;e+=1)for(var n=0;n<t.length;n+=1){var i=t[e],r=t[n];if(null==l[i][r])for(var s=-2;s<=2;s+=1)for(var o=-2;o<=2;o+=1)l[i+s][r+o]=-2==s||2==s||-2==o||2==o||0==s&&0==o}},f=function(t){for(var e=y.getBCHTypeNumber(a),n=0;n<18;n+=1){var i=!t&&1==(e>>n&1);l[Math.floor(n/3)][n%3+c-8-3]=i}for(n=0;n<18;n+=1){i=!t&&1==(e>>n&1);l[n%3+c-8-3][Math.floor(n/3)]=i}},p=function(t,e){for(var n=h<<3|e,i=y.getBCHTypeInfo(n),r=0;r<15;r+=1){var s=!t&&1==(i>>r&1);r<6?l[r][8]=s:r<8?l[r+1][8]=s:l[c-15+r][8]=s}for(r=0;r<15;r+=1){s=!t&&1==(i>>r&1);r<8?l[8][c-r-1]=s:r<9?l[8][15-r-1+1]=s:l[8][15-r-1]=s}l[c-8][8]=!t},g=function(t,e){for(var n=-1,i=c-1,r=7,s=0,o=y.getMaskFunction(e),a=c-1;0<a;a-=2)for(6==a&&(a-=1);;){for(var h=0;h<2;h+=1)if(null==l[i][a-h]){var u=!1;s<t.length&&(u=1==(t[s]>>>r&1)),o(i,a-h)&&(u=!u),l[i][a-h]=u,-1==(r-=1)&&(s+=1,r=7)}if((i+=n)<0||c<=i){i-=n,n=-n;break}}},m=function(t,e,n){for(var i=C.getRSBlocks(t,e),r=k(),s=0;s<n.length;s+=1){var o=n[s];r.put(o.getMode(),4),r.put(o.getLength(),y.getLengthInBits(o.getMode(),t)),o.write(r)}var a=0;for(s=0;s<i.length;s+=1)a+=i[s].dataCount;if(r.getLengthInBits()>8*a)throw"code length overflow. ("+r.getLengthInBits()+">"+8*a+")";for(r.getLengthInBits()+4<=8*a&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=8*a||(r.put(236,8),r.getLengthInBits()>=8*a));)r.put(17,8);return function(t,e){for(var n=0,i=0,r=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a+=1){var h=e[a].dataCount,u=e[a].totalCount-h;i=Math.max(i,h),r=Math.max(r,u),s[a]=new Array(h);for(var l=0;l<s[a].length;l+=1)s[a][l]=255&t.getBuffer()[l+n];n+=h;var c=y.getErrorCorrectPolynomial(u),f=x(s[a],c.getLength()-1).mod(c);for(o[a]=new Array(c.getLength()-1),l=0;l<o[a].length;l+=1){var d=l+f.getLength()-o[a].length;o[a][l]=0<=d?f.getAt(d):0}}var p=0;for(l=0;l<e.length;l+=1)p+=e[l].totalCount;var g=new Array(p),m=0;for(l=0;l<i;l+=1)for(a=0;a<e.length;a+=1)l<s[a].length&&(g[m]=s[a][l],m+=1);for(l=0;l<r;l+=1)for(a=0;a<e.length;a+=1)l<o[a].length&&(g[m]=o[a][l],m+=1);return g}(r,i)};return d.addData=function(t,e){var n=null;switch(e=e||"Byte"){case"Numeric":n=A(t);break;case"Alphanumeric":n=M(t);break;case"Byte":n=S(t);break;case"Kanji":n=P(t);break;default:throw"mode:"+e}u.push(n),i=null},d.isDark=function(t,e){if(t<0||c<=t||e<0||c<=e)throw t+","+e;return l[t][e]},d.getModuleCount=function(){return c},d.make=function(){if(a<1){for(var t=1;t<40;t++){for(var e=C.getRSBlocks(t,h),n=k(),i=0;i<u.length;i++){var r=u[i];n.put(r.getMode(),4),n.put(r.getLength(),y.getLengthInBits(r.getMode(),t)),r.write(n)}var s=0;for(i=0;i<e.length;i++)s+=e[i].dataCount;if(n.getLengthInBits()<=8*s)break}a=t}o(!1,function(){for(var t=0,e=0,n=0;n<8;n+=1){o(!0,n);var i=y.getLostPoint(d);(0==n||i<t)&&(t=i,e=n)}return e}())},d.createTableTag=function(t,e){t=t||2;var n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+(e=void 0===e?4*t:e)+"px;",n+='">',n+="<tbody>";for(var i=0;i<d.getModuleCount();i+=1){n+="<tr>";for(var r=0;r<d.getModuleCount();r+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+t+"px;",n+=" height: "+t+"px;",n+=" background-color: ",n+=d.isDark(i,r)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return n+="</tbody>",n+="</table>"},d.createSvgTag=function(t,e){var n={};"object"==typeof t&&(t=(n=t).cellSize,e=n.margin),t=t||2,e=void 0===e?4*t:e;var i,r,s,o,a=d.getModuleCount()*t+2*e,h="";for(o="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",h+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',h+=n.scalable?"":' width="'+a+'px" height="'+a+'px"',h+=' viewBox="0 0 '+a+" "+a+'" ',h+=' preserveAspectRatio="xMinYMin meet">',h+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',h+='<path d="',r=0;r<d.getModuleCount();r+=1)for(s=r*t+e,i=0;i<d.getModuleCount();i+=1)d.isDark(r,i)&&(h+="M"+(i*t+e)+","+s+o);return h+='" stroke="transparent" fill="black"/>',h+="</svg>"},d.createDataURL=function(r,t){r=r||2,t=void 0===t?4*r:t;var e=d.getModuleCount()*r+2*t,s=t,o=e-t;return B(e,e,function(t,e){if(s<=t&&t<o&&s<=e&&e<o){var n=Math.floor((t-s)/r),i=Math.floor((e-s)/r);return d.isDark(i,n)?0:1}return 1})},d.createImgTag=function(t,e,n){t=t||2,e=void 0===e?4*t:e;var i=d.getModuleCount()*t+2*e,r="";return r+="<img",r+=' src="',r+=d.createDataURL(t,e),r+='"',r+=' width="',r+=i,r+='"',r+=' height="',r+=i,r+='"',n&&(r+=' alt="',r+=n,r+='"'),r+="/>"},d.createASCII=function(t,e){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var e,n,i,r,s,o=1*d.getModuleCount()+2*t,a=t,h=o-t,u={"██":"█","█ ":"▀"," █":"▄","  ":" "},l={"██":"▀","█ ":"▀"," █":" ","  ":" "},c="";for(e=0;e<o;e+=2){for(i=Math.floor((e-a)/1),r=Math.floor((e+1-a)/1),n=0;n<o;n+=1)s="█",a<=n&&n<h&&a<=e&&e<h&&d.isDark(i,Math.floor((n-a)/1))&&(s=" "),a<=n&&n<h&&a<=e+1&&e+1<h&&d.isDark(r,Math.floor((n-a)/1))?s+=" ":s+="█",c+=t<1&&h<=e+1?l[s]:u[s];c+="\n"}return o%2&&0<t?c.substring(0,c.length-o-1)+Array(1+o).join("▀"):c.substring(0,c.length-1)}(e);t-=1,e=void 0===e?2*t:e;var n,i,r,s,o=d.getModuleCount()*t+2*e,a=e,h=o-e,u=Array(t+1).join("██"),l=Array(t+1).join("  "),c="",f="";for(n=0;n<o;n+=1){for(r=Math.floor((n-a)/t),f="",i=0;i<o;i+=1)s=1,a<=i&&i<h&&a<=n&&n<h&&d.isDark(r,Math.floor((i-a)/t))&&(s=0),f+=s?u:l;for(r=0;r<t;r+=1)c+=f+"\n"}return c.substring(0,c.length-1)},d.renderTo2dContext=function(t,e){e=e||2;for(var n=d.getModuleCount(),i=0;i<n;i++)for(var r=0;r<n;r++)t.fillStyle=d.isDark(i,r)?"black":"white",t.fillRect(i*e,r*e,e,e)},d}s.stringToBytes=(s.stringToBytesFuncs={default:function(t){for(var e=[],n=0;n<t.length;n+=1){var i=t.charCodeAt(n);e.push(255&i)}return e}}).default,s.createStringToBytes=function(a,h){var s=function(){function t(){var t=e.read();if(-1==t)throw"eof";return t}for(var e=N(a),n=0,i={};;){var r=e.read();if(-1==r)break;var s=t(),o=t()<<8|t();i[String.fromCharCode(r<<8|s)]=o,n+=1}if(n!=h)throw n+" != "+h;return i}(),o="?".charCodeAt(0);return function(t){for(var e=[],n=0;n<t.length;n+=1){var i=t.charCodeAt(n);if(i<128)e.push(i);else{var r=s[t.charAt(n)];"number"==typeof r?(255&r)==r?e.push(r):(e.push(r>>>8),e.push(255&r)):e.push(o)}}return e}};var o=1,a=2,r=4,h=8,v={L:1,M:0,Q:3,H:2},i=0,u=1,l=2,c=3,f=4,d=5,p=6,g=7,y=function(){function n(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e}var e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t={};return t.getBCHTypeInfo=function(t){for(var e=t<<10;0<=n(e)-n(1335);)e^=1335<<n(e)-n(1335);return 21522^(t<<10|e)},t.getBCHTypeNumber=function(t){for(var e=t<<12;0<=n(e)-n(7973);)e^=7973<<n(e)-n(7973);return t<<12|e},t.getPatternPosition=function(t){return e[t-1]},t.getMaskFunction=function(t){switch(t){case i:return function(t,e){return(t+e)%2==0};case u:return function(t,e){return t%2==0};case l:return function(t,e){return e%3==0};case c:return function(t,e){return(t+e)%3==0};case f:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case d:return function(t,e){return t*e%2+t*e%3==0};case p:return function(t,e){return(t*e%2+t*e%3)%2==0};case g:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw"bad maskPattern:"+t}},t.getErrorCorrectPolynomial=function(t){for(var e=x([1],0),n=0;n<t;n+=1)e=e.multiply(x([1,m.gexp(n)],0));return e},t.getLengthInBits=function(t,e){if(1<=e&&e<10)switch(t){case o:return 10;case a:return 9;case r:case h:return 8;default:throw"mode:"+t}else if(e<27)switch(t){case o:return 12;case a:return 11;case r:return 16;case h:return 10;default:throw"mode:"+t}else{if(!(e<41))throw"type:"+e;switch(t){case o:return 14;case a:return 13;case r:return 16;case h:return 12;default:throw"mode:"+t}}},t.getLostPoint=function(t){for(var e=t.getModuleCount(),n=0,i=0;i<e;i+=1)for(var r=0;r<e;r+=1){for(var s=0,o=t.isDark(i,r),a=-1;a<=1;a+=1)if(!(i+a<0||e<=i+a))for(var h=-1;h<=1;h+=1)r+h<0||e<=r+h||0==a&&0==h||o==t.isDark(i+a,r+h)&&(s+=1);5<s&&(n+=3+s-5)}for(i=0;i<e-1;i+=1)for(r=0;r<e-1;r+=1){var u=0;t.isDark(i,r)&&(u+=1),t.isDark(i+1,r)&&(u+=1),t.isDark(i,r+1)&&(u+=1),t.isDark(i+1,r+1)&&(u+=1),0!=u&&4!=u||(n+=3)}for(i=0;i<e;i+=1)for(r=0;r<e-6;r+=1)t.isDark(i,r)&&!t.isDark(i,r+1)&&t.isDark(i,r+2)&&t.isDark(i,r+3)&&t.isDark(i,r+4)&&!t.isDark(i,r+5)&&t.isDark(i,r+6)&&(n+=40);for(r=0;r<e;r+=1)for(i=0;i<e-6;i+=1)t.isDark(i,r)&&!t.isDark(i+1,r)&&t.isDark(i+2,r)&&t.isDark(i+3,r)&&t.isDark(i+4,r)&&!t.isDark(i+5,r)&&t.isDark(i+6,r)&&(n+=40);var l=0;for(r=0;r<e;r+=1)for(i=0;i<e;i+=1)t.isDark(i,r)&&(l+=1);return n+=10*(Math.abs(100*l/e/e-50)/5)},t}(),m=function(){for(var e=new Array(256),n=new Array(256),t=0;t<8;t+=1)e[t]=1<<t;for(t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(t=0;t<255;t+=1)n[e[t]]=t;var i={glog:function(t){if(t<1)throw"glog("+t+")";return n[t]},gexp:function(t){for(;t<0;)t+=255;for(;256<=t;)t-=255;return e[t]}};return i}();function x(i,r){if(void 0===i.length)throw i.length+"/"+r;var e=function(){for(var t=0;t<i.length&&0==i[t];)t+=1;for(var e=new Array(i.length-t+r),n=0;n<i.length-t;n+=1)e[n]=i[n+t];return e}(),s={getAt:function(t){return e[t]},getLength:function(){return e.length},multiply:function(t){for(var e=new Array(s.getLength()+t.getLength()-1),n=0;n<s.getLength();n+=1)for(var i=0;i<t.getLength();i+=1)e[n+i]^=m.gexp(m.glog(s.getAt(n))+m.glog(t.getAt(i)));return x(e,0)},mod:function(t){if(s.getLength()-t.getLength()<0)return s;for(var e=m.glog(s.getAt(0))-m.glog(t.getAt(0)),n=new Array(s.getLength()),i=0;i<s.getLength();i+=1)n[i]=s.getAt(i);for(i=0;i<t.getLength();i+=1)n[i]^=m.gexp(m.glog(t.getAt(i))+e);return x(n,0).mod(t)}};return s}function w(){var n=[],r={writeByte:function(t){n.push(255&t)},writeShort:function(t){r.writeByte(t),r.writeByte(t>>>8)},writeBytes:function(t,e,n){e=e||0,n=n||t.length;for(var i=0;i<n;i+=1)r.writeByte(t[i+e])},writeString:function(t){for(var e=0;e<t.length;e+=1)r.writeByte(t.charCodeAt(e))},toByteArray:function(){return n},toString:function(){var t="";t+="[";for(var e=0;e<n.length;e+=1)0<e&&(t+=","),t+=n[e];return t+="]"}};return r}var b,t,C=(b=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],(t={}).getRSBlocks=function(t,e){var n=function(t,e){switch(e){case v.L:return b[4*(t-1)+0];case v.M:return b[4*(t-1)+1];case v.Q:return b[4*(t-1)+2];case v.H:return b[4*(t-1)+3];default:return}}(t,e);if(void 0===n)throw"bad rs block @ typeNumber:"+t+"/errorCorrectionLevel:"+e;for(var i,r,s=n.length/3,o=[],a=0;a<s;a+=1)for(var h=n[3*a+0],u=n[3*a+1],l=n[3*a+2],c=0;c<h;c+=1)o.push((i=l,r=void 0,(r={}).totalCount=u,r.dataCount=i,r));return o},t),k=function(){var n=[],i=0,r={getBuffer:function(){return n},getAt:function(t){var e=Math.floor(t/8);return 1==(n[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n<e;n+=1)r.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return i},putBit:function(t){var e=Math.floor(i/8);n.length<=e&&n.push(0),t&&(n[e]|=128>>>i%8),i+=1}};return r},A=function(t){var e=o,i=t,n={getMode:function(){return e},getLength:function(t){return i.length},write:function(t){for(var e=i,n=0;n+2<e.length;)t.put(r(e.substring(n,n+3)),10),n+=3;n<e.length&&(e.length-n==1?t.put(r(e.substring(n,n+1)),4):e.length-n==2&&t.put(r(e.substring(n,n+2)),7))}},r=function(t){for(var e=0,n=0;n<t.length;n+=1)e=10*e+s(t.charAt(n));return e},s=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return n},M=function(t){var e=a,i=t,n={getMode:function(){return e},getLength:function(t){return i.length},write:function(t){for(var e=i,n=0;n+1<e.length;)t.put(45*r(e.charAt(n))+r(e.charAt(n+1)),11),n+=2;n<e.length&&t.put(r(e.charAt(n)),6)}},r=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return n},S=function(t){var e=r,n=s.stringToBytes(t),i={getMode:function(){return e},getLength:function(t){return n.length},write:function(t){for(var e=0;e<n.length;e+=1)t.put(n[e],8)}};return i},P=function(t){var e=h,i=s.stringToBytesFuncs.SJIS;if(!i)throw"sjis not supported.";!function(t,e){var n=i("友");if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported."}();var r=i(t),n={getMode:function(){return e},getLength:function(t){return~~(r.length/2)},write:function(t){for(var e=r,n=0;n+1<e.length;){var i=(255&e[n])<<8|255&e[n+1];if(33088<=i&&i<=40956)i-=33088;else{if(!(57408<=i&&i<=60351))throw"illegal char at "+(n+1)+"/"+i;i-=49472}i=192*(i>>>8&255)+(255&i),t.put(i,13),n+=2}if(n<e.length)throw"illegal char at "+(n+1)}};return n},N=function(t){var n=t,i=0,r=0,s=0,e={read:function(){for(;s<8;){if(i>=n.length){if(0==s)return-1;throw"unexpected end of file./"+s}var t=n.charAt(i);if(i+=1,"="==t)return s=0,-1;t.match(/^\s$/)||(r=r<<6|o(t.charCodeAt(0)),s+=6)}var e=r>>>s-8&255;return s-=8,e}},o=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return e},B=function(t,e,n){for(var i=function(t,e){var i=t,r=e,c=new Array(t*e),n={setPixel:function(t,e,n){c[e*i+t]=n},write:function(t){t.writeString("GIF87a"),t.writeShort(i),t.writeShort(r),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(i),t.writeShort(r),t.writeByte(0);var e=s(2);t.writeByte(2);for(var n=0;255<e.length-n;)t.writeByte(255),t.writeBytes(e,n,255),n+=255;t.writeByte(e.length-n),t.writeBytes(e,n,e.length-n),t.writeByte(0),t.writeString(";")}},s=function(t){for(var e=1<<t,n=1+(1<<t),i=t+1,r=f(),s=0;s<e;s+=1)r.add(String.fromCharCode(s));r.add(String.fromCharCode(e)),r.add(String.fromCharCode(n));var o=w(),a=function(t){var n=t,i=0,r=0,e={write:function(t,e){if(t>>>e!=0)throw"length over";for(;8<=i+e;)n.writeByte(255&(t<<i|r)),e-=8-i,t>>>=8-i,i=r=0;r|=t<<i,i+=e},flush:function(){0<i&&n.writeByte(r)}};return e}(o);a.write(e,i);var h=0,u=String.fromCharCode(c[h]);for(h+=1;h<c.length;){var l=String.fromCharCode(c[h]);h+=1,r.contains(u+l)?u+=l:(a.write(r.indexOf(u),i),r.size()<4095&&(r.size()==1<<i&&(i+=1),r.add(u+l)),u=l)}return a.write(r.indexOf(u),i),a.write(n,i),a.flush(),o.toByteArray()},f=function(){var e={},n=0,i={add:function(t){if(i.contains(t))throw"dup key:"+t;e[t]=n,n+=1},size:function(){return n},indexOf:function(t){return e[t]},contains:function(t){return void 0!==e[t]}};return i};return n}(t,e),r=0;r<e;r+=1)for(var s=0;s<t;s+=1)i.setPixel(s,r,n(s,r));var o=w();i.write(o);for(var a=function(){function n(t){o+=String.fromCharCode(e(63&t))}var i=0,r=0,s=0,o="",t={},e=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t};return t.writeByte=function(t){for(i=i<<8|255&t,r+=8,s+=1;6<=r;)n(i>>>r-6),r-=6},t.flush=function(){if(0<r&&(n(i<<6-r),r=i=0),s%3!=0)for(var t=3-s%3,e=0;e<t;e+=1)o+="="},t.toString=function(){return o},t}(),h=o.toByteArray(),u=0;u<h.length;u+=1)a.writeByte(h[u]);return a.flush(),"data:image/gif;base64,"+a};return s}();o.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var e=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?e.push(i):i<2048?e.push(192|i>>6,128|63&i):i<55296||57344<=i?e.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),e.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}return e}(t)},r=[],void 0===(s="function"==typeof(i=function(){return o})?i.apply(e,r):i)||(t.exports=s)},function(t,e,n){function u(t,e,n,i,r,s){t.isDark(r,s)&&e.rect(s*i,r*i,i,i)}var l=n(7),i=n(8);t.exports=function(t,e,n){!function(t,e){t.fillStyle=e.back,t.fillRect(0,0,e.size,e.size)}(e,n),function(t,e,n){if(t){var i=0<n.rounded&&n.rounded<=100?l:u,r=t.moduleCount,s=n.size/r,o=0;n.crisp&&(s=Math.floor(s),o=Math.floor((n.size-s*r)/2)),e.translate(o,o),e.beginPath();for(var a=0;a<r;a+=1)for(var h=0;h<r;h+=1)i(t,e,n,s,a,h);e.fillStyle=n.fill,e.fill(),e.translate(-o,-o)}}(t,e,n),i(e,n)}},function(t,e){t.exports=function(t,e,n,i,r,s){var o=s*i,a=r*i,h=o+i,u=a+i,l=.005*n.rounded*i,c=t.isDark,f=r-1,d=r+1,p=s-1,g=s+1,m=c(r,s),v=c(f,p),y=c(f,s),x=c(f,g),w=c(r,g),b=c(d,g),C=c(d,s),k=c(d,p),A=c(r,p);e=function(t){return{c:t,m:function(){var t;return(t=this.c).moveTo.apply(t,arguments),this},l:function(){var t;return(t=this.c).lineTo.apply(t,arguments),this},a:function(){var t;return(t=this.c).arcTo.apply(t,arguments),this}}}(e),m?function(t,e,n,i,r,s,o,a,h,u){o?t.m(e+s,n):t.m(e,n),a?t.l(i-s,n).a(i,n,i,r,s):t.l(i,n),h?t.l(i,r-s).a(i,r,e,r,s):t.l(i,r),u?t.l(e+s,r).a(e,r,e,n,s):t.l(e,r),o?t.l(e,n+s).a(e,n,i,n,s):t.l(e,n)}(e,o,a,h,u,l,!y&&!A,!y&&!w,!C&&!w,!C&&!A):function(t,e,n,i,r,s,o,a,h,u){o&&t.m(e+s,n).l(e,n).l(e,n+s).a(e,n,e+s,n,s),a&&t.m(i-s,n).l(i,n).l(i,n+s).a(i,n,i-s,n,s),h&&t.m(i-s,r).l(i,r).l(i,r-s).a(i,r,i-s,r,s),u&&t.m(e+s,r).l(e,r).l(e,r-s).a(e,r,e+s,r,s)}(e,o,a,h,u,l,y&&A&&v,y&&w&&x,C&&w&&b,C&&A&&k)}},function(t,e,n){var i=n(1).calc_image_pos;t.exports=function(t,e){var n=e.mode;"label"===n?function(t,e){var n=e.size,i="bold "+.01*e.mSize*n+"px "+e.fontname;t.strokeStyle=e.back,t.lineWidth=.01*e.mSize*n*.1,t.fillStyle=e.fontcolor,t.font=i;var r=t.measureText(e.label).width,s=.01*e.mSize,o=(1-r/n)*e.mPosX*.01*n,a=(1-s)*e.mPosY*.01*n+.75*e.mSize*.01*n;t.strokeText(e.label,o,a),t.fillText(e.label,o,a)}(t,e):"image"===n&&function(t,e){var n=i(e);t.drawImage(e.image,n.x,n.y,n.iw,n.ih)}(t,e)}},function(t,e,n){var i=n(1),a=i.create_canvas,h=i.dpr,u=i.calc_image_pos,l=n(10),c=function(t){var e=t.ratio||h,n=a(t.size,e).getContext("2d");n.scale(e,e);var i=t.size,r="bold "+.01*t.mSize*i+"px "+t.fontname;n.strokeStyle=t.back,n.lineWidth=.01*t.mSize*i*.1,n.fillStyle=t.fontcolor,n.font=r;var s=n.measureText(t.label).width,o=.01*t.mSize;return{x:(1-s/i)*t.mPosX*.01*i,y:(1-o)*t.mPosY*.01*i+.75*t.mSize*.01*i}};t.exports=function(t,e){var n=document.createElement("div");n.innerHTML=t;var i=n.firstChild,r=l(i);if(e.crisp&&(r.attr("width",e.size+"px"),r.attr("height",e.size+"px"),r.attr("viewBox","0 0 "+e.size+" "+e.size)),e.back&&r.select("rect").fill(e.back),e.fill&&r.select("path").fill(e.fill),"label"===e.mode){var s=c(e),o=r.text(function(t){t.tspan(e.label)});o.x(s.x),o.y(s.y),o.attr("fill",e.fontcolor),o.attr("font-family",e.fontname),o.attr("font-size",.01*e.mSize*e.size+"px"),e.fontoutline}else if("image"===e.mode){var a=u(e),h=r.image(e.image.getAttribute("src"),a.iw,a.ih);h.x(a.x),h.y(a.y)}return i}},function(t,e,n){var i,r;r="undefined"!=typeof window?window:this,void 0===(i=function(){return function(o,r){var c=(void 0!==this?this:o).SVG=function(t){if(c.supported)return t=new c.Doc(t),c.parser.draw||c.prepare(),t};if(c.ns="http://www.w3.org/2000/svg",c.xmlns="http://www.w3.org/2000/xmlns/",c.xlink="http://www.w3.org/1999/xlink",c.svgjs="http://svgjs.com/svgjs",c.supported=!!r.createElementNS&&!!r.createElementNS(c.ns,"svg").createSVGRect,!c.supported)return!1;c.did=1e3,c.eid=function(t){return"Svgjs"+a(t)+c.did++},c.create=function(t){var e=r.createElementNS(this.ns,t);return e.setAttribute("id",this.eid(t)),e},c.extend=function(){var t,e,n,i;for(t=[].slice.call(arguments),e=t.pop(),i=t.length-1;0<=i;i--)if(t[i])for(n in e)t[i].prototype[n]=e[n];c.Set&&c.Set.inherit&&c.Set.inherit()},c.invent=function(t){var e="function"==typeof t.create?t.create:function(){this.constructor.call(this,c.create(t.create))};return t.inherit&&(e.prototype=new t.inherit),t.extend&&c.extend(e,t.extend),t.construct&&c.extend(t.parent||c.Container,t.construct),e},c.adopt=function(t){return t?t.instance?t.instance:((e="svg"==t.nodeName?t.parentNode instanceof o.SVGElement?new c.Nested:new c.Doc:"linearGradient"==t.nodeName?new c.Gradient("linear"):"radialGradient"==t.nodeName?new c.Gradient("radial"):c[a(t.nodeName)]?new(c[a(t.nodeName)]):new c.Element(t)).type=t.nodeName,((e.node=t).instance=e)instanceof c.Doc&&e.namespace().defs(),e.setData(JSON.parse(t.getAttribute("svgjs:data"))||{}),e):null;var e},c.prepare=function(){var t=r.getElementsByTagName("body")[0],e=(t?new c.Doc(t):c.adopt(r.documentElement).nested()).size(2,0);c.parser={body:t||r.documentElement,draw:e.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:e.polyline().node,path:e.path().node,native:c.create("svg")}},c.parser={native:c.create("svg")},r.addEventListener("DOMContentLoaded",function(){c.parser.draw||c.prepare()},!1),c.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},c.utils={map:function(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r},filter:function(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r},radians:function(t){return t%360*Math.PI/180},degrees:function(t){return 180*t/Math.PI%360},filterSVGElements:function(t){return this.filter(t,function(t){return t instanceof o.SVGElement})}},c.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},c.Color=function(t){var e;this.r=0,this.g=0,this.b=0,t&&("string"==typeof t?c.regex.isRgb.test(t)?(e=c.regex.rgb.exec(t.replace(c.regex.whitespace,"")),this.r=parseInt(e[1]),this.g=parseInt(e[2]),this.b=parseInt(e[3])):c.regex.isHex.test(t)&&(e=c.regex.hex.exec(function(t){return 4==t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)),this.r=parseInt(e[1],16),this.g=parseInt(e[2],16),this.b=parseInt(e[3],16)):"object"==typeof t&&(this.r=t.r,this.g=t.g,this.b=t.b))},c.extend(c.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+l(this.r)+l(this.g)+l(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(t){return this.destination=new c.Color(t),this},at:function(t){return this.destination?(t=t<0?0:1<t?1:t,new c.Color({r:~~(this.r+(this.destination.r-this.r)*t),g:~~(this.g+(this.destination.g-this.g)*t),b:~~(this.b+(this.destination.b-this.b)*t)})):this}}),c.Color.test=function(t){return t+="",c.regex.isHex.test(t)||c.regex.isRgb.test(t)},c.Color.isRgb=function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b},c.Color.isColor=function(t){return c.Color.isRgb(t)||c.Color.test(t)},c.Array=function(t,e){0==(t=(t||[]).valueOf()).length&&e&&(t=e.valueOf()),this.value=this.parse(t)},c.extend(c.Array,{morph:function(t){if(this.destination=this.parse(t),this.value.length!=this.destination.length){for(var e=this.value[this.value.length-1],n=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(n);for(;this.value.length<this.destination.length;)this.value.push(e)}return this},settle:function(){for(var t=0,e=this.value.length,n=[];t<e;t++)-1==n.indexOf(this.value[t])&&n.push(this.value[t]);return this.value=n},at:function(t){if(!this.destination)return this;for(var e=0,n=this.value.length,i=[];e<n;e++)i.push(this.value[e]+(this.destination[e]-this.value[e])*t);return new c.Array(i)},toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(t){return t=t.valueOf(),Array.isArray(t)?t:this.split(t)},split:function(t){return t.trim().split(c.regex.delimiter).map(parseFloat)},reverse:function(){return this.value.reverse(),this},clone:function(){var t=new this.constructor;return t.value=function t(e){for(var n=e.slice(0),i=n.length;i--;)Array.isArray(n[i])&&(n[i]=t(n[i]));return n}(this.value),t}}),c.PointArray=function(t,e){c.Array.call(this,t,e||[[0,0]])},c.PointArray.prototype=new c.Array,c.PointArray.prototype.constructor=c.PointArray,c.extend(c.PointArray,{toString:function(){for(var t=0,e=this.value.length,n=[];t<e;t++)n.push(this.value[t].join(","));return n.join(" ")},toLine:function(){return{x1:this.value[0][0],y1:this.value[0][1],x2:this.value[1][0],y2:this.value[1][1]}},at:function(t){if(!this.destination)return this;for(var e=0,n=this.value.length,i=[];e<n;e++)i.push([this.value[e][0]+(this.destination[e][0]-this.value[e][0])*t,this.value[e][1]+(this.destination[e][1]-this.value[e][1])*t]);return new c.PointArray(i)},parse:function(t){var e=[];if(t=t.valueOf(),Array.isArray(t)){if(Array.isArray(t[0]))return t.map(function(t){return t.slice()});if(null!=t[0].x)return t.map(function(t){return[t.x,t.y]})}else t=t.trim().split(c.regex.delimiter).map(parseFloat);t.length%2!=0&&t.pop();for(var n=0,i=t.length;n<i;n+=2)e.push([t[n],t[n+1]]);return e},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i=this.value.length-1;0<=i;i--)this.value[i]=[this.value[i][0]+t,this.value[i][1]+e];return this},size:function(t,e){var n,i=this.bbox();for(n=this.value.length-1;0<=n;n--)i.width&&(this.value[n][0]=(this.value[n][0]-i.x)*t/i.width+i.x),i.height&&(this.value[n][1]=(this.value[n][1]-i.y)*e/i.height+i.y);return this},bbox:function(){return c.parser.poly.setAttribute("points",this.toString()),c.parser.poly.getBBox()}});for(var h={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},t="mlhvqtcsaz".split(""),e=0,n=t.length;e<n;++e)h[t[e]]=function(s){return function(t,e,n){if("H"==s)t[0]=t[0]+e.x;else if("V"==s)t[0]=t[0]+e.y;else if("A"==s)t[5]=t[5]+e.x,t[6]=t[6]+e.y;else for(var i=0,r=t.length;i<r;++i)t[i]=t[i]+(i%2?e.y:e.x);return h[s](t,e,n)}}(t[e].toUpperCase());c.PathArray=function(t,e){c.Array.call(this,t,e||[["M",0,0]])},c.PathArray.prototype=new c.Array,c.PathArray.prototype.constructor=c.PathArray,c.extend(c.PathArray,{toString:function(){return function(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e][0],null!=t[e][1]&&(i+=t[e][1],null!=t[e][2]&&(i+=" ",i+=t[e][2],null!=t[e][3]&&(i+=" ",i+=t[e][3],i+=" ",i+=t[e][4],null!=t[e][5]&&(i+=" ",i+=t[e][5],i+=" ",i+=t[e][6],null!=t[e][7]&&(i+=" ",i+=t[e][7])))));return i+" "}(this.value)},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i,r=this.value.length-1;0<=r;r--)"M"==(i=this.value[r][0])||"L"==i||"T"==i?(this.value[r][1]+=t,this.value[r][2]+=e):"H"==i?this.value[r][1]+=t:"V"==i?this.value[r][1]+=e:"C"==i||"S"==i||"Q"==i?(this.value[r][1]+=t,this.value[r][2]+=e,this.value[r][3]+=t,this.value[r][4]+=e,"C"==i&&(this.value[r][5]+=t,this.value[r][6]+=e)):"A"==i&&(this.value[r][6]+=t,this.value[r][7]+=e);return this},size:function(t,e){var n,i,r=this.bbox();for(n=this.value.length-1;0<=n;n--)"M"==(i=this.value[n][0])||"L"==i||"T"==i?(this.value[n][1]=(this.value[n][1]-r.x)*t/r.width+r.x,this.value[n][2]=(this.value[n][2]-r.y)*e/r.height+r.y):"H"==i?this.value[n][1]=(this.value[n][1]-r.x)*t/r.width+r.x:"V"==i?this.value[n][1]=(this.value[n][1]-r.y)*e/r.height+r.y:"C"==i||"S"==i||"Q"==i?(this.value[n][1]=(this.value[n][1]-r.x)*t/r.width+r.x,this.value[n][2]=(this.value[n][2]-r.y)*e/r.height+r.y,this.value[n][3]=(this.value[n][3]-r.x)*t/r.width+r.x,this.value[n][4]=(this.value[n][4]-r.y)*e/r.height+r.y,"C"==i&&(this.value[n][5]=(this.value[n][5]-r.x)*t/r.width+r.x,this.value[n][6]=(this.value[n][6]-r.y)*e/r.height+r.y)):"A"==i&&(this.value[n][1]=this.value[n][1]*t/r.width,this.value[n][2]=this.value[n][2]*e/r.height,this.value[n][6]=(this.value[n][6]-r.x)*t/r.width+r.x,this.value[n][7]=(this.value[n][7]-r.y)*e/r.height+r.y);return this},equalCommands:function(t){var e,n,i;for(t=new c.PathArray(t),i=this.value.length===t.value.length,e=0,n=this.value.length;i&&e<n;e++)i=this.value[e][0]===t.value[e][0];return i},morph:function(t){return t=new c.PathArray(t),this.equalCommands(t)?this.destination=t:this.destination=null,this},at:function(t){if(!this.destination)return this;var e,n,i,r,s=this.value,o=this.destination.value,a=[],h=new c.PathArray;for(e=0,n=s.length;e<n;e++){for(a[e]=[s[e][0]],i=1,r=s[e].length;i<r;i++)a[e][i]=s[e][i]+(o[e][i]-s[e][i])*t;"A"===a[e][0]&&(a[e][4]=+(0!=a[e][4]),a[e][5]=+(0!=a[e][5]))}return h.value=a,h},parse:function(t){if(t instanceof c.PathArray)return t.valueOf();var e,n={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};t="string"==typeof t?t.replace(c.regex.numbersWithDots,u).replace(c.regex.pathLetters," $& ").replace(c.regex.hyphen,"$1 -").trim().split(c.regex.delimiter):t.reduce(function(t,e){return[].concat.call(t,e)},[]);for(var i=[],r=new c.Point,s=new c.Point,o=0,a=t.length;c.regex.isPathLetter.test(t[o])?(e=t[o],++o):"M"==e?e="L":"m"==e&&(e="l"),i.push(h[e].call(null,t.slice(o,o+=n[e.toUpperCase()]).map(parseFloat),r,s)),o<a;);return i},bbox:function(){return c.parser.path.setAttribute("d",this.toString()),c.parser.path.getBBox()}}),c.Number=c.invent({create:function(t,e){this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(c.regex.numberAndUnit))&&(this.value=parseFloat(e[1]),"%"==e[5]?this.value/=100:"s"==e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof c.Number&&(this.value=t.valueOf(),this.unit=t.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(t){return t=new c.Number(t),new c.Number(this+t,this.unit||t.unit)},minus:function(t){return t=new c.Number(t),new c.Number(this-t,this.unit||t.unit)},times:function(t){return t=new c.Number(t),new c.Number(this*t,this.unit||t.unit)},divide:function(t){return t=new c.Number(t),new c.Number(this/t,this.unit||t.unit)},to:function(t){var e=new c.Number(this);return"string"==typeof t&&(e.unit=t),e},morph:function(t){return this.destination=new c.Number(t),t.relative&&(this.destination.value+=this.value),this},at:function(t){return this.destination?new c.Number(this.destination).minus(this).times(t).plus(this):this}}}),c.Element=c.invent({create:function(t){this._stroke=c.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=t)&&(this.type=t.nodeName,(this.node.instance=this)._events=t._events||{},this._stroke=t.getAttribute("stroke")||this._stroke)},extend:{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var n=f(this,t,e);return this.width(new c.Number(n.width)).height(new c.Number(n.height))},clone:function(t){this.writeDataToDom();var e=m(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(t){return this.after(t).remove(),t},addTo:function(t){return t.put(this)},putIn:function(t){return t.add(this)},id:function(t){return this.attr("id",t)},inside:function(t,e){var n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return"none"!=this.style("display")},toString:function(){return this.attr("id")},classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(c.regex.delimiter)},hasClass:function(t){return-1!=this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter(function(t){return t!=e}).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){return c.get(this.attr(t))},parent:function(t){var e=this;if(!e.node.parentNode)return null;if(e=c.adopt(e.node.parentNode),!t)return e;for(;e&&e.node instanceof o.SVGElement;){if("string"==typeof t?e.matches(t):e instanceof t)return e;if(!e.node.parentNode||"#document"==e.node.parentNode.nodeName||"#document-fragment"==e.node.parentNode.nodeName)return null;e=c.adopt(e.node.parentNode)}},doc:function(){return this instanceof c.Doc?this:this.parent(c.Doc)},parents:function(t){var e=[],n=this;do{if(!(n=n.parent(t))||!n.node)break;e.push(n)}while(n.parent);return e},matches:function(t){return function(t,e){return(t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector).call(t,e)}(this.node,t)},native:function(){return this.node},svg:function(t){var e=r.createElement("svg");if(!(t&&this instanceof c.Parent))return e.appendChild(t=r.createElement("svg")),this.writeDataToDom(),t.appendChild(this.node.cloneNode(!0)),e.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");e.innerHTML="<svg>"+t.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var n=0,i=e.firstChild.childNodes.length;n<i;n++)this.node.appendChild(e.firstChild.firstChild);return this},writeDataToDom:function(){if(this.each||this.lines){var t=this.each?this:this.lines();t.each(function(){this.writeDataToDom()})}return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(t){return this.dom=t,this},is:function(t){return function(t,e){return t instanceof e}(this,t)}}}),c.easing={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)}},c.morph=function(n){return function(t,e){return new c.MorphObj(t,e).at(n)}},c.Situation=c.invent({create:function(t){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new c.Number(t.duration).valueOf(),this.delay=new c.Number(t.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=t.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),c.FX=c.invent({create:function(t){this._target=t,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(t,e,n){"object"==typeof t&&(e=t.ease,n=t.delay,t=t.duration);var i=new c.Situation({duration:t||1e3,delay:n||0,ease:c.easing[e||"-"]||e});return this.queue(i),this},delay:function(t){var e=new c.Situation({duration:t,delay:0,ease:c.easing["-"]});return this.queue(e)},target:function(t){return t&&t instanceof c.Element?(this._target=t,this):this._target},timeToAbsPos:function(t){return(t-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(t){return this.situation.duration/this._speed*t+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=o.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){o.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(t){return("function"==typeof t||t instanceof c.Situation)&&this.situations.push(t),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof c.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var t,e,n,i=this.situation;if(i.init)return this;for(t in i.animations)for(n=this.target()[t](),Array.isArray(n)||(n=[n]),Array.isArray(i.animations[t])||(i.animations[t]=[i.animations[t]]),e=n.length;e--;)i.animations[t][e]instanceof c.Number&&(n[e]=new c.Number(n[e])),i.animations[t][e]=n[e].morph(i.animations[t][e]);for(t in i.attrs)i.attrs[t]=new c.MorphObj(this.target().attr(t),i.attrs[t]);for(t in i.styles)i.styles[t]=new c.MorphObj(this.target().style(t),i.styles[t]);return i.initialTransformation=this.target().matrixify(),i.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(t,e){var n=this.active;return this.active=!1,e&&this.clearQueue(),t&&this.situation&&(!n&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var t=this.situation;this.stop(),this.situation=t,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return!0===this.situation.loops&&(this.situation.loops=this.situation.loop+1),"number"==typeof this.situation.loops?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(t,e){var n=this.situation.duration/this._speed;return this.absPos=t,e||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*n,this.situation.finish=this.situation.start+n,this.step(!0)},speed:function(t){return 0===t?this.pause():t?(this._speed=t,this.at(this.absPos,!0)):this._speed},loop:function(t,e){var n=this.last();return n.loops=null==t||t,n.loop=0,e&&(n.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(t){var e=this.last();return e.reversed=void 0===t?!e.reversed:t,this},progress:function(t){return t?this.situation.ease(this.pos):this.pos},after:function(n){var i=this.last();return this.target().on("finished.fx",function t(e){e.detail.situation==i&&(n.call(this,i),this.off("finished.fx",t))}),this._callStart()},during:function(e){var n=this.last(),t=function(t){t.detail.situation==n&&e.call(this,t.detail.pos,c.morph(t.detail.pos),t.detail.eased,n)};return this.target().off("during.fx",t).on("during.fx",t),this.after(function(){this.off("during.fx",t)}),this._callStart()},afterAll:function(n){var t=function t(e){n.call(this),this.off("allfinished.fx",t)};return this.target().off("allfinished.fx",t).on("allfinished.fx",t),this._callStart()},duringAll:function(e){var t=function(t){e.call(this,t.detail.pos,c.morph(t.detail.pos),t.detail.eased,t.detail.situation)};return this.target().off("during.fx",t).on("during.fx",t),this.afterAll(function(){this.off("during.fx",t)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(t,e,n){return this.last()[n||"animations"][t]=e,this._callStart()},step:function(t){var e,n,i;t||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops?(e=Math.max(this.absPos,0),n=Math.floor(e),!0===this.situation.loops||n<this.situation.loops?(this.pos=e-n,i=this.situation.loop,this.situation.loop=n):(this.absPos=this.situation.loops,this.pos=1,i=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=Boolean((this.situation.loop-i)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var r=this.situation.ease(this.pos);for(var s in this.situation.once)s>this.lastPos&&s<=r&&(this.situation.once[s].call(this.target(),this.pos,r),delete this.situation.once[s]);return this.active&&this.target().fire("during",{pos:this.pos,eased:r,fx:this,situation:this.situation}),this.situation&&(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=r),this},eachAt:function(){var t,e,n,i=this,r=this.target(),s=this.situation;for(t in s.animations)n=[].concat(s.animations[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(s.ease(i.pos),i.pos):t}),r[t].apply(r,n);for(t in s.attrs)n=[t].concat(s.attrs[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(s.ease(i.pos),i.pos):t}),r.attr.apply(r,n);for(t in s.styles)n=[t].concat(s.styles[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(s.ease(i.pos),i.pos):t}),r.style.apply(r,n);if(s.transforms.length){for(n=s.initialTransformation,t=0,e=s.transforms.length;t<e;t++){var o=s.transforms[t];n=o instanceof c.Matrix?o.relative?n.multiply((new c.Matrix).morph(o).at(s.ease(this.pos))):n.morph(o).at(s.ease(this.pos)):(o.relative||o.undo(n.extract()),n.multiply(o.at(s.ease(this.pos))))}r.matrix(n)}return this},once:function(t,e,n){var i=this.last();return n||(t=i.ease(t)),i.once[t]=e,this},_callStart:function(){return setTimeout(function(){this.start()}.bind(this),0),this}},parent:c.Element,construct:{animate:function(t,e,n){return(this.fx||(this.fx=new c.FX(this))).animate(t,e,n)},delay:function(t){return(this.fx||(this.fx=new c.FX(this))).delay(t)},stop:function(t,e){return this.fx&&this.fx.stop(t,e),this},finish:function(){return this.fx&&this.fx.finish(),this},pause:function(){return this.fx&&this.fx.pause(),this},play:function(){return this.fx&&this.fx.play(),this},speed:function(t){if(this.fx){if(null==t)return this.fx.speed();this.fx.speed(t)}return this}}}),c.MorphObj=c.invent({create:function(t,e){return c.Color.isColor(e)?new c.Color(t).morph(e):c.regex.delimiter.test(t)?c.regex.pathLetters.test(t)?new c.PathArray(t).morph(e):new c.Array(t).morph(e):c.regex.numberAndUnit.test(e)?new c.Number(t).morph(e):(this.value=t,void(this.destination=e))},extend:{at:function(t,e){return e<1?this.value:this.destination},valueOf:function(){return this.value}}}),c.extend(c.FX,{attr:function(t,e,n){if("object"==typeof t)for(var i in t)this.attr(i,t[i]);else this.add(t,e,"attrs");return this},style:function(t,e){if("object"==typeof t)for(var n in t)this.style(n,t[n]);else this.add(t,e,"styles");return this},x:function(t,e){if(this.target()instanceof c.G)return this.transform({x:t},e),this;var n=new c.Number(t);return n.relative=e,this.add("x",n)},y:function(t,e){if(this.target()instanceof c.G)return this.transform({y:t},e),this;var n=new c.Number(t);return n.relative=e,this.add("y",n)},cx:function(t){return this.add("cx",new c.Number(t))},cy:function(t){return this.add("cy",new c.Number(t))},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},size:function(t,e){var n;return this.target()instanceof c.Text?this.attr("font-size",t):(t&&e||(n=this.target().bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.add("width",new c.Number(t)).add("height",new c.Number(e))),this},width:function(t){return this.add("width",new c.Number(t))},height:function(t){return this.add("height",new c.Number(t))},plot:function(t,e,n,i){return 4==arguments.length?this.plot([t,e,n,i]):this.add("plot",new(this.target().morphArray)(t))},leading:function(t){return this.target().leading?this.add("leading",new c.Number(t)):this},viewbox:function(t,e,n,i){return this.target()instanceof c.Container&&this.add("viewbox",new c.ViewBox(t,e,n,i)),this},update:function(t){if(this.target()instanceof c.Stop){if("number"==typeof t||t instanceof c.Number)return this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]});null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset)}return this}}),c.Box=c.invent({create:function(t,e,n,i){if(!("object"!=typeof t||t instanceof c.Element))return c.Box.call(this,null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height);4==arguments.length&&(this.x=t,this.y=e,this.width=n,this.height=i),v(this)},extend:{merge:function(t){var e=new this.constructor;return e.x=Math.min(this.x,t.x),e.y=Math.min(this.y,t.y),e.width=Math.max(this.x+this.width,t.x+t.width)-e.x,e.height=Math.max(this.y+this.height,t.y+t.height)-e.y,v(e)},transform:function(e){var t,n=1/0,i=-1/0,r=1/0,s=-1/0,o=[new c.Point(this.x,this.y),new c.Point(this.x2,this.y),new c.Point(this.x,this.y2),new c.Point(this.x2,this.y2)];return o.forEach(function(t){t=t.transform(e),n=Math.min(n,t.x),i=Math.max(i,t.x),r=Math.min(r,t.y),s=Math.max(s,t.y)}),(t=new this.constructor).x=n,t.width=i-n,t.y=r,t.height=s-r,v(t),t}}}),c.BBox=c.invent({create:function(e){if(c.Box.apply(this,[].slice.call(arguments)),e instanceof c.Element){var n;try{if(r.documentElement.contains){if(!r.documentElement.contains(e.node))throw new Exception("Element not in the dom")}else{for(var t=e.node;t.parentNode;)t=t.parentNode;if(t!=r)throw new Exception("Element not in the dom")}n=e.node.getBBox()}catch(t){if(e instanceof c.Shape){var i=e.clone(c.parser.draw.instance).show();n=i.node.getBBox(),i.remove()}else n={x:e.node.clientLeft,y:e.node.clientTop,width:e.node.clientWidth,height:e.node.clientHeight}}c.Box.call(this,n)}},inherit:c.Box,parent:c.Element,construct:{bbox:function(){return new c.BBox(this)}}}),c.BBox.prototype.constructor=c.BBox,c.extend(c.Element,{tbox:function(){return console.warn("Use of TBox is deprecated and mapped to RBox. Use .rbox() instead."),this.rbox(this.doc())}}),c.RBox=c.invent({create:function(t){c.Box.apply(this,[].slice.call(arguments)),t instanceof c.Element&&c.Box.call(this,t.node.getBoundingClientRect())},inherit:c.Box,parent:c.Element,extend:{addOffset:function(){return this.x+=o.pageXOffset,this.y+=o.pageYOffset,this}},construct:{rbox:function(t){return t?new c.RBox(this).transform(t.screenCTM().inverse()):new c.RBox(this).addOffset()}}}),c.RBox.prototype.constructor=c.RBox,c.Matrix=c.invent({create:function(t){var e,n=p([1,0,0,1,0,0]);for(t=t instanceof c.Element?t.matrixify():"string"==typeof t?p(t.split(c.regex.delimiter).map(parseFloat)):6==arguments.length?p([].slice.call(arguments)):Array.isArray(t)?p(t):"object"==typeof t?t:n,e=x.length-1;0<=e;--e)this[x[e]]=null!=t[x[e]]?t[x[e]]:n[x[e]]},extend:{extract:function(){var t=d(this,0,1),e=d(this,1,0),n=180/Math.PI*Math.atan2(t.y,t.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(n*Math.PI/180)+this.f*Math.sin(n*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(n*Math.PI/180)+this.e*Math.sin(-n*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-n,skewY:180/Math.PI*Math.atan2(e.y,e.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:n,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new c.Matrix(this)}},clone:function(){return new c.Matrix(this)},morph:function(t){return this.destination=new c.Matrix(t),this},at:function(t){if(!this.destination)return this;var e=new c.Matrix({a:this.a+(this.destination.a-this.a)*t,b:this.b+(this.destination.b-this.b)*t,c:this.c+(this.destination.c-this.c)*t,d:this.d+(this.destination.d-this.d)*t,e:this.e+(this.destination.e-this.e)*t,f:this.f+(this.destination.f-this.f)*t});return e},multiply:function(t){return new c.Matrix(this.native().multiply(function(t){return t instanceof c.Matrix||(t=new c.Matrix(t)),t}(t).native()))},inverse:function(){return new c.Matrix(this.native().inverse())},translate:function(t,e){return new c.Matrix(this.native().translate(t||0,e||0))},scale:function(t,e,n,i){return 1==arguments.length?e=t:3==arguments.length&&(i=n,n=e,e=t),this.around(n,i,new c.Matrix(t,0,0,e,0,0))},rotate:function(t,e,n){return t=c.utils.radians(t),this.around(e,n,new c.Matrix(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0))},flip:function(t,e){return"x"==t?this.scale(-1,1,e,0):"y"==t?this.scale(1,-1,0,e):this.scale(-1,-1,t,null!=e?e:t)},skew:function(t,e,n,i){return 1==arguments.length?e=t:3==arguments.length&&(i=n,n=e,e=t),t=c.utils.radians(t),e=c.utils.radians(e),this.around(n,i,new c.Matrix(1,Math.tan(e),Math.tan(t),1,0,0))},skewX:function(t,e,n){return this.skew(t,0,e,n)},skewY:function(t,e,n){return this.skew(0,t,e,n)},around:function(t,e,n){return this.multiply(new c.Matrix(1,0,0,1,t||0,e||0)).multiply(n).multiply(new c.Matrix(1,0,0,1,-t||0,-e||0))},native:function(){for(var t=c.parser.native.createSVGMatrix(),e=x.length-1;0<=e;e--)t[x[e]]=this[x[e]];return t},toString:function(){return"matrix("+y(this.a)+","+y(this.b)+","+y(this.c)+","+y(this.d)+","+y(this.e)+","+y(this.f)+")"}},parent:c.Element,construct:{ctm:function(){return new c.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof c.Nested){var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new c.Matrix(e)}return new c.Matrix(this.node.getScreenCTM())}}}),c.Point=c.invent({create:function(t,e){var n;n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:null!=t?{x:t,y:null!=e?e:t}:{x:0,y:0},this.x=n.x,this.y=n.y},extend:{clone:function(){return new c.Point(this)},morph:function(t,e){return this.destination=new c.Point(t,e),this},at:function(t){if(!this.destination)return this;var e=new c.Point({x:this.x+(this.destination.x-this.x)*t,y:this.y+(this.destination.y-this.y)*t});return e},native:function(){var t=c.parser.native.createSVGPoint();return t.x=this.x,t.y=this.y,t},transform:function(t){return new c.Point(this.native().matrixTransform(t.native()))}}}),c.extend(c.Element,{point:function(t,e){return new c.Point(t,e).transform(this.screenCTM().inverse())}}),c.extend(c.Element,{attr:function(t,e,n){if(null==t){for(t={},e=this.node.attributes,n=e.length-1;0<=n;n--)t[e[n].nodeName]=c.regex.isNumber.test(e[n].nodeValue)?parseFloat(e[n].nodeValue):e[n].nodeValue;return t}if("object"==typeof t)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?c.defaults.attrs[t]:c.regex.isNumber.test(e)?parseFloat(e):e;"stroke-width"==t?this.attr("stroke",0<parseFloat(e)?this._stroke:null):"stroke"==t&&(this._stroke=e),"fill"!=t&&"stroke"!=t||(c.regex.isImage.test(e)&&(e=this.doc().defs().image(e,0,0)),e instanceof c.Image&&(e=this.doc().defs().pattern(0,0,function(){this.add(e)}))),"number"==typeof e?e=new c.Number(e):c.Color.isColor(e)?e=new c.Color(e):Array.isArray(e)&&(e=new c.Array(e)),"leading"==t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!=t&&"x"!=t||this.rebuild(t,e)}return this}}),c.extend(c.Element,{transform:function(t,e){var n,i,r=this;if("object"!=typeof t)return n=new c.Matrix(r).extract(),"string"==typeof t?n[t]:n;if(n=new c.Matrix(r),e=!!e||!!t.relative,null!=t.a)n=e?n.multiply(new c.Matrix(t)):new c.Matrix(t);else if(null!=t.rotation)g(t,r),n=e?n.rotate(t.rotation,t.cx,t.cy):n.rotate(t.rotation-n.extract().rotation,t.cx,t.cy);else if(null!=t.scale||null!=t.scaleX||null!=t.scaleY){if(g(t,r),t.scaleX=null!=t.scale?t.scale:null!=t.scaleX?t.scaleX:1,t.scaleY=null!=t.scale?t.scale:null!=t.scaleY?t.scaleY:1,!e){var s=n.extract();t.scaleX=1*t.scaleX/s.scaleX,t.scaleY=1*t.scaleY/s.scaleY}n=n.scale(t.scaleX,t.scaleY,t.cx,t.cy)}else if(null!=t.skew||null!=t.skewX||null!=t.skewY){if(g(t,r),t.skewX=null!=t.skew?t.skew:null!=t.skewX?t.skewX:0,t.skewY=null!=t.skew?t.skew:null!=t.skewY?t.skewY:0,!e){var s=n.extract();n=n.multiply((new c.Matrix).skew(s.skewX,s.skewY,t.cx,t.cy).inverse())}n=n.skew(t.skewX,t.skewY,t.cx,t.cy)}else t.flip?("x"==t.flip||"y"==t.flip?t.offset=null==t.offset?r.bbox()["c"+t.flip]:t.offset:null==t.offset?(i=r.bbox(),t.flip=i.cx,t.offset=i.cy):t.flip=t.offset,n=(new c.Matrix).flip(t.flip,t.offset)):null==t.x&&null==t.y||(e?n=n.translate(t.x,t.y):(null!=t.x&&(n.e=t.x),null!=t.y&&(n.f=t.y)));return this.attr("transform",n)}}),c.extend(c.FX,{transform:function(t,e){var n,i,r=this.target();return"object"!=typeof t?(n=new c.Matrix(r).extract(),"string"==typeof t?n[t]:n):(e=!!e||!!t.relative,null!=t.a?n=new c.Matrix(t):null!=t.rotation?(g(t,r),n=new c.Rotate(t.rotation,t.cx,t.cy)):null!=t.scale||null!=t.scaleX||null!=t.scaleY?(g(t,r),t.scaleX=null!=t.scale?t.scale:null!=t.scaleX?t.scaleX:1,t.scaleY=null!=t.scale?t.scale:null!=t.scaleY?t.scaleY:1,n=new c.Scale(t.scaleX,t.scaleY,t.cx,t.cy)):null!=t.skewX||null!=t.skewY?(g(t,r),t.skewX=null!=t.skewX?t.skewX:0,t.skewY=null!=t.skewY?t.skewY:0,n=new c.Skew(t.skewX,t.skewY,t.cx,t.cy)):t.flip?("x"==t.flip||"y"==t.flip?t.offset=null==t.offset?r.bbox()["c"+t.flip]:t.offset:null==t.offset?(i=r.bbox(),t.flip=i.cx,t.offset=i.cy):t.flip=t.offset,n=(new c.Matrix).flip(t.flip,t.offset)):null==t.x&&null==t.y||(n=new c.Translate(t.x,t.y)),n?(n.relative=e,this.last().transforms.push(n),this._callStart()):this)}}),c.extend(c.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var t=(this.attr("transform")||"").split(c.regex.transforms).slice(0,-1).map(function(t){var e=t.trim().split("(");return[e[0],e[1].split(c.regex.delimiter).map(function(t){return parseFloat(t)})]}).reduce(function(t,e){return"matrix"==e[0]?t.multiply(p(e[1])):t[e[0]].apply(t,e[1])},new c.Matrix);return t},toParent:function(t){if(this==t)return this;var e=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t).untransform().transform(n.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())}}),c.Transformation=c.invent({create:function(t,e){if(1<arguments.length&&"boolean"!=typeof e)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(t))for(var n=0,i=this.arguments.length;n<i;++n)this[this.arguments[n]]=t[n];else if("object"==typeof t)for(var n=0,i=this.arguments.length;n<i;++n)this[this.arguments[n]]=t[this.arguments[n]];!(this.inversed=!1)===e&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(t){for(var e=[],n=0,i=this.arguments.length;n<i;++n)e.push(this[this.arguments[n]]);var r=this._undo||new c.Matrix;return r=(new c.Matrix).morph(c.Matrix.prototype[this.method].apply(r,e)).at(t),this.inversed?r.inverse():r},undo:function(t){for(var e=0,n=this.arguments.length;e<n;++e)t[this.arguments[e]]=void 0===this[this.arguments[e]]?0:t[this.arguments[e]];return t.cx=this.cx,t.cy=this.cy,this._undo=new(c[a(this.method)])(t,!0).at(1),this}}}),c.Translate=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),c.Rotate=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(t){var e=(new c.Matrix).rotate((new c.Number).morph(this.rotation-(this._undo?this._undo.rotation:0)).at(t),this.cx,this.cy);return this.inversed?e.inverse():e},undo:function(t){return this._undo=t,this}}}),c.Scale=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),c.Skew=c.invent({parent:c.Matrix,inherit:c.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),c.extend(c.Element,{style:function(t,e){if(0==arguments.length)return this.node.style.cssText||"";if(arguments.length<2)if("object"==typeof t)for(e in t)this.style(e,t[e]);else{if(!c.regex.isCss.test(t))return this.node.style[s(t)];for(t=t.split(/\s*;\s*/).filter(function(t){return!!t}).map(function(t){return t.split(/\s*:\s*/)});e=t.pop();)this.style(e[0],e[1])}else this.node.style[s(t)]=null===e||c.regex.isBlank.test(e)?"":e;return this}}),c.Parent=c.invent({create:function(t){this.constructor.call(this,t)},inherit:c.Element,extend:{children:function(){return c.utils.map(c.utils.filterSVGElements(this.node.childNodes),function(t){return c.adopt(t)})},add:function(t,e){return null==e?this.node.appendChild(t.node):t.node!=this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this},put:function(t,e){return this.add(t,e),t},has:function(t){return 0<=this.index(t)},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return c.adopt(this.node.childNodes[t])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(t,e){var n,i,r=this.children();for(n=0,i=r.length;n<i;n++)r[n]instanceof c.Element&&t.apply(r[n],[n,r]),e&&r[n]instanceof c.Container&&r[n].each(t,e);return this},removeElement:function(t){return this.node.removeChild(t.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),c.extend(c.Parent,{ungroup:function(t,e){return 0===e||this instanceof c.Defs||this.node==c.parser.draw||(t=t||(this instanceof c.Doc?this:this.parent(c.Parent)),e=e||1/0,this.each(function(){return this instanceof c.Defs?this:this instanceof c.Parent?this.ungroup(t,e-1):this.toParent(t)}),this.node.firstChild||this.remove()),this},flatten:function(t,e){return this.ungroup(t,e)}}),c.Container=c.invent({create:function(t){this.constructor.call(this,t)},inherit:c.Parent}),c.ViewBox=c.invent({create:function(t){var e,n,i,r,s,o,a,h=1,u=1,l=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(t instanceof c.Element){for(s=((a=o=t).attr("viewBox")||"").match(l),t.bbox,i=new c.Number(t.width()),r=new c.Number(t.height());"%"==i.unit;)h*=i.value,i=new c.Number(o instanceof c.Doc?o.parent().offsetWidth:o.parent().width()),o=o.parent();for(;"%"==r.unit;)u*=r.value,r=new c.Number(a instanceof c.Doc?a.parent().offsetHeight:a.parent().height()),a=a.parent();this.x=0,this.y=0,this.width=i*h,this.height=r*u,this.zoom=1,s&&(e=parseFloat(s[0]),n=parseFloat(s[1]),i=parseFloat(s[2]),r=parseFloat(s[3]),this.zoom=this.width/this.height>i/r?this.height/r:this.width/i,this.x=e,this.y=n,this.width=i,this.height=r)}else t="string"==typeof t?t.match(l).map(function(t){return parseFloat(t)}):Array.isArray(t)?t:"object"==typeof t?[t.x,t.y,t.width,t.height]:4==arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(t,e,n,i){return this.destination=new c.ViewBox(t,e,n,i),this},at:function(t){return this.destination?new c.ViewBox([this.x+(this.destination.x-this.x)*t,this.y+(this.destination.y-this.y)*t,this.width+(this.destination.width-this.width)*t,this.height+(this.destination.height-this.height)*t]):this}},parent:c.Container,construct:{viewbox:function(t,e,n,i){return 0==arguments.length?new c.ViewBox(this):this.attr("viewBox",new c.ViewBox(t,e,n,i))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(e){c.Element.prototype[e]=function(t){return null==t?c.off(this,e):c.on(this,e,t),this}}),c.listenerId=0,c.on=function(t,e,i,n,r){var s=i.bind(n||t),o=t instanceof c.Element?t.node:t;o.instance=o.instance||{_events:{}};var a=o.instance._events;i._svgjsListenerId||(i._svgjsListenerId=++c.listenerId),e.split(c.regex.delimiter).forEach(function(t){var e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][i._svgjsListenerId]=s,o.addEventListener(e,s,r||!1)})},c.off=function(t,e,s,o){var a=t instanceof c.Element?t.node:t;if(a.instance&&("function"!=typeof s||(s=s._svgjsListenerId))){var h=a.instance._events;(e||"").split(c.regex.delimiter).forEach(function(t){var e,n,i=t&&t.split(".")[0],r=t&&t.split(".")[1];if(s)h[i]&&h[i][r||"*"]&&(a.removeEventListener(i,h[i][r||"*"][s],o||!1),delete h[i][r||"*"][s]);else if(i&&r){if(h[i]&&h[i][r]){for(n in h[i][r])c.off(a,[i,r].join("."),n);delete h[i][r]}}else if(r)for(t in h)for(e in h[t])r===e&&c.off(a,[t,r].join("."));else if(i){if(h[i]){for(e in h[i])c.off(a,[i,e].join("."));delete h[i]}}else{for(t in h)c.off(a,t);a.instance._events={}}})}},c.extend(c.Element,{on:function(t,e,n,i){return c.on(this,t,e,n,i),this},off:function(t,e){return c.off(this.node,t,e),this},fire:function(t,e){return t instanceof o.Event?this.node.dispatchEvent(t):this.node.dispatchEvent(t=new c.CustomEvent(t,{detail:e,cancelable:!0})),this._event=t,this},event:function(){return this._event}}),c.Defs=c.invent({create:"defs",inherit:c.Container}),c.G=c.invent({create:"g",inherit:c.Container,extend:{x:function(t){return null==t?this.transform("x"):this.transform({x:t-this.x()},!0)},y:function(t){return null==t?this.transform("y"):this.transform({y:t-this.y()},!0)},cx:function(t){return null==t?this.gbox().cx:this.x(t-this.gbox().width/2)},cy:function(t){return null==t?this.gbox().cy:this.y(t-this.gbox().height/2)},gbox:function(){var t=this.bbox(),e=this.transform();return t.x+=e.x,t.x2+=e.x,t.cx+=e.x,t.y+=e.y,t.y2+=e.y,t.cy+=e.y,t}},construct:{group:function(){return this.put(new c.G)}}}),c.Doc=c.invent({create:function(t){t&&("svg"==(t="string"==typeof t?r.getElementById(t):t).nodeName?this.constructor.call(this,t):(this.constructor.call(this,c.create("svg")),t.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:c.Container,extend:{namespace:function(){return this.attr({xmlns:c.ns,version:"1.1"}).attr("xmlns:xlink",c.xlink,c.xmlns).attr("xmlns:svgjs",c.svgjs,c.xmlns)},defs:function(){var t;return this._defs||((t=this.node.getElementsByTagName("defs")[0])?this._defs=c.adopt(t):this._defs=new c.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName&&"#document-fragment"!=this.node.parentNode.nodeName?this.node.parentNode:null},spof:function(){var t=this.node.getScreenCTM();return t&&this.style("left",-t.e%1+"px").style("top",-t.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,c.parser.draw.parentNode||this.node.appendChild(c.parser.draw),this},clone:function(t){this.writeDataToDom();var e=this.node,n=m(e.cloneNode(!0));return t?(t.node||t).appendChild(n.node):e.parentNode.insertBefore(n.node,e.nextSibling),n}}}),c.extend(c.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),e instanceof c.Doc&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return 0<t&&this.parent().removeElement(this).add(this,t-1),this},front:function(){var t=this.parent();return t.node.appendChild(this.node),t instanceof c.Doc&&t.node.appendChild(t.defs().node),this},back:function(){return 0<this.position()&&this.parent().removeElement(this).add(this,0),this},before:function(t){t.remove();var e=this.position();return this.parent().add(t,e),this},after:function(t){t.remove();var e=this.position();return this.parent().add(t,e+1),this}}),c.Mask=c.invent({create:function(){this.constructor.call(this,c.create("mask")),this.targets=[]},inherit:c.Container,extend:{remove:function(){for(var t=this.targets.length-1;0<=t;t--)this.targets[t]&&this.targets[t].unmask();return this.targets=[],c.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new c.Mask)}}}),c.extend(c.Element,{maskWith:function(t){return this.masker=t instanceof c.Mask?t:this.parent().mask().add(t),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),c.ClipPath=c.invent({create:function(){this.constructor.call(this,c.create("clipPath")),this.targets=[]},inherit:c.Container,extend:{remove:function(){for(var t=this.targets.length-1;0<=t;t--)this.targets[t]&&this.targets[t].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new c.ClipPath)}}}),c.extend(c.Element,{clipWith:function(t){return this.clipper=t instanceof c.ClipPath?t:this.parent().clip().add(t),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),c.Gradient=c.invent({create:function(t){this.constructor.call(this,c.create(t+"Gradient")),this.type=t},inherit:c.Container,extend:{at:function(t,e,n){return this.put(new c.Stop).update(t,e,n)},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(t,e,n){return"transform"==t&&(t="gradientTransform"),c.Container.prototype.attr.call(this,t,e,n)}},construct:{gradient:function(t,e){return this.defs().gradient(t,e)}}}),c.extend(c.Gradient,c.FX,{from:function(t,e){return"radial"==(this._target||this).type?this.attr({fx:new c.Number(t),fy:new c.Number(e)}):this.attr({x1:new c.Number(t),y1:new c.Number(e)})},to:function(t,e){return"radial"==(this._target||this).type?this.attr({cx:new c.Number(t),cy:new c.Number(e)}):this.attr({x2:new c.Number(t),y2:new c.Number(e)})}}),c.extend(c.Defs,{gradient:function(t,e){return this.put(new c.Gradient(t)).update(e)}}),c.Stop=c.invent({create:"stop",inherit:c.Element,extend:{update:function(t){return("number"==typeof t||t instanceof c.Number)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new c.Number(t.offset)),this}}}),c.Pattern=c.invent({create:"pattern",inherit:c.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},toString:function(){return this.fill()},attr:function(t,e,n){return"transform"==t&&(t="patternTransform"),c.Container.prototype.attr.call(this,t,e,n)}},construct:{pattern:function(t,e,n){return this.defs().pattern(t,e,n)}}}),c.extend(c.Defs,{pattern:function(t,e,n){return this.put(new c.Pattern).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}}),c.Shape=c.invent({create:function(t){this.constructor.call(this,t)},inherit:c.Element}),c.Bare=c.invent({create:function(t,e){if(this.constructor.call(this,c.create(t)),e)for(var n in e.prototype)"function"==typeof e.prototype[n]&&(this[n]=e.prototype[n])},inherit:c.Element,extend:{words:function(t){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(r.createTextNode(t)),this}}}),c.extend(c.Parent,{element:function(t,e){return this.put(new c.Bare(t,e))}}),c.Symbol=c.invent({create:"symbol",inherit:c.Container,construct:{symbol:function(){return this.put(new c.Symbol)}}}),c.Use=c.invent({create:"use",inherit:c.Shape,extend:{element:function(t,e){return this.attr("href",(e||"")+"#"+t,c.xlink)}},construct:{use:function(t,e){return this.put(new c.Use).element(t,e)}}}),c.Rect=c.invent({create:"rect",inherit:c.Shape,construct:{rect:function(t,e){return this.put(new c.Rect).size(t,e)}}}),c.Circle=c.invent({create:"circle",inherit:c.Shape,construct:{circle:function(t){return this.put(new c.Circle).rx(new c.Number(t).divide(2)).move(0,0)}}}),c.extend(c.Circle,c.FX,{rx:function(t){return this.attr("r",t)},ry:function(t){return this.rx(t)}}),c.Ellipse=c.invent({create:"ellipse",inherit:c.Shape,construct:{ellipse:function(t,e){return this.put(new c.Ellipse).size(t,e).move(0,0)}}}),c.extend(c.Ellipse,c.Rect,c.FX,{rx:function(t){return this.attr("rx",t)},ry:function(t){return this.attr("ry",t)}}),c.extend(c.Circle,c.Ellipse,{x:function(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())},y:function(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())},cx:function(t){return null==t?this.attr("cx"):this.attr("cx",t)},cy:function(t){return null==t?this.attr("cy"):this.attr("cy",t)},width:function(t){return null==t?2*this.rx():this.rx(new c.Number(t).divide(2))},height:function(t){return null==t?2*this.ry():this.ry(new c.Number(t).divide(2))},size:function(t,e){var n=f(this,t,e);return this.rx(new c.Number(n.width).divide(2)).ry(new c.Number(n.height).divide(2))}}),c.Line=c.invent({create:"line",inherit:c.Shape,extend:{array:function(){return new c.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(t,e,n,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:i}:new c.PointArray(t).toLine(),this.attr(t))},move:function(t,e){return this.attr(this.array().move(t,e).toLine())},size:function(t,e){var n=f(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}},construct:{line:function(t,e,n,i){return c.Line.prototype.plot.apply(this.put(new c.Line),null!=t?[t,e,n,i]:[0,0,0,0])}}}),c.Polyline=c.invent({create:"polyline",inherit:c.Shape,construct:{polyline:function(t){return this.put(new c.Polyline).plot(t||new c.PointArray)}}}),c.Polygon=c.invent({create:"polygon",inherit:c.Shape,construct:{polygon:function(t){return this.put(new c.Polygon).plot(t||new c.PointArray)}}}),c.extend(c.Polyline,c.Polygon,{array:function(){return this._array||(this._array=new c.PointArray(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new c.PointArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var n=f(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}}),c.extend(c.Line,c.Polyline,c.Polygon,{morphArray:c.PointArray,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}}),c.Path=c.invent({create:"path",inherit:c.Shape,extend:{morphArray:c.PathArray,array:function(){return this._array||(this._array=new c.PathArray(this.attr("d")))},plot:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new c.PathArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("d",this.array().move(t,e))},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},size:function(t,e){var n=f(this,t,e);return this.attr("d",this.array().size(n.width,n.height))},width:function(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)},height:function(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}},construct:{path:function(t){return this.put(new c.Path).plot(t||new c.PathArray)}}}),c.Image=c.invent({create:"image",inherit:c.Shape,extend:{load:function(e){if(!e)return this;var n=this,i=new o.Image;return c.on(i,"load",function(){c.off(i);var t=n.parent(c.Pattern);null!==t&&(0==n.width()&&0==n.height()&&n.size(i.width,i.height),t&&0==t.width()&&0==t.height()&&t.size(n.width(),n.height()),"function"==typeof n._loaded&&n._loaded.call(n,{width:i.width,height:i.height,ratio:i.width/i.height,url:e}))}),c.on(i,"error",function(t){c.off(i),"function"==typeof n._error&&n._error.call(n,t)}),this.attr("href",i.src=this.src=e,c.xlink)},loaded:function(t){return this._loaded=t,this},error:function(t){return this._error=t,this}},construct:{image:function(t,e,n){return this.put(new c.Image).load(t).size(e||0,n||e||0)}}}),c.Text=c.invent({create:function(){this.constructor.call(this,c.create("text")),this.dom.leading=new c.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",c.defaults.attrs["font-family"])},inherit:c.Shape,extend:{x:function(t){return null==t?this.attr("x"):this.attr("x",t)},y:function(t){var e=this.attr("y"),n="number"==typeof e?e-this.bbox().y:0;return null==t?"number"==typeof e?e-n:e:this.attr("y","number"==typeof t.valueOf()?t+n:t)},cx:function(t){return null==t?this.bbox().cx:this.x(t-this.bbox().width/2)},cy:function(t){return null==t?this.bbox().cy:this.y(t-this.bbox().height/2)},text:function(t){if(void 0===t){for(var t="",e=this.node.childNodes,n=0,i=e.length;n<i;++n)0!=n&&3!=e[n].nodeType&&1==c.adopt(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent;return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else{t=t.split("\n");for(var n=0,r=t.length;n<r;n++)this.tspan(t[n]).newLine()}return this.build(!1).rebuild()},size:function(t){return this.attr("font-size",t).rebuild()},leading:function(t){return null==t?this.dom.leading:(this.dom.leading=new c.Number(t),this.rebuild())},lines:function(){var t=(this.textPath&&this.textPath()||this).node,e=c.utils.map(c.utils.filterSVGElements(t.childNodes),function(t){return c.adopt(t)});return new c.Set(e)},rebuild:function(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){var e=this,n=0,i=this.dom.leading*new c.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(e.textPath()||this.attr("x",e.attr("x")),"\n"==this.text()?n+=i:(this.attr("dy",i+n),n=0))}),this.fire("rebuild")}return this},build:function(t){return this._build=!!t,this},setData:function(t){return this.dom=t,this.dom.leading=new c.Number(t.leading||1.3),this}},construct:{text:function(t){return this.put(new c.Text).text(t)},plain:function(t){return this.put(new c.Text).plain(t)}}}),c.Tspan=c.invent({create:"tspan",inherit:c.Shape,extend:{text:function(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)},dx:function(t){return this.attr("dx",t)},dy:function(t){return this.attr("dy",t)},newLine:function(){var t=this.parent(c.Text);return this.dom.newLined=!0,this.dy(t.dom.leading*t.attr("font-size")).attr("x",t.x())}}}),c.extend(c.Text,c.Tspan,{plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(r.createTextNode(t)),this},tspan:function(t){var e=(this.textPath&&this.textPath()||this).node,n=new c.Tspan;return!1===this._build&&this.clear(),e.appendChild(n.node),n.text(t)},clear:function(){for(var t=(this.textPath&&this.textPath()||this).node;t.hasChildNodes();)t.removeChild(t.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),c.TextPath=c.invent({create:"textPath",inherit:c.Parent,parent:c.Text,construct:{morphArray:c.PathArray,path:function(t){for(var e=new c.TextPath,n=this.doc().defs().path(t);this.node.hasChildNodes();)e.node.appendChild(this.node.firstChild);return this.node.appendChild(e.node),e.attr("href","#"+n,c.xlink),this},array:function(){var t=this.track();return t?t.array():null},plot:function(t){var e=this.track(),n=null;return e&&(n=e.plot(t)),null==t?n:this},track:function(){var t=this.textPath();if(t)return t.reference("href")},textPath:function(){if(this.node.firstChild&&"textPath"==this.node.firstChild.nodeName)return c.adopt(this.node.firstChild)}}}),c.Nested=c.invent({create:function(){this.constructor.call(this,c.create("svg")),this.style("overflow","visible")},inherit:c.Container,construct:{nested:function(){return this.put(new c.Nested)}}}),c.A=c.invent({create:"a",inherit:c.Container,extend:{to:function(t){return this.attr("href",t,c.xlink)},show:function(t){return this.attr("show",t,c.xlink)},target:function(t){return this.attr("target",t)}},construct:{link:function(t){return this.put(new c.A).to(t)}}}),c.extend(c.Element,{linkTo:function(t){var e=new c.A;return"function"==typeof t?t.call(e,e):e.to(t),this.parent().put(e).put(this)}}),c.Marker=c.invent({create:"marker",inherit:c.Container,extend:{width:function(t){return this.attr("markerWidth",t)},height:function(t){return this.attr("markerHeight",t)},ref:function(t,e){return this.attr("refX",t).attr("refY",e)},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(t,e,n){return this.defs().marker(t,e,n)}}}),c.extend(c.Defs,{marker:function(t,e,n){return this.put(new c.Marker).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}}),c.extend(c.Line,c.Polyline,c.Polygon,c.Path,{marker:function(t,e,n,i){var r=["marker"];return"all"!=t&&r.push(t),r=r.join("-"),t=arguments[1]instanceof c.Marker?arguments[1]:this.doc().marker(e,n,i),this.attr(r,t)}});var i={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"==e?t:t+"-"+e}};function u(t,e,n,i){return n+i.replace(c.regex.dots," .")}function s(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function a(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t){var e=t.toString(16);return 1==e.length?"0"+e:e}function f(t,e,n){if(null==e||null==n){var i=t.bbox();null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)}return{width:e,height:n}}function d(t,e,n){return{x:e*t.a+n*t.c+0,y:e*t.b+n*t.d+0}}function p(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}function g(t,e){t.cx=null==t.cx?e.bbox().cx:t.cx,t.cy=null==t.cy?e.bbox().cy:t.cy}function m(t){for(var e=t.childNodes.length-1;0<=e;e--)t.childNodes[e]instanceof o.SVGElement&&m(t.childNodes[e]);return c.adopt(t).id(c.eid(t.nodeName))}function v(t){return null==t.x&&(t.x=0,t.y=0,t.width=0,t.height=0),t.w=t.width,t.h=t.height,t.x2=t.x+t.width,t.y2=t.y+t.height,t.cx=t.x+t.width/2,t.cy=t.y+t.height/2,t}function y(t){return 1e-37<Math.abs(t)?t:0}["fill","stroke"].forEach(function(e){var n,t={};t[e]=function(t){if(void 0===t)return this;if("string"==typeof t||c.Color.isRgb(t)||t&&"function"==typeof t.fill)this.attr(e,t);else for(n=i[e].length-1;0<=n;n--)null!=t[i[e][n]]&&this.attr(i.prefix(e,i[e][n]),t[i[e][n]]);return this},c.extend(c.Element,c.FX,t)}),c.extend(c.Element,c.FX,{rotate:function(t,e,n){return this.transform({rotation:t,cx:e,cy:n})},skew:function(t,e,n,i){return 1==arguments.length||3==arguments.length?this.transform({skew:t,cx:e,cy:n}):this.transform({skewX:t,skewY:e,cx:n,cy:i})},scale:function(t,e,n,i){return 1==arguments.length||3==arguments.length?this.transform({scale:t,cx:e,cy:n}):this.transform({scaleX:t,scaleY:e,cx:n,cy:i})},translate:function(t,e){return this.transform({x:t,y:e})},flip:function(t,e){return e="number"==typeof t?t:e,this.transform({flip:t||"both",offset:e})},matrix:function(t){return this.attr("transform",new c.Matrix(6==arguments.length?[].slice.call(arguments):t))},opacity:function(t){return this.attr("opacity",t)},dx:function(t){return this.x(new c.Number(t).plus(this instanceof c.FX?0:this.x()),!0)},dy:function(t){return this.y(new c.Number(t).plus(this instanceof c.FX?0:this.y()),!0)},dmove:function(t,e){return this.dx(t).dy(e)}}),c.extend(c.Rect,c.Ellipse,c.Circle,c.Gradient,c.FX,{radius:function(t,e){var n=(this._target||this).type;return"radial"==n||"circle"==n?this.attr("r",new c.Number(t)):this.rx(t).ry(null==e?t:e)}}),c.extend(c.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(t){return this.node.getPointAtLength(t)}}),c.extend(c.Parent,c.Text,c.Tspan,c.FX,{font:function(t,e){if("object"==typeof t)for(e in t)this.font(e,t[e]);return"leading"==t?this.leading(e):"anchor"==t?this.attr("text-anchor",e):"size"==t||"family"==t||"weight"==t||"stretch"==t||"variant"==t||"style"==t?this.attr("font-"+t,e):this.attr(t,e)}}),c.Set=c.invent({create:function(t){t instanceof c.Set?this.members=t.members.slice():Array.isArray(t)?this.members=t:this.clear()},extend:{add:function(){var t,e,n=[].slice.call(arguments);for(t=0,e=n.length;t<e;t++)this.members.push(n[t]);return this},remove:function(t){var e=this.index(t);return-1<e&&this.members.splice(e,1),this},each:function(t){for(var e=0,n=this.members.length;e<n;e++)t.apply(this.members[e],[e,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(t){return 0<=this.index(t)},index:function(t){return this.members.indexOf(t)},get:function(t){return this.members[t]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(0==this.members.length)return new c.RBox;var t=this.members[0].rbox(this.members[0].doc());return this.each(function(){t=t.merge(this.rbox(this.doc()))}),t}},construct:{set:function(t){return new c.Set(t)}}}),c.FX.Set=c.invent({create:function(t){this.set=t}}),c.Set.inherit=function(){var t=[];for(var e in c.Shape.prototype)"function"==typeof c.Shape.prototype[e]&&"function"!=typeof c.Set.prototype[e]&&t.push(e);for(var e in t.forEach(function(n){c.Set.prototype[n]=function(){for(var t=0,e=this.members.length;t<e;t++)this.members[t]&&"function"==typeof this.members[t][n]&&this.members[t][n].apply(this.members[t],arguments);return"animate"==n?this.fx||(this.fx=new c.FX.Set(this)):this}}),t=[],c.FX.prototype)"function"==typeof c.FX.prototype[e]&&"function"!=typeof c.FX.Set.prototype[e]&&t.push(e);t.forEach(function(n){c.FX.Set.prototype[n]=function(){for(var t=0,e=this.set.members.length;t<e;t++)this.set.members[t].fx[n].apply(this.set.members[t].fx,arguments);return this}})},c.extend(c.Element,{data:function(e,t,n){if("object"==typeof e)for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+e))}catch(t){return this.attr("data-"+e)}else this.attr("data-"+e,null===t?null:!0===n||"string"==typeof t||"number"==typeof t?t:JSON.stringify(t));return this}}),c.extend(c.Element,{remember:function(t,e){if("object"==typeof arguments[0])for(var e in t)this.remember(e,t[e]);else{if(1==arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0==arguments.length)this._memory={};else for(var t=arguments.length-1;0<=t;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory||(this._memory={})}}),c.get=function(t){var e=r.getElementById(function(t){var e=(t||"").toString().match(c.regex.reference);if(e)return e[1]}(t)||t);return c.adopt(e)},c.select=function(t,e){return new c.Set(c.utils.map((e||r).querySelectorAll(t),function(t){return c.adopt(t)}))},c.extend(c.Parent,{select:function(t){return c.select(t,this.node)}});var x="abcdef".split("");if("function"!=typeof o.CustomEvent){var w=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=r.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n};w.prototype=o.Event.prototype,c.CustomEvent=w}else c.CustomEvent=o.CustomEvent;return function(r){for(var s=0,t=["moz","webkit"],e=0;e<t.length&&!o.requestAnimationFrame;++e)r.requestAnimationFrame=r[t[e]+"RequestAnimationFrame"],r.cancelAnimationFrame=r[t[e]+"CancelAnimationFrame"]||r[t[e]+"CancelRequestAnimationFrame"];r.requestAnimationFrame=r.requestAnimationFrame||function(t){var e=(new Date).getTime(),n=Math.max(0,16-(e-s)),i=r.setTimeout(function(){t(e+n)},n);return s=e+n,i},r.cancelAnimationFrame=r.cancelAnimationFrame||r.clearTimeout}(o),c}(r,r.document)}.call(e,n,e,t))||(t.exports=i)}])});