├── .babelrc
├── .builderrc
├── .editorconfig
├── .gitignore
├── .npmignore
├── .travis.yml
├── CONTRIBUTING.md
├── DEVELOPMENT.md
├── LICENSE.txt
├── README.md
├── demo
├── app.jsx
└── index.html
├── dist
├── radium-grid.js
├── radium-grid.js.map
├── radium-grid.min.js
└── radium-grid.min.js.map
├── package.json
├── src
├── components
│ ├── cell.js
│ ├── grid.js
│ └── util
│ │ ├── parse-fraction.js
│ │ ├── resolve-cell-defaults.js
│ │ ├── resolve-cell-styles.js
│ │ ├── resolve-cells.js
│ │ └── resolve-column-counts.js
└── index.js
├── test
└── client
│ ├── main.js
│ ├── spec
│ └── components
│ │ ├── grid.spec.jsx
│ │ └── util.spec.jsx
│ └── test.html
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./node_modules/builder-radium-component/config/babel/.babelrc"
3 | }
4 |
--------------------------------------------------------------------------------
/.builderrc:
--------------------------------------------------------------------------------
1 | ---
2 | archetypes:
3 | - builder-radium-component
4 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 | max_line_length = 100
12 |
13 | [*.md]
14 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### SublimeText ###
2 | *.sublime-workspace
3 |
4 | ### OSX ###
5 | .DS_Store
6 | .AppleDouble
7 | .LSOverride
8 | Icon
9 |
10 | # Thumbnails
11 | ._*
12 |
13 | # Files that might appear on external disk
14 | .Spotlight-V100
15 | .Trashes
16 |
17 | ### Windows ###
18 | # Windows image file caches
19 | Thumbs.db
20 | ehthumbs.db
21 |
22 | # Folder config file
23 | Desktop.ini
24 |
25 | # Recycle Bin used on file shares
26 | $RECYCLE.BIN/
27 |
28 | # App specific
29 |
30 | coverage
31 | node_modules
32 | bower_components
33 | .tmp
34 | lib
35 | npm-debug.log*
36 | *.sublime-project
37 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # Cruft
2 | *.sublime-workspace
3 | .DS_Store
4 | .AppleDouble
5 | .LSOverride
6 | Icon
7 | ._*
8 | .Spotlight-V100
9 | .Trashes
10 | Thumbs.db
11 | ehthumbs.db
12 | Desktop.ini
13 | $RECYCLE.BIN/
14 | .tmp
15 | npm-debug.log*
16 |
17 | # Code / build
18 | coverage
19 | node_modules
20 | bower_components
21 | demo
22 | test
23 | karma*
24 | webpack*
25 | .eslint*
26 | .editor*
27 | .travis*
28 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 |
3 | node_js:
4 | - "4"
5 | - "6"
6 |
7 | # Use container-based Travis infrastructure.
8 | sudo: false
9 |
10 | branches:
11 | only:
12 | - master
13 |
14 | addons:
15 | firefox: "latest"
16 |
17 | before_install:
18 | # GUI for real browsers.
19 | - export DISPLAY=:99.0
20 | - sh -e /etc/init.d/xvfb start
21 |
22 | - 'npm install -g npm@3'
23 |
24 | script:
25 | - npm --version
26 | - node_modules/.bin/builder run check-ci
27 |
28 | # Prune deps to just production and ensure we can still build
29 | - npm prune --production
30 | - node_modules/.bin/builder run build
31 | - cat coverage/client/*/lcov.info | node_modules/.bin/coveralls || echo "Coveralls upload failed"
32 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Contributing
2 | ============
3 |
4 | Thanks for helping out!
5 |
6 | ## Development
7 |
8 | Run `builder run open-dev` to run a webpack dev server with component examples.
9 |
10 | ## Checks, Tests
11 |
12 | Run `builder run check` before committing.
13 |
14 | ## Dist
15 |
16 | Please do not commit changes to files in `dist`.
17 | These files are only committed when we tag releases.
18 |
--------------------------------------------------------------------------------
/DEVELOPMENT.md:
--------------------------------------------------------------------------------
1 | Development
2 | ===========
3 |
4 | We use [builder][] and `npm` to control all aspects of development and
5 | publishing.
6 |
7 | As a preliminary matter, please update your shell to include
8 | `./node_modules/.bin` in `PATH` like:
9 |
10 | ```sh
11 | export PATH="${PATH}:./node_modules/.bin"
12 | ```
13 |
14 | So you can type `builder` instead of `./node_modules/.bin/builder` for all
15 | commands.
16 |
17 |
18 | ## Build
19 |
20 | Build for production use (NPM, bower, etc) and create `dist` UMD bundles
21 | (min'ed, non-min'ed)
22 |
23 | ```
24 | $ builder run build
25 | ```
26 |
27 | Note that `dist/` files are only updated and committed on **tagged releases**.
28 |
29 |
30 | ## Development
31 |
32 | All development tasks consist of watching the demo bundle, the test bundle
33 | and launching a browser pointed to the demo page.
34 |
35 | Run the `demo` application with watched rebuilds either doing:
36 |
37 | ### Basic Watched Builds
38 |
39 | ```sh
40 | $ builder run dev # dev test/app server
41 | $ builder run open-dev # (OR) dev servers _and a browser window opens!_
42 | ```
43 |
44 | ### Watched Builds + Hot Reloading
45 |
46 | Same as above, but with hot reloading of React components.
47 |
48 | ```sh
49 | $ builder run hot # hot test/app server
50 | $ builder run open-hot # (OR) hot servers _and a browser window opens!_
51 | ```
52 |
53 | From there, using either `dev` or `hot`, you can see:
54 |
55 | * Demo app: [127.0.0.1:3000](http://127.0.0.1:3000/)
56 | * Client tests: [127.0.0.1:3001/test/client/test.html](http://127.0.0.1:3001/test/client/test.html)
57 |
58 |
59 | ## Programming Guide
60 |
61 | ### Logging
62 |
63 | We use the following basic pattern for logging:
64 |
65 | ```js
66 | if (process.env.NODE_ENV !== "production") {
67 | /* eslint-disable no-console */
68 | if (typeof console !== "undefined" && console.warn) {
69 | console.warn("Oh noes! bad things happened.");
70 | }
71 | /* eslint-enable no-console */
72 | }
73 | ```
74 |
75 | Replace `console.warn` in the condtional + method call as appropriate.
76 |
77 | Breaking this down:
78 |
79 | * `process.env.NODE_ENV !== "production"` - This part removes all traces of
80 | the code in the production bundle, to save on file size. This _also_ means
81 | that no warnings will be displayed in production.
82 | * `typeof console !== "undefined" && console.METHOD` - A permissive check to
83 | make sure the `console` object exists and can use the appropriate `METHOD` -
84 | `warn`, `info`, etc.
85 |
86 | To signal production mode to the webpack build, declare the `NODE_ENV` variable:
87 |
88 | ```js
89 | new webpack.DefinePlugin({
90 | "process.env.NODE_ENV": JSON.stringify("production")
91 | })
92 | ```
93 |
94 | Unfortunately, we need to do _all_ of this every time to have Uglify properly
95 | drop the code, but with this trick, the production bundle has no change in code
96 | size.
97 |
98 |
99 | ## Quality
100 |
101 | ### In Development
102 |
103 | During development, you are expected to be running either:
104 |
105 | ```sh
106 | $ builder run dev
107 | ```
108 |
109 | to build the lib and test files. With these running, you can run the faster
110 |
111 | ```sh
112 | $ builder run check-dev
113 | ```
114 |
115 | Command. It is comprised of:
116 |
117 | ```sh
118 | $ builder run lint
119 | $ builder run test-dev
120 | ```
121 |
122 | Note that the tests here are not instrumented for code coverage and are thus
123 | more development / debugging friendly.
124 |
125 | ### Continuous Integration
126 |
127 | CI doesn't have source / test file watchers, so has to _build_ the test files
128 | via the commands:
129 |
130 | ```sh
131 | $ builder run check # PhantomJS only
132 | $ builder run check-cov # (OR) PhantomJS w/ coverage
133 | $ builder run check-ci # (OR) PhantomJS,Firefox + coverage - available on Travis.
134 | ```
135 |
136 | Which is currently comprised of:
137 |
138 | ```sh
139 | $ builder run lint # AND ...
140 |
141 | $ builder run test # PhantomJS only
142 | $ builder run test-cov # (OR) PhantomJS w/ coverage
143 | $ builder run test-ci # (OR) PhantomJS,Firefox + coverage
144 | ```
145 |
146 | Note that `(test|check)-(cov|ci)` run code coverage and thus the
147 | test code may be harder to debug because it is instrumented.
148 |
149 | ### Client Tests
150 |
151 | The client tests rely on webpack dev server to create and serve the bundle
152 | of the app/test code at: http://127.0.0.1:3001/assets/main.js which is done
153 | with the task `builder run server-test` (part of `npm dev`).
154 |
155 | #### Code Coverage
156 |
157 | Code coverage reports are outputted to:
158 |
159 | ```
160 | coverage/
161 | client/
162 | BROWSER_STRING/
163 | lcov-report/index.html # Viewable web report.
164 | ```
165 |
166 | ## Releases
167 |
168 | **IMPORTANT - NPM**: To correctly run `preversion` your first step is to make
169 | sure that you have a very modern `npm` binary:
170 |
171 | ```sh
172 | $ npm install -g npm
173 | ```
174 |
175 | Built files in `dist/` should **not** be committeed during development or PRs.
176 | Instead we _only_ build and commit them for published, tagged releases. So
177 | the basic workflow is:
178 |
179 | ```sh
180 | # Make sure you have a clean, up-to-date `master`
181 | $ git pull
182 | $ git status # (should be no changes)
183 |
184 | # Choose a semantic update for the new version.
185 | # If you're unsure, read about semantic versioning at http://semver.org/
186 | $ npm version major|minor|patch -m "Version %s - INSERT_REASONS"
187 |
188 | # ... the `dist/` and `lib/` directories are now built, `package.json` is
189 | # updated, and the appropriate files are committed to git (but unpushed).
190 | #
191 | # *Note*: `lib/` is uncommitted, but built and must be present to push to npm.
192 |
193 | # Check that everything looks good in last commit and push.
194 | $ git diff HEAD^ HEAD
195 | $ git push && git push --tags
196 | # ... the project is now pushed to GitHub and available to `bower`.
197 |
198 | # And finally publish to `npm`!
199 | $ npm publish
200 | ```
201 |
202 | And you've published!
203 |
204 | For additional information on the underlying NPM technologies and approaches,
205 | please review:
206 |
207 | * [`npm version`](https://docs.npmjs.com/cli/version): Runs verification,
208 | builds `dist/` and `lib/` via `scripts` commands.
209 | * Our scripts also run the applicable `git` commands, so be very careful
210 | when running out `version` commands.
211 | * [`npm publish`](https://docs.npmjs.com/cli/publish): Uploads to NPM.
212 | * **NOTE**: We don't _build_ in `prepublish` because of the
213 | [`npm install` runs `npm prepublish` bug](https://github.com/npm/npm/issues/3059)
214 |
215 | [builder]: https://github.com/FormidableLabs/builder
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Formidable Labs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Radium Grid [](https://travis-ci.org/FormidableLabs/radium-grid) [](https://coveralls.io/github/FormidableLabs/radium-grid?branch=master) [![Maintenance Status][maintenance-image]](#maintenance-status)
2 |
3 |
4 | Radium Grid is a powerful, no-fuss grid system component for React. It combines the best decisions from the ecosystem of (S)CSS-based grid systems and implements them hack-free on top of Flexbox.
5 |
6 | ## What makes Radium Grid special?
7 | - Declarative layout using JSX.
8 | - Sensible defaults.
9 | - Uses arbitrary fractions for cell widths. No more 12-column straitjacket!
10 | - Infers rows from the given cell sizes. No need for explicit rows or extra `
`s!
11 | - Customizable cell alignment, including a hack-free vertical align!
12 | - Customizable fixed-width and fluid-width gutters. Just pass a CSS unit!
13 | - Customizable media queries for breakpoint definitions.
14 | - Uses Radium Style to handle breakpoint changes efficiently.
15 | - Accepts `style` arrays and resolves them with Radium Style.
16 | - Cascading defaults: set cell props on:
17 | - all cells for all sizes,
18 | - all cells for individual sizes,
19 | - a single cell for all sizes,
20 | - a single cell for individual sizes,
21 | - ...with the lowest props in the tree overriding parent props.
22 |
23 | ## Prerelease
24 | Although this is prerelease software, we'll do our best to avoid breaking public API changes.
25 |
26 | ## Installation
27 | `npm install --save radium-grid`
28 |
29 | ## Usage
30 | ```es6
31 | import { Grid, Cell } from 'radium-grid';
32 |
33 | const App = () => {
34 | return (
35 |
36 |
37 | Lorem
38 | |
39 |
40 | ipsum
41 | |
42 |
43 | dolor
44 | |
45 |
46 | sit
47 | |
48 |
49 | );
50 | }
51 | ```
52 | The above example will render with the following provided defaults:
53 | - All cells in the grid are 1/3 wide for all screen sizes.
54 | - The grid uses a 16px fixed gutter.
55 | - Cell content is aligned to the top left.
56 | - The breakpoints use the following media queries:
57 | - small: "@media only screen and (max-width: 640px)",
58 | - medium: "@media only screen and (min-width: 641px) and (max-width: 1024px)",
59 | - large: "@media only screen and (min-width: 1025px) and (max-width: 1440px)",
60 | - xlarge: "@media only screen and (min-width: 1441px)"
61 |
62 | To set a default width and alignment for every cell in the grid:
63 | ```es6
64 |
65 |
66 | Lorem
67 | |
68 |
69 | ipsum
70 | |
71 |
72 | ```
73 |
74 | An example of setting widths and alignment per screen size for every cell in the grid:
75 | ```es6
76 |
84 |
85 | Lorem
86 | |
87 |
88 | ipsum
89 | |
90 |
91 | ```
92 |
93 | An example of custom per-cell widths and alignments:
94 | ```es6
95 |
96 |
101 | Lorem
102 | |
103 |
108 | ipsum
109 | |
110 |
115 | dolor
116 | |
117 |
122 | sit
123 | |
124 |
125 | ```
126 |
127 | The same as above, but with different per-cell widths on small screens:
128 | ```es6
129 |
130 |
136 | Lorem
137 | |
138 |
144 | ipsum
145 | |
146 |
147 | ```
148 |
149 | Custom gutters can use any valid CSS value string. Percentage values create fluid gutters, while all other values create fixed gutters. Example:
150 |
151 | ```es6
152 |
153 |
154 | Lorem
155 | |
156 |
157 | ipsum
158 | |
159 |
160 |
161 |
162 |
163 | Lorem
164 | |
165 |
166 | ipsum
167 | |
168 |
169 | ```
170 |
171 | While we recommend the default breakpoints, you can customize them:
172 | ```es6
173 | const breakpoints = {
174 | small: "@media only screen and (max-width: 320px)",
175 | medium: "@media only screen and (min-width: 320px) and (max-width: 640px)",
176 | large: "@media only screen and (min-width: 641px) and (max-width: 1024px)",
177 | xlarge: "@media only screen and (min-width: 1025px)"
178 | }
179 |
180 |
181 | Lorem
182 | |
183 |
184 | ipsum
185 | |
186 |
187 | ```
188 |
189 | ## Demo
190 | There are more complex examples on the demo page. Check out the code in [app.jsx](https://github.com/FormidableLabs/radium-grid/blob/master/demo/app.jsx).
191 |
192 | ### Installation
193 | - Install builder: `npm install -g builder`
194 | - Clone this repo
195 | - `npm install` and then `builder run hot` will load a webpack dev server at localhost:3000
196 |
197 | ## Gotchas
198 | `
` only accepts `
| `s as children, since inserting arbitrary children can break the layout. Two options for custom children are:
199 | - Wrap the children in a `
| `.
200 | - Move the children to a sibling of `
`.
201 |
202 |
203 | ## Maintenance Status
204 |
205 | **Archived:** This project is no longer maintained by Formidable. We are no longer responding to issues or pull requests unless they relate to security concerns. We encourage interested developers to fork this project and make it their own!
206 |
207 | [maintenance-image]: https://img.shields.io/badge/maintenance-archived-red.svg
208 |
--------------------------------------------------------------------------------
/demo/app.jsx:
--------------------------------------------------------------------------------
1 | /* global document:false */
2 | /* eslint-disable new-cap */
3 | import React from "react";
4 | import ReactDOM from "react-dom";
5 | import Radium, { Style, StyleRoot } from "radium";
6 | import { Grid, Cell } from "../src/index";
7 |
8 | const colors = {
9 | formidared: "#FF4136",
10 | shade1: "#CC342B",
11 | shade2: "#B22D26",
12 | shade3: "#992720",
13 | white: "#fff",
14 | black: "#2b303b"
15 | };
16 |
17 | const App = () => {
18 | const { styles } = App;
19 | return (
20 |
21 |
22 | Radium Grid Demo
23 | Resize for full effect!
24 |
25 | Default widths
26 |
27 |
28 | Lorem
29 | |
30 |
31 | ipsum
32 | |
33 |
34 | dolor
35 | |
36 |
37 | sit
38 | |
39 |
40 |
41 | Default widths per screen size
42 |
48 |
49 | Lorem
50 | |
51 |
52 | ipsum
53 | |
54 |
55 | dolor
56 | |
57 |
58 | sit
59 | |
60 |
61 | amet
62 | |
63 |
64 | consectetuer
65 | |
66 |
67 |
68 | Custom per-cell widths
69 |
75 |
80 | Lorem
81 | |
82 |
87 | ipsum
88 | |
89 |
95 | solor
96 | |
97 |
104 | sit
105 | |
106 |
107 |
108 | Custom fixed gutters and per-grid custom alignments
109 |
118 |
119 | Lorem
120 | |
121 |
122 | ipsum
123 | |
124 |
125 | dolor
126 | |
127 |
128 | sit
129 | |
130 |
131 |
132 | Custom fluid gutters and per-cell custom alignments
133 |
137 |
142 | Lorem
143 | |
144 |
149 | ipsum
150 | |
151 |
152 | dolor
153 | |
154 |
155 |
156 | Custom cell order per breakpoint
157 |
158 |
165 | 1) Lorem
166 | |
167 |
174 | 2) ipsum
175 | |
176 |
183 | 3) dolor
184 | |
185 |
192 | 4) sit
193 | |
194 |
195 |
196 | Nested grids
197 |
198 |
199 |
200 |
201 | Lorem
202 | |
203 |
204 | ipsum
205 | |
206 |
207 | |
208 |
209 |
210 |
211 | Lorem
212 | |
213 |
214 | ipsum
215 | |
216 |
217 | dolor
218 | |
219 |
220 | |
221 |
222 |
223 | );
224 | };
225 |
226 | App.styles = {
227 | global: {
228 | body: {
229 | fontFamily: "Whitney SSm A, Whitney SSm B, Helvetica Neue, Helvetica, Arial, sans-serif",
230 | lineHeight: 1.5,
231 | margin: 0
232 | },
233 | p: {
234 | margin: 0
235 | }
236 | },
237 | cell: {
238 | marginBottom: "1rem",
239 | padding: "1rem",
240 | minWidth: "0px",
241 | height: "150px"
242 | },
243 | fluidCell: {
244 | height: "auto"
245 | },
246 | nestedCell: {
247 | marginBottom: 0
248 | },
249 | redCell: {
250 | backgroundColor: colors.shade1
251 | },
252 | darkRedCell: {
253 | backgroundColor: colors.shade3
254 | },
255 | blackCell: {
256 | backgroundColor: colors.black
257 | },
258 | image: {
259 | maxWidth: "100%",
260 | maxHeight: "100%"
261 | },
262 | cellText: {
263 | color: colors.white
264 | }
265 | };
266 |
267 | const Wrapper = Radium(App);
268 |
269 | ReactDOM.render( , document.getElementById("content"));
270 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 | Demo
10 |
11 |
12 |
14 |
36 |
37 |
38 |
41 |
42 |
46 |
47 |
48 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/dist/radium-grid.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap c3e656a5983654869a90","webpack:///./index.js","webpack:///./components/grid.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///external {\"root\":\"Radium\",\"commonjs2\":\"radium\",\"commonjs\":\"radium\",\"amd\":\"radium\"}","webpack:///./components/util/resolve-cells.js","webpack:///./components/util/resolve-cell-defaults.js","webpack:///./components/util/resolve-column-counts.js","webpack:///../~/lodash.initial/index.js","webpack:///../~/lodash.last/index.js","webpack:///./components/util/parse-fraction.js","webpack:///./components/util/resolve-cell-styles.js","webpack:///../~/lodash.merge/index.js","webpack:///../~/webpack/buildin/module.js","webpack:///../~/radium/lib/merge-styles.js","webpack:///./components/cell.js"],"names":["Grid","Cell","props","styles","display","flexDirection","flexWrap","justifyContent","minWidth","style","propTypes","cellWidth","string","cellAlign","cellVerticalAlign","smallCellWidth","smallCellAlign","smallCellVerticalAlign","mediumCellWidth","mediumCellAlign","mediumCellVerticalAlign","largeCellWidth","largeCellAlign","largeCellVerticalAlign","xlargeCellWidth","xlargeCellAlign","xlargeCellVerticalAlign","breakpoints","shape","small","medium","large","xlarge","gutter","object","children","node","defaultProps","resolveCells","childProps","childrenWithDefaults","map","child","cloneElement","childrenWithColumnCounts","prune","Object","keys","reduce","acc","key","undefined","resolveCellDefaults","gridDefault","width","horizontalAlign","verticalAlign","cellDefault","align","order","size","mediaQuery","gridBreakpointDefault","cellBreakpointDefault","breakpoint","cellConfig","resolveColumnCounts","columnCounts","all","cell","breakpointCell","length","rest","row","sum","column","previous","concat","index","propsWithColumnCounts","columnCount","cellProps","validateFraction","fraction","n","d","numerator","parseInt","replace","denominator","result","Error","parseFraction","trim","split","rawNumerator","rawDenominator","parseUnit","value","matches","match","number","unit","resolveCellGutter","resolveCellFlexBasis","MULTIPLIER","finalGutter","resolvePropStyles","Array","isArray","resolveCellStyles","alignmentMap","left","center","right","top","middle","bottom","mediaQueries","filter","indexOf","cellStyle","breakpointStyles","flexBasis","alignItems","horizontalPropType","oneOf","verticalPropType","smallWidth","smallHorizontalAlign","smallVerticalAlign","smallOrder","mediumWidth","mediumHorizontalAlign","mediumVerticalAlign","mediumOrder","largeWidth","largeHorizontalAlign","largeVerticalAlign","largeOrder","xlargeWidth","xlargeHorizontalAlign","xlargeVerticalAlign","xlargeOrder"],"mappings":"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wG,aAAaW,iBAAiBnE,eAA9B,CARJ;AASZI,cAAO+D,iBAAiB/D,KAAjB,GAAyB+D,iBAAiB/D,KAA1C,GAAkD;AAT7C,MAFhB;AAcD,IAjBiB,EAiBf,EAjBe,CAAlB;;AAmBA;AACA;AACA,UAAO,sBACL8D,SADK,EAELd,kBAAkBzG,MAAMO,KAAxB,CAFK,CAAP;AAID,EAvCD;;mBAyCeqG,iB;;;;;;AChFf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAoC;;AAEpC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,EAAE;AACb,YAAW,MAAM;AACjB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,MAAM;AACjB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,SAAS;AACpB,YAAW,EAAE;AACb,YAAW,QAAQ;AACnB;AACA,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,QAAQ;AACnB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,QAAQ;AACnB,YAAW,QAAQ;AACnB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,YAAY;AACvB,cAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,MAAM;AACjB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,YAAW,OAAO,WAAW;AAC7B,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA,yBAAwB;;AAExB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO,WAAW;AAC7B,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,EAAE;AACb,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,kBAAiB;AACjB,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA,8BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,SAAS;AACtB,WAAU;AACV;AACA,cAAa,SAAS;AACtB,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,UAAU;AACrB,cAAa,OAAO;AACpB;AACA;AACA;AACA,aAAY,SAAS,GAAG,SAAS;AACjC;AACA;AACA;AACA,aAAY,SAAS,GAAG,SAAS;AACjC;AACA;AACA;AACA,WAAU,QAAQ,iBAAiB,GAAG,iBAAiB;AACvD;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9pEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACTA;;AAEA;AACA;AACA,EAAC;;AAED,qGAAoG,mBAAmB,EAAE,mBAAmB,kGAAkG;;AAE9O;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA,E;;;;;;;;;;;;ACzDA;;;;AACA;;;;;;AAFA;AAIA,KAAM7G,OAAO,SAAPA,IAAO,CAACC,KAAD,EAAW;AACtB,UACE;AAAA;AAAA,OAAK,OAAOA,MAAMO,KAAlB;AACGP,WAAMiC;AADT,IADF;AAKD,EAND;;AAQA,KAAM0F,qBAAqB,iBAAUC,KAAV,CAAgB,CAAC,MAAD,EAAS,QAAT,EAAmB,OAAnB,CAAhB,CAA3B;AACA,KAAMC,mBAAmB,iBAAUD,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,EAAkB,QAAlB,CAAhB,CAAzB;AACA7H,MAAKS,SAAL,GAAiB;AACf4C,UAAO,iBAAU1C,MADF;AAEf2C,oBAAiBsE,kBAFF;AAGfrE,kBAAeuE,gBAHA;AAIfpE,UAAO,iBAAU0C,MAJF;;AAMf2B,eAAY,iBAAUpH,MANP;AAOfqH,yBAAsBJ,kBAPP;AAQfK,uBAAoBH,gBARL;AASfI,eAAY,iBAAU9B,MATP;;AAWf+B,gBAAa,iBAAUxH,MAXR;AAYfyH,0BAAuBR,kBAZR;AAafS,wBAAqBP,gBAbN;AAcfQ,gBAAa,iBAAUlC,MAdR;;AAgBfmC,eAAY,iBAAU5H,MAhBP;AAiBf6H,yBAAsBZ,kBAjBP;AAkBfa,uBAAoBX,gBAlBL;AAmBfY,eAAY,iBAAUtC,MAnBP;;AAqBfuC,gBAAa,iBAAUhI,MArBR;AAsBfiI,0BAAuBhB,kBAtBR;AAuBfiB,wBAAqBf,gBAvBN;AAwBfgB,gBAAa,iBAAU1C,MAxBR;;AA0BflE,aAAU,iBAAUC,IA1BL;AA2Bf3B,UAAO,iBAAUyB;AA3BF,EAAjB;;mBA8Be,sBAAOjC,IAAP,C","file":"radium-grid.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"radium\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"radium\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"RadiumGrid\"] = factory(require(\"react\"), require(\"radium\"));\n\telse\n\t\troot[\"RadiumGrid\"] = factory(root[\"React\"], root[\"Radium\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c3e656a5983654869a90","import GridImport from \"./components/grid\";\nimport CellImport from \"./components/cell\";\n\nexport const Grid = GridImport;\nexport const Cell = CellImport;\n\n\n\n// WEBPACK FOOTER //\n// ./index.js","/* eslint-disable new-cap */\nimport React, { PropTypes } from \"react\";\nimport Radium from \"radium\";\nimport resolveCells from \"./util/resolve-cells\";\n\nconst Grid = (props) => {\n const styles = {\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n justifyContent: \"space-between\",\n minWidth: \"100%\",\n ...props.style\n };\n\n return (\n \n {resolveCells(props)}\n
\n );\n};\n\nGrid.propTypes = {\n cellWidth: PropTypes.string,\n cellAlign: PropTypes.string,\n cellVerticalAlign: PropTypes.string,\n\n smallCellWidth: PropTypes.string,\n smallCellAlign: PropTypes.string,\n smallCellVerticalAlign: PropTypes.string,\n\n mediumCellWidth: PropTypes.string,\n mediumCellAlign: PropTypes.string,\n mediumCellVerticalAlign: PropTypes.string,\n\n largeCellWidth: PropTypes.string,\n largeCellAlign: PropTypes.string,\n largeCellVerticalAlign: PropTypes.string,\n\n xlargeCellWidth: PropTypes.string,\n xlargeCellAlign: PropTypes.string,\n xlargeCellVerticalAlign: PropTypes.string,\n\n breakpoints: PropTypes.shape({\n small: PropTypes.string,\n medium: PropTypes.string,\n large: PropTypes.string,\n xlarge: PropTypes.string\n }),\n\n gutter: PropTypes.string,\n\n style: PropTypes.object,\n children: PropTypes.node\n};\n\nGrid.defaultProps = {\n cellWidth: \"1/3\",\n cellAlign: \"left\",\n cellVerticalAlign: \"top\",\n\n breakpoints: {\n small: \"@media only screen and (max-width: 640px)\",\n medium: \"@media only screen and (min-width: 641px) and (max-width: 1024px)\",\n large: \"@media only screen and (min-width: 1025px) and (max-width: 1440px)\",\n xlarge: \"@media only screen and (min-width: 1441px)\"\n },\n\n gutter: \"16px\"\n};\n\nexport default Radium(Grid);\n\n\n\n// WEBPACK FOOTER //\n// ./components/grid.js","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n// module id = 2\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"Radium\",\"commonjs2\":\"radium\",\"commonjs\":\"radium\",\"amd\":\"radium\"}\n// module id = 3\n// module chunks = 0","import React, { Children } from \"react\";\nimport resolveCellDefaults from \"./resolve-cell-defaults\";\nimport resolveColumnCounts from \"./resolve-column-counts\";\nimport resolveCellStyles from \"./resolve-cell-styles\";\n\nconst resolveCells = (props) => {\n // Resolve the final style defaults for each cell\n const {children, style, ...childProps } = props; // eslint-disable-line no-unused-vars\n const childrenWithDefaults = Children.map(\n props.children, (child) => {\n return React.cloneElement(child, resolveCellDefaults(\n {...childProps, ...child.props})\n );\n }\n );\n\n // Add column counts to each cell's props\n const childrenWithColumnCounts = resolveColumnCounts({\n children: childrenWithDefaults,\n breakpoints: props.breakpoints\n });\n\n // Resolve the final cell styles\n return Children.map(childrenWithColumnCounts, (child) => {\n return React.cloneElement(child, {\n style: resolveCellStyles(child.props)\n });\n });\n};\n\nexport default resolveCells;\n\n\n\n// WEBPACK FOOTER //\n// ./components/util/resolve-cells.js","const prune = (object) => {\n return Object.keys(object).reduce((acc, key) => {\n return object[key] === undefined ? acc : {...acc, [key]: object[key]};\n }, {});\n};\n\nconst resolveCellDefaults = (props) => {\n const gridDefault = {\n width: props.cellWidth,\n horizontalAlign: props.cellAlign,\n verticalAlign: props.cellVerticalAlign,\n gutter: props.gutter\n };\n\n const cellDefault = {\n width: props.width,\n horizontalAlign: props.align,\n verticalAlign: props.verticalAlign,\n order: props.order\n };\n\n const breakpoints = [\"small\", \"medium\", \"large\", \"xlarge\"].map((size) => {\n return {\n mediaQuery: props.breakpoints[size],\n gridBreakpointDefault: {\n width: props[`${size}CellWidth`],\n horizontalAlign: props[`${size}CellAlign`],\n verticalAlign: props[`${size}CellVerticalAlign`]\n },\n cellBreakpointDefault: {\n width: props[`${size}Width`],\n horizontalAlign: props[`${size}Align`],\n verticalAlign: props[`${size}VerticalAlign`],\n order: props[`${size}Order`]\n }\n };\n });\n\n return breakpoints.reduce((acc, breakpoint) => {\n // Extract the media query and the breakpoint cell configs\n const {\n mediaQuery,\n gridBreakpointDefault,\n cellBreakpointDefault\n } = breakpoint;\n\n // Determine the final cell configuration.\n // Uses these sources for cell styles, in order of precedence:\n // - Grid default\n // - Grid breakpoint default\n // - Cell default\n // - Cell breakpoint default\n const cellConfig = {\n ...prune(gridDefault),\n ...prune(gridBreakpointDefault),\n ...prune(cellDefault),\n ...prune(cellBreakpointDefault)\n };\n\n return {...acc, [mediaQuery]: cellConfig};\n }, {});\n};\n\nexport default resolveCellDefaults;\n\n\n\n// WEBPACK FOOTER //\n// ./components/util/resolve-cell-defaults.js","/* eslint-disable new-cap */\nimport React, { Children } from \"react\";\n\nimport initial from \"lodash.initial\";\nimport last from \"lodash.last\";\nimport parseFraction from \"./parse-fraction\";\n\nconst resolveColumnCounts = ({ children, breakpoints }) => {\n // Create an array of column counts that matches\n // the indices of the cell array. This way, each\n // cell knows about how many columns its parent\n // row contains and therefore can calculate\n // gutters correctly.\n\n // The data pipeline looks like this:\n // [[CellProps, CellProps], [CellProps, CellProps, CellProps]] ->\n // [[2, 2], [3, 3, 3]] ->\n // [2, 2, 3, 3, 3]\n\n // The indices of the final array align with the\n // indices of the child cell array.\n const columnCounts = Object.keys(breakpoints)\n .reduce((all, breakpoint) => {\n const mediaQuery = breakpoints[breakpoint];\n return {\n ...all,\n [mediaQuery]: children.reduce((acc, cell) => {\n const breakpointCell = cell.props[mediaQuery];\n\n // On the first fold, add a new subarray\n // with the first cell props.\n if (!acc.length) {\n return [[breakpointCell]];\n }\n\n const rest = initial(acc);\n const row = last(acc);\n\n // If the sum of the current and previous\n // cells is gte 1, leave the current\n // subarray and start a new one with\n // the current cell\n const sum = row\n .map((column) => parseFraction(column.width))\n .reduce((previous, width) => previous + width);\n if (sum >= 1) {\n return [...acc, [breakpointCell]];\n }\n\n return [...rest, [...row, breakpointCell]];\n }, [])\n .map((row) => row.map(() => row.length))\n .reduce((acc, row) => acc.concat(row))\n };\n }, {});\n\n // Add the column counts to the cell props.\n return Children.map(children, (cell, index) => {\n const propsWithColumnCounts = Object.keys(columnCounts)\n .reduce((acc, breakpoint) => {\n const columnCount = columnCounts[breakpoint][index];\n const cellProps = cell.props[breakpoint];\n return {\n ...acc,\n [breakpoint]: {...cellProps, columnCount}\n };\n }, {});\n return React.cloneElement(cell, propsWithColumnCounts);\n });\n};\n\nexport default resolveColumnCounts;\n\n\n\n// WEBPACK FOOTER //\n// ./components/util/resolve-column-counts.js","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\n/**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\nfunction initial(array) {\n var length = array ? array.length : 0;\n return length ? baseSlice(array, 0, -1) : [];\n}\n\nmodule.exports = initial;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/lodash.initial/index.js\n// module id = 7\n// module chunks = 0","/**\n * lodash 3.0.0 (Custom Build) \n * Build: `lodash modern modularize exports=\"npm\" -o ./`\n * Copyright 2012-2015 The Dojo Foundation \n * Based on Underscore.js 1.7.0 \n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/lodash.last/index.js\n// module id = 8\n// module chunks = 0","const validateFraction = (fraction) => {\n const [n, d] = fraction;\n\n // Remove all whitespace and parse numbers\n const numerator = parseInt(n.replace(/\\s/g, \"\"), 10);\n const denominator = parseInt(d.replace(/\\s/g, \"\"), 10);\n const result = numerator / denominator;\n\n if (denominator === 0) {\n throw new Error(\"Your fraction divides by zero.\");\n }\n\n if (!numerator || !denominator) {\n throw new Error(\"Your fraction is missing a numerator or denominator.\");\n }\n\n if (result > 1) {\n throw new Error(\"Your fraction must be less than or equal to 1.\");\n }\n\n return [numerator, denominator];\n};\n\nconst parseFraction = (string) => {\n if (string.trim() === \"1\") {\n return 1;\n }\n\n const [rawNumerator, rawDenominator] = string.split(\"/\");\n const [numerator, denominator] = validateFraction([\n rawNumerator, rawDenominator\n ]);\n\n return numerator / denominator;\n};\n\nexport default parseFraction;\n\n\n\n// WEBPACK FOOTER //\n// ./components/util/parse-fraction.js","/* eslint-disable no-magic-numbers */\nimport merge from \"lodash.merge\";\nimport { mergeStyles } from \"radium/lib/merge-styles\";\nimport parseFraction from \"./parse-fraction\";\n\nconst parseUnit = (value) => {\n // http://stackoverflow.com/questions/2868947/split1px-into-1px-1-px-in-javascript\n const matches = value.match(/^(\\d+(?:\\.\\d+)?)(.*)$/);\n const [, number, unit] = matches;\n return { number, unit };\n};\n\nconst resolveCellGutter = ({ gutter, columnCount }) => {\n const { number, unit } = parseUnit(gutter);\n return `${(number - (number / columnCount))}${unit}`;\n};\n\nconst resolveCellFlexBasis = ({ width, gutter, columnCount }) => {\n const MULTIPLIER = 100;\n\n // Full-width cells have no gutter\n if (width === 1) {\n return \"100%\";\n }\n\n const finalGutter = resolveCellGutter({ gutter, columnCount });\n\n return `calc(${width * MULTIPLIER}% - ${finalGutter})`;\n};\n\n// Merge Radium style arrays and leave\n// normal style objects untouched\nconst resolvePropStyles = (styles) => {\n if (styles && Array.isArray(styles)) {\n return mergeStyles(styles);\n }\n return styles ? styles : {};\n};\n\nconst resolveCellStyles = (props) => {\n // Translate grid-speak to flexbox-speak\n const alignmentMap = {\n left: \"flex-start\",\n center: \"center\",\n right: \"flex-end\",\n top: \"flex-start\",\n middle: \"center\",\n bottom: \"flex-end\"\n };\n\n const mediaQueries = Object.keys(props)\n .filter((key) => key.indexOf(\"@media\") !== -1);\n\n const cellStyle = mediaQueries.reduce((acc, mediaQuery) => {\n const breakpointStyles = props[mediaQuery];\n\n return {\n ...acc,\n [mediaQuery]: {\n display: \"flex\",\n flexBasis: resolveCellFlexBasis({\n width: parseFraction(breakpointStyles.width),\n gutter: breakpointStyles.gutter,\n columnCount: breakpointStyles.columnCount\n }),\n alignItems: alignmentMap[breakpointStyles.verticalAlign],\n justifyContent: alignmentMap[breakpointStyles.horizontalAlign],\n order: breakpointStyles.order ? breakpointStyles.order : \"initial\"\n }\n };\n }, {});\n\n // Deep merge here so that custom media query\n // styles don't get obliterated by the defaults\n return merge(\n cellStyle,\n resolvePropStyles(props.style)\n );\n};\n\nexport default resolveCellStyles;\n\n\n\n// WEBPACK FOOTER //\n// ./components/util/resolve-cell-styles.js","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (typeof key == 'number' && value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n if (!(isArray(source) || isTypedArray(source))) {\n var props = baseKeysIn(source);\n }\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(object[key], srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n });\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = object[key],\n srcValue = source[key],\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n newValue = srcValue;\n if (isArray(srcValue) || isTypedArray(srcValue)) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else {\n isCommon = false;\n newValue = baseClone(srcValue, true);\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n isCommon = false;\n newValue = baseClone(srcValue, true);\n }\n else {\n newValue = objValue;\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) ||\n objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/lodash.merge/index.js\n// module id = 11\n// module chunks = 0","module.exports = function(module) {\n\tif(!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tmodule.children = [];\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/webpack/buildin/module.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nexports.isNestedStyle = isNestedStyle;\nexports.mergeStyles = mergeStyles;\nfunction isNestedStyle(value) {\n // Don't merge objects overriding toString, since they should be converted\n // to string values.\n return value && value.constructor === Object && value.toString === Object.prototype.toString;\n}\n\n// Merge style objects. Deep merge plain object values.\nfunction mergeStyles(styles) {\n var result = {};\n\n styles.forEach(function (style) {\n if (!style || (typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') {\n return;\n }\n\n if (Array.isArray(style)) {\n style = mergeStyles(style);\n }\n\n Object.keys(style).forEach(function (key) {\n // Simple case, nothing nested\n if (!isNestedStyle(style[key]) || !isNestedStyle(result[key])) {\n result[key] = style[key];\n return;\n }\n\n // If nested media, don't merge the nested styles, append a space to the\n // end (benign when converted to CSS). This way we don't end up merging\n // media queries that appear later in the chain with those that appear\n // earlier.\n if (key.indexOf('@media') === 0) {\n var newKey = key;\n while (true) {\n // eslint-disable-line no-constant-condition\n newKey += ' ';\n if (!result[newKey]) {\n result[newKey] = style[key];\n return;\n }\n }\n }\n\n // Merge all other nested styles recursively\n result[key] = mergeStyles([result[key], style[key]]);\n });\n });\n\n return result;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/radium/lib/merge-styles.js\n// module id = 13\n// module chunks = 0","/* eslint-disable new-cap */\nimport React, { PropTypes } from \"react\";\nimport Radium from \"radium\";\n\nconst Cell = (props) => {\n return (\n \n {props.children}\n
\n );\n};\n\nconst horizontalPropType = PropTypes.oneOf([\"left\", \"center\", \"right\"]);\nconst verticalPropType = PropTypes.oneOf([\"top\", \"middle\", \"bottom\"]);\nCell.propTypes = {\n width: PropTypes.string,\n horizontalAlign: horizontalPropType,\n verticalAlign: verticalPropType,\n order: PropTypes.number,\n\n smallWidth: PropTypes.string,\n smallHorizontalAlign: horizontalPropType,\n smallVerticalAlign: verticalPropType,\n smallOrder: PropTypes.number,\n\n mediumWidth: PropTypes.string,\n mediumHorizontalAlign: horizontalPropType,\n mediumVerticalAlign: verticalPropType,\n mediumOrder: PropTypes.number,\n\n largeWidth: PropTypes.string,\n largeHorizontalAlign: horizontalPropType,\n largeVerticalAlign: verticalPropType,\n largeOrder: PropTypes.number,\n\n xlargeWidth: PropTypes.string,\n xlargeHorizontalAlign: horizontalPropType,\n xlargeVerticalAlign: verticalPropType,\n xlargeOrder: PropTypes.number,\n\n children: PropTypes.node,\n style: PropTypes.object\n};\n\nexport default Radium(Cell);\n\n\n\n// WEBPACK FOOTER //\n// ./components/cell.js"],"sourceRoot":""}
--------------------------------------------------------------------------------
/dist/radium-grid.min.js:
--------------------------------------------------------------------------------
1 | !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("radium")):"function"==typeof define&&define.amd?define(["react","radium"],r):"object"==typeof exports?exports.RadiumGrid=r(require("react"),require("radium")):t.RadiumGrid=r(t.React,t.Radium)}(this,function(t,r){return function(t){function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"__esModule",{value:!0}),r.Cell=r.Grid=void 0;var o=e(1),i=n(o),u=e(14),a=n(u);r.Grid=i.default,r.Cell=a.default},function(t,r,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"__esModule",{value:!0});var o=Object.assign||function(t){for(var r=1;r=0||Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}Object.defineProperty(r,"__esModule",{value:!0});var i=Object.assign||function(t){for(var r=1;r=1?[].concat(i(t),[[e]]):[].concat(i(n),[[].concat(i(o),[e])])},[]).map(function(t){return t.map(function(){return t.length})}).reduce(function(t,r){return t.concat(r)})))},{});return a.Children.map(r,function(t,r){var e=Object.keys(n).reduce(function(e,i){var a=n[i][r],c=t.props[i];return u({},e,o({},i,u({},c,{columnCount:a})))},{});return c.default.cloneElement(t,e)})};r.default=v},function(t,r){function e(t,r,e){var n=-1,o=t.length;r<0&&(r=-r>o?0:o+r),e=e>o?o:e,e<0&&(e+=o),o=r>e?0:e-r>>>0,r>>>=0;for(var i=Array(o);++n1)throw new Error("Your fraction must be less than or equal to 1.");return[i,u]},o=function(t){if("1"===t.trim())return 1;var r=t.split("/"),o=e(r,2),i=o[0],u=o[1],a=n([i,u]),c=e(a,2),l=c[0],f=c[1];return l/f};r.default=o},function(t,r,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}Object.defineProperty(r,"__esModule",{value:!0});var i=Object.assign||function(t){for(var r=1;r-1}function T(t,r){var e=this.__data__,n=G(e,t);return n<0?e.push([t,r]):e[n][1]=r,this}function C(t){var r=-1,e=t?t.length:0;for(this.clear();++r1?e[o-1]:void 0,u=o>2?e[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,u&&jt(e[0],e[1],u)&&(i=o<3?void 0:i,o=1),r=Object(r);++n-1&&t%1==0&&t-1&&t%1==0&&t<=Gt}function Wt(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function Vt(t){return!!t&&"object"==typeof t}function zt(t){if(!Vt(t)||Rr.call(t)!=Zt||p(t))return!1;var r=Hr(t);if(null===r)return!0;var e=$r.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&Br.call(e)==Dr}function It(t){return st(t,$t(t))}function Bt(t){return St(t)?R(t):K(t)}function $t(t){return St(t)?R(t,!0):X(t)}function Dt(){return[]}function Rt(){return!1}var Ft=200,qt="__lodash_hash_undefined__",Gt=9007199254740991,Ut="[object Arguments]",Ht="[object Array]",Yt="[object Boolean]",Lt="[object Date]",Nt="[object Error]",Qt="[object Function]",Jt="[object GeneratorFunction]",Kt="[object Map]",Xt="[object Number]",Zt="[object Object]",tr="[object Promise]",rr="[object RegExp]",er="[object Set]",nr="[object String]",or="[object Symbol]",ir="[object WeakMap]",ur="[object ArrayBuffer]",ar="[object DataView]",cr="[object Float32Array]",lr="[object Float64Array]",fr="[object Int8Array]",sr="[object Int16Array]",pr="[object Int32Array]",dr="[object Uint8Array]",yr="[object Uint8ClampedArray]",vr="[object Uint16Array]",hr="[object Uint32Array]",gr=/[\\^$.*+?()[\]{}|]/g,br=/\w*$/,mr=/^\[object .+?Constructor\]$/,_r=/^(?:0|[1-9]\d*)$/,jr={};jr[cr]=jr[lr]=jr[fr]=jr[sr]=jr[pr]=jr[dr]=jr[yr]=jr[vr]=jr[hr]=!0,jr[Ut]=jr[Ht]=jr[ur]=jr[Yt]=jr[ar]=jr[Lt]=jr[Nt]=jr[Qt]=jr[Kt]=jr[Xt]=jr[Zt]=jr[rr]=jr[er]=jr[nr]=jr[ir]=!1;var Ar={};Ar[Ut]=Ar[Ht]=Ar[ur]=Ar[ar]=Ar[Yt]=Ar[Lt]=Ar[cr]=Ar[lr]=Ar[fr]=Ar[sr]=Ar[pr]=Ar[Kt]=Ar[Xt]=Ar[Zt]=Ar[rr]=Ar[er]=Ar[nr]=Ar[or]=Ar[dr]=Ar[yr]=Ar[vr]=Ar[hr]=!0,Ar[Nt]=Ar[Qt]=Ar[ir]=!1;var Or="object"==typeof t&&t&&t.Object===Object&&t,wr="object"==typeof self&&self&&self.Object===Object&&self,Pr=Or||wr||Function("return this")(),xr="object"==typeof r&&r&&!r.nodeType&&r,Tr=xr&&"object"==typeof e&&e&&!e.nodeType&&e,Cr=Tr&&Tr.exports===xr,Sr=Cr&&Or.process,kr=function(){try{return Sr&&Sr.binding("util")}catch(t){}}(),Mr=kr&&kr.isTypedArray,Er=Array.prototype,Wr=Function.prototype,Vr=Object.prototype,zr=Pr["__core-js_shared__"],Ir=function(){var t=/[^.]+$/.exec(zr&&zr.keys&&zr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Br=Wr.toString,$r=Vr.hasOwnProperty,Dr=Br.call(Object),Rr=Vr.toString,Fr=RegExp("^"+Br.call($r).replace(gr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qr=Cr?Pr.Buffer:void 0,Gr=Pr.Symbol,Ur=Pr.Uint8Array,Hr=y(Object.getPrototypeOf,Object),Yr=Object.create,Lr=Vr.propertyIsEnumerable,Nr=Er.splice,Qr=Object.getOwnPropertySymbols,Jr=qr?qr.isBuffer:void 0,Kr=y(Object.keys,Object),Xr=Math.max,Zr=ht(Pr,"DataView"),te=ht(Pr,"Map"),re=ht(Pr,"Promise"),ee=ht(Pr,"Set"),ne=ht(Pr,"WeakMap"),oe=ht(Object,"create"),ie=xt(Zr),ue=xt(te),ae=xt(re),ce=xt(ee),le=xt(ne),fe=Gr?Gr.prototype:void 0,se=fe?fe.valueOf:void 0;h.prototype.clear=g,h.prototype.delete=b,h.prototype.get=m,h.prototype.has=_,h.prototype.set=j,A.prototype.clear=O,A.prototype.delete=w,A.prototype.get=P,A.prototype.has=x,A.prototype.set=T,C.prototype.clear=S,C.prototype.delete=k,C.prototype.get=M,C.prototype.has=E,C.prototype.set=W,V.prototype.clear=z,V.prototype.delete=I,V.prototype.get=B,V.prototype.has=$,V.prototype.set=D;var pe=Qr?y(Qr,Object):Dt,de=N;(Zr&&de(new Zr(new ArrayBuffer(1)))!=ar||te&&de(new te)!=Kt||re&&de(re.resolve())!=tr||ee&&de(new ee)!=er||ne&&de(new ne)!=ir)&&(de=function(t){var r=Rr.call(t),e=r==Zt?t.constructor:void 0,n=e?xt(e):void 0;if(n)switch(n){case ie:return ar;case ue:return Kt;case ae:return tr;case ce:return er;case le:return ir}return r});var ye=Array.isArray,ve=Jr||Rt,he=Mr?f(Mr):J,ge=dt(function(t,r,e){Z(t,r,e)});e.exports=ge}).call(r,function(){return this}(),e(12)(t))},function(t,r){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,r){"use strict";function e(t){return t&&t.constructor===Object&&t.toString===Object.prototype.toString}function n(t){var r={};return t.forEach(function(t){t&&"object"===("undefined"==typeof t?"undefined":o(t))&&(Array.isArray(t)&&(t=n(t)),Object.keys(t).forEach(function(o){if(!e(t[o])||!e(r[o]))return void(r[o]=t[o]);if(0===o.indexOf("@media"))for(var i=o;;)if(i+=" ",!r[i])return void(r[i]=t[o]);r[o]=n([r[o],t[o]])}))}),r}Object.defineProperty(r,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};r.isNestedStyle=e,r.mergeStyles=n},function(t,r,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"__esModule",{value:!0});var o=e(2),i=n(o),u=e(3),a=n(u),c=function(t){return i.default.createElement("div",{style:t.style},t.children)},l=o.PropTypes.oneOf(["left","center","right"]),f=o.PropTypes.oneOf(["top","middle","bottom"]);c.propTypes={width:o.PropTypes.string,horizontalAlign:l,verticalAlign:f,order:o.PropTypes.number,smallWidth:o.PropTypes.string,smallHorizontalAlign:l,smallVerticalAlign:f,smallOrder:o.PropTypes.number,mediumWidth:o.PropTypes.string,mediumHorizontalAlign:l,mediumVerticalAlign:f,mediumOrder:o.PropTypes.number,largeWidth:o.PropTypes.string,largeHorizontalAlign:l,largeVerticalAlign:f,largeOrder:o.PropTypes.number,xlargeWidth:o.PropTypes.string,xlargeHorizontalAlign:l,xlargeVerticalAlign:f,xlargeOrder:o.PropTypes.number,children:o.PropTypes.node,style:o.PropTypes.object},r.default=(0,a.default)(c)}])});
2 | //# sourceMappingURL=radium-grid.min.js.map
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "radium-grid",
3 | "version": "2.0.3",
4 | "description": "Radium grid component",
5 | "main": "lib/index.js",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/FormidableLabs/radium-grid.git"
9 | },
10 | "license": "MIT",
11 | "bugs": {
12 | "url": "https://github.com/FormidableLabs/radium-grid/issues"
13 | },
14 | "homepage": "https://github.com/FormidableLabs/radium-grid",
15 | "scripts": {
16 | "preversion": "builder run npm:preversion",
17 | "version": "builder run npm:version",
18 | "test": "builder run npm:test"
19 | },
20 | "dependencies": {
21 | "builder": "^3.1.0",
22 | "builder-radium-component": "^2.1.2",
23 | "coveralls": "^2.11.14",
24 | "lodash.initial": "^4.1.1",
25 | "lodash.last": "^3.0.0",
26 | "lodash.merge": "^4.6.0"
27 | },
28 | "devDependencies": {
29 | "babel-polyfill": "^6.16.0",
30 | "babel-preset-es2015": "^6.18.0",
31 | "babel-register": "^6.18.0",
32 | "builder": "^3.1.0",
33 | "builder-radium-component-dev": "^2.1.2",
34 | "chai": "^3.2.0",
35 | "mocha": "^3.1.2",
36 | "radium": "^0.18.1",
37 | "react": "^15.3.2",
38 | "react-addons-test-utils": "^15.3.2",
39 | "react-dom": "^15.3.2",
40 | "sinon": "^1.17.6",
41 | "sinon-chai": "^2.8.0",
42 | "webpack-dev-server": "^1.16.2"
43 | },
44 | "peerDependencies": {
45 | "radium": "^0.18.1",
46 | "react": "^0.14.0 || ^15.0.0-0",
47 | "react-dom": "^0.14.0 || ^15.0.0-0"
48 | },
49 | "author": "Tyler Thompson",
50 | "sideEffects": false
51 | }
52 |
--------------------------------------------------------------------------------
/src/components/cell.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable new-cap */
2 | import React, { PropTypes } from "react";
3 | import Radium from "radium";
4 |
5 | const Cell = (props) => {
6 | return (
7 |
8 | {props.children}
9 |
10 | );
11 | };
12 |
13 | const horizontalPropType = PropTypes.oneOf(["left", "center", "right"]);
14 | const verticalPropType = PropTypes.oneOf(["top", "middle", "bottom"]);
15 | Cell.propTypes = {
16 | width: PropTypes.string,
17 | horizontalAlign: horizontalPropType,
18 | verticalAlign: verticalPropType,
19 | order: PropTypes.number,
20 |
21 | smallWidth: PropTypes.string,
22 | smallHorizontalAlign: horizontalPropType,
23 | smallVerticalAlign: verticalPropType,
24 | smallOrder: PropTypes.number,
25 |
26 | mediumWidth: PropTypes.string,
27 | mediumHorizontalAlign: horizontalPropType,
28 | mediumVerticalAlign: verticalPropType,
29 | mediumOrder: PropTypes.number,
30 |
31 | largeWidth: PropTypes.string,
32 | largeHorizontalAlign: horizontalPropType,
33 | largeVerticalAlign: verticalPropType,
34 | largeOrder: PropTypes.number,
35 |
36 | xlargeWidth: PropTypes.string,
37 | xlargeHorizontalAlign: horizontalPropType,
38 | xlargeVerticalAlign: verticalPropType,
39 | xlargeOrder: PropTypes.number,
40 |
41 | children: PropTypes.node,
42 | style: PropTypes.object
43 | };
44 |
45 | export default Radium(Cell);
46 |
--------------------------------------------------------------------------------
/src/components/grid.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable new-cap */
2 | import React, { PropTypes } from "react";
3 | import Radium from "radium";
4 | import resolveCells from "./util/resolve-cells";
5 |
6 | const Grid = (props) => {
7 | const styles = {
8 | display: "flex",
9 | flexDirection: "row",
10 | flexWrap: "wrap",
11 | justifyContent: "space-between",
12 | minWidth: "100%",
13 | ...props.style
14 | };
15 |
16 | return (
17 |
18 | {resolveCells(props)}
19 |
20 | );
21 | };
22 |
23 | Grid.propTypes = {
24 | cellWidth: PropTypes.string,
25 | cellAlign: PropTypes.string,
26 | cellVerticalAlign: PropTypes.string,
27 |
28 | smallCellWidth: PropTypes.string,
29 | smallCellAlign: PropTypes.string,
30 | smallCellVerticalAlign: PropTypes.string,
31 |
32 | mediumCellWidth: PropTypes.string,
33 | mediumCellAlign: PropTypes.string,
34 | mediumCellVerticalAlign: PropTypes.string,
35 |
36 | largeCellWidth: PropTypes.string,
37 | largeCellAlign: PropTypes.string,
38 | largeCellVerticalAlign: PropTypes.string,
39 |
40 | xlargeCellWidth: PropTypes.string,
41 | xlargeCellAlign: PropTypes.string,
42 | xlargeCellVerticalAlign: PropTypes.string,
43 |
44 | breakpoints: PropTypes.shape({
45 | small: PropTypes.string,
46 | medium: PropTypes.string,
47 | large: PropTypes.string,
48 | xlarge: PropTypes.string
49 | }),
50 |
51 | gutter: PropTypes.string,
52 |
53 | style: PropTypes.object,
54 | children: PropTypes.node
55 | };
56 |
57 | Grid.defaultProps = {
58 | cellWidth: "1/3",
59 | cellAlign: "left",
60 | cellVerticalAlign: "top",
61 |
62 | breakpoints: {
63 | small: "@media only screen and (max-width: 640px)",
64 | medium: "@media only screen and (min-width: 641px) and (max-width: 1024px)",
65 | large: "@media only screen and (min-width: 1025px) and (max-width: 1440px)",
66 | xlarge: "@media only screen and (min-width: 1441px)"
67 | },
68 |
69 | gutter: "16px"
70 | };
71 |
72 | export default Radium(Grid);
73 |
--------------------------------------------------------------------------------
/src/components/util/parse-fraction.js:
--------------------------------------------------------------------------------
1 | const validateFraction = (fraction) => {
2 | const [n, d] = fraction;
3 |
4 | // Remove all whitespace and parse numbers
5 | const numerator = parseInt(n.replace(/\s/g, ""), 10);
6 | const denominator = parseInt(d.replace(/\s/g, ""), 10);
7 | const result = numerator / denominator;
8 |
9 | if (denominator === 0) {
10 | throw new Error("Your fraction divides by zero.");
11 | }
12 |
13 | if (!numerator || !denominator) {
14 | throw new Error("Your fraction is missing a numerator or denominator.");
15 | }
16 |
17 | if (result > 1) {
18 | throw new Error("Your fraction must be less than or equal to 1.");
19 | }
20 |
21 | return [numerator, denominator];
22 | };
23 |
24 | const parseFraction = (string) => {
25 | if (string.trim() === "1") {
26 | return 1;
27 | }
28 |
29 | const [rawNumerator, rawDenominator] = string.split("/");
30 | const [numerator, denominator] = validateFraction([
31 | rawNumerator, rawDenominator
32 | ]);
33 |
34 | return numerator / denominator;
35 | };
36 |
37 | export default parseFraction;
38 |
--------------------------------------------------------------------------------
/src/components/util/resolve-cell-defaults.js:
--------------------------------------------------------------------------------
1 | const prune = (object) => {
2 | return Object.keys(object).reduce((acc, key) => {
3 | return object[key] === undefined ? acc : {...acc, [key]: object[key]};
4 | }, {});
5 | };
6 |
7 | const resolveCellDefaults = (props) => {
8 | const gridDefault = {
9 | width: props.cellWidth,
10 | horizontalAlign: props.cellAlign,
11 | verticalAlign: props.cellVerticalAlign,
12 | gutter: props.gutter
13 | };
14 |
15 | const cellDefault = {
16 | width: props.width,
17 | horizontalAlign: props.align,
18 | verticalAlign: props.verticalAlign,
19 | order: props.order
20 | };
21 |
22 | const breakpoints = ["small", "medium", "large", "xlarge"].map((size) => {
23 | return {
24 | mediaQuery: props.breakpoints[size],
25 | gridBreakpointDefault: {
26 | width: props[`${size}CellWidth`],
27 | horizontalAlign: props[`${size}CellAlign`],
28 | verticalAlign: props[`${size}CellVerticalAlign`]
29 | },
30 | cellBreakpointDefault: {
31 | width: props[`${size}Width`],
32 | horizontalAlign: props[`${size}Align`],
33 | verticalAlign: props[`${size}VerticalAlign`],
34 | order: props[`${size}Order`]
35 | }
36 | };
37 | });
38 |
39 | return breakpoints.reduce((acc, breakpoint) => {
40 | // Extract the media query and the breakpoint cell configs
41 | const {
42 | mediaQuery,
43 | gridBreakpointDefault,
44 | cellBreakpointDefault
45 | } = breakpoint;
46 |
47 | // Determine the final cell configuration.
48 | // Uses these sources for cell styles, in order of precedence:
49 | // - Grid default
50 | // - Grid breakpoint default
51 | // - Cell default
52 | // - Cell breakpoint default
53 | const cellConfig = {
54 | ...prune(gridDefault),
55 | ...prune(gridBreakpointDefault),
56 | ...prune(cellDefault),
57 | ...prune(cellBreakpointDefault)
58 | };
59 |
60 | return {...acc, [mediaQuery]: cellConfig};
61 | }, {});
62 | };
63 |
64 | export default resolveCellDefaults;
65 |
--------------------------------------------------------------------------------
/src/components/util/resolve-cell-styles.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-magic-numbers */
2 | import merge from "lodash.merge";
3 | import { mergeStyles } from "radium/lib/merge-styles";
4 | import parseFraction from "./parse-fraction";
5 |
6 | const parseUnit = (value) => {
7 | // http://stackoverflow.com/questions/2868947/split1px-into-1px-1-px-in-javascript
8 | const matches = value.match(/^(\d+(?:\.\d+)?)(.*)$/);
9 | const [, number, unit] = matches;
10 | return { number, unit };
11 | };
12 |
13 | const resolveCellGutter = ({ gutter, columnCount }) => {
14 | const { number, unit } = parseUnit(gutter);
15 | return `${(number - (number / columnCount))}${unit}`;
16 | };
17 |
18 | const resolveCellFlexBasis = ({ width, gutter, columnCount }) => {
19 | const MULTIPLIER = 100;
20 |
21 | // Full-width cells have no gutter
22 | if (width === 1) {
23 | return "100%";
24 | }
25 |
26 | const finalGutter = resolveCellGutter({ gutter, columnCount });
27 |
28 | return `calc(${width * MULTIPLIER}% - ${finalGutter})`;
29 | };
30 |
31 | // Merge Radium style arrays and leave
32 | // normal style objects untouched
33 | const resolvePropStyles = (styles) => {
34 | if (styles && Array.isArray(styles)) {
35 | return mergeStyles(styles);
36 | }
37 | return styles ? styles : {};
38 | };
39 |
40 | const resolveCellStyles = (props) => {
41 | // Translate grid-speak to flexbox-speak
42 | const alignmentMap = {
43 | left: "flex-start",
44 | center: "center",
45 | right: "flex-end",
46 | top: "flex-start",
47 | middle: "center",
48 | bottom: "flex-end"
49 | };
50 |
51 | const mediaQueries = Object.keys(props)
52 | .filter((key) => key.indexOf("@media") !== -1);
53 |
54 | const cellStyle = mediaQueries.reduce((acc, mediaQuery) => {
55 | const breakpointStyles = props[mediaQuery];
56 |
57 | return {
58 | ...acc,
59 | [mediaQuery]: {
60 | display: "flex",
61 | flexBasis: resolveCellFlexBasis({
62 | width: parseFraction(breakpointStyles.width),
63 | gutter: breakpointStyles.gutter,
64 | columnCount: breakpointStyles.columnCount
65 | }),
66 | alignItems: alignmentMap[breakpointStyles.verticalAlign],
67 | justifyContent: alignmentMap[breakpointStyles.horizontalAlign],
68 | order: breakpointStyles.order ? breakpointStyles.order : "initial"
69 | }
70 | };
71 | }, {});
72 |
73 | // Deep merge here so that custom media query
74 | // styles don't get obliterated by the defaults
75 | return merge(
76 | cellStyle,
77 | resolvePropStyles(props.style)
78 | );
79 | };
80 |
81 | export default resolveCellStyles;
82 |
--------------------------------------------------------------------------------
/src/components/util/resolve-cells.js:
--------------------------------------------------------------------------------
1 | import React, { Children } from "react";
2 | import resolveCellDefaults from "./resolve-cell-defaults";
3 | import resolveColumnCounts from "./resolve-column-counts";
4 | import resolveCellStyles from "./resolve-cell-styles";
5 |
6 | const resolveCells = (props) => {
7 | // Resolve the final style defaults for each cell
8 | const {children, style, ...childProps } = props; // eslint-disable-line no-unused-vars
9 | const childrenWithDefaults = Children.map(
10 | props.children, (child) => {
11 | return React.cloneElement(child, resolveCellDefaults(
12 | {...childProps, ...child.props})
13 | );
14 | }
15 | );
16 |
17 | // Add column counts to each cell's props
18 | const childrenWithColumnCounts = resolveColumnCounts({
19 | children: childrenWithDefaults,
20 | breakpoints: props.breakpoints
21 | });
22 |
23 | // Resolve the final cell styles
24 | return Children.map(childrenWithColumnCounts, (child) => {
25 | return React.cloneElement(child, {
26 | style: resolveCellStyles(child.props)
27 | });
28 | });
29 | };
30 |
31 | export default resolveCells;
32 |
--------------------------------------------------------------------------------
/src/components/util/resolve-column-counts.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable new-cap */
2 | import React, { Children } from "react";
3 |
4 | import initial from "lodash.initial";
5 | import last from "lodash.last";
6 | import parseFraction from "./parse-fraction";
7 |
8 | const resolveColumnCounts = ({ children, breakpoints }) => {
9 | // Create an array of column counts that matches
10 | // the indices of the cell array. This way, each
11 | // cell knows about how many columns its parent
12 | // row contains and therefore can calculate
13 | // gutters correctly.
14 |
15 | // The data pipeline looks like this:
16 | // [[CellProps, CellProps], [CellProps, CellProps, CellProps]] ->
17 | // [[2, 2], [3, 3, 3]] ->
18 | // [2, 2, 3, 3, 3]
19 |
20 | // The indices of the final array align with the
21 | // indices of the child cell array.
22 | const columnCounts = Object.keys(breakpoints)
23 | .reduce((all, breakpoint) => {
24 | const mediaQuery = breakpoints[breakpoint];
25 | return {
26 | ...all,
27 | [mediaQuery]: children.reduce((acc, cell) => {
28 | const breakpointCell = cell.props[mediaQuery];
29 |
30 | // On the first fold, add a new subarray
31 | // with the first cell props.
32 | if (!acc.length) {
33 | return [[breakpointCell]];
34 | }
35 |
36 | const rest = initial(acc);
37 | const row = last(acc);
38 |
39 | // If the sum of the current and previous
40 | // cells is gte 1, leave the current
41 | // subarray and start a new one with
42 | // the current cell
43 | const sum = row
44 | .map((column) => parseFraction(column.width))
45 | .reduce((previous, width) => previous + width);
46 | if (sum >= 1) {
47 | return [...acc, [breakpointCell]];
48 | }
49 |
50 | return [...rest, [...row, breakpointCell]];
51 | }, [])
52 | .map((row) => row.map(() => row.length))
53 | .reduce((acc, row) => acc.concat(row))
54 | };
55 | }, {});
56 |
57 | // Add the column counts to the cell props.
58 | return Children.map(children, (cell, index) => {
59 | const propsWithColumnCounts = Object.keys(columnCounts)
60 | .reduce((acc, breakpoint) => {
61 | const columnCount = columnCounts[breakpoint][index];
62 | const cellProps = cell.props[breakpoint];
63 | return {
64 | ...acc,
65 | [breakpoint]: {...cellProps, columnCount}
66 | };
67 | }, {});
68 | return React.cloneElement(cell, propsWithColumnCounts);
69 | });
70 | };
71 |
72 | export default resolveColumnCounts;
73 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import GridImport from "./components/grid";
2 | import CellImport from "./components/cell";
3 |
4 | export const Grid = GridImport;
5 | export const Cell = CellImport;
6 |
--------------------------------------------------------------------------------
/test/client/main.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Test setup for client-side tests.
3 | *
4 | * Intended for:
5 | * - Karma tests: `builder run test-frontend`
6 | * - Browser tests: `http://localhost:3000/test/client/test.html`
7 | */
8 | /* globals window:false */
9 | const chai = require("chai");
10 | const sinonChai = require("sinon-chai");
11 |
12 | // --------------------------------------------------------------------------
13 | // Chai / Sinon / Mocha configuration.
14 | // --------------------------------------------------------------------------
15 | // Exports
16 | window.expect = chai.expect;
17 |
18 | // Plugins
19 | chai.use(sinonChai);
20 |
21 | // Mocha (part of static include).
22 | window.mocha.setup({
23 | ui: "bdd",
24 | bail: false
25 | });
26 |
27 | // --------------------------------------------------------------------------
28 | // Bootstrap
29 | // --------------------------------------------------------------------------
30 | // Use webpack to include all app code _except_ the entry point so we can get
31 | // code coverage in the bundle, whether tested or not.
32 | const srcReq = require.context("src", true, /\.jsx?$/);
33 | srcReq.keys().map(srcReq);
34 |
35 | // Use webpack to infer and `require` tests automatically.
36 | const testsReq = require.context(".", true, /\.spec.jsx?$/);
37 | testsReq.keys().map(testsReq);
38 |
39 | // Only start mocha in browser.
40 | if (!window.__karma__) {
41 | window.mocha.run();
42 | }
43 |
--------------------------------------------------------------------------------
/test/client/spec/components/grid.spec.jsx:
--------------------------------------------------------------------------------
1 | /* eslint-disable new-cap,max-statements,no-unused-expressions*/
2 |
3 | // Help PhantomJS out
4 | require("babel-polyfill");
5 |
6 | import React from "react";
7 | import { Grid, Cell } from "../../../../src/index";
8 | import resolveCells from "../../../../src/components/util/resolve-cells";
9 |
10 | describe("Grid", () => {
11 | const extractMediaQueries = (childProps) => {
12 | return childProps.map((props) => {
13 | return Object.keys(props).filter(
14 | (key) => !key.search(/@media/g)
15 | );
16 | });
17 | };
18 |
19 | const extractBreakpointStyles = (childProps, exclude = "") => {
20 | return childProps.map((props) => {
21 | return Object.keys(props).filter(
22 | (key) => !key.search(/@media/g)
23 | ).filter((key) => key !== exclude).map(
24 | (mediaQuery) => props.style[mediaQuery]
25 | );
26 | });
27 | };
28 |
29 | const testCellsAllBreakpoints = (cells, tests) => {
30 | expect(cells).to.not.be.empty;
31 | const breakpointStyles = extractBreakpointStyles(
32 | cells.map((cell) => cell.props)
33 | );
34 | for (const breakpointStyle of breakpointStyles) {
35 | for (const style of breakpointStyle) {
36 | tests(style);
37 | }
38 | }
39 | };
40 |
41 | const testCellsAllBreakpointsExcept = (cells, breakpoint, tests) => {
42 | expect(cells).to.not.be.empty;
43 | const breakpointStyles = extractBreakpointStyles(
44 | cells.map((cell) => cell.props),
45 | Grid.defaultProps.breakpoints[breakpoint]
46 | );
47 | for (const breakpointStyle of breakpointStyles) {
48 | for (const style of breakpointStyle) {
49 | tests(style);
50 | }
51 | }
52 | };
53 |
54 | const testCellsOneBreakpoint = (cells, breakpoint, tests) => {
55 | expect(cells).to.not.be.empty;
56 | const breakpointStyle = cells.map(
57 | (cell) => cell.props.style[Grid.defaultProps.breakpoints[breakpoint]]
58 | );
59 | for (const style of breakpointStyle) {
60 | tests(style);
61 | }
62 | };
63 |
64 | it("should map grid breakpoints to Radium media queries", () => {
65 | const grid = (
66 |
67 |
68 | testing
69 | |
70 |
71 | testing!
72 | |
73 |
74 | );
75 | const cells = resolveCells(grid.props);
76 |
77 | const mediaQueries = extractMediaQueries(
78 | cells.map((cell) => cell.props)
79 | );
80 | const expectedMediaQueries = Object.keys(
81 | Grid.defaultProps.breakpoints
82 | ).map((key) => Grid.defaultProps.breakpoints[key]);
83 |
84 | for (const queries of mediaQueries) {
85 | expect(
86 | JSON.stringify(queries)
87 | ).to.equal(
88 | JSON.stringify(expectedMediaQueries)
89 | );
90 | }
91 | });
92 |
93 | it("should be a flex container to allow for custom cell content alignment", () => {
94 | const grid = (
95 |
96 |
97 | testing
98 | |
99 |
100 | testing!
101 | |
102 |
103 | );
104 | const cells = resolveCells(grid.props);
105 | testCellsAllBreakpoints(cells, (style) => {
106 | expect(style).to.have.deep.property("display", "flex");
107 | });
108 | });
109 |
110 | it("should resolve styles to sensible defaults when no props are specified", () => {
111 | const grid = (
112 |
113 |
114 | testing
115 | |
116 |
117 | testing!
118 | |
119 |
120 | );
121 | const cells = resolveCells(grid.props);
122 |
123 | testCellsAllBreakpoints(cells, (style) => {
124 | expect(style).to.have.deep.property("justifyContent", "flex-start");
125 | expect(style).to.have.deep.property("alignItems", "flex-start");
126 | expect(style).to.have.deep.property("flexBasis").with.string("33.333");
127 | });
128 | });
129 |
130 | it(`should resolve styles when these are specified:
131 | 1) grid props`, () => {
132 | const grid = (
133 |
138 |
139 | testing
140 | |
141 |
142 | testing!
143 | |
144 |
145 | );
146 | const cells = resolveCells(grid.props);
147 | testCellsAllBreakpoints(cells, (style) => {
148 | expect(style).to.have.deep.property("justifyContent", "flex-end");
149 | expect(style).to.have.deep.property("alignItems", "flex-end");
150 | expect(style).to.have.deep.property("flexBasis").with.string("25");
151 | });
152 | });
153 |
154 | it(`should resolve styles when these are specified:
155 | 1) grid props
156 | 2) grid breakpoint props`, () => {
157 | const grid = (
158 |
166 |
167 | testing
168 | |
169 |
170 | testing!
171 | |
172 |
173 | );
174 | const cells = resolveCells(grid.props);
175 |
176 | testCellsAllBreakpointsExcept(cells, "small", (style) => {
177 | expect(style).to.have.deep.property("justifyContent", "flex-end");
178 | expect(style).to.have.deep.property("alignItems", "flex-end");
179 | expect(style).to.have.deep.property("flexBasis").with.string("25");
180 | });
181 |
182 | // Check only small breakpoints on all cells
183 | testCellsOneBreakpoint(cells, "small", (style) => {
184 | expect(style).to.have.deep.property("justifyContent", "center");
185 | expect(style).to.have.deep.property("alignItems", "center");
186 | expect(style).to.have.deep.property("flexBasis").with.string("100%");
187 | });
188 | });
189 |
190 | it(`should resolve styles when these are specified:
191 | 1) grid props
192 | 2) grid breakpoint props
193 | 3) cell props`, () => {
194 | const grid = (
195 |
203 |
208 | testing
209 | |
210 |
211 | testing!
212 | |
213 |
214 | testing?
215 | |
216 |
217 | );
218 | const cells = resolveCells(grid.props);
219 | const [cellWithCellProps, ...cellsWithoutCellProps] = cells;
220 |
221 | testCellsAllBreakpoints([cellWithCellProps], (style) => {
222 | expect(style).to.have.deep.property("justifyContent", "flex-start");
223 | expect(style).to.have.deep.property("alignItems", "flex-start");
224 | expect(style).to.have.deep.property("flexBasis").with.string("50%");
225 | });
226 |
227 | // Cells with grid props, excluding small breakpoint
228 | testCellsAllBreakpointsExcept(cellsWithoutCellProps, "small", (style) => {
229 | expect(style).to.have.deep.property("justifyContent", "flex-end");
230 | expect(style).to.have.deep.property("alignItems", "flex-end");
231 | expect(style).to.have.deep.property("flexBasis").with.string("25%");
232 | });
233 |
234 | // Cells with small grid breakpoint props
235 | testCellsOneBreakpoint(cellsWithoutCellProps, "small", (style) => {
236 | expect(style).to.have.deep.property("justifyContent", "center");
237 | expect(style).to.have.deep.property("alignItems", "center");
238 | expect(style).to.have.deep.property("flexBasis").with.string("100%");
239 | });
240 | });
241 |
242 |
243 | it(`should resolve styles when these are specified:
244 | 1) grid props
245 | 2) grid breakpoint props
246 | 3) cell props
247 | 4) cell breakpoint props`, () => {
248 | const grid = (
249 |
257 |
265 | testing
266 | |
267 |
268 | testing!
269 | |
270 |
271 | testing?
272 | |
273 |
274 | );
275 | const cells = resolveCells(grid.props);
276 | const [cellWithCellProps, ...cellsWithoutCellProps] = cells;
277 |
278 | testCellsAllBreakpointsExcept([cellWithCellProps], "small", (style) => {
279 | expect(style).to.have.deep.property("justifyContent", "flex-start");
280 | expect(style).to.have.deep.property("alignItems", "flex-start");
281 | expect(style).to.have.deep.property("flexBasis").with.string("50%");
282 | });
283 |
284 | testCellsOneBreakpoint([cellWithCellProps], "small", (style) => {
285 | expect(style).to.have.deep.property("justifyContent", "flex-end");
286 | expect(style).to.have.deep.property("alignItems", "center");
287 | expect(style).to.have.deep.property("flexBasis").with.string("33.333");
288 | });
289 |
290 | // Cells with grid props, excluding small breakpoint
291 | testCellsAllBreakpointsExcept(cellsWithoutCellProps, "small", (style) => {
292 | expect(style).to.have.deep.property("justifyContent", "flex-end");
293 | expect(style).to.have.deep.property("alignItems", "flex-end");
294 | expect(style).to.have.deep.property("flexBasis").with.string("25%");
295 | });
296 |
297 | // Cells with small grid breakpoint props
298 | testCellsOneBreakpoint(cellsWithoutCellProps, "small", (style) => {
299 | expect(style).to.have.deep.property("justifyContent", "center");
300 | expect(style).to.have.deep.property("alignItems", "center");
301 | expect(style).to.have.deep.property("flexBasis").with.string("100%");
302 | });
303 | });
304 |
305 | // Pairwise tests
306 | // Grid Grid breakpoint Cell Cell breakpoint
307 | // no yes no yes
308 | // yes no yes no
309 | // yes yes yes yes
310 | // yes no no yes
311 | // no yes no no
312 | // no no yes no
313 | it(`should resolve styles when these are specified:
314 | 1) grid breakpoint props
315 | 2) cell breakpoint props`, () => {
316 | const grid = (
317 |
322 |
327 | testing
328 | |
329 |
330 | testing!
331 | |
332 |
333 | testing?
334 | |
335 |
336 | );
337 | const cells = resolveCells(grid.props);
338 | const [cellWithCellProps, ...cellsWithoutCellProps] = cells;
339 |
340 | testCellsOneBreakpoint([cellWithCellProps], "medium", (style) => {
341 | expect(style).to.have.deep.property("justifyContent", "flex-end");
342 | expect(style).to.have.deep.property("alignItems", "flex-end");
343 | expect(style).to.have.deep.property("flexBasis").with.string("25%");
344 | });
345 |
346 | testCellsOneBreakpoint(cellsWithoutCellProps, "medium", (style) => {
347 | expect(style).to.have.deep.property("justifyContent", "center");
348 | expect(style).to.have.deep.property("alignItems", "center");
349 | expect(style).to.have.deep.property("flexBasis").with.string("100%");
350 | });
351 | });
352 |
353 | it(`should resolve styles when these are specified:
354 | 1) grid props
355 | 2) cell props`, () => {
356 | const grid = (
357 |
362 |
367 | testing
368 | |
369 |
370 | testing!
371 | |
372 |
373 | testing?
374 | |
375 |
376 | );
377 | const cells = resolveCells(grid.props);
378 | const [cellWithCellProps, ...cellsWithoutCellProps] = cells;
379 |
380 | testCellsAllBreakpoints([cellWithCellProps], (style) => {
381 | expect(style).to.have.deep.property("justifyContent", "center");
382 | expect(style).to.have.deep.property("alignItems", "center");
383 | expect(style).to.have.deep.property("flexBasis").with.string("20%");
384 | });
385 |
386 | testCellsAllBreakpoints(cellsWithoutCellProps, (style) => {
387 | expect(style).to.have.deep.property("justifyContent", "flex-start");
388 | expect(style).to.have.deep.property("alignItems", "flex-end");
389 | expect(style).to.have.deep.property("flexBasis").with.string("50%");
390 | });
391 | });
392 |
393 | it(`should resolve styles when these are specified:
394 | 1) grid props
395 | 2) cell breakpoint props`, () => {
396 | const grid = (
397 |
402 |
407 | testing
408 | |
409 |
410 | testing!
411 | |
412 |
413 | testing?
414 | |
415 |
416 | );
417 | const cells = resolveCells(grid.props);
418 | const [cellWithCellProps, ...cellsWithoutCellProps] = cells;
419 |
420 | testCellsOneBreakpoint([cellWithCellProps], "xlarge", (style) => {
421 | expect(style).to.have.deep.property("justifyContent", "flex-end");
422 | expect(style).to.have.deep.property("alignItems", "flex-start");
423 | expect(style).to.have.deep.property("flexBasis").with.string("20%");
424 | });
425 |
426 | testCellsAllBreakpoints(cellsWithoutCellProps, (style) => {
427 | expect(style).to.have.deep.property("justifyContent", "center");
428 | expect(style).to.have.deep.property("alignItems", "center");
429 | expect(style).to.have.deep.property("flexBasis").with.string("33.333");
430 | });
431 | });
432 |
433 | it(`should resolve styles when these are specified:
434 | 1) grid breakpoint props`, () => {
435 | const grid = (
436 |
441 |
442 | testing
443 | |
444 |
445 | testing!
446 | |
447 |
448 | testing?
449 | |
450 |
451 | );
452 | const cells = resolveCells(grid.props);
453 |
454 | testCellsOneBreakpoint(cells, "large", (style) => {
455 | expect(style).to.have.deep.property("justifyContent", "flex-start");
456 | expect(style).to.have.deep.property("alignItems", "flex-start");
457 | expect(style).to.have.deep.property("flexBasis").with.string("100%");
458 | });
459 | });
460 |
461 | it(`should resolve styles when these are specified:
462 | 1) cell props`, () => {
463 | const grid = (
464 |
465 |
470 | testing
471 | |
472 |
473 | testing!
474 | |
475 |
476 | testing?
477 | |
478 |
479 | );
480 | const cells = resolveCells(grid.props);
481 |
482 | testCellsAllBreakpoints([cells[0]], (style) => {
483 | expect(style).to.have.deep.property("justifyContent", "center");
484 | expect(style).to.have.deep.property("alignItems", "center");
485 | expect(style).to.have.deep.property("flexBasis").with.string("16.666");
486 | });
487 | });
488 |
489 |
490 | it("should resolve individual cell breakpoint sizes without conflict", () => {
491 | const grid = (
492 |
493 |
501 | testing
502 | |
503 |
504 | testing!
505 | |
506 |
507 | testing?
508 | |
509 |
510 | );
511 | const cells = resolveCells(grid.props);
512 |
513 | testCellsOneBreakpoint([cells[0]], "small", (style) => {
514 | expect(style).to.have.deep.property("justifyContent", "flex-end");
515 | expect(style).to.have.deep.property("alignItems", "center");
516 | expect(style).to.have.deep.property("flexBasis").with.string("100%");
517 | });
518 |
519 | testCellsOneBreakpoint([cells[0]], "large", (style) => {
520 | expect(style).to.have.deep.property("justifyContent", "center");
521 | expect(style).to.have.deep.property("alignItems", "flex-end");
522 | expect(style).to.have.deep.property("flexBasis").with.string("25%");
523 | });
524 |
525 | testCellsOneBreakpoint([cells[0]], "medium", (style) => {
526 | expect(style).to.have.deep.property("justifyContent", "flex-start");
527 | expect(style).to.have.deep.property("alignItems", "flex-start");
528 | expect(style).to.have.deep.property("flexBasis").with.string("33.333");
529 | });
530 | });
531 |
532 | it("should allow overridable cell source order", () => {
533 | const grid = (
534 |
535 |
536 | testing
537 | |
538 |
539 | testing!
540 | |
541 |
542 | testing?
543 | |
544 |
545 | );
546 | const cells = resolveCells(grid.props);
547 |
548 | testCellsAllBreakpoints([cells[1]], (style) => {
549 | expect(style.order).to.deep.equal(1);
550 | });
551 | });
552 |
553 | it("should allow overridable individual cell breakpoint order", () => {
554 | const grid = (
555 |
556 |
557 | testing
558 | |
559 |
565 | testing!
566 | |
567 |
568 | testing?
569 | |
570 |
571 | );
572 | const cells = resolveCells(grid.props);
573 |
574 | testCellsOneBreakpoint([cells[1]], "small", (style) => {
575 | expect(style.order).to.deep.equal(1);
576 | });
577 |
578 | testCellsOneBreakpoint([cells[1]], "medium", (style) => {
579 | expect(style.order).to.deep.equal(2);
580 | });
581 |
582 | testCellsOneBreakpoint([cells[1]], "large", (style) => {
583 | expect(style.order).to.deep.equal(3);
584 | });
585 |
586 | testCellsOneBreakpoint([cells[1]], "xlarge", (style) => {
587 | expect(style.order).to.deep.equal(4);
588 | });
589 | });
590 |
591 |
592 | it("should allow customizable fixed gutters", () => {
593 | const grid = (
594 |
595 |
596 | testing
597 | |
598 |
599 | testing!
600 | |
601 |
602 | testing?
603 | |
604 |
605 | );
606 | const cells = resolveCells(grid.props);
607 |
608 | testCellsAllBreakpoints(cells, (style) => {
609 | expect(style).to.have.deep.property("flexBasis").with.string("calc(33.333");
610 | expect(style).to.have.deep.property("flexBasis").with.string("- 16px");
611 | });
612 | });
613 |
614 |
615 | it("should allow customizable fluid gutters", () => {
616 | const grid = (
617 |
618 |
619 | testing
620 | |
621 |
622 | testing!
623 | |
624 |
625 | testing?
626 | |
627 |
628 | );
629 | const cells = resolveCells(grid.props);
630 |
631 | testCellsAllBreakpoints(cells, (style) => {
632 | expect(style).to.have.deep.property("flexBasis").with.string("calc(33.333");
633 |
634 | // TODO: this is a magic number. Write tests for gutter calcs
635 | expect(style).to.have.deep.property("flexBasis").with.string("- 1.3333");
636 | });
637 | });
638 |
639 | it("should apply custom props style objects", () => {
640 | const grid = (
641 |
642 |
643 | testing
644 | |
645 |
646 | testing!
647 | |
648 |
649 | testing?
650 | |
651 |
652 | );
653 | const cells = resolveCells(grid.props);
654 | expect(cells).to.have.deep.property("[0].props.style.backgroundColor", "blue");
655 | });
656 |
657 | it("should apply custom props Radium style arrays", () => {
658 | const grid = (
659 |
660 |
666 | testing
667 | |
668 |
669 | testing!
670 | |
671 |
672 | testing?
673 | |
674 |
675 | );
676 | const cells = resolveCells(grid.props);
677 | expect(cells).to.have.deep.property("[0].props.style.backgroundColor", "blue");
678 | expect(cells).to.have.deep.property("[0].props.style.padding", "1rem");
679 | });
680 |
681 | // Regression: don't obliterate custom styles
682 | // with Radium media query keys
683 | it("should allow custom styles with Radium media query keys", () => {
684 | const grid = (
685 |
686 |
697 | testing
698 | |
699 |
700 | testing!
701 | |
702 |
703 | testing?
704 | |
705 |
706 | );
707 | const cells = resolveCells(grid.props);
708 | const smallStyle = cells[0].props.style[
709 | Grid.defaultProps.breakpoints.small
710 | ];
711 | expect(smallStyle).to.have.deep.property("display", "flex");
712 | expect(smallStyle).to.have.deep.property("backgroundColor", "red");
713 | });
714 | });
715 |
--------------------------------------------------------------------------------
/test/client/spec/components/util.spec.jsx:
--------------------------------------------------------------------------------
1 | /* eslint-disable new-cap */
2 |
3 | require("babel-polyfill");
4 |
5 | import parseFraction from "../../../../src/components/util/parse-fraction";
6 |
7 | describe("Fraction parser", () => {
8 | it("should return the integer 1 if the string '1' or if a whole fraction is provided", () => {
9 | expect(parseFraction("1")).to.equal(1);
10 | expect(parseFraction("1/1")).to.equal(1);
11 | expect(parseFraction("20/20")).to.equal(1);
12 | });
13 |
14 | it("should not allow improper fractions", () => {
15 | expect(parseFraction.bind(null, "4/1")).to.throw(Error);
16 | });
17 |
18 | it("should allow spaces in otherwise valid input", () => {
19 | expect(parseFraction("1 ")).to.equal(1);
20 | expect(parseFraction(" 1 ")).to.equal(1);
21 | expect(parseFraction("1/ 4")).to.equal(1 / 4);
22 | expect(parseFraction("1/3 ")).to.equal(1 / 3);
23 | expect(parseFraction.bind(null, "1 1/2")).to.throw(Error);
24 | });
25 |
26 | it("should not allow division by zero", () => {
27 | expect(parseFraction.bind(null, "2/0")).to.throw(Error);
28 | });
29 |
30 | it("should convert fraction strings into decimals", () => {
31 | expect(parseFraction("1/2")).to.equal((1 / 2));
32 | expect(parseFraction("1/3")).to.equal((1 / 3));
33 | expect(parseFraction("12/12")).to.equal((12 / 12));
34 | expect(parseFraction("1/6")).to.equal((1 / 6));
35 | expect(parseFraction("1/6")).to.equal((1 / 6));
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/test/client/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Frontend Tests
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------