├── examples
├── map
│ ├── app.css
│ ├── index.html
│ └── app.js
├── index.html
├── global.css
└── webpack.config.js
├── .jshintignore
├── .gitignore
├── .jshintrc
├── modules
├── index.js
├── tile.js
├── zoomcontrol.js
├── util
│ ├── template.js
│ └── tile.js
└── map.js
├── lib
├── index.js
├── tile.js
├── zoomcontrol.js
├── util
│ ├── template.js
│ └── tile.js
├── map.js
└── umd
│ └── ReactMap.min.js
├── scripts
├── build.sh
└── release.sh
├── webpack.config.js
├── README.md
└── package.json
/examples/map/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.jshintignore:
--------------------------------------------------------------------------------
1 | build
2 | examples/**/*-bundle.js
3 | node_modules
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | examples/**/*-bundle.js
2 | node_modules
3 | npm-debug.log
4 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "asi": true,
3 | "eqnull": true,
4 | "esnext": true,
5 | "unused": "vars",
6 | "predef": [ "-Promise" ]
7 | }
8 |
--------------------------------------------------------------------------------
/modules/index.js:
--------------------------------------------------------------------------------
1 | exports.Map = require('./map');
2 | exports.ZoomControl = require('./zoomcontrol');
3 | exports.TileUtil = require('./util/tile');
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | exports.Map = require('./map');
4 | exports.ZoomControl = require('./zoomcontrol');
5 | exports.TileUtil = require('./util/tile');
--------------------------------------------------------------------------------
/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
React Map Examples
3 |
4 |
5 | React Map Examples
6 |
9 |
--------------------------------------------------------------------------------
/modules/tile.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 |
3 | var Tile = React.createClass({
4 |
5 | render: function() {
6 | return (
7 |
8 | );
9 | }
10 |
11 | });
12 |
13 | module.exports = Tile;
--------------------------------------------------------------------------------
/modules/zoomcontrol.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 |
3 | var ZoomControl = React.createClass({
4 |
5 | render: function() {
6 | return (
7 |
8 | );
9 | }
10 |
11 | });
12 |
13 | module.exports = ZoomControl;
--------------------------------------------------------------------------------
/lib/tile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var React = require('react');
4 |
5 | var Tile = React.createClass({
6 | displayName: 'Tile',
7 |
8 | render: function render() {
9 | return React.createElement('div', null);
10 | }
11 |
12 | });
13 |
14 | module.exports = Tile;
--------------------------------------------------------------------------------
/lib/zoomcontrol.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var React = require('react');
4 |
5 | var ZoomControl = React.createClass({
6 | displayName: 'ZoomControl',
7 |
8 | render: function render() {
9 | return React.createElement('div', null);
10 | }
11 |
12 | });
13 |
14 | module.exports = ZoomControl;
--------------------------------------------------------------------------------
/examples/global.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: "Helvetica Neue", Arial;
3 | font-weight: 200;
4 | }
5 |
6 | h1, h2, h3 {
7 | font-weight: 100;
8 | }
9 |
10 | a {
11 | color: hsl(200, 50%, 50%);
12 | }
13 |
14 | a.active {
15 | color: hsl(20, 50%, 50%);
16 | }
17 |
18 | .breadcrumbs a {
19 | text-decoration: none;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/map/index.html:
--------------------------------------------------------------------------------
1 |
2 | Map Example
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/scripts/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | babel=node_modules/.bin/babel
4 | webpack=node_modules/.bin/webpack
5 | build_dir=lib
6 |
7 | rm -rf $build_dir
8 |
9 | $babel -d $build_dir ./modules
10 | find -X $build_dir -type d -name __tests__ | xargs rm -rf
11 | NODE_ENV=production $webpack modules/index.js $build_dir/umd/ReactMap.js
12 | NODE_ENV=production COMPRESS=1 $webpack modules/index.js $build_dir/umd/ReactMap.min.js
13 |
14 | echo "gzipped, the global build is `gzip -c $build_dir/umd/ReactMap.min.js | wc -c | sed -e 's/^[[:space:]]*//'` bytes"
15 |
--------------------------------------------------------------------------------
/modules/util/template.js:
--------------------------------------------------------------------------------
1 | var templateRe = /\{ *([\w_]+) *\}/g;
2 |
3 | var TemplateUtil = {
4 | template: function (str, data) {
5 | return str.replace(templateRe, function (str, key) {
6 | var value = data[key];
7 |
8 | if (value === undefined) {
9 | throw new Error('No value provided for variable ' + str);
10 |
11 | } else if (typeof value === 'function') {
12 | value = value(data);
13 | }
14 | return value;
15 | });
16 | }
17 | }
18 |
19 | module.exports = TemplateUtil;
--------------------------------------------------------------------------------
/lib/util/template.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var templateRe = /\{ *([\w_]+) *\}/g;
4 |
5 | var TemplateUtil = {
6 | template: function template(str, data) {
7 | return str.replace(templateRe, function (str, key) {
8 | var value = data[key];
9 |
10 | if (value === undefined) {
11 | throw new Error('No value provided for variable ' + str);
12 | } else if (typeof value === 'function') {
13 | value = value(data);
14 | }
15 | return value;
16 | });
17 | }
18 | };
19 |
20 | module.exports = TemplateUtil;
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | var webpack = require('webpack');
2 |
3 | var plugins = [
4 | new webpack.DefinePlugin({
5 | 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
6 | })
7 | ];
8 |
9 | if (process.env.COMPRESS) {
10 | plugins.push(
11 | new webpack.optimize.UglifyJsPlugin({
12 | compressor: {
13 | warnings: false
14 | }
15 | })
16 | );
17 | }
18 |
19 | module.exports = {
20 |
21 | output: {
22 | library: 'ReactMap',
23 | libraryTarget: 'umd'
24 | },
25 |
26 | externals: [
27 | {
28 | "react": {
29 | root: "React",
30 | commonjs2: "react",
31 | commonjs: "react",
32 | amd: "react"
33 | }
34 | }
35 | ],
36 |
37 | module: {
38 | loaders: [
39 | { test: /\.js$/, loader: 'babel-loader' }
40 | ]
41 | },
42 |
43 | node: {
44 | Buffer: false
45 | },
46 |
47 | plugins: plugins
48 |
49 | };
50 |
--------------------------------------------------------------------------------
/scripts/release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | changelog=node_modules/.bin/changelog
4 |
5 | update_version() {
6 | echo "$(node -p "p=require('./${1}');p.version='${2}';JSON.stringify(p,null,2)")" > $1
7 | echo "Updated ${1} version to ${2}"
8 | }
9 |
10 | current_version=$(node -p "require('./package').version")
11 |
12 | printf "Next version (current is $current_version)? "
13 | read next_version
14 |
15 | if ! [[ $next_version =~ ^[0-9]\.[0-9]+\.[0-9](-.+)? ]]; then
16 | echo "Version must be a valid semver string, e.g. 1.0.2 or 2.3.0-beta.1"
17 | exit 1
18 | fi
19 |
20 | next_ref="v$next_version"
21 |
22 | update_version 'package.json' $next_version
23 |
24 | $changelog -t $next_ref
25 |
26 | npm run build
27 | git add -A build
28 |
29 | git commit -am "Version $next_version"
30 |
31 | git tag $next_ref
32 | git tag latest -f
33 |
34 | git push origin master
35 | git push origin $next_ref
36 | git push origin latest -f
37 |
38 | npm publish build
--------------------------------------------------------------------------------
/examples/map/app.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 | var ReactMap = require('react-map');
3 |
4 | var {
5 | Map
6 | } = ReactMap;
7 |
8 | var viewportWidth = function() {
9 | return window.innerWidth - 100;
10 | }
11 | var viewportHeight = function() {
12 | return window.innerHeight - 100;
13 | }
14 |
15 | var center = [
16 | -122.668197,45.525292
17 | ]
18 | var App = React.createClass({
19 | getInitialState: function() {
20 | return {
21 | center: center,
22 | zoom: 15
23 | }
24 | },
25 |
26 | handleDrag: function(newCenter) {
27 | this.setState({
28 | center: newCenter
29 | })
30 | },
31 | render: function () {
32 | return (
33 |
34 |
42 |
43 | );
44 | }
45 | });
46 |
47 | React.render(, document.getElementById('example'));
48 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #ReactMap
2 |
3 | ```
4 | npm install react-art-map
5 | ```
6 |
7 | ```js
8 | var React = require('react');
9 | var ReactMap = require('react-map');
10 |
11 | var {
12 | Map
13 | } = ReactMap;
14 |
15 | var viewportWidth = function() {
16 | return window.innerWidth - 100;
17 | }
18 | var viewportHeight = function() {
19 | return window.innerHeight - 100;
20 | }
21 |
22 | var center = [
23 | -122.668197,45.525292 //Portland
24 | ];
25 |
26 | var App = React.createClass({
27 | getInitialState: function() {
28 | return {
29 | center: center,
30 | zoom: 15
31 | }
32 | },
33 |
34 | handleDrag: function(newCenter) {
35 | this.setState({
36 | center: newCenter
37 | })
38 | },
39 | render: function () {
40 | return (
41 |
42 |
50 |
51 | );
52 | }
53 | });
54 |
55 | React.render(, document.getElementById('example'));
56 | ```
--------------------------------------------------------------------------------
/examples/webpack.config.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var path = require('path');
3 | var webpack = require('webpack');
4 |
5 | function isDirectory(dir) {
6 | return fs.lstatSync(dir).isDirectory();
7 | }
8 |
9 | module.exports = {
10 |
11 | devtool: 'inline-source-map',
12 |
13 | entry: fs.readdirSync(__dirname).reduce(function (entries, dir) {
14 | var isDraft = dir.charAt(0) === '_';
15 |
16 | if (!isDraft && isDirectory(path.join(__dirname, dir)))
17 | entries[dir] = path.join(__dirname, dir, 'app.js');
18 |
19 | return entries;
20 | }, {}),
21 |
22 | output: {
23 | path: 'examples/__build__',
24 | filename: '[name].js',
25 | chunkFilename: '[id].chunk.js',
26 | publicPath: '/__build__/'
27 | },
28 |
29 | module: {
30 | loaders: [
31 | { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }
32 | ]
33 | },
34 |
35 | resolve: {
36 | alias: {
37 | 'react-map': '../../modules/index'
38 | }
39 | },
40 |
41 | plugins: [
42 | new webpack.optimize.CommonsChunkPlugin('shared.js'),
43 | new webpack.DefinePlugin({
44 | 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
45 | })
46 | ]
47 |
48 | };
49 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-art-map",
3 | "version": "1.0.8",
4 | "description": "A react map rendered with react-art",
5 | "main": "lib",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/browniefed/react-art-map.git"
9 | },
10 | "homepage": "https://github.com/browniefed/react-art-map",
11 | "bugs": "https://github.com/browniefed/react-art-map/issues",
12 | "scripts": {
13 | "build": "scripts/build.sh",
14 | "watch": "babel ./modules --watch -d lib",
15 | "prepublish": "npm run build",
16 | "examples": "webpack-dev-server --config examples/webpack.config.js --content-base examples"
17 | },
18 | "authors": [
19 | "Jason Brown"
20 | ],
21 | "license": "MIT",
22 | "devDependencies": {
23 | "babel": "^5.0.12",
24 | "babel-core": "^5.0.12",
25 | "babel-loader": "^5.0.0",
26 | "bundle-loader": "^0.5.2",
27 | "react": "0.13.x",
28 | "webpack": "^1.4.13",
29 | "webpack-dev-server": "^1.6.6"
30 | },
31 | "peerDependencies": {
32 | "react": "0.13.x",
33 | "react-art": "^0.13.0"
34 | },
35 | "dependencies": {
36 | "googlemaps-utils": "0.0.1",
37 | "map-the-tiles": "0.0.0",
38 | "paths-js": "^0.3.4"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/modules/util/tile.js:
--------------------------------------------------------------------------------
1 | var TemplateUtil = require('./template');
2 | var MapTheTiles = require('map-the-tiles');
3 | var gmu = require('googlemaps-utils');
4 |
5 | var TileUtil = {
6 | getSubdmain(tilePoint, subdomains) {
7 | var index = Math.abs(tilePoint.x + tilePoint.y) % subdomains.length;
8 | return subdomains[index];
9 | },
10 | getTileUrl(str, coords, subdomains) {
11 |
12 | return TemplateUtil.template(str, {
13 | s: this.getSubdmain(coords, subdomains),
14 | x: coords.x,
15 | y: coords.y,
16 | z: coords.z
17 | });
18 | },
19 | degrees2meters(lon,lat) {
20 | var x = lon * 20037508.34 / 180;
21 | var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
22 | y = y * 20037508.34 / 180;
23 | return [x, y]
24 | },
25 | meters2degress(x,y) {
26 | var lon = x * 180 / 20037508.34 ;
27 | var lat = Number(180 / Math.PI * (2 * Math.atan(Math.exp(y * Math.PI / 180)) - Math.PI / 2));
28 | return [lon, lat]
29 | },
30 | getTileLayout(options) {
31 | var layout = [];
32 | var bounds = gmu.calcBounds(options.center[1], options.center[0], options.zoom, options.width, options.height);
33 |
34 | var topLeftMeters = TileUtil.degrees2meters(bounds.left, bounds.top),
35 | bottomRightMeters = TileUtil.degrees2meters(bounds.right, bounds.bottom);
36 |
37 | var tiler = new MapTheTiles(null, options.tileWidth);
38 |
39 | var layoutForBounds = {
40 | top: topLeftMeters[1],
41 | left: topLeftMeters[0],
42 | right: bottomRightMeters[0],
43 | bottom: bottomRightMeters[1]
44 | };
45 |
46 | var tiles = tiler.getTiles(layoutForBounds, options.zoom)
47 |
48 | tiles.forEach(function(tile) {
49 | var coordPoint = {
50 | x: tile.X,
51 | y: tile.Y,
52 | z: tile.Z
53 | },
54 | coord = {
55 | x: tile.left,
56 | y: tile.top,
57 | img: TileUtil.getTileUrl(options.tileSource, coordPoint, options.subdomains)
58 | };
59 |
60 | layout.push(coord);
61 | }, this);
62 |
63 | return layout;
64 | }
65 | };
66 |
67 | module.exports = TileUtil;
--------------------------------------------------------------------------------
/lib/util/tile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var TemplateUtil = require('./template');
4 | var MapTheTiles = require('map-the-tiles');
5 | var gmu = require('googlemaps-utils');
6 |
7 | var TileUtil = {
8 | getSubdmain: function getSubdmain(tilePoint, subdomains) {
9 | var index = Math.abs(tilePoint.x + tilePoint.y) % subdomains.length;
10 | return subdomains[index];
11 | },
12 | getTileUrl: function getTileUrl(str, coords, subdomains) {
13 |
14 | return TemplateUtil.template(str, {
15 | s: this.getSubdmain(coords, subdomains),
16 | x: coords.x,
17 | y: coords.y,
18 | z: coords.z
19 | });
20 | },
21 | degrees2meters: function degrees2meters(lon, lat) {
22 | var x = lon * 20037508.34 / 180;
23 | var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
24 | y = y * 20037508.34 / 180;
25 | return [x, y];
26 | },
27 | meters2degress: function meters2degress(x, y) {
28 | var lon = x * 180 / 20037508.34;
29 | var lat = Number(180 / Math.PI * (2 * Math.atan(Math.exp(y * Math.PI / 180)) - Math.PI / 2));
30 | return [lon, lat];
31 | },
32 | getTileLayout: function getTileLayout(options) {
33 | var layout = [];
34 | var bounds = gmu.calcBounds(options.center[1], options.center[0], options.zoom, options.width, options.height);
35 |
36 | var topLeftMeters = TileUtil.degrees2meters(bounds.left, bounds.top),
37 | bottomRightMeters = TileUtil.degrees2meters(bounds.right, bounds.bottom);
38 |
39 | var tiler = new MapTheTiles(null, options.tileWidth);
40 |
41 | var layoutForBounds = {
42 | top: topLeftMeters[1],
43 | left: topLeftMeters[0],
44 | right: bottomRightMeters[0],
45 | bottom: bottomRightMeters[1]
46 | };
47 |
48 | var tiles = tiler.getTiles(layoutForBounds, options.zoom);
49 |
50 | tiles.forEach(function (tile) {
51 | var coordPoint = {
52 | x: tile.X,
53 | y: tile.Y,
54 | z: tile.Z
55 | },
56 | coord = {
57 | x: tile.left,
58 | y: tile.top,
59 | img: TileUtil.getTileUrl(options.tileSource, coordPoint, options.subdomains)
60 | };
61 |
62 | layout.push(coord);
63 | }, this);
64 |
65 | return layout;
66 | }
67 | };
68 |
69 | module.exports = TileUtil;
--------------------------------------------------------------------------------
/modules/map.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 | var ReactArt = require('react-art');
3 | var TileUtil = require('./util/tile');
4 | var MapTheTiles = require('map-the-tiles');
5 | var Rectangle = require('paths-js/rectangle');
6 |
7 | var {
8 | Surface,
9 | Shape,
10 | Group,
11 | Pattern
12 | } = ReactArt;
13 |
14 | var rectanglePath = Rectangle({
15 | top: 0,
16 | left: 0,
17 | right: 256,
18 | bottom: 256
19 | }).path.print();
20 |
21 | var gmu = require('googlemaps-utils');
22 |
23 | var Map = React.createClass({
24 | propTypes: {
25 | width: React.PropTypes.number,
26 | height: React.PropTypes.number,
27 | zoom: React.PropTypes.number,
28 | center: React.PropTypes.array,
29 | tileSource: React.PropTypes.string,
30 | subdomains: React.PropTypes.string,
31 | tileWidth: React.PropTypes.number,
32 |
33 | onMouseDown: React.PropTypes.func,
34 | onMouseMove: React.PropTypes.func,
35 | onMouseUp: React.PropTypes.func
36 | },
37 | getDefaultProps() {
38 | return {
39 | subdomains: 'abc',
40 | tileWidth: 256,
41 | zoom: 15,
42 | onMouseDown: function() {},
43 | onMouseMove: function() {},
44 | onMouseUp: function() {},
45 | onDrag: function() {}
46 | }
47 | },
48 | componentDidMount() {
49 | document.addEventListener('mousemove', this.handleMouseMove , false);
50 | document.addEventListener('mouseup', this.handleMouseUp , false);
51 | },
52 | componentWillUnmount() {
53 | document.removeEventListener('mousemove', this.handleMouseMove, false);
54 | document.removeEventListener('mouseup', this.handleMouseUp, false);
55 | },
56 | handleMouseDown(e) {
57 | this.dragging = true;
58 | this.coords = {
59 | x: e.x,
60 | y: e.y
61 | };
62 | this.dragCenter = this.props.center.slice(0);
63 |
64 | this.props.onMouseDown(e);
65 | },
66 | handleMouseUp(e) {
67 | this.dragging = false;
68 | this.coords = {};
69 | this.dragCenter = [];
70 | this.props.onMouseUp(e);
71 | },
72 | handleMouseMove(e) {
73 | if (this.dragging) {
74 | e.preventDefault();
75 | //Get mouse change differential
76 | var xDiff = this.coords.x - e.x,
77 | yDiff = this.coords.y - e.y;
78 | //Update to our new coordinates
79 | this.coords.x = e.x;
80 | this.coords.y = e.y;
81 |
82 | var centerMeters = TileUtil.degrees2meters(this.dragCenter[0], this.dragCenter[1]);
83 |
84 | var R = 6378137,
85 | lat = this.dragCenter[1],
86 | lon = this.dragCenter[0];
87 |
88 | var dn = xDiff * 10;
89 | var de = yDiff * 5;
90 |
91 | //Coordinate offsets in radians
92 | var dLat = de/R || 0;
93 | var dLon = dn/R || 0;
94 |
95 | //OffsetPosition, decimal degrees
96 | var latO = lat - dLat * 180/Math.PI;
97 | var lonO = lon + dLon * 180/Math.PI;
98 |
99 | var newPos = [
100 | lonO,
101 | latO
102 | ];
103 |
104 | this.dragCenter = newPos;
105 | this.props.onDrag(newPos, e);
106 | }
107 | },
108 | getTiles() {
109 |
110 | var layout = TileUtil.getTileLayout({
111 | center: this.props.center,
112 | zoom: this.props.zoom,
113 | tileWidth: this.props.tileWidth,
114 |
115 | tileSource: this.props.tileSource,
116 | subdomains: this.props.subdomains,
117 |
118 | width: this.props.width,
119 | height: this.props.height
120 | })
121 |
122 | return layout.map(function(tile) {
123 | return (
124 |
130 | )
131 | }, this);
132 |
133 | },
134 | render() {
135 | return (
136 |
140 |
143 | {this.getTiles()}
144 | {this.props.children}
145 |
146 |
147 | );
148 | }
149 |
150 | });
151 |
152 | module.exports = Map;
--------------------------------------------------------------------------------
/lib/map.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var React = require('react');
4 | var ReactArt = require('react-art');
5 | var TileUtil = require('./util/tile');
6 | var MapTheTiles = require('map-the-tiles');
7 | var Rectangle = require('paths-js/rectangle');
8 |
9 | var Surface = ReactArt.Surface;
10 | var Shape = ReactArt.Shape;
11 | var Group = ReactArt.Group;
12 | var Pattern = ReactArt.Pattern;
13 |
14 | var rectanglePath = Rectangle({
15 | top: 0,
16 | left: 0,
17 | right: 256,
18 | bottom: 256
19 | }).path.print();
20 |
21 | var gmu = require('googlemaps-utils');
22 |
23 | var Map = React.createClass({
24 | displayName: 'Map',
25 |
26 | propTypes: {
27 | width: React.PropTypes.number,
28 | height: React.PropTypes.number,
29 | zoom: React.PropTypes.number,
30 | center: React.PropTypes.array,
31 | tileSource: React.PropTypes.string,
32 | subdomains: React.PropTypes.string,
33 | tileWidth: React.PropTypes.number,
34 |
35 | onMouseDown: React.PropTypes.func,
36 | onMouseMove: React.PropTypes.func,
37 | onMouseUp: React.PropTypes.func
38 | },
39 | getDefaultProps: function getDefaultProps() {
40 | return {
41 | subdomains: 'abc',
42 | tileWidth: 256,
43 | zoom: 15,
44 | onMouseDown: function onMouseDown() {},
45 | onMouseMove: function onMouseMove() {},
46 | onMouseUp: function onMouseUp() {},
47 | onDrag: function onDrag() {}
48 | };
49 | },
50 | componentDidMount: function componentDidMount() {
51 | document.addEventListener('mousemove', this.handleMouseMove, false);
52 | document.addEventListener('mouseup', this.handleMouseUp, false);
53 | },
54 | componentWillUnmount: function componentWillUnmount() {
55 | document.removeEventListener('mousemove', this.handleMouseMove, false);
56 | document.removeEventListener('mouseup', this.handleMouseUp, false);
57 | },
58 | handleMouseDown: function handleMouseDown(e) {
59 | this.dragging = true;
60 | this.coords = {
61 | x: e.x,
62 | y: e.y
63 | };
64 | this.dragCenter = this.props.center.slice(0);
65 |
66 | this.props.onMouseDown(e);
67 | },
68 | handleMouseUp: function handleMouseUp(e) {
69 | this.dragging = false;
70 | this.coords = {};
71 | this.dragCenter = [];
72 | this.props.onMouseUp(e);
73 | },
74 | handleMouseMove: function handleMouseMove(e) {
75 | if (this.dragging) {
76 | e.preventDefault();
77 | //Get mouse change differential
78 | var xDiff = this.coords.x - e.x,
79 | yDiff = this.coords.y - e.y;
80 | //Update to our new coordinates
81 | this.coords.x = e.x;
82 | this.coords.y = e.y;
83 |
84 | var centerMeters = TileUtil.degrees2meters(this.dragCenter[0], this.dragCenter[1]);
85 |
86 | var R = 6378137,
87 | lat = this.dragCenter[1],
88 | lon = this.dragCenter[0];
89 |
90 | var dn = xDiff * 10;
91 | var de = yDiff * 5;
92 |
93 | //Coordinate offsets in radians
94 | var dLat = de / R || 0;
95 | var dLon = dn / R || 0;
96 |
97 | //OffsetPosition, decimal degrees
98 | var latO = lat - dLat * 180 / Math.PI;
99 | var lonO = lon + dLon * 180 / Math.PI;
100 |
101 | var newPos = [lonO, latO];
102 |
103 | this.dragCenter = newPos;
104 | this.props.onDrag(newPos, e);
105 | }
106 | },
107 | getTiles: function getTiles() {
108 |
109 | var layout = TileUtil.getTileLayout({
110 | center: this.props.center,
111 | zoom: this.props.zoom,
112 | tileWidth: this.props.tileWidth,
113 |
114 | tileSource: this.props.tileSource,
115 | subdomains: this.props.subdomains,
116 |
117 | width: this.props.width,
118 | height: this.props.height
119 | });
120 |
121 | return layout.map(function (tile) {
122 | return React.createElement(Shape, {
123 | d: rectanglePath,
124 | x: tile.x,
125 | y: tile.y,
126 | fill: new Pattern(tile.img, this.props.tileWidth, this.props.tileWidth, 0, 0)
127 | });
128 | }, this);
129 | },
130 | render: function render() {
131 | return React.createElement(
132 | Surface,
133 | {
134 | width: this.props.width,
135 | height: this.props.height
136 | },
137 | React.createElement(
138 | Group,
139 | {
140 | onMouseDown: this.handleMouseDown
141 | },
142 | this.getTiles(),
143 | this.props.children
144 | )
145 | );
146 | }
147 |
148 | });
149 |
150 | module.exports = Map;
--------------------------------------------------------------------------------
/lib/umd/ReactMap.min.js:
--------------------------------------------------------------------------------
1 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactMap=e(require("react")):t.ReactMap=e(t.React)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";e.Map=n(1),e.ZoomControl=n(80),e.TileUtil=n(71)},function(t,e,n){"use strict";var i=n(3),r=n(4),o=n(71),s=(n(2),n(75)),a=r.Surface,l=r.Shape,h=r.Group,u=r.Pattern,c=s({top:0,left:0,right:256,bottom:256}).path.print(),p=(n(73),i.createClass({displayName:"Map",propTypes:{width:i.PropTypes.number,height:i.PropTypes.number,zoom:i.PropTypes.number,center:i.PropTypes.array,tileSource:i.PropTypes.string,subdomains:i.PropTypes.string,tileWidth:i.PropTypes.number,onMouseDown:i.PropTypes.func,onMouseMove:i.PropTypes.func,onMouseUp:i.PropTypes.func},getDefaultProps:function(){return{subdomains:"abc",tileWidth:256,zoom:15,onMouseDown:function(){},onMouseMove:function(){},onMouseUp:function(){},onDrag:function(){}}},componentDidMount:function(){document.addEventListener("mousemove",this.handleMouseMove,!1),document.addEventListener("mouseup",this.handleMouseUp,!1)},componentWillUnmount:function(){document.removeEventListener("mousemove",this.handleMouseMove,!1),document.removeEventListener("mouseup",this.handleMouseUp,!1)},handleMouseDown:function(t){this.dragging=!0,this.coords={x:t.x,y:t.y},this.dragCenter=this.props.center.slice(0),this.props.onMouseDown(t)},handleMouseUp:function(t){this.dragging=!1,this.coords={},this.dragCenter=[],this.props.onMouseUp(t)},handleMouseMove:function(t){if(this.dragging){t.preventDefault();var e=this.coords.x-t.x,n=this.coords.y-t.y;this.coords.x=t.x,this.coords.y=t.y;var i=(o.degrees2meters(this.dragCenter[0],this.dragCenter[1]),6378137),r=this.dragCenter[1],s=this.dragCenter[0],a=10*e,l=5*n,h=l/i||0,u=a/i||0,c=r-180*h/Math.PI,p=s+180*u/Math.PI,f=[p,c];this.dragCenter=f,this.props.onDrag(f,t)}},getTiles:function(){var t=o.getTileLayout({center:this.props.center,zoom:this.props.zoom,tileWidth:this.props.tileWidth,tileSource:this.props.tileSource,subdomains:this.props.subdomains,width:this.props.width,height:this.props.height});return t.map(function(t){return i.createElement(l,{d:c,x:t.x,y:t.y,fill:new u(t.img,this.props.tileWidth,this.props.tileWidth,0,0)})},this)},render:function(){return i.createElement(a,{width:this.props.width,height:this.props.height},i.createElement(h,{onMouseDown:this.handleMouseDown},this.getTiles(),this.props.children))}}));t.exports=p},function(t,e,n){"use strict";var i=function(t,e){this.projExtent=t||{left:-20037508.342789244,right:20037508.342789244,bottom:-20037508.342789244,top:20037508.342789244},this.size=e||256,this.maxRes=Math.min(Math.abs(this.projExtent.right-this.projExtent.left)/this.size,Math.abs(this.projExtent.top-this.projExtent.bottom)/this.size)};i.prototype.getTiles=function(t,e){for(var n=this.maxRes/Math.pow(2,e),i=Math.floor((t.left-this.projExtent.left)/n),r=Math.floor((t.right-this.projExtent.left)/n),o=Math.floor((this.projExtent.top-t.bottom)/n),s=Math.floor((this.projExtent.top-t.top)/n),a=Math.floor(i/this.size),l=Math.floor(r/this.size),h=Math.floor(o/this.size),u=Math.floor(s/this.size),c=topStart=u*this.size-s,p=a*this.size-i,f=[],d=a;l>=d;d++){c=topStart;for(var m=u;h>=m;m++)f.push({X:d,Y:m,Z:e,top:c,left:p}),c+=this.size;p+=this.size}return f},t.exports=i},function(e,n,i){e.exports=t},function(t,e,n){"use strict";function i(t){return t?"string"==typeof t?t:t.length?t.join("\n"):"":""}function r(t){var e=function(t){this.node=null,this.subscriptions=null,this.listeners=null,this._mountImage=null,this._renderedChildren=null,this._mostRecentlyPlacedChild=null};e.displayName=t;for(var n=1,i=arguments.length;i>n;n++)f(e.prototype,arguments[n]);return e}function o(t,e,n,i,r){this.args=T.call(arguments)}function s(t,e,n,i,r,o,s){this.args=T.call(arguments)}function a(t,e,n,i,r){this.args=T.call(arguments)}n(42);var l=n(46),h=n(61),u=n(3),c=n(5),p=n(36),f=n(19),d=n(20),m=new l,v=f({},c.Mixin,{moveChild:function(t,e){var n=t._mountImage,i=this._mostRecentlyPlacedChild;null==i?n.previousSibling&&(this.node.firstChild?n.injectBefore(this.node.firstChild):n.inject(this.node)):i.nextSibling!==n&&(i.nextSibling?n.injectBefore(i.nextSibling):n.inject(this.node)),this._mostRecentlyPlacedChild=n},createChild:function(t,e){t._mountImage=e;var n=this._mostRecentlyPlacedChild;null==n?this.node.firstChild?e.injectBefore(this.node.firstChild):e.inject(this.node):n.nextSibling?e.injectBefore(n.nextSibling):e.inject(this.node),this._mostRecentlyPlacedChild=e},removeChild:function(t){t._mountImage.eject(),t._mountImage=null},updateChildrenAtRoot:function(t,e){this.updateChildren(t,e,d)},mountAndInjectChildrenAtRoot:function(t,e){this.mountAndInjectChildren(t,e,d)},updateChildren:function(t,e,n){this._mostRecentlyPlacedChild=null,this._updateChildren(t,e,n)},mountAndInjectChildren:function(t,e,n){var i=this.mountChildren(t,e,n),r=0;for(var o in this._renderedChildren)if(this._renderedChildren.hasOwnProperty(o)){var s=this._renderedChildren[o];s._mountImage=i[r],i[r].inject(this.node),r++}}}),y=u.createClass({displayName:"Surface",mixins:[v],componentDidMount:function(){var t=this.getDOMNode();this.node=h.Surface(+this.props.width,+this.props.height,t);var e=p.ReactReconcileTransaction.getPooled();e.perform(this.mountAndInjectChildrenAtRoot,this,this.props.children,e),p.ReactReconcileTransaction.release(e)},componentDidUpdate:function(t){var e=this.node;(this.props.width!=t.width||this.props.height!=t.height)&&e.resize(+this.props.width,+this.props.height);var n=p.ReactReconcileTransaction.getPooled();n.perform(this.updateChildrenAtRoot,this,this.props.children,n),p.ReactReconcileTransaction.release(n),e.render&&e.render()},componentWillUnmount:function(){this.unmountChildren()},render:function(){var t=this.props;return u.createElement(h.Surface.tagName,{accesskey:t.accesskey,className:t.className,draggable:t.draggable,role:t.role,style:t.style,tabindex:t.tabindex,title:t.title})}}),g={onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseUp:"mouseup",onMouseDown:"mousedown",onClick:"click"},x={construct:function(t){this._currentElement=t},getPublicInstance:function(){return this.node},putEventListener:function(t,e){var n=this.subscriptions||(this.subscriptions={}),i=this.listeners||(this.listeners={});i[t]=e,e?n[t]||(n[t]=this.node.subscribe(t,e,this)):n[t]&&(n[t](),delete n[t])},handleEvent:function(t){var e=this.listeners[t.type];e&&("function"==typeof e?e.call(this,t):e.handleEvent&&e.handleEvent(t))},destroyEventListeners:function(){var t=this.subscriptions;if(t)for(var e in t)t[e]();this.subscriptions=null,this.listeners=null},applyNodeProps:function(t,e){var n=this.node,i=null!=e.scaleX?e.scaleX:null!=e.scale?e.scale:1,r=null!=e.scaleY?e.scaleY:null!=e.scale?e.scale:1;m.transformTo(1,0,0,1,0,0).move(e.x||0,e.y||0).rotate(e.rotation||0,e.originX,e.originY).scale(i,r,e.originX,e.originY),null!=e.transform&&m.transform(e.transform),(n.xx!==m.xx||n.yx!==m.yx||n.xy!==m.xy||n.yy!==m.yy||n.x!==m.x||n.y!==m.y)&&n.transformTo(m),(e.cursor!==t.cursor||e.title!==t.title)&&n.indicate(e.cursor,e.title),n.blend&&e.opacity!==t.opacity&&n.blend(null==e.opacity?1:e.opacity),e.visible!==t.visible&&(null==e.visible||e.visible?n.show():n.hide());for(var o in g)this.putEventListener(g[o],e[o])},mountComponentIntoNode:function(t,e){throw new Error("You cannot render an ART component standalone. You need to wrap it in a Surface.")}},_=r("Group",x,v,{mountComponent:function(t,e,n){this.node=h.Group();var i=this._currentElement.props;return this.applyGroupProps(d,i),this.mountAndInjectChildren(i.children,e,n),this.node},receiveComponent:function(t,e,n){var i=t.props,r=this._currentElement.props;this.applyGroupProps(r,i),this.updateChildren(i.children,e,n),this._currentElement=t},applyGroupProps:function(t,e){this.node.width=e.width,this.node.height=e.height,this.applyNodeProps(t,e)},unmountComponent:function(){this.destroyEventListeners(),this.unmountChildren()}}),C=r("ClippingRectangle",x,v,{mountComponent:function(t,e,n){this.node=h.ClippingRectangle();var i=this._currentElement.props;return this.applyClippingProps(d,i),this.mountAndInjectChildren(i.children,e,n),this.node},receiveComponent:function(t,e,n){var i=t.props,r=this._currentElement.props;this.applyClippingProps(r,i),this.updateChildren(i.children,e,n),this._currentElement=t},applyClippingProps:function(t,e){this.node.width=e.width,this.node.height=e.height,this.node.x=e.x,this.node.y=e.y,this.applyNodeProps(t,e)},unmountComponent:function(){this.destroyEventListeners(),this.unmountChildren()}}),b=f({},x,{applyRenderableProps:function(t,e){t.fill!==e.fill&&(e.fill&&e.fill.applyFill?e.fill.applyFill(this.node):this.node.fill(e.fill)),(t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.strokeCap!==e.strokeCap||t.strokeJoin!==e.strokeJoin||t.strokeDash!==e.strokeDash)&&this.node.stroke(e.stroke,e.strokeWidth,e.strokeCap,e.strokeJoin,e.strokeDash),this.applyNodeProps(t,e)},unmountComponent:function(){this.destroyEventListeners()}}),w=r("Shape",b,{construct:function(t){this._currentElement=t,this._oldPath=null},mountComponent:function(t,e,n){this.node=h.Shape();var i=this._currentElement.props;return this.applyShapeProps(d,i),this.node},receiveComponent:function(t,e,n){var i=t.props,r=this._currentElement.props;this.applyShapeProps(r,i),this._currentElement=t},applyShapeProps:function(t,e){var n=this._oldPath,r=e.d||i(e.children);(r!==n||t.width!==e.width||t.height!==e.height)&&(this.node.draw(r,e.width,e.height),this._oldPath=r),this.applyRenderableProps(t,e)}}),M=r("Text",b,{construct:function(t){this._currentElement=t,this._oldString=null},mountComponent:function(t,e,n){var r=this._currentElement.props,o=i(r.children);return this.node=h.Text(o,r.font,r.alignment,r.path),this._oldString=o,this.applyRenderableProps(d,r),this.node},isSameFont:function(t,e){return t===e?!0:"string"==typeof e||"string"==typeof t?!1:e.fontSize===t.fontSize&&e.fontStyle===t.fontStyle&&e.fontVariant===t.fontVariant&&e.fontWeight===t.fontWeight&&e.fontFamily===t.fontFamily},receiveComponent:function(t,e,n){var r=t.props,o=this._currentElement.props,s=this._oldString,a=i(r.children);s===a&&this.isSameFont(o.font,r.font)&&o.alignment===r.alignment&&o.path===r.path||(this.node.draw(a,r.font,r.alignment,r.path),this._oldString=a),this.applyRenderableProps(o,r),this._currentElement=t}}),T=Array.prototype.slice;o.prototype.applyFill=function(t){t.fillLinear.apply(t,this.args)},s.prototype.applyFill=function(t){t.fillRadial.apply(t,this.args)},a.prototype.applyFill=function(t){t.fillImage.apply(t,this.args)};var E={LinearGradient:o,RadialGradient:s,Pattern:a,Transform:l,Path:h.Path,Surface:y,Group:_,ClippingRectangle:C,Shape:w,Text:M};t.exports=E},function(t,e,n){"use strict";function i(t,e,n){d.push({parentID:t,parentNode:null,type:u.INSERT_MARKUP,markupIndex:m.push(e)-1,textContent:null,fromIndex:null,toIndex:n})}function r(t,e,n){d.push({parentID:t,parentNode:null,type:u.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:e,toIndex:n})}function o(t,e){d.push({parentID:t,parentNode:null,type:u.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:e,toIndex:null})}function s(t,e){d.push({parentID:t,parentNode:null,type:u.TEXT_CONTENT,markupIndex:null,textContent:e,fromIndex:null,toIndex:null})}function a(){d.length&&(h.processChildrenUpdates(d,m),l())}function l(){d.length=0,m.length=0}var h=n(6),u=n(8),c=n(10),p=n(26),f=0,d=[],m=[],v={Mixin:{mountChildren:function(t,e,n){var i=p.instantiateChildren(t,e,n);this._renderedChildren=i;var r=[],o=0;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s],l=this._rootNodeID+s,h=c.mountComponent(a,l,e,n);a._mountIndex=o,r.push(h),o++}return r},updateTextContent:function(t){f++;var e=!0;try{var n=this._renderedChildren;p.unmountChildren(n);for(var i in n)n.hasOwnProperty(i)&&this._unmountChildByName(n[i],i);this.setTextContent(t),e=!1}finally{f--,f||(e?l():a())}},updateChildren:function(t,e,n){f++;var i=!0;try{this._updateChildren(t,e,n),i=!1}finally{f--,f||(i?l():a())}},_updateChildren:function(t,e,n){var i=this._renderedChildren,r=p.updateChildren(i,t,e,n);if(this._renderedChildren=r,r||i){var o,s=0,a=0;for(o in r)if(r.hasOwnProperty(o)){var l=i&&i[o],h=r[o];l===h?(this.moveChild(l,a,s),s=Math.max(l._mountIndex,s),l._mountIndex=a):(l&&(s=Math.max(l._mountIndex,s),this._unmountChildByName(l,o)),this._mountChildByNameAtIndex(h,o,a,e,n)),a++}for(o in i)!i.hasOwnProperty(o)||r&&r.hasOwnProperty(o)||this._unmountChildByName(i[o],o)}},unmountChildren:function(){var t=this._renderedChildren;p.unmountChildren(t),this._renderedChildren=null},moveChild:function(t,e,n){t._mountIndex");var a="";r&&(a=" The element was created by "+r+".")}}function p(t,e){return t!==t?e!==e:0===t&&0===e?1/t===1/e:t===e}function f(t){if(t._store){var e=t._store.originalProps,n=t.props;for(var i in n)n.hasOwnProperty(i)&&(e.hasOwnProperty(i)&&p(e[i],n[i])||(c(i,t),e[i]=n[i]))}}function d(t){if(null!=t.type){var e=x.getComponentClassForElement(t),n=e.displayName||e.name;e.propTypes&&u(n,e.propTypes,t.props,y.prop),"function"==typeof e.getDefaultProps}}var m=n(15),v=n(22),y=n(23),g=(n(24),n(21)),x=n(25),_=n(14),C=n(7),b=(n(16),{}),w={},M=/^\d+$/,T={},E={checkAndWarnForMutatedProps:f,createElement:function(t,e,n){var i=m.createElement.apply(this,arguments);if(null==i)return i;for(var r=2;r1){for(var p=Array(c),f=0;c>f;f++)p[f]=arguments[f+2];l.children=p}if(t&&t.defaultProps){var d=t.defaultProps;for(o in d)"undefined"==typeof l[o]&&(l[o]=d[o])}return new a(t,h,u,r.current,i.current,l)},a.createFactory=function(t){var e=a.createElement.bind(null,t);return e.type=t,e},a.cloneAndReplaceProps=function(t,e){var n=new a(t.type,t.key,t.ref,t._owner,t._context,e);return n},a.cloneElement=function(t,e,n){var i,l=o({},t.props),h=t.key,u=t.ref,c=t._owner;if(null!=e){void 0!==e.ref&&(u=e.ref,c=r.current),void 0!==e.key&&(h=""+e.key);for(i in e)e.hasOwnProperty(i)&&!s.hasOwnProperty(i)&&(l[i]=e[i])}var p=arguments.length-2;if(1===p)l.children=n;else if(p>1){for(var f=Array(p),d=0;p>d;d++)f[d]=arguments[d+2];l.children=f}return new a(t.type,h,u,c,t._context,l)},a.isValidElement=function(t){var e=!(!t||!t._isReactElement);return e},t.exports=a},function(t,e,n){"use strict";var i=n(17),r=i;t.exports=r},function(t,e,n){"use strict";function i(t){return function(){return t}}function r(){}r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var i=n(19),r=n(20),o=(n(16),{current:r,withContext:function(t,e){var n,r=o.current;o.current=i({},r,t);try{n=e()}finally{o.current=r}return n}});t.exports=o},function(t,e,n){"use strict";function i(t,e){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(t),i=Object.prototype.hasOwnProperty,r=1;r=s;s++)if(r(t,s)&&r(e,s))i=s;else if(t.charAt(s)!==e.charAt(s))break;var a=t.substr(0,i);return p(o(a)),a}function u(t,e,n,i,r,o){t=t||"",e=e||"",p(t!==e);var h=s(e,t);p(h||s(t,e));for(var u=0,c=h?a:l,f=t;;f=c(f,e)){var d;if(r&&f===t||o&&f===e||(d=n(f,h,i)),d===!1||f===e)break;p(u++1){var e=t.indexOf(f,1);return e>-1?t.substr(0,e):t}return null},traverseEnterLeave:function(t,e,n,i,r){var o=h(t,e);o!==t&&u(t,o,n,i,!1,!0),o!==e&&u(o,e,n,r,!0,!1)},traverseTwoPhase:function(t,e,n){t&&(u("",t,e,n,!0,!1),u(t,"",e,n,!1,!0))},traverseAncestors:function(t,e,n){u("",t,e,n,!0,!1)},_getFirstCommonAncestorID:h,_getNextDescendantID:l,isAncestorIDOf:s,SEPARATOR:f};t.exports=v},function(t,e,n){"use strict";var i={injectCreateReactRootIndex:function(t){r.createReactRootIndex=t}},r={createReactRootIndex:null,injection:i};t.exports=r},function(t,e,n){"use strict";function i(t){return"function"==typeof t&&"undefined"!=typeof t.prototype&&"function"==typeof t.prototype.mountComponent&&"function"==typeof t.prototype.receiveComponent}function r(t,e){var n;if((null===t||t===!1)&&(t=s.emptyElement),"object"==typeof t){var r=t;n=e===r.type&&"string"==typeof r.type?a.createInternalComponent(r):i(r.type)?new r.type(r):new u}else"string"==typeof t||"number"==typeof t?n=a.createInstanceForText(t):h(!1);return n.construct(t),n._mountIndex=0,n._mountImage=null,n}var o=n(32),s=n(41),a=n(25),l=n(19),h=n(7),u=(n(16),function(){});l(u.prototype,o.Mixin,{_instantiateReactComponent:r}),t.exports=r},function(t,e,n){"use strict";function i(t){var e=t._currentElement._owner||null;if(e){var n=e.getName();if(n)return" Check the render method of `"+n+"`."}return""}var r=n(6),o=n(18),s=n(21),a=n(15),l=(n(13),n(33)),h=n(34),u=n(25),c=n(35),p=n(23),f=(n(24),n(10)),d=n(36),m=n(19),v=n(20),y=n(7),g=n(40),x=(n(16),1),_={construct:function(t){this._currentElement=t,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._isTopLevel=!1,this._pendingCallbacks=null},mountComponent:function(t,e,n){this._context=n,this._mountOrder=x++,this._rootNodeID=t;var i=this._processProps(this._currentElement.props),r=this._processContext(this._currentElement._context),o=u.getComponentClassForElement(this._currentElement),s=new o(i,r);s.props=i,s.context=r,s.refs=v,this._instance=s,l.set(s,this);var a=s.state;void 0===a&&(s.state=a=null),y("object"==typeof a&&!Array.isArray(a)),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var c,p,d=h.currentlyMountingInstance;h.currentlyMountingInstance=this;try{s.componentWillMount&&(s.componentWillMount(),this._pendingStateQueue&&(s.state=this._processPendingState(s.props,s.context))),c=this._getValidatedChildContext(n),p=this._renderValidatedComponent(c)}finally{h.currentlyMountingInstance=d}this._renderedComponent=this._instantiateReactComponent(p,this._currentElement.type);var m=f.mountComponent(this._renderedComponent,t,e,this._mergeChildContext(n,c));return s.componentDidMount&&e.getReactMountReady().enqueue(s.componentDidMount,s),m},unmountComponent:function(){var t=this._instance;if(t.componentWillUnmount){var e=h.currentlyUnmountingInstance;h.currentlyUnmountingInstance=this;try{t.componentWillUnmount()}finally{h.currentlyUnmountingInstance=e}}f.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,l.remove(t)},_setPropsInternal:function(t,e){var n=this._pendingElement||this._currentElement;this._pendingElement=a.cloneAndReplaceProps(n,m({},n.props,t)),d.enqueueUpdate(this,e)},_maskContext:function(t){var e=null;if("string"==typeof this._currentElement.type)return v;var n=this._currentElement.type.contextTypes;if(!n)return v;e={};for(var i in n)e[i]=t[i];return e},_processContext:function(t){var e=this._maskContext(t);return e},_getValidatedChildContext:function(t){var e=this._instance,n=e.getChildContext&&e.getChildContext();if(n){y("object"==typeof e.constructor.childContextTypes);for(var i in n)y(i in e.constructor.childContextTypes);return n}return null},_mergeChildContext:function(t,e){return e?m({},t,e):t},_processProps:function(t){return t},_checkPropTypes:function(t,e,n){var r=this.getName();for(var o in t)if(t.hasOwnProperty(o)){var s;try{y("function"==typeof t[o]),s=t[o](e,o,r,n)}catch(a){s=a}if(s instanceof Error){i(this);n===p.prop}}},receiveComponent:function(t,e,n){var i=this._currentElement,r=this._context;this._pendingElement=null,this.updateComponent(e,i,t,r,n)},performUpdateIfNecessary:function(t){null!=this._pendingElement&&f.receiveComponent(this,this._pendingElement||this._currentElement,t,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(t,this._currentElement,this._currentElement,this._context,this._context)},_warnIfContextsDiffer:function(t,e){t=this._maskContext(t),e=this._maskContext(e);for(var n=Object.keys(e).sort(),i=(this.getName()||"ReactCompositeComponent",0);in;n++){var i=y[n],r=i._pendingCallbacks;if(i._pendingCallbacks=null,f.performUpdateIfNecessary(i,t.reconcileTransaction),r)for(var o=0;on;n++)t[n].call(e[n]);t.length=0,e.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(i),t.exports=i},function(t,e,n){"use strict";var i=n(7),r=function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)},o=function(t,e){var n=this;if(n.instancePool.length){var i=n.instancePool.pop();return n.call(i,t,e),i}return new n(t,e)},s=function(t,e,n){var i=this;if(i.instancePool.length){var r=i.instancePool.pop();return i.call(r,t,e,n),r}return new i(t,e,n)},a=function(t,e,n,i,r){var o=this;if(o.instancePool.length){var s=o.instancePool.pop();return o.call(s,t,e,n,i,r),s}return new o(t,e,n,i,r)},l=function(t){var e=this;i(t instanceof e),t.destructor&&t.destructor(),e.instancePool.lengthn;n++){var r=arguments[n];"function"==typeof r&&(r=r.prototype);for(var o in r)e[o]=r[o]}return e.initialize||(e.initialize=function(){}),e.constructor=function(t,n,i,r,o,s,a,l){return new e.initialize(t,n,i,r,o,s,a,l)},e.constructor.prototype=e.initialize.prototype=e,e.constructor}},function(t,e,n){"use strict";function i(t,e,n,i,r,o){return t&&"object"==typeof t&&(e=t.yx,i=t.yy,o=t.y,n=t.xy,r=t.x,t=t.xx),this.xx=null==t?1:t,this.yx=e||0,this.xy=n||0,this.yy=null==i?1:i,this.x=(null==r?this.x:r)||0,this.y=(null==o?this.y:o)||0,this._transform(),this}var r=n(45);t.exports=r({initialize:i,_transform:function(){},xx:1,yx:0,x:0,xy:0,yy:1,y:0,transform:function(t,e,n,i,r,o){var s=this;return t&&"object"==typeof t&&(e=t.yx,i=t.yy,o=t.y,n=t.xy,r=t.x,t=t.xx),r||(r=0),o||(o=0),this.transformTo(s.xx*t+s.xy*e,s.yx*t+s.yy*e,s.xx*n+s.xy*i,s.yx*n+s.yy*i,s.xx*r+s.xy*o+s.x,s.yx*r+s.yy*o+s.y)},transformTo:i,translate:function(t,e){return this.transform(1,0,0,1,t,e)},move:function(t,e){return this.x+=t||0,this.y+=e||0,this._transform(),this},scale:function(t,e){return null==e&&(e=t),this.transform(t,0,0,e,0,0)},rotate:function(t,e,n){(null==e||null==n)&&(e=(this.left||0)+(this.width||0)/2,n=(this.top||0)+(this.height||0)/2);var i=t*Math.PI/180,r=Math.sin(i),o=Math.cos(i);this.transform(1,0,0,1,e,n);var s=this;return this.transformTo(o*s.xx-r*s.yx,r*s.xx+o*s.yx,o*s.xy-r*s.yy,r*s.xy+o*s.yy,s.x,s.y).transform(1,0,0,1,-e,-n)},moveTo:function(t,e){var n=this;return this.transformTo(n.xx,n.yx,n.xy,n.yy,t,e)},rotateTo:function(t,e,n){var i=this,r=i.yx/i.xx>i.yy/i.xy?-1:1;return(i.xx<0?i.xy>=0:i.xy<0)&&(r=-r),this.rotate(t-180*Math.atan2(r*i.yx,r*i.xx)/Math.PI,e,n)},scaleTo:function(t,e){var n=this,i=Math.sqrt(n.xx*n.xx+n.yx*n.yx);return n.xx/=i,n.yx/=i,i=Math.sqrt(n.yy*n.yy+n.xy*n.xy),n.yy/=i,n.xy/=i,this.scale(t,e)},resizeTo:function(t,e){var n=this.width,i=this.height;return n&&i?this.scaleTo(t/n,e/i):this},inversePoint:function(t,e){var n=this.xx,i=this.yx,r=this.xy,o=this.yy,s=this.x,a=this.y,l=i*r-n*o;return 0==l?null:{x:(o*(s-t)+r*(e-a))/l,y:(n*(a-e)+i*(t-s))/l}},point:function(t,e){var n=this;return{x:n.xx*t+n.xy*e+n.x,y:n.yx*t+n.yy*e+n.y}}})},function(t,e,n){"use strict";var i=n(45);t.exports=i({grab:function(){for(var t=0;ti;i++){var o,s=n[i];o="function"==typeof s?s.call(this,t):s.handleEvent(t),o===!1&&t.preventDefault()}}this.parentNode&&this.parentNode.dispatch&&this.parentNode.dispatch(t)},subscribe:function(t,e,n){if("string"!=typeof t){var i=[];for(var r in t)i.push(this.subscribe(r,t[r]));return function(){for(var t=0,e=i.length;e>t;t++)i[t]();return this}}var o="function"==typeof e?e.bind(n||this):e,s=this._events||(this._events={}),a=s[t]||(s[t]=[]);return a.push(o),function(){for(var t=0,e=a.length;e>t;t++)if(a[t]===o){a.splice(t,1);break}}}})},function(t,e,n){"use strict";function i(t){return t.toElement?t.toElement():t.getDOMNode?t.getDOMNode():t.getNode?t.getNode():t}var r=n(45);t.exports=r({toElement:function(){return this.element},getDOMNode:function(){return this.toElement()},getNode:function(){return this.toElement()},inject:function(t){return(t.containerElement||i(t)).appendChild(this.element),this},injectBefore:function(t){var e=i(t);return e.parentNode.insertBefore(this.element,e),this},eject:function(){var t=this.element,e=t.parentNode;return e&&e.removeChild(t),this},subscribe:function(t,e,n){if("string"!=typeof t){var i=[];for(var r in t)i.push(this.subscribe(r,t[r]));return function(){for(var t=0,e=i.length;e>t;t++)i[t]();return this}}n||(n=this);var o;o="function"==typeof e?e.bind?e.bind(n):function(){return e.apply(n,arguments)}:e;var s=this.element;return s.addEventListener?(s.addEventListener(t,o,!1),function(){return s.removeEventListener(t,o,!1),this}):(s.attachEvent("on"+t,o),function(){return s.detachEvent("on"+t,o),this})}})},function(t,e,n){"use strict";var i,r="behavior:url(#default#VML);display:inline-block;position:absolute;left:0px;top:0px;",o={},s=function(t){i&&(o[t]=i.addRule("av\\:"+t,r))};e.init=function(t){var e;try{e=t.namespaces}catch(n){}return e?(e.add("av","urn:schemas-microsoft-com:vml"),e.add("ao","urn:schemas-microsoft-com:office:office"),i=t.createStyleSheet(),i.addRule("vml","display:inline-block;position:relative;overflow:hidden;"),s("vml"),!0):!1},e.createElement=function(t){return t in o||s(t),document.createElement("av:"+t)}},function(t,e,n){"use strict";var i=n(45),r=n(47),o=n(51),s=n(52),a=100,l=i(o,r,{initialize:function(t,e,n){this.element=n||document.createElement("vml"),this.containerElement=s.createElement("group"),this.element.appendChild(this.containerElement),null!=t&&null!=e&&this.resize(t,e)},resize:function(t,e){this.width=t,this.height=e;var n=this.element.style;n.pixelWidth=t,n.pixelHeight=e,n=this.containerElement.style,n.width=t,n.height=e;var i=.5*a;return this.containerElement.coordorigin=i+","+i,this.containerElement.coordsize=t*a+","+e*a,this}});l.tagName="av:vml",t.exports=l},function(t,e,n){"use strict";var i=n(45),r=n(55),o=100,s=Math.round,a=i(r,{initialize:function(t){this.reset(),t instanceof a?this.path=[Array.prototype.join.call(t.path," ")]:t&&(t.applyToPath?t.applyToPath(this):this.push(t))},onReset:function(){this.path=[]},onMove:function(t,e,n,i){this.path.push("m",s(n*o),s(i*o))},onLine:function(t,e,n,i){this.path.push("l",s(n*o),s(i*o))},onBezierCurve:function(t,e,n,i,r,a,l,h){this.path.push("c",s(n*o),s(i*o),s(r*o),s(a*o),s(l*o),s(h*o))},_arcToBezier:r.prototype.onArc,onArc:function(t,e,n,i,r,a,l,h,u,c,p,f){return l!=h||f?this._arcToBezier(t,e,n,i,r,a,l,h,u,c,p,f):(r*=o,a*=o,l*=o,void this.path.push(p?"at":"wa",s(r-l),s(a-l),s(r+l),s(a+l),s(t*o),s(e*o),s(n*o),s(i*o)))},onClose:function(){this.path.push("x")},toVML:function(){return this.path.join(" ")}});a.prototype.toString=a.prototype.toVML,t.exports=a},function(t,e,n){"use strict";var i=n(45);t.exports=i({initialize:function(t){this.reset().push(t)},push:function(){var t=Array.prototype.join.call(arguments," ").match(/[a-df-z]|[\-+]?(?:[\d\.]e[\-+]?|[^\s\-+,a-z])+/gi);if(!t)return this;for(var e,n=t[0],i=1;n;){switch(n){case"m":this.move(t[i++],t[i++]);break;case"l":this.line(t[i++],t[i++]);break;case"c":this.curve(t[i++],t[i++],t[i++],t[i++],t[i++],t[i++]);break;case"s":this.curve(t[i++],t[i++],null,null,t[i++],t[i++]);break;case"q":this.curve(t[i++],t[i++],t[i++],t[i++]);break;case"t":this.curve(t[i++],t[i++]);break;case"a":this.arc(t[i+5],t[i+6],t[i],t[i+1],t[i+3],!+t[i+4],t[i+2]),i+=7;break;case"h":this.line(t[i++],0);break;case"v":this.line(0,t[i++]);break;case"M":this.moveTo(t[i++],t[i++]);break;case"L":this.lineTo(t[i++],t[i++]);break;case"C":this.curveTo(t[i++],t[i++],t[i++],t[i++],t[i++],t[i++]);break;case"S":this.curveTo(t[i++],t[i++],null,null,t[i++],t[i++]);break;case"Q":this.curveTo(t[i++],t[i++],t[i++],t[i++]);break;case"T":this.curveTo(t[i++],t[i++]);break;case"A":this.arcTo(t[i+5],t[i+6],t[i],t[i+1],t[i+3],!+t[i+4],t[i+2]),i+=7;break;case"H":this.lineTo(t[i++],this.penY);break;case"V":this.lineTo(this.penX,t[i++]);break;case"Z":case"z":this.close();break;default:n=e,i--;continue}e=n,"m"==e?e="l":"M"==e&&(e="L"),n=t[i++]}return this},reset:function(){return this.penX=this.penY=0,this.penDownX=this.penDownY=null,this._pivotX=this._pivotY=0,this.onReset(),this},move:function(t,e){return this.onMove(this.penX,this.penY,this._pivotX=this.penX+=+t,this._pivotY=this.penY+=+e),this},moveTo:function(t,e){return this.onMove(this.penX,this.penY,this._pivotX=this.penX=+t,this._pivotY=this.penY=+e),this},line:function(t,e){return this.lineTo(this.penX+ +t,this.penY+ +e)},lineTo:function(t,e){return null==this.penDownX&&(this.penDownX=this.penX,this.penDownY=this.penY),this.onLine(this.penX,this.penY,this._pivotX=this.penX=+t,this._pivotY=this.penY=+e),this},curve:function(t,e,n,i,r,o){var s=this.penX,a=this.penY;return this.curveTo(s+ +t,a+ +e,null==n?null:s+ +n,null==i?null:a+ +i,null==r?null:s+ +r,null==o?null:a+ +o)},curveTo:function(t,e,n,i,r,o){var s=this.penX,a=this.penY;return null==n&&(n=+t,i=+e,t=2*s-(this._pivotX||0),e=2*a-(this._pivotY||0)),null==r?(this._pivotX=+t,this._pivotY=+e,r=+n,o=+i,n=(r+2*+t)/3,i=(o+2*+e)/3,t=(s+2*+t)/3,e=(a+2*+e)/3):(this._pivotX=+n,this._pivotY=+i),null==this.penDownX&&(this.penDownX=s,this.penDownY=a),this.onBezierCurve(s,a,+t,+e,+n,+i,this.penX=+r,this.penY=+o),this},arc:function(t,e,n,i,r,o,s){return this.arcTo(this.penX+ +t,this.penY+ +e,n,i,r,o,s)},arcTo:function(t,e,n,i,r,o,s){if(i=Math.abs(+i||+n||+e-this.penY),n=Math.abs(+n||+t-this.penX),!n||!i||t==this.penX&&e==this.penY)return this.lineTo(t,e);var a=this.penX,l=this.penY,h=!+o,u=!!+r,c=s?s*Math.PI/180:0,p=Math.cos(c),f=Math.sin(c);t-=a,e-=l;var d=p*t/2+f*e/2,m=-f*t/2+p*e/2,v=n*n*i*i,y=i*i*d*d,g=n*n*m*m,x=v-g-y;if(0>x)x=Math.sqrt(1-x/v),n*=x,i*=x,d=t/2,m=e/2;else{x=Math.sqrt(x/(g+y)),u==h&&(x=-x);var _=-x*m*n/i,C=x*d*i/n;d=p*_-f*C+t/2,m=f*_+p*C+e/2}var b=p/n,w=f/n,M=-f/i,T=p/i,E=Math.atan2(M*-d+T*-m,b*-d+w*-m),P=Math.atan2(M*(t-d)+T*(e-m),b*(t-d)+w*(e-m));return d+=a,m+=l,t+=a,e+=l,null==this.penDownX&&(this.penDownX=this.penX,this.penDownY=this.penY),this.onArc(a,l,this._pivotX=this.penX=t,this._pivotY=this.penY=e,d,m,n,i,E,P,!h,s),this},counterArc:function(t,e,n,i,r){return this.arc(t,e,n,i,r,!0)},counterArcTo:function(t,e,n,i,r){return this.arcTo(t,e,n,i,r,!0)},close:function(){return null!=this.penDownX&&(this.onClose(this.penX,this.penY,this.penX=this.penDownX,this.penY=this.penDownY),this.penDownX=null),this},onReset:function(){},onMove:function(t,e,n,i){},onLine:function(t,e,n,i){this.onBezierCurve(t,e,t,e,n,i,n,i)},onBezierCurve:function(t,e,n,i,r,o,s,a){var l,h,u,c,p,f=s-t,d=a-e,m=f*f+d*d;if(u=n-t,c=i-e,p=u*f+c*d,p>m?(u-=f,c-=d):p>0&&0!=m&&(u-=p/m*f,c-=p/m*d),l=u*u+c*c,u=r-t,c=o-e,p=u*f+c*d,p>m?(u-=f,c-=d):p>0&&0!=m&&(u-=p/m*f,c-=p/m*d),h=u*u+c*c,.01>l&&.01>h)return void this.onLine(t,e,s,a);if(isNaN(l)||isNaN(h))throw new Error("Bad input");var v=.5*(n+r),y=.5*(i+o),g=.5*(n+t),x=.5*(i+e),_=.5*(g+v),C=.5*(x+y),b=.5*(s+r),w=.5*(a+o),M=.5*(b+v),T=.5*(w+y),E=.5*(_+M),P=.5*(C+T);this.onBezierCurve(t,e,g,x,_,C,E,P),this.onBezierCurve(E,P,M,T,b,w,s,a)},onArc:function(t,e,n,i,r,o,s,a,l,h,u,c){var p=c?c*Math.PI/180:0,f=Math.cos(p),d=Math.sin(p),m=f*s,v=-d*a,y=d*s,g=f*a,x=h-l;0>x&&!u?x+=2*Math.PI:x>0&&u&&(x-=2*Math.PI);for(var _=Math.ceil(Math.abs(x/(Math.PI/2))),C=x/_,b=4/3*Math.tan(C/4),w=Math.cos(l),M=Math.sin(l),T=0;_>T;T++){var E=w-b*M,P=M+b*w;l+=C,w=Math.cos(l),M=Math.sin(l);var I=w+b*M,R=M-b*w;this.onBezierCurve(t,e,r+m*E+v*P,o+y*E+g*P,r+m*I+v*R,o+y*I+g*R,t=r+m*w+v*M,e=o+y*w+g*M)}},onClose:function(t,e,n,i){this.onLine(t,e,n,i)}})},function(t,e,n){"use strict";var i=n(45),r=n(57),o=n(54),s=n(52),a=100;t.exports=i(r,{base_initialize:r.prototype.initialize,initialize:function(t,e,n){this.base_initialize("shape");var i=this.pathElement=s.createElement("path");i.gradientshapeok=!0,this.element.appendChild(i),this.width=e,this.height=n,null!=t&&this.draw(t)},draw:function(t,e,n){return t instanceof o||(t=new o(t)),this._vml=t.toVML(),null!=e&&(this.width=e),null!=n&&(this.height=n),this._boxCoords||this._transform(),this._redraw(this._prefix,this._suffix),this},_redraw:function(t,e){var n=this._vml||"";this._prefix=t,this._suffix=e,t&&(n=[t,n,e,"ns e",n,"nf"].join(" ")),this.element.path=n+"e"},fillRadial:function(t,e,n,i,r,o,s){var l=this._createGradient("gradientradial",t);null==e&&(e=(this.left||0)+.5*(this.width||0)),null==n&&(n=(this.top||0)+.5*(this.height||0)),null==r&&(r=i||.5*this.height||0),null==i&&(i=.5*(this.width||0)),null==o&&(o=e),null==s&&(s=n),o+=o-e,s+=s-n;var h=Math.round(o*a),u=Math.round(s*a),c=Math.round(2*i*a),p=Math.round(2*r*a),f=["wa",h-c,u-p,h+c,u+p].join(" ");return this._redraw(["m",h,u-p,"l",h,u-p].join(" "),["m",h,u-p,f,h,u-p,h,u+p,f,h,u+p,h,u-p,f,h,u-p,h,u+p,f,h,u+p,h,u-p].join(" ")),this._boxCoords={left:e-2,top:n-2,width:4,height:4},l.focusposition="0.5,0.5",l.focussize="0 0",l.focus="50%",this._transform(),this}})},function(t,e,n){"use strict";var i=n(45),r=n(46),o=n(58),s=n(48),a=n(52),l=100,h={left:0,top:0,width:500,height:500};t.exports=i(s,{element_initialize:s.prototype.initialize,initialize:function(t){this.element_initialize(t);var e=this.element,n=this.skewElement=a.createElement("skew");n.on=!0,e.appendChild(n);var i=this.fillElement=a.createElement("fill");i.on=!1,e.appendChild(i);var r=this.strokeElement=a.createElement("stroke");r.on=!1,e.appendChild(r)},_transform:function(){var t=this.parentNode,e=t?new r(t._activeTransform).transform(this):this,n=this._boxCoords||this._size||h,i=n.left||0,o=n.top||0,s=n.width||1,a=n.height||1,u=e.yx/e.xx>e.yy/e.xy;(e.xx<0?e.xy>=0:e.xy<0)&&(u=!u),u=u?-1:1,e=(new r).scale(u,1).transform(e);var c=180*Math.atan2(-e.xy,e.yy)/Math.PI,p=c*Math.PI/180,f=Math.sin(p),d=Math.cos(p),m=new r(e.xx*d-e.xy*f,(e.yx*d-e.yy*f)*u,(e.xy*d+e.xx*f)*u,e.yy*d+e.yx*f),v=(new r).rotate(c,0,0),y=(new r).rotate(-c,0,0).transform(e).moveTo(0,0);s*=Math.abs(y.xx),a*=Math.abs(y.yy);var g=e.x,x=e.y,_=-s/2,C=-a/2,b=v.point(_,C);g-=b.x-_,x-=b.y-C;var w=new r(e).moveTo(0,0);b=w.point(i,o),g+=b.x,x+=b.y,0>u&&(g=-g-s);var M=w.point(-i,-o),T=v.point(s,a),E=v.point(s,0),P=v.point(0,a),I=Math.min(0,T.x,E.x,P.x),R=Math.max(0,T.x,E.x,P.x),S=Math.min(0,T.y,E.y,P.y),k=Math.max(0,T.y,E.y,P.y),z=(M.x-T.x/2)/(R-I)*u,N=(M.y-T.y/2)/(k-S);b=y.point(i,o),i=b.x,o=b.y;var D=this._strokeWidth;if(D){var _=e.xx+e.xy,C=e.yy+e.yx;D*=Math.sqrt(_*_+C*C)/Math.sqrt(2)}i*=l,o*=l,g*=l,x*=l,s*=l,a*=l;var j=this.element;j.coordorigin=i+","+o,j.coordsize=s+","+a,j.style.left=g+"px",j.style.top=x+"px",j.style.width=s,j.style.height=a,j.style.rotation=c.toFixed(8),j.style.flip=0>u?"x":"";var A=this.skewElement;A.matrix=[m.xx.toFixed(4),m.xy.toFixed(4),m.yx.toFixed(4),m.yy.toFixed(4),0,0],A.origin=z+","+N,this.strokeElement.weight=D+"px"},_createGradient:function(t,e){var n=this.fillElement;this.element.removeChild(n),n.type=t,n.method="none",n.rotate=!0;var i,r,s=[],a=function(t,e){e=o.detach(e),null==i?i=r=e:r=e,s.push(t+" "+e[0])};if("length"in e)for(var l=0,h=e.length-1;h>=l;l++)a(l/h,e[l]);else for(var u in e)a(u,e[u]);return n.color=i[0],n.color2=r[0],n.colors=s,n.opacity=r[1],n["ao:opacity2"]=i[1],n.on=!0,this.element.appendChild(n),n},_setColor:function(t,e){var n="fill"==t?this.fillElement:this.strokeElement;null==e?n.on=!1:(e=o.detach(e),n.color=e[0],n.opacity=e[1],n.on=!0)},fill:function u(t){if(arguments.length>1)this.fillLinear(arguments);else{this._boxCoords=h;var u=this.fillElement;u.type="solid",u.color2="",u["ao:opacity2"]="",u.colors&&(u.colors.value=""),this._setColor("fill",t)}return this},fillRadial:function(t,e,n,i,r,o,s){var a=this._createGradient("gradientradial",t);null==e&&(e=this.left+.5*this.width),null==n&&(n=this.top+.5*this.height),null==r&&(r=i||.5*this.height),null==i&&(i=.5*this.width),null==o&&(o=e),null==s&&(s=n),o+=o-e,s+=s-n;var l=this._boxCoords={left:o-2*i,top:s-2*r,width:4*i,height:4*r};return e-=l.left,n-=l.top,e/=l.width,n/=l.height,a.focussize="0 0",a.focusposition=e+","+n,a.focus="50%",this._transform(),this},fillLinear:function(t,e,n,i,r){var o=this._createGradient("gradient",t);if(o.focus="100%",5==arguments.length){var s=Math.abs(i-e),a=Math.abs(r-n);this._boxCoords={left:Math.min(e,i),top:Math.min(n,r),width:1>s?a:s,height:1>a?s:a},o.angle=(360+180*Math.atan2((i-e)/a,(r-n)/s)/Math.PI)%360}else this._boxCoords=null,o.angle=null==e?0:(90+e)%360;return this._transform(),this},fillImage:function(t,e,n,i,r,s,a){var l=this.fillElement;return null!=s?(s=o.detach(s),null!=a&&(a=o.detach(a)),l.type="pattern",l.color=s[0],l.color2=null==a?s[0]:a[0],l.opacity=null==a?0:a[1],l["ao:opacity2"]=s[1]):(l.type="tile",l.color="",l.color2="",l.opacity=1,l["ao:opacity2"]=1),l.colors&&(l.colors.value=""),l.rotate=!0,l.src=t,l.size="1,1",l.position="0,0",l.origin="0,0",l.aspect="ignore",l.on=!0,i||(i=0),r||(r=0),this._boxCoords=e?{left:i+.5,top:r+.5,width:e,height:n}:null,this._transform(),this},stroke:function c(t,e,n,i){var c=this.strokeElement;return this._strokeWidth=null!=e?e:1,c.weight=null!=e?e+"px":1,c.endcap=null!=n?"butt"==n?"flat":n:"round",c.joinstyle=null!=i?i:"round",this._setColor("stroke",t),this}})},function(t,e,n){"use strict";var i={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080"},r=function(t,e){for(var n=[],i=0,r=t.length;r>i;i++)n[i]=e(t[i],i);return n},o=function u(t,e){if(t.isColor)this.red=t.red,this.green=t.green,this.blue=t.blue,this.alpha=t.alpha;else{var n=i[t];switch(n&&(t=n,e="hex"),typeof t){case"string":e||(e=(e=t.match(/^rgb|^hsb|^hsl/))?e[0]:"hex");break;case"object":e=e||"rgb",t=t.toString();break;case"number":e="hex",t=t.toString(16)}t=u["parse"+e.toUpperCase()](t),this.red=t[0],this.green=t[1],this.blue=t[2],this.alpha=t[3]}this.isColor=!0},s=function(t,e,n){return Math.min(n,Math.max(e,t))},a=/([-.\d]+\%?)\s*,\s*([-.\d]+\%?)\s*,\s*([-.\d]+\%?)\s*,?\s*([-.\d]*\%?)/,l=/^#?([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{0,2})$/i;o.parseRGB=function(t){return r(t.match(a).slice(1),function(t,e){return t&&(t=parseFloat(t)*("%"==t[t.length-1]?2.55:1)),3>e?Math.round((t%=256)<0?t+256:t):s(""===t?1:Number(t),0,1)})},o.parseHEX=function(t){return 1==t.length&&(t=t+t+t),r(t.match(l).slice(1),function(t,e){return 3==e?t?parseInt(t,16)/255:1:parseInt(1==t.length?t+t:t,16)})},o.parseHSB=function(t){var e=r(t.match(a).slice(1),function(t,e){return t&&(t=parseFloat(t)),0===e?Math.round((t%=360)<0?t+360:t):3>e?s(Math.round(t),0,100):s(""===t?1:Number(t),0,1)}),n=e[3],i=Math.round(e[2]/100*255);if(0==e[1])return[i,i,i,n];var o=e[0],l=o%60,h=Math.round(e[2]*(100-e[1])/1e4*255),u=Math.round(e[2]*(6e3-e[1]*l)/6e5*255),c=Math.round(e[2]*(6e3-e[1]*(60-l))/6e5*255);switch(Math.floor(o/60)){case 0:return[i,c,h,n];case 1:return[u,i,h,n];case 2:return[h,i,c,n];case 3:return[h,u,i,n];case 4:return[c,h,i,n];default:return[i,h,u,n]}},o.parseHSL=function(t){var e=r(t.match(a).slice(1),function(t,e){return t&&(t=parseFloat(t)),0===e?Math.round((t%=360)<0?t+360:t):3>e?s(Math.round(t),0,100):s(""===t?1:Number(t),0,1)}),n=e[0]/60,i=e[1]/100,o=e[2]/100,l=e[3],h=(1-Math.abs(2*o-1))*i,u=h*(1-Math.abs(n%2-1)),c=o-h/2,p=Math.round(255*(h+c)),f=Math.round(255*(u+c)),d=Math.round(255*c);switch(Math.floor(n)){case 0:return[p,f,d,l];case 1:return[f,p,d,l];case 2:return[d,p,f,l];case 3:return[d,f,p,l];case 4:return[f,d,p,l];default:return[p,d,f,l]}};var h=function(t,e){return 1!=e[3]?t+="a":e.pop(),t+"("+e.join(", ")+")"};o.prototype={toHSB:function(t){var e=this.red,n=this.green,i=this.blue,r=this.alpha,o=Math.max(e,n,i),s=Math.min(e,n,i),a=o-s,l=0,u=0!=a?a/o:0,c=o/255;if(u){var p=(o-e)/a,f=(o-n)/a,d=(o-i)/a;l=e==o?d-f:n==o?2+p-d:4+f-p,(l/=6)<0&&l++}var m=[Math.round(360*l),Math.round(100*u),Math.round(100*c),r];return t?m:h("hsb",m)},toHSL:function(t){var e=this.red,n=this.green,i=this.blue,r=this.alpha,o=Math.max(e,n,i),s=Math.min(e,n,i),a=o-s,l=0,u=0!=a?a/(255-Math.abs(o+s-255)):0,c=(o+s)/512;if(u){var p=(o-e)/a,f=(o-n)/a,d=(o-i)/a;l=e==o?d-f:n==o?2+p-d:4+f-p,(l/=6)<0&&l++}var m=[Math.round(360*l),Math.round(100*u),Math.round(100*c),r];return t?m:h("hsl",m)},toHEX:function(t){var e=this.alpha,n=1==(e=Math.round(255*e).toString(16)).length?e+e:e,i=r([this.red,this.green,this.blue],function(t){return t=t.toString(16),1==t.length?"0"+t:t});return t?i.concat(n):"#"+i.join("")+("ff"==n?"":n)},toRGB:function(t){var e=[this.red,this.green,this.blue,this.alpha];return t?e:h("rgb",e)}},o.prototype.toString=o.prototype.toRGB,o.hex=function(t){return new o(t,"hex")},null==(void 0).hex&&((void 0).hex=o.hex),o.hsb=function(t,e,n,i){return new o([t||0,e||0,n||0,null==i?1:i],"hsb")},null==(void 0).hsb&&((void 0).hsb=o.hsb),o.hsl=function(t,e,n,i){return new o([t||0,e||0,n||0,null==i?1:i],"hsl")},null==(void 0).hsl&&((void 0).hsl=o.hsl),o.rgb=function(t,e,n,i){return new o([t||0,e||0,n||0,null==i?1:i],"rgb")},null==(void 0).rgb&&((void 0).rgb=o.rgb),o.detach=function(t){return t=new o(t),[o.rgb(t.red,t.green,t.blue).toString(),t.alpha]},t.exports=o},function(t,e,n){"use strict";var i=n(45),r=n(46),o=n(47),s=n(48);t.exports=i(s,o,{element_initialize:s.prototype.initialize,initialize:function(t,e){this.element_initialize("group"),this.width=t,this.height=e},_transform:function(){var t=this.element;t.coordorigin="0,0",t.coordsize="1000,1000",t.style.left=0,t.style.top=0,t.style.width=1e3,t.style.height=1e3,t.style.rotation=0;var e=this.parentNode;this._activeTransform=e?new r(e._activeTransform).transform(this):this;for(var n=this.firstChild;n;)n._transform(),n=n.nextSibling}})},function(t,e,n){"use strict";var i=n(45),r=n(57),o=n(54),s=n(53),a=n(59),l=n(52),h={start:"left",middle:"center",end:"right"};t.exports=i(r,{base_initialize:r.prototype.initialize,initialize:function(t,e,n,i){this.base_initialize("shape");var r=this.pathElement=l.createElement("path");r.textpathok=!0,this.element.appendChild(r),r=this.textPathElement=l.createElement("textpath"),r.on=!0,r.style["v-text-align"]="left",this.element.appendChild(r),this.draw.apply(this,arguments)},draw:function(t,e,n,i){var r=this.element,l=this.textPathElement,u=l.style;if(l.string=t,e)if("string"==typeof e)u.font=e;else for(var c in e){var p=c.camelCase?c.camelCase():c;"fontFamily"==p?u[p]="'"+e[c]+"'":u[p]=e[c]}if(n&&(u["v-text-align"]=h[n]||n),i)this.currentPath=i=new o(i),this.element.path=i.toVML();else if(!this.currentPath){for(var f=-1,d="\n";(f=t.indexOf("\n",f+1))>-1;)d+="\n";l.string=d+l.string,this.element.path="m0,0l1,0"}r=r.cloneNode(!0),u=r.style,r.coordorigin="0,0",r.coordsize="10000,10000",u.left="0px",u.top="0px",u.width="10000px",u.height="10000px",u.rotation=0,r.removeChild(r.firstChild);var m=new s(1,1),v=new a,y=r.ownerDocument.body;m.inject(y),v.element.appendChild(r),v.inject(m);var g=r.getBoundingClientRect(),x=m.toElement().getBoundingClientRect();return m.eject(),this.left=g.left-x.left,this.top=g.top-x.top,this.width=g.right-g.left,this.height=g.bottom-g.top,this.right=g.right-x.left,
3 | this.bottom=g.bottom-x.top,this._transform(),this}})},function(t,e,n){"use strict";function i(){throw new Error("You must require a mode before requiring anything else.")}e.Surface=i,e.Path=i,e.Shape=i,e.Group=i,e.ClippingRectangle=i,e.Text=i,e.setCurrent=function(t){for(var n in t)e[n]=t[n]}},function(t,e,n){"use strict";e.Surface=n(65),e.Path=n(66),e.Shape=n(67),e.Group=n(63),e.ClippingRectangle=n(69),e.Text=n(70)},function(t,e,n){"use strict";var i=n(45),r=n(47),o=n(64);t.exports=i(o,r,{initialize:function(t,e){this.width=t,this.height=e},localHitTest:function(t,e){for(var n=this.lastChild;n;){var i=n.hitTest(t,e);if(i)return i;n=n.previousSibling}return null},renderLayerTo:function(t,e,n,i,r,o,s){if(!this._invisible){o=e*this.x+i*this.y+o,s=n*this.x+r*this.y+s;var a=e;e=a*this.xx+i*this.yx,i=a*this.xy+i*this.yy,a=n,n=a*this.xx+r*this.yx,r=a*this.xy+r*this.yy;for(var l=this.firstChild;l;)l.renderTo(t,e,n,i,r,o,s),l=l.nextSibling}}})},function(t,e,n){"use strict";var i=n(45),r=n(46),o=n(50),s=i(r,o,{invalidate:function(){return this.parentNode&&this.parentNode.invalidate(),this._layer&&(this._layerCache=null),this},_place:function(){this.invalidate()},_transform:function(){this.invalidate()},blend:function(t){return t>=1&&this._layer&&(this._layer=null),this._opacity=t,this.parentNode&&this.parentNode.invalidate(),this},hide:function(){return this._invisible=!0,this.parentNode&&this.parentNode.invalidate(),this},show:function(){return this._invisible=!1,this.parentNode&&this.parentNode.invalidate(),this},indicate:function(t,e){return this._cursor=t,this._tooltip=e,this.invalidate()},hitTest:function(t,e){if(this._invisible)return null;var n=this.inversePoint(t,e);return n?this.localHitTest(n.x,n.y):null},renderTo:function(t,e,n,i,r,o,s){var a=this._opacity;if(null==a||a>=1)return this.renderLayerTo(t,e,n,i,r,o,s);var l,h=this._layer,u=!0,c=t.canvas.width,p=t.canvas.height;if(h)if(h.setTransform(1,0,0,1,0,0),l=h.canvas,l.widthe;e++){var r=t[e];r._valid=!0,r.render()}},u="undefined"!=typeof window&&window.devicePixelRatio||1,c=null,p=null,f=r(s,o,{initialize:function(t,e,n){var i=this.element=n||document.createElement("canvas");this.context=i.getContext("2d");this._valid=!0,null!=t&&null!=e&&this.resize(t,e),i.addEventListener("mousemove",this,!1),i.addEventListener("mouseout",this,!1),i.addEventListener("mouseover",this,!1),i.addEventListener("mouseup",this,!1),i.addEventListener("mousedown",this,!1),i.addEventListener("click",this,!1)},handleEvent:function(t){if(null!=t.clientX){var e=this.element,n=e.getBoundingClientRect(),i=t.clientX-n.left-e.clientLeft,r=t.clientY-n.top-e.clientTop,o=this.hitTest(i,r);o!==c&&(c&&c.dispatch({type:"mouseout",target:c,relatedTarget:o,sourceEvent:t}),o&&o.dispatch({type:"mouseover",target:o,relatedTarget:c,sourceEvent:t}),c=o,p=this,this.refreshCursor()),o&&o.dispatch(t)}},refreshCursor:function(){if(p===this){for(var t=c,e="",n="";!(!t||!e&&t._cursor&&(e=t._cursor,n)||!n&&t._tooltip&&(n=t._tooltip,e));)t=t.parentNode;this.element.style.cursor=e,this.element.title=n}},resize:function(t,e){var n=this.element;return n.setAttribute("width",t*u),n.setAttribute("height",e*u),n.style.width=t+"px",n.style.height=e+"px",this.width=t,this.height=e,this},invalidate:function(t,e,n,r){return this._valid&&(this._valid=!1,l.push(this),i||(window.mozRequestAnimationFrame?(i=!0,window.mozRequestAnimationFrame(h)):i=setTimeout(h,a))),this},hitTest:function(t,e){if(0>t||0>e||t>this.width||e>this.height)return null;for(var n=this.lastChild;n;){var i=n.hitTest(t,e);if(i)return i;n=n.previousSibling}return null},render:function(){var t=this.firstChild,e=this.context;for(e.setTransform(u,0,0,u,0,0),e.clearRect(0,0,this.width,this.height);t;)t.renderTo(e,u,0,0,u,0,0),t=t.nextSibling;this.refreshCursor()}});f.tagName="canvas",t.exports=f},function(t,e,n){"use strict";var i=n(45),r=n(55),o=i(r,{initialize:function(t){this.reset(),t instanceof o?this.path=t.path.slice(0):t&&(t.applyToPath?t.applyToPath(this):this.push(t))},onReset:function(){this.path=[]},onMove:function(t,e,n,i){this.path.push(function(t){t.moveTo(n,i)})},onLine:function(t,e,n,i){this.path.push(function(t){t.lineTo(n,i)})},onBezierCurve:function(t,e,n,i,r,o,s,a){this.path.push(function(t){t.bezierCurveTo(n,i,r,o,s,a)})},_arcToBezier:r.prototype.onArc,onArc:function(t,e,n,i,r,o,s,a,l,h,u,c){return s!=a||c?this._arcToBezier(t,e,n,i,r,o,s,a,l,h,u,c):void this.path.push(function(t){t.arc(r,o,s,l,h,u)})},onClose:function(){this.path.push(function(t){t.closePath()})},toCommands:function(){return this.path.slice(0)}});t.exports=o},function(t,e,n){"use strict";var i=n(45),r=n(68),o=n(66);t.exports=i(r,{base_initialize:r.prototype.initialize,initialize:function(t,e,n){this.base_initialize(),this.width=e,this.height=n,null!=t&&this.draw(t)},draw:function(t,e,n){return t instanceof o||(t=new o(t)),this.path=t,this._commands=t.toCommands(),null!=e&&(this.width=e),null!=n&&(this.height=n),this.invalidate()},localHitTest:function(t,e){if(!this._fill)return null;if(null==this.width||null==this.height){var n=r._genericContext,i=this._commands;if(!i)return null;n.beginPath();for(var o=0,s=i.length;s>o;o++)i[o](n);return n.isPointInPath(t,e)?this:null}return t>0&&e>0&&to;o++)e[o](t);if(n){var a=this._fillTransform;a?(t.save(),t.transform(a.xx,a.yx,a.xy,a.yy,a.x,a.y),t.fillStyle=n,t.fill(),t.restore()):(t.fillStyle=n,t.fill())}i&&(t.strokeStyle=i,t.lineWidth=this._strokeWidth,t.lineCap=this._strokeCap,t.lineJoin=this._strokeJoin,t.stroke())}})},function(t,e,n){"use strict";function i(t,e,n){e=o.detach(e),n=o.detach(n);var i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t.width,i.height=t.height,r.fillStyle=n[0],r.fillRect(0,0,t.width,t.height),r.globalCompositeOperation="lighter",r.drawImage(t,0,0),i}var r=n(45),o=n(58),s=n(46),a=n(64),l="undefined"!=typeof document&&document.createElement("canvas"),h=l&&l.getContext&&l.getContext("2d"),u=r(a,{initialize:function(){this._fill=null,this._pendingFill=null,this._fillTransform=null,this._stroke=null,this._strokeCap=null,this._strokeDash=null,this._strokeJoin=null,this._strokeWidth=null},_addColors:function(t,e){if("length"in e)for(var n=0,i=e.length-1;i>=n;n++)t.addColorStop(n/i,new o(e[n]).toString());else for(var r in e)t.addColorStop(r,new o(e[r]).toString());return t},fill:function(t){return arguments.length>1?this.fillLinear(arguments):(this._pendingFill&&this._pendingFill(),this._fill=t?new o(t).toString():null,this.invalidate())},fillRadial:function(t,e,n,i,r,a,l){if(null==e&&(e=(this.left||0)+.5*(this.width||0)),null==n&&(n=(this.top||0)+.5*(this.height||0)),null==r&&(r=i||.5*this.height||0),null==i&&(i=.5*(this.width||0)),null==a&&(a=e),null==l&&(l=n),a+=a-e,l+=l-n,0===i||"0"===i)return this.fillLinear(t);var u=r/i;this._pendingFill&&this._pendingFill();var c=h.createRadialGradient(e,n/u,0,a,l/u,2*i);if("length"in t)for(var p=0,f=t.length-1;f>=p;p++)c.addColorStop(p/f/2,new o(t[p]).toString()),c.addColorStop(1-p/f/2,new o(t[p]).toString());else for(var d in t)c.addColorStop(d/2,new o(t[d]).toString()),c.addColorStop(1-d/2,new o(t[d]).toString());return this._fill=c,this._fillTransform=new s(1,0,0,u),this.invalidate()},fillLinear:function(t,e,n,i,r){if(arguments.length<5){var o=(null==e?270:e)*Math.PI/180,a=Math.cos(o),l=-Math.sin(o),u=(Math.abs(a)+Math.abs(l))/2,c=this.width||1,p=this.height||1;a*=u,l*=u,e=.5-a,i=.5+a,n=.5-l,r=.5+l,this._fillTransform=new s(c,0,0,p)}else this._fillTransform=null;this._pendingFill&&this._pendingFill();var f=h.createLinearGradient(e,n,i,r);return this._addColors(f,t),this._fill=f,this.invalidate()},fillImage:function(t,e,n,i,r,o,s){this._pendingFill&&this._pendingFill();var a=t;if(a instanceof Image||(a=new Image,a.src=t),a.width&&a.height)return this._fillImage(a,e,n,i||0,r||0,o,s);this._fill=null;var l=this,h=function(){u(),l._fillImage(a,e,n,i||0,r||0,o,s)},u=function(){a.removeEventListener("load",h,!1),l._pendingFill=null};return this._pendingFill=u,a.addEventListener("load",h,!1),this},_fillImage:function(t,e,n,r,o,a,l){var u=e?e/t.width:1,c=n?n/t.height:1;return null!=a&&(t=i(t,a,l)),this._fill=h.createPattern(t,"repeat"),this._fillTransform=new s(u,0,0,c,r||0,o||0),this.invalidate()},stroke:function(t,e,n,i,r){return this._stroke=t?new o(t).toString():null,this._strokeWidth=null!=e?e:1,this._strokeCap=null!=n?n:"round",this._strokeJoin=null!=i?i:"round",this._strokeDash=r,this.invalidate()},element_renderTo:a.prototype.renderTo,renderTo:function(t,e,n,i,r,o,s){var a=this._opacity;if(null==a||a>=1)return this.renderLayerTo(t,e,n,i,r,o,s);if(this._fill&&this._stroke)return this.element_renderTo(t,e,n,i,r,o,s);t.globalAlpha=a;var l=this.renderLayerTo(t,e,n,i,r,o,s);return t.globalAlpha=1,l},renderLayerTo:function(t,e,n,i,r,o,s){t.setTransform(e,n,i,r,o,s),this.renderShapeTo(t)}});u._genericContext=h,t.exports=u},function(t,e,n){"use strict";var i=n(45),r=n(47),o=n(64);t.exports=i(o,r,{initialize:function(t,e){this.width=t,this.height=e},localHitTest:function(t,e){for(var n=this.lastChild;n;){var i=n.hitTest(t,e);if(i)return i;n=n.previousSibling}return null},renderLayerTo:function(t,e,n,i,r,o,s){t.setTransform(e,n,i,r,o,s),t.save(),t.beginPath(),t.rect(this.x,this.y,this.width,this.height),t.clip();for(var a=this.firstChild;a;)a.renderTo(t,e,n,i,r,o,s),a=a.nextSibling;t.restore()}})},function(t,e,n){"use strict";var i=n(45),r=n(68),o={middle:"center"};t.exports=i(r,{base_initialize:r.prototype.initialize,initialize:function(t,e,n,i){this.base_initialize(),this.draw.apply(this,arguments)},draw:function(t,e,n,i){var s;"string"==typeof e?s=Number(/(\d+)/.exec(e)[0]):e?(s=parseFloat(e.fontSize||e["font-size"]||"12"),e=(e.fontStyle||e["font-style"]||"")+" "+(e.fontVariant||e["font-variant"]||"")+" "+(e.fontWeight||e["font-weight"]||"")+" "+s+"px "+(e.fontFamily||e["font-family"]||"Arial")):e=this._font;var a=t&&t.split(/\r?\n/);this._font=e,this._fontSize=s,this._text=a,this._alignment=o[n]||n||"left";var l=r._genericContext;l.font=this._font,l.textAlign=this._alignment,l.textBaseline="middle",a=this._text;for(var h=a.length,u=0,c=0;h>c;c++){var p=l.measureText(a[c]).width;p>u&&(u=p)}return this.width=u,this.height=h?1.1*h*s:0,this.invalidate()},localHitTest:function(t,e){return this._fill&&t>0&&e>0&&tu;u++)t.fillText(l[u],0,s+u*a)}if(n)for(r?t.setLineDash?t.setLineDash(r):t.mozDash=r:t.setLineDash?t.setLineDash([]):t.mozDash=null,t.strokeStyle=n,t.lineWidth=this._strokeWidth,t.lineCap=this._strokeCap,t.lineJoin=this._strokeJoin,u=0;h>u;u++)t.strokeText(l[u],0,s+u*a)}})},function(t,e,n){"use strict";var i=n(72),r=n(2),o=n(73),s={getSubdmain:function(t,e){var n=Math.abs(t.x+t.y)%e.length;return e[n]},getTileUrl:function(t,e,n){return i.template(t,{s:this.getSubdmain(e,n),x:e.x,y:e.y,z:e.z})},degrees2meters:function(t,e){var n=20037508.34*t/180,i=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return i=20037508.34*i/180,[n,i]},meters2degress:function(t,e){var n=180*t/20037508.34,i=Number(180/Math.PI*(2*Math.atan(Math.exp(e*Math.PI/180))-Math.PI/2));return[n,i]},getTileLayout:function(t){var e=[],n=o.calcBounds(t.center[1],t.center[0],t.zoom,t.width,t.height),i=s.degrees2meters(n.left,n.top),a=s.degrees2meters(n.right,n.bottom),l=new r(null,t.tileWidth),h={top:i[1],left:i[0],right:a[0],bottom:a[1]},u=l.getTiles(h,t.zoom);return u.forEach(function(n){var i={x:n.X,y:n.Y,z:n.Z},r={x:n.left,y:n.top,img:s.getTileUrl(t.tileSource,i,t.subdomains)};e.push(r)},this),e}};t.exports=s},function(t,e,n){"use strict";var i=/\{ *([\w_]+) *\}/g,r={template:function(t,e){return t.replace(i,function(t,n){var i=e[n];if(void 0===i)throw new Error("No value provided for variable "+t);return"function"==typeof i&&(i=i(e)),i})}};t.exports=r},function(t,e,n){"use strict";function i(t,e,n,i,r){var o=Math.pow(2,n),s=a.fromLatLngToPoint({lng:e,lat:t}),l={x:s.x-i/2/o,y:s.y+r/2/o},h=a.fromPointToLatLng(l),u={x:s.x+i/2/o,y:s.y-r/2/o},c=a.fromPointToLatLng(u);return{bounds:[h.lng,h.lat,c.lng,c.lat],bbox:h.lng+","+h.lat+","+c.lng+","+c.lat,top:c.lat,right:c.lng,bottom:h.lat,left:h.lng}}function r(t,e,n){var i={width:256,height:256},r=21,a={lon:t[2],lat:t[3]},l={lon:t[0],lat:t[1]},h=(o(a.lat)-o(l.lat))/Math.PI,u=a.lon-l.lon,c=(0>u?u+360:u)/360,p=s(n,i.height,h),f=s(e,i.width,c);return Math.min(p,f,r)}function o(t){var e=Math.sin(t*Math.PI/180),n=Math.log((1+e)/(1-e))/2;return Math.max(Math.min(n,Math.PI),-Math.PI)/2}function s(t,e,n){return Math.round(Math.log(t/e/n)/Math.LN2)}var a=n(74);e.calcBounds=i,e.calcZoomForBounds=r},function(t,e,n){"use strict";function i(t,e,n){return null!=e&&(t=Math.max(t,e)),null!=n&&(t=Math.min(t,n)),t}function r(t){return t*(Math.PI/180)}function o(t){return t/(Math.PI/180)}function s(t,e){var n={x:null,y:null},o=h;n.x=o.x+t.lng*u;var s=i(Math.sin(r(t.lat)),-.9999,.9999);return n.y=o.y+.5*Math.log((1+s)/(1-s))*-c,n}function a(t){var e=h,n=(t.x-e.x)/u,i=(t.y-e.y)/-c,r=o(2*Math.atan(Math.exp(i))-Math.PI/2);return{lat:r,lng:n}}e.fromLatLngToPoint=s,e.fromPointToLatLng=a;var l=256,h={x:l/2,y:l/2},u=l/360,c=l/(2*Math.PI)},function(t,e,n){"use strict";(function(){var e=(!!n(76),n(77));t.exports=function(){return function(t){var n,i,r,o;return i=t.left,r=t.right,o=t.top,n=t.bottom,e({points:[[r,o],[r,n],[i,n],[i,o]],closed:!0})}}.call(this)}).call(void 0)},function(t,e,n){(function(e){t.exports=e}).call(e,{})},function(t,e,n){"use strict";(function(){var e=(!!n(76),n(78)),i=n(79);t.exports=function(){return function(t){var n,r,o,s,a,l,h;return a=t.points,n=t.closed,o=a.length,r=a[0],h=a.slice(1,+o+1||9e9),s=h.reduce(function(t,e){return t.lineto.apply(t,e)},(l=e()).moveto.apply(l,r)),{path:n?s.closepath():s,centroid:i.average(a)}}}.call(this)}).call(void 0)},function(t,e,n){"use strict";(function(){!!n(76);t.exports=function(){var t;return t=function(e){var n,i,r,o,s,a,l,h,u;return i=e||[],a=function(t,e){var n;return n=t.slice(0,t.length),n.push(e),n},n=function(t,e){return t[0]===e[0]&&t[1]===e[1]},h=function(t,e){var n;for(n=t.length;"0"===t.charAt(n-1);)n-=1;return"."===t.charAt(n-1)&&(n-=1),t.substr(0,n)},l=function(t,e){var n;return n=t.toFixed(e),h(n)},s=function(t){var e,n,i,r;return e=t.command,r=t.params,n=function(){var t,e,n;for(n=[],t=0,e=r.length;e>t;t++)i=r[t],n.push(l(i,6));return n}(),e+" "+n.join(" ")},o=function(t,e){var n,i,r,o;switch(n=t.command,i=t.params,r=e[0],o=e[1],n){case"M":return[i[0],i[1]];case"L":return[i[0],i[1]];case"H":return[i[0],o];case"V":return[r,i[0]];case"Z":return null;case"C":return[i[4],i[5]];case"S":return[i[2],i[3]];case"Q":return[i[2],i[3]];case"T":return[i[0],i[1]];case"A":return[i[5],i[6]]}},u=function(t,e){return function(n){var i;return i="object"==typeof n?t.map(function(t){return n[t]}):arguments,e.apply(null,i)}},r=function(e){return t(a(i,e))},{moveto:u(["x","y"],function(t,e){return r({command:"M",params:[t,e]})}),lineto:u(["x","y"],function(t,e){return r({command:"L",params:[t,e]})}),hlineto:u(["x"],function(t){return r({command:"H",params:[t]})}),vlineto:u(["y"],function(t){return r({command:"V",params:[t]})}),closepath:function(){return r({command:"Z",params:[]})},curveto:u(["x1","y1","x2","y2","x","y"],function(t,e,n,i,o,s){return r({command:"C",params:[t,e,n,i,o,s]})}),smoothcurveto:u(["x2","y2","x","y"],function(t,e,n,i){return r({command:"S",params:[t,e,n,i]})}),qcurveto:u(["x1","y1","x","y"],function(t,e,n,i){return r({command:"Q",params:[t,e,n,i]})}),smoothqcurveto:u(["x","y"],function(t,e){return r({command:"T",params:[t,e]})}),arc:u(["rx","ry","xrot","large_arc_flag","sweep_flag","x","y"],function(t,e,n,i,o,s,a){return r({command:"A",params:[t,e,n,i,o,s,a]})}),print:function(){return i.map(s).join(" ")},points:function(){var t,e,n,r,s,a;for(a=[],s=[0,0],t=function(){var t;return t=o(n,s),s=t,t?a.push(t):void 0},e=0,r=i.length;r>e;e++)n=i[e],t();return a},instructions:function(){return i.slice(0,i.length)},connect:function(e){var i,r,o;return r=this.points().slice(-1)[0],i=e.points()[0],o=e.instructions().slice(1),n(r,i)||o.unshift({command:"L",params:i}),t(this.instructions().concat(o))}}},function(){return t()}}.call(this)}).call(void 0)},function(t,e,n){"use strict";(function(){!!n(76);t.exports=function(){var t,e,n,i,r,o,s,a,l,h,u;return l=function(t){return t.reduce(function(t,e){return t+e},0)},r=function(t){return t.reduce(function(t,e){return Math.min(t,e)})},i=function(t){return t.reduce(function(t,e){return Math.max(t,e)})},a=function(t,e){var n,i,r,o;return n=t[0],i=t[1],r=e[0],o=e[1],[n+r,i+o]},o=function(t,e){var n,i,r,o;return n=t[0],i=t[1],r=e[0],o=e[1],[n-r,i-o]},u=function(t,e){var n,i;return n=e[0],i=e[1],[t*n,t*i]},n=function(t){var e,n;return e=t[0],n=t[1],Math.sqrt(e*e+n*n)},h=function(t){return t.reduce(function(t,e){return a(t,e)},[0,0])},t=function(t){return u(1/t.length,t.reduce(a))},s=function(t,e){return u(t,[Math.sin(e),-Math.cos(e)])},e=function(t,e){var n,i,r;r=t||{};for(n in r)i=r[n],e[n]=i(e.index,e.item,e.group);return e},{sum:l,min:r,max:i,plus:a,minus:o,times:u,length:n,sum_vectors:h,average:t,on_circle:s,enhance:e}}.call(this)}).call(void 0)},function(t,e,n){"use strict";var i=n(3),r=i.createClass({displayName:"ZoomControl",render:function(){return i.createElement("div",null)}});t.exports=r}])});
--------------------------------------------------------------------------------