Repository: puranjayjain/react-materialui-notifications Branch: master Commit: 69726ce67c3d Files: 38 Total size: 1.5 MB Directory structure: gitextract_r2gxrxq5/ ├── .babelrc ├── .github/ │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bower.json ├── build/ │ ├── app.js │ ├── index.html │ └── main.css ├── gulp/ │ ├── config.js │ ├── tasks/ │ │ ├── browserSync.js │ │ ├── browserify.js │ │ ├── build.js │ │ ├── buildComponent.js │ │ ├── copyImages.js │ │ ├── default.js │ │ ├── markup.js │ │ ├── minify.js │ │ ├── release.js │ │ ├── setWatch.js │ │ └── watch.js │ └── util/ │ ├── bundleLogger.js │ └── handleErrors.js ├── gulp release.bat ├── gulp run.bat ├── gulpfile.js ├── lib/ │ └── ReactMaterialUiNotifications.js ├── package.json └── src/ ├── app/ │ ├── Github.js │ ├── Main.js │ ├── ReactMaterialUiNotifications.js │ ├── app.js │ └── data.js └── www/ ├── index.html └── main.css ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "presets": ["es2015", "react", "stage-0"], "plugins": [ "transform-es2015-duplicate-keys", "transform-class-properties" ] } ================================================ FILE: .github/CONTRIBUTING.md ================================================ # Contributing to md-date-time-picker There are a number of ways you can help by Contributing to this project, Here are some: - Improve the docs and point out suggestions / improvements - Send pull requests if you can fix a bug. - Always be polite in your approach. ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ # Issue Templates - Search the currently opened issues and past issues before posting a new one. - Escalate issues by making a reaction of :+1: at the first comment on the issue (the issue author's) - Be clear and try to open an issue with one problem at a time (open multiple issues if you have multiple problems) ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ # Pull Request template If you want to make a contribution to the project's source code, follow the guide: 1. Make sure to make changes to one file per pr. 2. Make sure it passes all linter checks of the ci. To more about the linter rules go [here](https://houndci.com/configuration) 3. Be precise as to what are you trying to correct in your title and/or comment. 4. Make sure to open a pr to the correct branch. 5. Try to make as little changes as possible to make the diff more readable. 6. Respect the coding guidelines as mentioned in the linter guide. 7. ================================================ FILE: .gitignore ================================================ # Logs logs *.log npm-debug.log* # Runtime data pids *.pid *.seed # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # node-waf configuration .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules bower_components jspm_packages # Optional npm cache directory .npm # Optional REPL history .node_repl_history .idea/ yarn.lock ================================================ FILE: CHANGELOG.md ================================================ ## v0.0.1 > First Release ## v0.2.0 * Docs updated with useful information * Updated some modules to the latest version * personalised notification enabled * breaking change avatar is now passed as url image instead of element * overflowText is now string * minWidth of the container changed to 325px as default ## v0.3.0 * Fixed npm build issues ## v0.3.1 * Fixed left icon prop being passed empty resulted in an error * Fixed left icon padding ## v0.3.2 * Changed max notification count to infinity and allowed values are natural numbers or Infinity ## v0.4.0 * changed the way props are handled internally for react css transition group * added a demo for react css transition group * added license to package json * added transitionAppear and other related props > **Note** Major breaking changes! * removed children prop in favor of static showNotification method * you can now only use one ReactMaterialUiNotifications component per app, so try to put it in a common spot, this was done to solve the problem of incorrect notifications getting displayed and to introduce the dismiss action in a future release ## v0.4.1 * Bumped versions of dependencies to newer versions ## v0.5.0 * Warning this release contains breaking changes in dependencies. * react-addons-css-transition-group changed to react-transition-group to remove warning. * removed proptypes from react instead imported from prop-types library * Special thanks to [Gonçalo Margalho @DevAlien](https://github.com/DevAlien) for making that wonderful hotfix ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2017 Puranjay Jain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # react-materialui-notifications [![GitHub version](https://img.shields.io/github/release/puranjayjain/react-materialui-notifications.svg)](https://badge.fury.io/gh/puranjayjain%2Freact-materialui-notifications) [![npm version](https://badge.fury.io/js/react-materialui-notifications.svg)](https://badge.fury.io/js/react-materialui-notifications) [![Issues](https://img.shields.io/github/issues/puranjayjain/react-materialui-notifications.svg)](https://github.com/puranjayjain/react-materialui-notifications/issues) [![Forks](https://img.shields.io/github/forks/puranjayjain/react-materialui-notifications.svg)](https://github.com/puranjayjain/react-materialui-notifications/network) [![Stars](https://img.shields.io/github/stars/puranjayjain/react-materialui-notifications.svg)](https://github.com/puranjayjain/react-materialui-notifications/stargazers) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/puranjayjain/react-materialui-notifications/master/LICENSE.md) :heart: the package? Then :star: it! > Spec compliant notifications for react and material ui users # Installation * Use the latest github release * or Install via `npm i react-materialui-notifications --save` # Demo For a demo see the docs site (below), for usage example see `src/app/Main.js` # Documentation Consult the website [https://puranjayjain.github.io/react-materialui-notifications](https://puranjayjain.github.io/react-materialui-notifications) # Versioning For transparency into our release cycle and in striving to maintain backward compatibility, the project is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible. # Development * If developing the project use `gulp run.bat` or the equivalent command written in it. * To release the project use `gulp run.bat` then run `gulp release.bat` or the equivalent command written in them. # TODO - [x] a lot of core functionality - [x] finish up props of the notification class - [ ] implement expanding notifications - [x] show the priority notifications on top - [ ] implement custom notification element which the user can pass (PR required) - [x] styles for position - [ ] swipe to dismiss - [ ] i18n # License The Project is Licensed under the [MIT License](https://github.com/puranjayjain/react-materialui-notifications/blob/master/LICENSE) ================================================ FILE: bower.json ================================================ { "name": "react-materialui-notifications", "description": "Spec compliant notifications for react and material ui users", "main": "./lib/ReactMaterialUiNotifications.js", "authors": [ "Puranjay Jain " ], "license": "MIT", "keywords": [ "react", "material", "design", "notification", "material-ui" ], "homepage": "https://github.com/puranjayjain/react-materialui-notifications", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "devDependencies": { "babel-core": "^6.10.4", "babel-plugin-transform-class-properties": "^6.10.2", "babel-plugin-transform-es2015-duplicate-keys": "^6.8.0", "babel-preset-es2015": "^6.9.0", "babel-preset-react": "^6.11.1", "babel-preset-stage-0": "^6.5.0", "babelify": "^7.3.0", "browser-sync": "^2.13.0", "browserify": "^13.0.1", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", "gulp-notify": "^2.2.0", "gulp-rename": "^1.2.2", "gulp-uglify": "^1.5.4", "gulp-util": "^3.0.7", "moment": "^2.14.1", "pretty-hrtime": "^1.0.2", "pump": "^1.0.1", "recompose": "^0.20.2", "require-dir": "^0.3.0", "run-sequence": "^1.2.2", "underscore": "^1.8.3", "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0" }, "dependencies": { "material-ui": "^0.15.1", "react": "^15.2.0", "react-addons-css-transition-group": "^15.2.0", "react-dom": "^15.2.0", "react-tap-event-plugin": "^1.0.0" } } ================================================ FILE: build/app.js ================================================ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; },{}],15:[function(require,module,exports){ "use strict"; exports.__esModule = true; var _typeof2 = require("../helpers/typeof"); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; }; },{"../helpers/typeof":18}],16:[function(require,module,exports){ "use strict"; exports.__esModule = true; var _from = require("../core-js/array/from"); var _from2 = _interopRequireDefault(_from); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (arr) { return Array.isArray(arr) ? arr : (0, _from2.default)(arr); }; },{"../core-js/array/from":1}],17:[function(require,module,exports){ "use strict"; exports.__esModule = true; var _from = require("../core-js/array/from"); var _from2 = _interopRequireDefault(_from); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return (0, _from2.default)(arr); } }; },{"../core-js/array/from":1}],18:[function(require,module,exports){ "use strict"; exports.__esModule = true; var _iterator = require("../core-js/symbol/iterator"); var _iterator2 = _interopRequireDefault(_iterator); var _symbol = require("../core-js/symbol"); var _symbol2 = _interopRequireDefault(_symbol); var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { return typeof obj === "undefined" ? "undefined" : _typeof(obj); } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); }; },{"../core-js/symbol":8,"../core-js/symbol/iterator":9}],19:[function(require,module,exports){ /*! * Bowser - a browser detector * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2015 */ !function (root, name, definition) { if (typeof module != 'undefined' && module.exports) module.exports = definition() else if (typeof define == 'function' && define.amd) define(name, definition) else root[name] = definition() }(this, 'bowser', function () { /** * See useragents.js for examples of navigator.userAgent */ var t = true function detect(ua) { function getFirstMatch(regex) { var match = ua.match(regex); return (match && match.length > 1 && match[1]) || ''; } function getSecondMatch(regex) { var match = ua.match(regex); return (match && match.length > 1 && match[2]) || ''; } var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() , likeAndroid = /like android/i.test(ua) , android = !likeAndroid && /android/i.test(ua) , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) , chromeos = /CrOS/.test(ua) , silk = /silk/i.test(ua) , sailfish = /sailfish/i.test(ua) , tizen = /tizen/i.test(ua) , webos = /(web|hpw)os/i.test(ua) , windowsphone = /windows phone/i.test(ua) , samsungBrowser = /SamsungBrowser/i.test(ua) , windows = !windowsphone && /windows/i.test(ua) , mac = !iosdevice && !silk && /macintosh/i.test(ua) , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) , edgeVersion = getFirstMatch(/edge\/(\d+(\.\d+)?)/i) , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) , tablet = /tablet/i.test(ua) , mobile = !tablet && /[^-]mobi/i.test(ua) , xbox = /xbox/i.test(ua) , result if (/opera/i.test(ua)) { // an old Opera result = { name: 'Opera' , opera: t , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) } } else if (/opr|opios/i.test(ua)) { // a new Opera result = { name: 'Opera' , opera: t , version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier } } else if (/SamsungBrowser/i.test(ua)) { result = { name: 'Samsung Internet for Android' , samsungBrowser: t , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) } } else if (/coast/i.test(ua)) { result = { name: 'Opera Coast' , coast: t , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) } } else if (/yabrowser/i.test(ua)) { result = { name: 'Yandex Browser' , yandexbrowser: t , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) } } else if (/ucbrowser/i.test(ua)) { result = { name: 'UC Browser' , ucbrowser: t , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/mxios/i.test(ua)) { result = { name: 'Maxthon' , maxthon: t , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/epiphany/i.test(ua)) { result = { name: 'Epiphany' , epiphany: t , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/puffin/i.test(ua)) { result = { name: 'Puffin' , puffin: t , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) } } else if (/sleipnir/i.test(ua)) { result = { name: 'Sleipnir' , sleipnir: t , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) } } else if (/k-meleon/i.test(ua)) { result = { name: 'K-Meleon' , kMeleon: t , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) } } else if (windowsphone) { result = { name: 'Windows Phone' , windowsphone: t } if (edgeVersion) { result.msedge = t result.version = edgeVersion } else { result.msie = t result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) } } else if (/msie|trident/i.test(ua)) { result = { name: 'Internet Explorer' , msie: t , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) } } else if (chromeos) { result = { name: 'Chrome' , chromeos: t , chromeBook: t , chrome: t , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) } } else if (/chrome.+? edge/i.test(ua)) { result = { name: 'Microsoft Edge' , msedge: t , version: edgeVersion } } else if (/vivaldi/i.test(ua)) { result = { name: 'Vivaldi' , vivaldi: t , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier } } else if (sailfish) { result = { name: 'Sailfish' , sailfish: t , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) } } else if (/seamonkey\//i.test(ua)) { result = { name: 'SeaMonkey' , seamonkey: t , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) } } else if (/firefox|iceweasel|fxios/i.test(ua)) { result = { name: 'Firefox' , firefox: t , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) } if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { result.firefoxos = t } } else if (silk) { result = { name: 'Amazon Silk' , silk: t , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) } } else if (/phantom/i.test(ua)) { result = { name: 'PhantomJS' , phantom: t , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) } } else if (/slimerjs/i.test(ua)) { result = { name: 'SlimerJS' , slimer: t , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) } } else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { result = { name: 'BlackBerry' , blackberry: t , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) } } else if (webos) { result = { name: 'WebOS' , webos: t , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) }; /touchpad\//i.test(ua) && (result.touchpad = t) } else if (/bada/i.test(ua)) { result = { name: 'Bada' , bada: t , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) }; } else if (tizen) { result = { name: 'Tizen' , tizen: t , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier }; } else if (/qupzilla/i.test(ua)) { result = { name: 'QupZilla' , qupzilla: t , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier } } else if (/chromium/i.test(ua)) { result = { name: 'Chromium' , chromium: t , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier } } else if (/chrome|crios|crmo/i.test(ua)) { result = { name: 'Chrome' , chrome: t , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) } } else if (android) { result = { name: 'Android' , version: versionIdentifier } } else if (/safari|applewebkit/i.test(ua)) { result = { name: 'Safari' , safari: t } if (versionIdentifier) { result.version = versionIdentifier } } else if (iosdevice) { result = { name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' } // WTF: version is not part of user agent in web apps if (versionIdentifier) { result.version = versionIdentifier } } else if(/googlebot/i.test(ua)) { result = { name: 'Googlebot' , googlebot: t , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier } } else { result = { name: getFirstMatch(/^(.*)\/(.*) /), version: getSecondMatch(/^(.*)\/(.*) /) }; } // set webkit or gecko flag for browsers based on these engines if (!result.msedge && /(apple)?webkit/i.test(ua)) { if (/(apple)?webkit\/537\.36/i.test(ua)) { result.name = result.name || "Blink" result.blink = t } else { result.name = result.name || "Webkit" result.webkit = t } if (!result.version && versionIdentifier) { result.version = versionIdentifier } } else if (!result.opera && /gecko\//i.test(ua)) { result.name = result.name || "Gecko" result.gecko = t result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) } // set OS flags for platforms that have multiple browsers if (!result.windowsphone && !result.msedge && (android || result.silk)) { result.android = t } else if (!result.windowsphone && !result.msedge && iosdevice) { result[iosdevice] = t result.ios = t } else if (mac) { result.mac = t } else if (xbox) { result.xbox = t } else if (windows) { result.windows = t } else if (linux) { result.linux = t } function getWindowsVersion (s) { switch (s) { case 'NT': return 'NT' case 'XP': return 'XP' case 'NT 5.0': return '2000' case 'NT 5.1': return 'XP' case 'NT 5.2': return '2003' case 'NT 6.0': return 'Vista' case 'NT 6.1': return '7' case 'NT 6.2': return '8' case 'NT 6.3': return '8.1' case 'NT 10.0': return '10' default: return undefined } } // OS version extraction var osVersion = ''; if (result.windows) { osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i)) } else if (result.windowsphone) { osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); } else if (result.mac) { osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i); osVersion = osVersion.replace(/[_\s]/g, '.'); } else if (iosdevice) { osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); osVersion = osVersion.replace(/[_\s]/g, '.'); } else if (android) { osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); } else if (result.webos) { osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); } else if (result.blackberry) { osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); } else if (result.bada) { osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); } else if (result.tizen) { osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); } if (osVersion) { result.osversion = osVersion; } // device type extraction var osMajorVersion = !result.windows && osVersion.split('.')[0]; if ( tablet || nexusTablet || iosdevice == 'ipad' || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) || result.silk ) { result.tablet = t } else if ( mobile || iosdevice == 'iphone' || iosdevice == 'ipod' || android || nexusMobile || result.blackberry || result.webos || result.bada ) { result.mobile = t } // Graded Browser Support // http://developer.yahoo.com/yui/articles/gbs if (result.msedge || (result.msie && result.version >= 10) || (result.yandexbrowser && result.version >= 15) || (result.vivaldi && result.version >= 1.0) || (result.chrome && result.version >= 20) || (result.samsungBrowser && result.version >= 4) || (result.firefox && result.version >= 20.0) || (result.safari && result.version >= 6) || (result.opera && result.version >= 10.0) || (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || (result.blackberry && result.version >= 10.1) || (result.chromium && result.version >= 20) ) { result.a = t; } else if ((result.msie && result.version < 10) || (result.chrome && result.version < 20) || (result.firefox && result.version < 20.0) || (result.safari && result.version < 6) || (result.opera && result.version < 10.0) || (result.ios && result.osversion && result.osversion.split(".")[0] < 6) || (result.chromium && result.version < 20) ) { result.c = t } else result.x = t return result } var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '') bowser.test = function (browserList) { for (var i = 0; i < browserList.length; ++i) { var browserItem = browserList[i]; if (typeof browserItem=== 'string') { if (browserItem in bowser) { return true; } } } return false; } /** * Get version precisions count * * @example * getVersionPrecision("1.10.3") // 3 * * @param {string} version * @return {number} */ function getVersionPrecision(version) { return version.split(".").length; } /** * Array::map polyfill * * @param {Array} arr * @param {Function} iterator * @return {Array} */ function map(arr, iterator) { var result = [], i; if (Array.prototype.map) { return Array.prototype.map.call(arr, iterator); } for (i = 0; i < arr.length; i++) { result.push(iterator(arr[i])); } return result; } /** * Calculate browser version weight * * @example * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 * compareVersions(['1.10.2.1', '1.0800.2']); // -1 * * @param {Array} versions versions to compare * @return {Number} comparison result */ function compareVersions(versions) { // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); var chunks = map(versions, function (version) { var delta = precision - getVersionPrecision(version); // 2) "9" -> "9.0" (for precision = 2) version = version + new Array(delta + 1).join(".0"); // 3) "9.0" -> ["000000000"", "000000009"] return map(version.split("."), function (chunk) { return new Array(20 - chunk.length).join("0") + chunk; }).reverse(); }); // iterate in reverse order by reversed chunks array while (--precision >= 0) { // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) if (chunks[0][precision] > chunks[1][precision]) { return 1; } else if (chunks[0][precision] === chunks[1][precision]) { if (precision === 0) { // all version chunks are same return 0; } } else { return -1; } } } /** * Check if browser is unsupported * * @example * bowser.isUnsupportedBrowser({ * msie: "10", * firefox: "23", * chrome: "29", * safari: "5.1", * opera: "16", * phantom: "534" * }); * * @param {Object} minVersions map of minimal version to browser * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map * @param {String} [ua] user agent string * @return {Boolean} */ function isUnsupportedBrowser(minVersions, strictMode, ua) { var _bowser = bowser; // make strictMode param optional with ua param usage if (typeof strictMode === 'string') { ua = strictMode; strictMode = void(0); } if (strictMode === void(0)) { strictMode = false; } if (ua) { _bowser = detect(ua); } var version = "" + _bowser.version; for (var browser in minVersions) { if (minVersions.hasOwnProperty(browser)) { if (_bowser[browser]) { if (typeof minVersions[browser] !== 'string') { throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions)); } // browser version and min supported version. return compareVersions([version, minVersions[browser]]) < 0; } } } return strictMode; // not found } /** * Check if browser is supported * * @param {Object} minVersions map of minimal version to browser * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map * @param {String} [ua] user agent string * @return {Boolean} */ function check(minVersions, strictMode, ua) { return !isUnsupportedBrowser(minVersions, strictMode, ua); } bowser.isUnsupportedBrowser = isUnsupportedBrowser; bowser.compareVersions = compareVersions; bowser.check = check; /* * Set our detect method to the main bowser object so we can * reuse it to test other user agents. * This is needed to implement future tests. */ bowser._detect = detect; return bowser }); },{}],20:[function(require,module,exports){ module.exports = function chain(){ var len = arguments.length var args = []; for (var i = 0; i < len; i++) args[i] = arguments[i] args = args.filter(function(fn){ return fn != null }) if (args.length === 0) return undefined if (args.length === 1) return args[0] return args.reduce(function(current, next){ return function chainedFunction() { current.apply(this, arguments); next.apply(this, arguments); }; }) } },{}],21:[function(require,module,exports){ require('../../modules/es6.string.iterator'); require('../../modules/es6.array.from'); module.exports = require('../../modules/_core').Array.from; },{"../../modules/_core":36,"../../modules/es6.array.from":95,"../../modules/es6.string.iterator":104}],22:[function(require,module,exports){ require('../../modules/es6.object.assign'); module.exports = require('../../modules/_core').Object.assign; },{"../../modules/_core":36,"../../modules/es6.object.assign":97}],23:[function(require,module,exports){ require('../../modules/es6.object.create'); var $Object = require('../../modules/_core').Object; module.exports = function create(P, D){ return $Object.create(P, D); }; },{"../../modules/_core":36,"../../modules/es6.object.create":98}],24:[function(require,module,exports){ require('../../modules/es6.object.define-property'); var $Object = require('../../modules/_core').Object; module.exports = function defineProperty(it, key, desc){ return $Object.defineProperty(it, key, desc); }; },{"../../modules/_core":36,"../../modules/es6.object.define-property":99}],25:[function(require,module,exports){ require('../../modules/es6.object.get-prototype-of'); module.exports = require('../../modules/_core').Object.getPrototypeOf; },{"../../modules/_core":36,"../../modules/es6.object.get-prototype-of":100}],26:[function(require,module,exports){ require('../../modules/es6.object.keys'); module.exports = require('../../modules/_core').Object.keys; },{"../../modules/_core":36,"../../modules/es6.object.keys":101}],27:[function(require,module,exports){ require('../../modules/es6.object.set-prototype-of'); module.exports = require('../../modules/_core').Object.setPrototypeOf; },{"../../modules/_core":36,"../../modules/es6.object.set-prototype-of":102}],28:[function(require,module,exports){ require('../../modules/es6.symbol'); require('../../modules/es6.object.to-string'); require('../../modules/es7.symbol.async-iterator'); require('../../modules/es7.symbol.observable'); module.exports = require('../../modules/_core').Symbol; },{"../../modules/_core":36,"../../modules/es6.object.to-string":103,"../../modules/es6.symbol":105,"../../modules/es7.symbol.async-iterator":106,"../../modules/es7.symbol.observable":107}],29:[function(require,module,exports){ require('../../modules/es6.string.iterator'); require('../../modules/web.dom.iterable'); module.exports = require('../../modules/_wks-ext').f('iterator'); },{"../../modules/_wks-ext":92,"../../modules/es6.string.iterator":104,"../../modules/web.dom.iterable":108}],30:[function(require,module,exports){ module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; },{}],31:[function(require,module,exports){ module.exports = function(){ /* empty */ }; },{}],32:[function(require,module,exports){ var isObject = require('./_is-object'); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; },{"./_is-object":54}],33:[function(require,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = require('./_to-iobject') , toLength = require('./_to-length') , toIndex = require('./_to-index'); module.exports = function(IS_INCLUDES){ return function($this, el, fromIndex){ var O = toIObject($this) , length = toLength(O.length) , index = toIndex(fromIndex, length) , value; // Array#includes uses SameValueZero equality algorithm if(IS_INCLUDES && el != el)while(length > index){ value = O[index++]; if(value != value)return true; // Array#toIndex ignores holes, Array#includes - not } else for(;length > index; index++)if(IS_INCLUDES || index in O){ if(O[index] === el)return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; },{"./_to-index":84,"./_to-iobject":86,"./_to-length":87}],34:[function(require,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = require('./_cof') , TAG = require('./_wks')('toStringTag') // ES3 wrong here , ARG = cof(function(){ return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function(it, key){ try { return it[key]; } catch(e){ /* empty */ } }; module.exports = function(it){ var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; },{"./_cof":35,"./_wks":93}],35:[function(require,module,exports){ var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; },{}],36:[function(require,module,exports){ var core = module.exports = {version: '2.4.0'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef },{}],37:[function(require,module,exports){ 'use strict'; var $defineProperty = require('./_object-dp') , createDesc = require('./_property-desc'); module.exports = function(object, index, value){ if(index in object)$defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; },{"./_object-dp":66,"./_property-desc":77}],38:[function(require,module,exports){ // optional / simple context binding var aFunction = require('./_a-function'); module.exports = function(fn, that, length){ aFunction(fn); if(that === undefined)return fn; switch(length){ case 1: return function(a){ return fn.call(that, a); }; case 2: return function(a, b){ return fn.call(that, a, b); }; case 3: return function(a, b, c){ return fn.call(that, a, b, c); }; } return function(/* ...args */){ return fn.apply(that, arguments); }; }; },{"./_a-function":30}],39:[function(require,module,exports){ // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; },{}],40:[function(require,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !require('./_fails')(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); },{"./_fails":45}],41:[function(require,module,exports){ var isObject = require('./_is-object') , document = require('./_global').document // in old IE typeof document.createElement is 'object' , is = isObject(document) && isObject(document.createElement); module.exports = function(it){ return is ? document.createElement(it) : {}; }; },{"./_global":46,"./_is-object":54}],42:[function(require,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); },{}],43:[function(require,module,exports){ // all enumerable object keys, includes symbols var getKeys = require('./_object-keys') , gOPS = require('./_object-gops') , pIE = require('./_object-pie'); module.exports = function(it){ var result = getKeys(it) , getSymbols = gOPS.f; if(getSymbols){ var symbols = getSymbols(it) , isEnum = pIE.f , i = 0 , key; while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); } return result; }; },{"./_object-gops":71,"./_object-keys":74,"./_object-pie":75}],44:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , ctx = require('./_ctx') , hide = require('./_hide') , PROTOTYPE = 'prototype'; var $export = function(type, name, source){ var IS_FORCED = type & $export.F , IS_GLOBAL = type & $export.G , IS_STATIC = type & $export.S , IS_PROTO = type & $export.P , IS_BIND = type & $export.B , IS_WRAP = type & $export.W , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) , expProto = exports[PROTOTYPE] , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] , key, own, out; if(IS_GLOBAL)source = name; for(key in source){ // contains in native own = !IS_FORCED && target && target[key] !== undefined; if(own && key in exports)continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library : IS_WRAP && target[key] == out ? (function(C){ var F = function(a, b, c){ if(this instanceof C){ switch(arguments.length){ case 0: return new C; case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE] = C[PROTOTYPE]; return F; // make static versions for prototype methods })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if(IS_PROTO){ (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); } } }; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; },{"./_core":36,"./_ctx":38,"./_global":46,"./_hide":48}],45:[function(require,module,exports){ module.exports = function(exec){ try { return !!exec(); } catch(e){ return true; } }; },{}],46:[function(require,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef },{}],47:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; },{}],48:[function(require,module,exports){ var dP = require('./_object-dp') , createDesc = require('./_property-desc'); module.exports = require('./_descriptors') ? function(object, key, value){ return dP.f(object, key, createDesc(1, value)); } : function(object, key, value){ object[key] = value; return object; }; },{"./_descriptors":40,"./_object-dp":66,"./_property-desc":77}],49:[function(require,module,exports){ module.exports = require('./_global').document && document.documentElement; },{"./_global":46}],50:[function(require,module,exports){ module.exports = !require('./_descriptors') && !require('./_fails')(function(){ return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; }); },{"./_descriptors":40,"./_dom-create":41,"./_fails":45}],51:[function(require,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = require('./_cof'); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; },{"./_cof":35}],52:[function(require,module,exports){ // check on default Array iterator var Iterators = require('./_iterators') , ITERATOR = require('./_wks')('iterator') , ArrayProto = Array.prototype; module.exports = function(it){ return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; },{"./_iterators":60,"./_wks":93}],53:[function(require,module,exports){ // 7.2.2 IsArray(argument) var cof = require('./_cof'); module.exports = Array.isArray || function isArray(arg){ return cof(arg) == 'Array'; }; },{"./_cof":35}],54:[function(require,module,exports){ module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; },{}],55:[function(require,module,exports){ // call something on iterator step with safe closing on error var anObject = require('./_an-object'); module.exports = function(iterator, fn, value, entries){ try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch(e){ var ret = iterator['return']; if(ret !== undefined)anObject(ret.call(iterator)); throw e; } }; },{"./_an-object":32}],56:[function(require,module,exports){ 'use strict'; var create = require('./_object-create') , descriptor = require('./_property-desc') , setToStringTag = require('./_set-to-string-tag') , IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function(){ return this; }); module.exports = function(Constructor, NAME, next){ Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); }; },{"./_hide":48,"./_object-create":65,"./_property-desc":77,"./_set-to-string-tag":80,"./_wks":93}],57:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , $export = require('./_export') , redefine = require('./_redefine') , hide = require('./_hide') , has = require('./_has') , Iterators = require('./_iterators') , $iterCreate = require('./_iter-create') , setToStringTag = require('./_set-to-string-tag') , getPrototypeOf = require('./_object-gpo') , ITERATOR = require('./_wks')('iterator') , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` , FF_ITERATOR = '@@iterator' , KEYS = 'keys' , VALUES = 'values'; var returnThis = function(){ return this; }; module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ $iterCreate(Constructor, NAME, next); var getMethod = function(kind){ if(!BUGGY && kind in proto)return proto[kind]; switch(kind){ case KEYS: return function keys(){ return new Constructor(this, kind); }; case VALUES: return function values(){ return new Constructor(this, kind); }; } return function entries(){ return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator' , DEF_VALUES = DEFAULT == VALUES , VALUES_BUG = false , proto = Base.prototype , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] , $default = $native || getMethod(DEFAULT) , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined , $anyNative = NAME == 'Array' ? proto.entries || $native : $native , methods, key, IteratorPrototype; // Fix native if($anyNative){ IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); if(IteratorPrototype !== Object.prototype){ // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if(DEF_VALUES && $native && $native.name !== VALUES){ VALUES_BUG = true; $default = function values(){ return $native.call(this); }; } // Define iterator if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if(DEFAULT){ methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if(FORCED)for(key in methods){ if(!(key in proto))redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; },{"./_export":44,"./_has":47,"./_hide":48,"./_iter-create":56,"./_iterators":60,"./_library":62,"./_object-gpo":72,"./_redefine":78,"./_set-to-string-tag":80,"./_wks":93}],58:[function(require,module,exports){ var ITERATOR = require('./_wks')('iterator') , SAFE_CLOSING = false; try { var riter = [7][ITERATOR](); riter['return'] = function(){ SAFE_CLOSING = true; }; Array.from(riter, function(){ throw 2; }); } catch(e){ /* empty */ } module.exports = function(exec, skipClosing){ if(!skipClosing && !SAFE_CLOSING)return false; var safe = false; try { var arr = [7] , iter = arr[ITERATOR](); iter.next = function(){ return {done: safe = true}; }; arr[ITERATOR] = function(){ return iter; }; exec(arr); } catch(e){ /* empty */ } return safe; }; },{"./_wks":93}],59:[function(require,module,exports){ module.exports = function(done, value){ return {value: value, done: !!done}; }; },{}],60:[function(require,module,exports){ module.exports = {}; },{}],61:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject'); module.exports = function(object, el){ var O = toIObject(object) , keys = getKeys(O) , length = keys.length , index = 0 , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; },{"./_object-keys":74,"./_to-iobject":86}],62:[function(require,module,exports){ module.exports = true; },{}],63:[function(require,module,exports){ var META = require('./_uid')('meta') , isObject = require('./_is-object') , has = require('./_has') , setDesc = require('./_object-dp').f , id = 0; var isExtensible = Object.isExtensible || function(){ return true; }; var FREEZE = !require('./_fails')(function(){ return isExtensible(Object.preventExtensions({})); }); var setMeta = function(it){ setDesc(it, META, {value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs }}); }; var fastKey = function(it, create){ // return primitive with prefix if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if(!has(it, META)){ // can't set metadata to uncaught frozen object if(!isExtensible(it))return 'F'; // not necessary to add metadata if(!create)return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function(it, create){ if(!has(it, META)){ // can't set metadata to uncaught frozen object if(!isExtensible(it))return true; // not necessary to add metadata if(!create)return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function(it){ if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; },{"./_fails":45,"./_has":47,"./_is-object":54,"./_object-dp":66,"./_uid":90}],64:[function(require,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = require('./_object-keys') , gOPS = require('./_object-gops') , pIE = require('./_object-pie') , toObject = require('./_to-object') , IObject = require('./_iobject') , $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || require('./_fails')(function(){ var A = {} , B = {} , S = Symbol() , K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function(k){ B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source){ // eslint-disable-line no-unused-vars var T = toObject(target) , aLen = arguments.length , index = 1 , getSymbols = gOPS.f , isEnum = pIE.f; while(aLen > index){ var S = IObject(arguments[index++]) , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) , length = keys.length , j = 0 , key; while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; } return T; } : $assign; },{"./_fails":45,"./_iobject":51,"./_object-gops":71,"./_object-keys":74,"./_object-pie":75,"./_to-object":88}],65:[function(require,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = require('./_an-object') , dPs = require('./_object-dps') , enumBugKeys = require('./_enum-bug-keys') , IE_PROTO = require('./_shared-key')('IE_PROTO') , Empty = function(){ /* empty */ } , PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function(){ // Thrash, waste and sodomy: IE GC bug var iframe = require('./_dom-create')('iframe') , i = enumBugKeys.length , lt = '<' , gt = '>' , iframeDocument; iframe.style.display = 'none'; require('./_html').appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties){ var result; if(O !== null){ Empty[PROTOTYPE] = anObject(O); result = new Empty; Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; },{"./_an-object":32,"./_dom-create":41,"./_enum-bug-keys":42,"./_html":49,"./_object-dps":67,"./_shared-key":81}],66:[function(require,module,exports){ var anObject = require('./_an-object') , IE8_DOM_DEFINE = require('./_ie8-dom-define') , toPrimitive = require('./_to-primitive') , dP = Object.defineProperty; exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){ anObject(O); P = toPrimitive(P, true); anObject(Attributes); if(IE8_DOM_DEFINE)try { return dP(O, P, Attributes); } catch(e){ /* empty */ } if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); if('value' in Attributes)O[P] = Attributes.value; return O; }; },{"./_an-object":32,"./_descriptors":40,"./_ie8-dom-define":50,"./_to-primitive":89}],67:[function(require,module,exports){ var dP = require('./_object-dp') , anObject = require('./_an-object') , getKeys = require('./_object-keys'); module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties){ anObject(O); var keys = getKeys(Properties) , length = keys.length , i = 0 , P; while(length > i)dP.f(O, P = keys[i++], Properties[P]); return O; }; },{"./_an-object":32,"./_descriptors":40,"./_object-dp":66,"./_object-keys":74}],68:[function(require,module,exports){ var pIE = require('./_object-pie') , createDesc = require('./_property-desc') , toIObject = require('./_to-iobject') , toPrimitive = require('./_to-primitive') , has = require('./_has') , IE8_DOM_DEFINE = require('./_ie8-dom-define') , gOPD = Object.getOwnPropertyDescriptor; exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P){ O = toIObject(O); P = toPrimitive(P, true); if(IE8_DOM_DEFINE)try { return gOPD(O, P); } catch(e){ /* empty */ } if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); }; },{"./_descriptors":40,"./_has":47,"./_ie8-dom-define":50,"./_object-pie":75,"./_property-desc":77,"./_to-iobject":86,"./_to-primitive":89}],69:[function(require,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = require('./_to-iobject') , gOPN = require('./_object-gopn').f , toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function(it){ try { return gOPN(it); } catch(e){ return windowNames.slice(); } }; module.exports.f = function getOwnPropertyNames(it){ return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; },{"./_object-gopn":70,"./_to-iobject":86}],70:[function(require,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = require('./_object-keys-internal') , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ return $keys(O, hiddenKeys); }; },{"./_enum-bug-keys":42,"./_object-keys-internal":73}],71:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],72:[function(require,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = require('./_has') , toObject = require('./_to-object') , IE_PROTO = require('./_shared-key')('IE_PROTO') , ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function(O){ O = toObject(O); if(has(O, IE_PROTO))return O[IE_PROTO]; if(typeof O.constructor == 'function' && O instanceof O.constructor){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; },{"./_has":47,"./_shared-key":81,"./_to-object":88}],73:[function(require,module,exports){ var has = require('./_has') , toIObject = require('./_to-iobject') , arrayIndexOf = require('./_array-includes')(false) , IE_PROTO = require('./_shared-key')('IE_PROTO'); module.exports = function(object, names){ var O = toIObject(object) , i = 0 , result = [] , key; for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); // Don't enum bug & hidden keys while(names.length > i)if(has(O, key = names[i++])){ ~arrayIndexOf(result, key) || result.push(key); } return result; }; },{"./_array-includes":33,"./_has":47,"./_shared-key":81,"./_to-iobject":86}],74:[function(require,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = require('./_object-keys-internal') , enumBugKeys = require('./_enum-bug-keys'); module.exports = Object.keys || function keys(O){ return $keys(O, enumBugKeys); }; },{"./_enum-bug-keys":42,"./_object-keys-internal":73}],75:[function(require,module,exports){ exports.f = {}.propertyIsEnumerable; },{}],76:[function(require,module,exports){ // most Object methods by ES6 should accept primitives var $export = require('./_export') , core = require('./_core') , fails = require('./_fails'); module.exports = function(KEY, exec){ var fn = (core.Object || {})[KEY] || Object[KEY] , exp = {}; exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); }; },{"./_core":36,"./_export":44,"./_fails":45}],77:[function(require,module,exports){ module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value }; }; },{}],78:[function(require,module,exports){ module.exports = require('./_hide'); },{"./_hide":48}],79:[function(require,module,exports){ // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = require('./_is-object') , anObject = require('./_an-object'); var check = function(O, proto){ anObject(O); if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function(test, buggy, set){ try { set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch(e){ buggy = true; } return function setPrototypeOf(O, proto){ check(O, proto); if(buggy)O.__proto__ = proto; else set(O, proto); return O; }; }({}, false) : undefined), check: check }; },{"./_an-object":32,"./_ctx":38,"./_is-object":54,"./_object-gopd":68}],80:[function(require,module,exports){ var def = require('./_object-dp').f , has = require('./_has') , TAG = require('./_wks')('toStringTag'); module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; },{"./_has":47,"./_object-dp":66,"./_wks":93}],81:[function(require,module,exports){ var shared = require('./_shared')('keys') , uid = require('./_uid'); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; },{"./_shared":82,"./_uid":90}],82:[function(require,module,exports){ var global = require('./_global') , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; },{"./_global":46}],83:[function(require,module,exports){ var toInteger = require('./_to-integer') , defined = require('./_defined'); // true -> String#at // false -> String#codePointAt module.exports = function(TO_STRING){ return function(that, pos){ var s = String(defined(that)) , i = toInteger(pos) , l = s.length , a, b; if(i < 0 || i >= l)return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; },{"./_defined":39,"./_to-integer":85}],84:[function(require,module,exports){ var toInteger = require('./_to-integer') , max = Math.max , min = Math.min; module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; },{"./_to-integer":85}],85:[function(require,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; },{}],86:[function(require,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = require('./_iobject') , defined = require('./_defined'); module.exports = function(it){ return IObject(defined(it)); }; },{"./_defined":39,"./_iobject":51}],87:[function(require,module,exports){ // 7.1.15 ToLength var toInteger = require('./_to-integer') , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; },{"./_to-integer":85}],88:[function(require,module,exports){ // 7.1.13 ToObject(argument) var defined = require('./_defined'); module.exports = function(it){ return Object(defined(it)); }; },{"./_defined":39}],89:[function(require,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function(it, S){ if(!isObject(it))return it; var fn, val; if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to primitive value"); }; },{"./_is-object":54}],90:[function(require,module,exports){ var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; },{}],91:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , LIBRARY = require('./_library') , wksExt = require('./_wks-ext') , defineProperty = require('./_object-dp').f; module.exports = function(name){ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); }; },{"./_core":36,"./_global":46,"./_library":62,"./_object-dp":66,"./_wks-ext":92}],92:[function(require,module,exports){ exports.f = require('./_wks'); },{"./_wks":93}],93:[function(require,module,exports){ var store = require('./_shared')('wks') , uid = require('./_uid') , Symbol = require('./_global').Symbol , USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function(name){ return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; },{"./_global":46,"./_shared":82,"./_uid":90}],94:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); module.exports = require('./_core').getIteratorMethod = function(it){ if(it != undefined)return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; },{"./_classof":34,"./_core":36,"./_iterators":60,"./_wks":93}],95:[function(require,module,exports){ 'use strict'; var ctx = require('./_ctx') , $export = require('./_export') , toObject = require('./_to-object') , call = require('./_iter-call') , isArrayIter = require('./_is-array-iter') , toLength = require('./_to-length') , createProperty = require('./_create-property') , getIterFn = require('./core.get-iterator-method'); $export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ var O = toObject(arrayLike) , C = typeof this == 'function' ? this : Array , aLen = arguments.length , mapfn = aLen > 1 ? arguments[1] : undefined , mapping = mapfn !== undefined , index = 0 , iterFn = getIterFn(O) , length, result, step, iterator; if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); } } else { length = toLength(O.length); for(result = new C(length); length > index; index++){ createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; } }); },{"./_create-property":37,"./_ctx":38,"./_export":44,"./_is-array-iter":52,"./_iter-call":55,"./_iter-detect":58,"./_to-length":87,"./_to-object":88,"./core.get-iterator-method":94}],96:[function(require,module,exports){ 'use strict'; var addToUnscopables = require('./_add-to-unscopables') , step = require('./_iter-step') , Iterators = require('./_iterators') , toIObject = require('./_to-iobject'); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = require('./_iter-define')(Array, 'Array', function(iterated, kind){ this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var O = this._t , kind = this._k , index = this._i++; if(!O || index >= O.length){ this._t = undefined; return step(1); } if(kind == 'keys' )return step(0, index); if(kind == 'values')return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); },{"./_add-to-unscopables":31,"./_iter-define":57,"./_iter-step":59,"./_iterators":60,"./_to-iobject":86}],97:[function(require,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = require('./_export'); $export($export.S + $export.F, 'Object', {assign: require('./_object-assign')}); },{"./_export":44,"./_object-assign":64}],98:[function(require,module,exports){ var $export = require('./_export') // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', {create: require('./_object-create')}); },{"./_export":44,"./_object-create":65}],99:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f}); },{"./_descriptors":40,"./_export":44,"./_object-dp":66}],100:[function(require,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = require('./_to-object') , $getPrototypeOf = require('./_object-gpo'); require('./_object-sap')('getPrototypeOf', function(){ return function getPrototypeOf(it){ return $getPrototypeOf(toObject(it)); }; }); },{"./_object-gpo":72,"./_object-sap":76,"./_to-object":88}],101:[function(require,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = require('./_to-object') , $keys = require('./_object-keys'); require('./_object-sap')('keys', function(){ return function keys(it){ return $keys(toObject(it)); }; }); },{"./_object-keys":74,"./_object-sap":76,"./_to-object":88}],102:[function(require,module,exports){ // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = require('./_export'); $export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set}); },{"./_export":44,"./_set-proto":79}],103:[function(require,module,exports){ },{}],104:[function(require,module,exports){ 'use strict'; var $at = require('./_string-at')(true); // 21.1.3.27 String.prototype[@@iterator]() require('./_iter-define')(String, 'String', function(iterated){ this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function(){ var O = this._t , index = this._i , point; if(index >= O.length)return {value: undefined, done: true}; point = $at(O, index); this._i += point.length; return {value: point, done: false}; }); },{"./_iter-define":57,"./_string-at":83}],105:[function(require,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = require('./_global') , has = require('./_has') , DESCRIPTORS = require('./_descriptors') , $export = require('./_export') , redefine = require('./_redefine') , META = require('./_meta').KEY , $fails = require('./_fails') , shared = require('./_shared') , setToStringTag = require('./_set-to-string-tag') , uid = require('./_uid') , wks = require('./_wks') , wksExt = require('./_wks-ext') , wksDefine = require('./_wks-define') , keyOf = require('./_keyof') , enumKeys = require('./_enum-keys') , isArray = require('./_is-array') , anObject = require('./_an-object') , toIObject = require('./_to-iobject') , toPrimitive = require('./_to-primitive') , createDesc = require('./_property-desc') , _create = require('./_object-create') , gOPNExt = require('./_object-gopn-ext') , $GOPD = require('./_object-gopd') , $DP = require('./_object-dp') , $keys = require('./_object-keys') , gOPD = $GOPD.f , dP = $DP.f , gOPN = gOPNExt.f , $Symbol = global.Symbol , $JSON = global.JSON , _stringify = $JSON && $JSON.stringify , PROTOTYPE = 'prototype' , HIDDEN = wks('_hidden') , TO_PRIMITIVE = wks('toPrimitive') , isEnum = {}.propertyIsEnumerable , SymbolRegistry = shared('symbol-registry') , AllSymbols = shared('symbols') , OPSymbols = shared('op-symbols') , ObjectProto = Object[PROTOTYPE] , USE_NATIVE = typeof $Symbol == 'function' , QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function(){ return _create(dP({}, 'a', { get: function(){ return dP(this, 'a', {value: 7}).a; } })).a != 7; }) ? function(it, key, D){ var protoDesc = gOPD(ObjectProto, key); if(protoDesc)delete ObjectProto[key]; dP(it, key, D); if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); } : dP; var wrap = function(tag){ var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ return typeof it == 'symbol'; } : function(it){ return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D){ if(it === ObjectProto)$defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if(has(AllSymbols, key)){ if(!D.enumerable){ if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; D = _create(D, {enumerable: createDesc(0, false)}); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P){ anObject(it); var keys = enumKeys(P = toIObject(P)) , i = 0 , l = keys.length , key; while(l > i)$defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P){ return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key){ var E = isEnum.call(this, key = toPrimitive(key, true)); if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ it = toIObject(it); key = toPrimitive(key, true); if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; var D = gOPD(it, key); if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it){ var names = gOPN(toIObject(it)) , result = [] , i = 0 , key; while(names.length > i){ if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ var IS_OP = it === ObjectProto , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) , result = [] , i = 0 , key; while(names.length > i){ if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if(!USE_NATIVE){ $Symbol = function Symbol(){ if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function(value){ if(this === ObjectProto)$set.call(OPSymbols, value); if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString(){ return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; require('./_object-pie').f = $propertyIsEnumerable; require('./_object-gops').f = $getOwnPropertySymbols; if(DESCRIPTORS && !require('./_library')){ redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function(name){ return wrap(wks(name)); } } $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); for(var symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function(key){ return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(key){ if(isSymbol(key))return keyOf(SymbolRegistry, key); throw TypeError(key + ' is not a symbol!'); }, useSetter: function(){ setter = true; }, useSimple: function(){ setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it){ if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined var args = [it] , i = 1 , replacer, $replacer; while(arguments.length > i)args.push(arguments[i++]); replacer = args[1]; if(typeof replacer == 'function')$replacer = replacer; if($replacer || !isArray(replacer))replacer = function(key, value){ if($replacer)value = $replacer.call(this, key, value); if(!isSymbol(value))return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); },{"./_an-object":32,"./_descriptors":40,"./_enum-keys":43,"./_export":44,"./_fails":45,"./_global":46,"./_has":47,"./_hide":48,"./_is-array":53,"./_keyof":61,"./_library":62,"./_meta":63,"./_object-create":65,"./_object-dp":66,"./_object-gopd":68,"./_object-gopn":70,"./_object-gopn-ext":69,"./_object-gops":71,"./_object-keys":74,"./_object-pie":75,"./_property-desc":77,"./_redefine":78,"./_set-to-string-tag":80,"./_shared":82,"./_to-iobject":86,"./_to-primitive":89,"./_uid":90,"./_wks":93,"./_wks-define":91,"./_wks-ext":92}],106:[function(require,module,exports){ require('./_wks-define')('asyncIterator'); },{"./_wks-define":91}],107:[function(require,module,exports){ require('./_wks-define')('observable'); },{"./_wks-define":91}],108:[function(require,module,exports){ require('./es6.array.iterator'); var global = require('./_global') , hide = require('./_hide') , Iterators = require('./_iterators') , TO_STRING_TAG = require('./_wks')('toStringTag'); for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ var NAME = collections[i] , Collection = global[NAME] , proto = Collection && Collection.prototype; if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } },{"./_global":46,"./_hide":48,"./_iterators":60,"./_wks":93,"./es6.array.iterator":96}],109:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = hyphenateProperty; var _hyphenateStyleName = require('hyphenate-style-name'); var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function hyphenateProperty(property) { return (0, _hyphenateStyleName2.default)(property); } module.exports = exports['default']; },{"hyphenate-style-name":141}],110:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isPrefixedValue; var regex = /-webkit-|-moz-|-ms-/; function isPrefixedValue(value) { return typeof value === 'string' && regex.test(value); } module.exports = exports['default']; },{}],111:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = addClass; var _hasClass = require('./hasClass'); var _hasClass2 = _interopRequireDefault(_hasClass); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function addClass(element, className) { if (element.classList) element.classList.add(className);else if (!(0, _hasClass2.default)(element)) element.className = element.className + ' ' + className; } module.exports = exports['default']; },{"./hasClass":112}],112:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = hasClass; function hasClass(element, className) { if (element.classList) return !!className && element.classList.contains(className);else return (" " + element.className + " ").indexOf(" " + className + " ") !== -1; } module.exports = exports["default"]; },{}],113:[function(require,module,exports){ 'use strict'; module.exports = function removeClass(element, className) { if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, ''); }; },{}],114:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined; var _inDOM = require('../util/inDOM'); var _inDOM2 = _interopRequireDefault(_inDOM); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var transform = 'transform'; var prefix = void 0, transitionEnd = void 0, animationEnd = void 0; var transitionProperty = void 0, transitionDuration = void 0, transitionTiming = void 0, transitionDelay = void 0; var animationName = void 0, animationDuration = void 0, animationTiming = void 0, animationDelay = void 0; if (_inDOM2.default) { var _getTransitionPropert = getTransitionProperties(); prefix = _getTransitionPropert.prefix; exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd; exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd; exports.transform = transform = prefix + '-' + transform; exports.transitionProperty = transitionProperty = prefix + '-transition-property'; exports.transitionDuration = transitionDuration = prefix + '-transition-duration'; exports.transitionDelay = transitionDelay = prefix + '-transition-delay'; exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function'; exports.animationName = animationName = prefix + '-animation-name'; exports.animationDuration = animationDuration = prefix + '-animation-duration'; exports.animationTiming = animationTiming = prefix + '-animation-delay'; exports.animationDelay = animationDelay = prefix + '-animation-timing-function'; } exports.transform = transform; exports.transitionProperty = transitionProperty; exports.transitionTiming = transitionTiming; exports.transitionDelay = transitionDelay; exports.transitionDuration = transitionDuration; exports.transitionEnd = transitionEnd; exports.animationName = animationName; exports.animationDuration = animationDuration; exports.animationTiming = animationTiming; exports.animationDelay = animationDelay; exports.animationEnd = animationEnd; exports.default = { transform: transform, end: transitionEnd, property: transitionProperty, timing: transitionTiming, delay: transitionDelay, duration: transitionDuration }; function getTransitionProperties() { var style = document.createElement('div').style; var vendorMap = { O: function O(e) { return 'o' + e.toLowerCase(); }, Moz: function Moz(e) { return e.toLowerCase(); }, Webkit: function Webkit(e) { return 'webkit' + e; }, ms: function ms(e) { return 'MS' + e; } }; var vendors = Object.keys(vendorMap); var transitionEnd = void 0, animationEnd = void 0; var prefix = ''; for (var i = 0; i < vendors.length; i++) { var vendor = vendors[i]; if (vendor + 'TransitionProperty' in style) { prefix = '-' + vendor.toLowerCase(); transitionEnd = vendorMap[vendor]('TransitionEnd'); animationEnd = vendorMap[vendor]('AnimationEnd'); break; } } if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend'; if (!animationEnd && 'animationName' in style) animationEnd = 'animationend'; style = null; return { animationEnd: animationEnd, transitionEnd: transitionEnd, prefix: prefix }; } },{"../util/inDOM":115}],115:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = !!(typeof window !== 'undefined' && window.document && window.document.createElement); module.exports = exports['default']; },{}],116:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _inDOM = require('./inDOM'); var _inDOM2 = _interopRequireDefault(_inDOM); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var vendors = ['', 'webkit', 'moz', 'o', 'ms']; var cancel = 'clearTimeout'; var raf = fallback; var compatRaf = void 0; var getKey = function getKey(vendor, k) { return vendor + (!vendor ? k : k[0].toUpperCase() + k.substr(1)) + 'AnimationFrame'; }; if (_inDOM2.default) { vendors.some(function (vendor) { var rafKey = getKey(vendor, 'request'); if (rafKey in window) { cancel = getKey(vendor, 'cancel'); return raf = function raf(cb) { return window[rafKey](cb); }; } }); } /* https://github.com/component/raf */ var prev = new Date().getTime(); function fallback(fn) { var curr = new Date().getTime(), ms = Math.max(0, 16 - (curr - prev)), req = setTimeout(fn, ms); prev = curr; return req; } compatRaf = function compatRaf(cb) { return raf(cb); }; compatRaf.cancel = function (id) { window[cancel] && typeof window[cancel] === 'function' && window[cancel](id); }; exports.default = compatRaf; module.exports = exports['default']; },{"./inDOM":115}],117:[function(require,module,exports){ 'use strict'; /** * Copyright (c) 2013-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @typechecks */ var emptyFunction = require('./emptyFunction'); /** * Upstream version of event listener. Does not take into account specific * nature of platform. */ var EventListener = { /** * Listen to DOM events during the bubble phase. * * @param {DOMEventTarget} target DOM element to register listener on. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. * @param {function} callback Callback function. * @return {object} Object with a `remove` method. */ listen: function listen(target, eventType, callback) { if (target.addEventListener) { target.addEventListener(eventType, callback, false); return { remove: function remove() { target.removeEventListener(eventType, callback, false); } }; } else if (target.attachEvent) { target.attachEvent('on' + eventType, callback); return { remove: function remove() { target.detachEvent('on' + eventType, callback); } }; } }, /** * Listen to DOM events during the capture phase. * * @param {DOMEventTarget} target DOM element to register listener on. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. * @param {function} callback Callback function. * @return {object} Object with a `remove` method. */ capture: function capture(target, eventType, callback) { if (target.addEventListener) { target.addEventListener(eventType, callback, true); return { remove: function remove() { target.removeEventListener(eventType, callback, true); } }; } else { if ("production" !== 'production') { console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); } return { remove: emptyFunction }; } }, registerDefault: function registerDefault() {} }; module.exports = EventListener; },{"./emptyFunction":124}],118:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); /** * Simple, lightweight module assisting with the detection and context of * Worker. Helps avoid circular dependencies and allows code to reason about * whether or not they are in a Worker, even if they never include the main * `ReactWorker` dependency. */ var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== 'undefined', canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; },{}],119:[function(require,module,exports){ "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks */ var _hyphenPattern = /-(.)/g; /** * Camelcases a hyphenated string, for example: * * > camelize('background-color') * < "backgroundColor" * * @param {string} string * @return {string} */ function camelize(string) { return string.replace(_hyphenPattern, function (_, character) { return character.toUpperCase(); }); } module.exports = camelize; },{}],120:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks */ 'use strict'; var camelize = require('./camelize'); var msPattern = /^-ms-/; /** * Camelcases a hyphenated CSS property name, for example: * * > camelizeStyleName('background-color') * < "backgroundColor" * > camelizeStyleName('-moz-transition') * < "MozTransition" * > camelizeStyleName('-ms-transition') * < "msTransition" * * As Andi Smith suggests * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix * is converted to lowercase `ms`. * * @param {string} string * @return {string} */ function camelizeStyleName(string) { return camelize(string.replace(msPattern, 'ms-')); } module.exports = camelizeStyleName; },{"./camelize":119}],121:[function(require,module,exports){ 'use strict'; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * */ var isTextNode = require('./isTextNode'); /*eslint-disable no-bitwise */ /** * Checks if a given DOM node contains or is another DOM node. */ function containsNode(outerNode, innerNode) { if (!outerNode || !innerNode) { return false; } else if (outerNode === innerNode) { return true; } else if (isTextNode(outerNode)) { return false; } else if (isTextNode(innerNode)) { return containsNode(outerNode, innerNode.parentNode); } else if ('contains' in outerNode) { return outerNode.contains(innerNode); } else if (outerNode.compareDocumentPosition) { return !!(outerNode.compareDocumentPosition(innerNode) & 16); } else { return false; } } module.exports = containsNode; },{"./isTextNode":134}],122:[function(require,module,exports){ 'use strict'; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks */ var invariant = require('./invariant'); /** * Convert array-like objects to arrays. * * This API assumes the caller knows the contents of the data type. For less * well defined inputs use createArrayFromMixed. * * @param {object|function|filelist} obj * @return {array} */ function toArray(obj) { var length = obj.length; // Some browsers builtin objects can report typeof 'function' (e.g. NodeList // in old versions of Safari). !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "production" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; !(typeof length === 'number') ? "production" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; !(length === 0 || length - 1 in obj) ? "production" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; !(typeof obj.callee !== 'function') ? "production" !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; // Old IE doesn't give collections access to hasOwnProperty. Assume inputs // without method will throw during the slice call and skip straight to the // fallback. if (obj.hasOwnProperty) { try { return Array.prototype.slice.call(obj); } catch (e) { // IE < 9 does not support Array#slice on collections objects } } // Fall back to copying key by key. This assumes all keys have a value, // so will not preserve sparsely populated inputs. var ret = Array(length); for (var ii = 0; ii < length; ii++) { ret[ii] = obj[ii]; } return ret; } /** * Perform a heuristic test to determine if an object is "array-like". * * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" * Joshu replied: "Mu." * * This function determines if its argument has "array nature": it returns * true if the argument is an actual array, an `arguments' object, or an * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). * * It will return false for other array-like objects like Filelist. * * @param {*} obj * @return {boolean} */ function hasArrayNature(obj) { return ( // not null/false !!obj && ( // arrays are objects, NodeLists are functions in Safari typeof obj == 'object' || typeof obj == 'function') && // quacks like an array 'length' in obj && // not window !('setInterval' in obj) && // no DOM node should be considered an array-like // a 'select' element has 'length' and 'item' properties on IE8 typeof obj.nodeType != 'number' && ( // a real array Array.isArray(obj) || // arguments 'callee' in obj || // HTMLCollection/NodeList 'item' in obj) ); } /** * Ensure that the argument is an array by wrapping it in an array if it is not. * Creates a copy of the argument if it is already an array. * * This is mostly useful idiomatically: * * var createArrayFromMixed = require('createArrayFromMixed'); * * function takesOneOrMoreThings(things) { * things = createArrayFromMixed(things); * ... * } * * This allows you to treat `things' as an array, but accept scalars in the API. * * If you need to convert an array-like object, like `arguments`, into an array * use toArray instead. * * @param {*} obj * @return {array} */ function createArrayFromMixed(obj) { if (!hasArrayNature(obj)) { return [obj]; } else if (Array.isArray(obj)) { return obj.slice(); } else { return toArray(obj); } } module.exports = createArrayFromMixed; },{"./invariant":132}],123:[function(require,module,exports){ 'use strict'; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks */ /*eslint-disable fb-www/unsafe-html*/ var ExecutionEnvironment = require('./ExecutionEnvironment'); var createArrayFromMixed = require('./createArrayFromMixed'); var getMarkupWrap = require('./getMarkupWrap'); var invariant = require('./invariant'); /** * Dummy container used to render all markup. */ var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; /** * Pattern used by `getNodeName`. */ var nodeNamePattern = /^\s*<(\w+)/; /** * Extracts the `nodeName` of the first element in a string of markup. * * @param {string} markup String of markup. * @return {?string} Node name of the supplied markup. */ function getNodeName(markup) { var nodeNameMatch = markup.match(nodeNamePattern); return nodeNameMatch && nodeNameMatch[1].toLowerCase(); } /** * Creates an array containing the nodes rendered from the supplied markup. The * optionally supplied `handleScript` function will be invoked once for each * ================================================ FILE: build/main.css ================================================ html { font-family: 'Roboto', sans-serif; } body { margin: 0; font-size: 13px; line-height: 20px; background-color: #ccc; } /*animations for the demo*/ /*http://daneden.github.io/animate.css*/ @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } .fadeOut { animation-name: fadeOut; animation-duration: .3s; animation-fill-mode: both; } @keyframes zoomInUp { from { opacity: 0; transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0); animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); } 60% { opacity: 1; transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); } } .zoomInUp { animation-name: zoomInUp; animation-duration: .3s; animation-fill-mode: both; } ================================================ FILE: gulp/config.js ================================================ var dest = './build', src = './src', mui = './node_modules/material-ui/src'; module.exports = { browserSync: { server: { // We're serving the src folder as well // for sass sourcemap linking baseDir: [dest, src] }, files: [ dest + '/**' ] }, markup: { src: src + "/www/**", dest: dest }, browserify: { // Enable source maps debug: false, // A separate bundle will be generated for each // bundle config in the list below bundleConfigs: [{ entries: src + '/app/app.js', dest: dest, outputName: 'app.js' } ], extensions: ['.js'], } }; ================================================ FILE: gulp/tasks/browserSync.js ================================================ var browserSync = require('browser-sync'); var gulp = require('gulp'); var config = require('../config').browserSync; gulp.task('browserSync', ['build'], function() { browserSync(config); }); ================================================ FILE: gulp/tasks/browserify.js ================================================ /* browserify task --------------- Bundle javascripty things with browserify! This task is set up to generate multiple separate bundles, from different sources, and to use Watchify when run from the default task. See browserify.bundleConfigs in gulp/config.js */ var browserify = require('browserify'); var watchify = require('watchify'); var bundleLogger = require('../util/bundleLogger'); var gulp = require('gulp'); var handleErrors = require('../util/handleErrors'); var source = require('vinyl-source-stream'); var config = require('../config').browserify; var babelify = require('babelify'); gulp.task('browserify', function(callback) { var bundleQueue = config.bundleConfigs.length; var browserifyThis = function(bundleConfig) { var bundler = browserify({ // Required watchify args cache: {}, packageCache: {}, fullPaths: false, // Specify the entry point of your app entries: bundleConfig.entries, // Add file extensions to make optional in your requires extensions: config.extensions, // Enable source maps! debug: config.debug }); var bundle = function() { // Log when bundling starts bundleLogger.start(bundleConfig.outputName); return bundler .bundle() // Report compile errors .on('error', handleErrors) // Use vinyl-source-stream to make the // stream gulp compatible. Specify the // desired output filename here. .pipe(source(bundleConfig.outputName)) // Specify the output destination .pipe(gulp.dest(bundleConfig.dest)) .on('end', reportFinished); }; bundler.transform(babelify.configure()); if (global.isWatching) { // Wrap with watchify and rebundle on changes bundler = watchify(bundler); // Rebundle on update bundler.on('update', bundle); } var reportFinished = function() { // Log when bundling completes bundleLogger.end(bundleConfig.outputName); if (bundleQueue) { bundleQueue--; if (bundleQueue === 0) { // If queue is empty, tell gulp the task is complete. // https://github.com/gulpjs/gulp/blob/master/docs/API.md#accept-a-callback callback(); } } }; return bundle(); }; // Start bundling with Browserify for each bundleConfig specified config.bundleConfigs.forEach(browserifyThis); }); ================================================ FILE: gulp/tasks/build.js ================================================ var gulp = require('gulp'); gulp.task('build', ['browserify', 'copyImages', 'markup']); ================================================ FILE: gulp/tasks/buildComponent.js ================================================ var gulp = require('gulp'); var babel = require('gulp-babel'); var rename = require('gulp-rename'); var uglify = require('gulp-uglify'); gulp.task('buildComponents', function () { return gulp.src('src/app/ReactMaterialUiNotifications.js') .pipe(babel()) .pipe(gulp.dest('lib')) .pipe(rename({ suffix: '.min' })) .pipe(uglify()) .pipe(gulp.dest('lib')); }); ================================================ FILE: gulp/tasks/copyImages.js ================================================ // copy relevant images to the destination folder var gulp = require('gulp'); gulp.task('copyImages', function() { return gulp.src('assets/**/*.png') .pipe(gulp.dest('build')); }); ================================================ FILE: gulp/tasks/default.js ================================================ var gulp = require('gulp'); gulp.task('default', ['watch']); ================================================ FILE: gulp/tasks/markup.js ================================================ var gulp = require('gulp'); var config = require('../config').markup; gulp.task('markup', function() { return gulp.src(config.src) .pipe(gulp.dest(config.dest)); }); ================================================ FILE: gulp/tasks/minify.js ================================================ var gulp = require('gulp'); var config = require('../config').browserify.bundleConfigs; var uglify = require('gulp-uglify'); var pump = require('pump'); var rename = require("gulp-rename"); gulp.task('minifyApp', function(cb) { pump([ gulp.src('build/app.js'), uglify(), rename(function (path) { path.extname = ".min.js" }), gulp.dest('build') ], cb ); }); ================================================ FILE: gulp/tasks/release.js ================================================ // make a release build var gulp = require('gulp'); var runSequence = require('run-sequence'); gulp.task('release', ['browserify', 'copyImages', 'markup', 'buildComponents'], function(done) { runSequence('minifyApp', function() { done(); }); }); ================================================ FILE: gulp/tasks/setWatch.js ================================================ var gulp = require('gulp'); gulp.task('setWatch', function() { global.isWatching = true; }); ================================================ FILE: gulp/tasks/watch.js ================================================ /* Notes: - gulp/tasks/browserify.js handles js recompiling with watchify - gulp/tasks/browserSync.js watches and reloads compiled files */ var gulp = require('gulp'); var config = require('../config'); gulp.task('watch', ['setWatch', 'browserSync'], function() { gulp.watch(config.markup.src, ['markup']); }); ================================================ FILE: gulp/util/bundleLogger.js ================================================ /* bundleLogger ------------ Provides gulp style logs to the bundle method in browserify.js */ var gutil = require('gulp-util'); var prettyHrtime = require('pretty-hrtime'); var startTime; module.exports = { start: function(filepath) { startTime = process.hrtime(); gutil.log('Bundling', gutil.colors.green(filepath) + '...'); }, end: function(filepath) { var taskTime = process.hrtime(startTime); var prettyTime = prettyHrtime(taskTime); gutil.log('Bundled', gutil.colors.green(filepath), 'in', gutil.colors.magenta(prettyTime)); } }; ================================================ FILE: gulp/util/handleErrors.js ================================================ var notify = require("gulp-notify"); module.exports = function() { var args = Array.prototype.slice.call(arguments); // Send error to notification center with gulp-notify notify.onError({ title: "Compile Error", message: "<%= error.message %>" }).apply(this, args); // Keep gulp from hanging on this task this.emit('end'); }; ================================================ FILE: gulp release.bat ================================================ set NODE_ENV=production gulp release ================================================ FILE: gulp run.bat ================================================ set NODE_ENV=development gulp default ================================================ FILE: gulpfile.js ================================================ /* gulpfile.js =========== Rather than manage one giant configuration file responsible for creating multiple tasks, each task has been broken out into its own file in gulp/tasks. Any files in that directory get automatically required below. To add a new task, simply add a new task file that directory. gulp/tasks/default.js specifies the default set of tasks to run when you run `gulp`. */ var requireDir = require('require-dir'); // Require all tasks in gulp/tasks, including subfolders requireDir('./gulp/tasks', { recurse: true }); ================================================ FILE: lib/ReactMaterialUiNotifications.js ================================================ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _propTypes = require('prop-types'); var _propTypes2 = _interopRequireDefault(_propTypes); var _propTypes3 = require('material-ui/utils/propTypes'); var _propTypes4 = _interopRequireDefault(_propTypes3); var _reactTransitionGroup = require('react-transition-group'); var _Paper = require('material-ui/Paper'); var _Paper2 = _interopRequireDefault(_Paper); var _List = require('material-ui/List'); var _Divider = require('material-ui/Divider'); var _Divider2 = _interopRequireDefault(_Divider); var _IconButton = require('material-ui/IconButton'); var _IconButton2 = _interopRequireDefault(_IconButton); var _Avatar = require('material-ui/Avatar'); var _Avatar2 = _interopRequireDefault(_Avatar); var _close = require('material-ui/svg-icons/navigation/close'); var _close2 = _interopRequireDefault(_close); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * material design spec compliant notifications for react and material-ui users */ // icons // this will store the notifications and their count to track them and also maxNotifications for use in internal functions var notifications = [], count = 0, maxNotifications = void 0; var ReactMaterialUiNotifications = function (_Component) { _inherits(ReactMaterialUiNotifications, _Component); function ReactMaterialUiNotifications() { var _ref; var _temp, _this, _ret; _classCallCheck(this, ReactMaterialUiNotifications); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ReactMaterialUiNotifications.__proto__ || Object.getPrototypeOf(ReactMaterialUiNotifications)).call.apply(_ref, [this].concat(args))), _this), _this.getStyle = function () { var style = { position: 'fixed', zIndex: 1, minWidth: 325 }; return Object.assign(style, _this.props.rootStyle); }, _this.getProps = function (props) { var _this$props = _this.props, children = _this$props.children, rootStyle = _this$props.rootStyle, maxNotifications = _this$props.maxNotifications, pProps = _objectWithoutProperties(_this$props, ['children', 'rootStyle', 'maxNotifications']); return Object.assign(props, pProps); }, _temp), _possibleConstructorReturn(_this, _ret); } /** * default props */ _createClass(ReactMaterialUiNotifications, [{ key: 'componentWillMount', /** * copy some values to global for use in internal functions */ value: function componentWillMount() { notifications = []; maxNotifications = this.props.maxNotifications; } // add notification method /** * filter out and only keep the open notifications * @method * @param {object} notification [a notification object] */ /** * perform operations like capping on the operations before doing them */ // merge local styles and overriding styles and return it /** * get the props we want to forward to the notification */ }, { key: 'removeNotification', value: function removeNotification(index) { notifications.splice(index, 1); this.forceUpdate(); } }, { key: 'render', value: function render() { var _this2 = this; return _react2.default.createElement( 'div', { style: this.getStyle() }, notifications.map(function (props, index) { return _react2.default.createElement(Notification, _extends({ removeNotification: function removeNotification() { _this2.removeNotification(index); }, open: true, key: props.count }, _this2.getProps(props))); }) ); } }]); return ReactMaterialUiNotifications; }(_react.Component); ReactMaterialUiNotifications.muiPropTypes = { /** * Desktop device or touch device */ desktop: _propTypes2.default.bool, /** * maximum number of notifications to display */ maxNotifications: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), /** * root component's style */ rootStyle: _propTypes2.default.object }; ReactMaterialUiNotifications.defaultProps = { maxNotifications: Infinity, rootStyle: { bottom: 20, right: 25 } }; ReactMaterialUiNotifications.contextTypes = { muiTheme: _propTypes2.default.object.isRequired }; ReactMaterialUiNotifications.showNotification = function (notification) { var tempNotifications = notifications; // push a new notification to notifications notification.open = true; notification.count = count; tempNotifications.push(notification // filter and keep only the open ones );tempNotifications = tempNotifications.filter(ReactMaterialUiNotifications.filterOpen // shuffle notifications and set actual notifications to the temp ones to update render );notifications = ReactMaterialUiNotifications.shuffleNotifications(tempNotifications // update counter );count++; }; ReactMaterialUiNotifications.filterOpen = function (notification) { return notification.open; }; ReactMaterialUiNotifications.shuffleNotifications = function (tempNotifications) { if (tempNotifications.length > maxNotifications) { for (var i in tempNotifications) { if (_typeof(tempNotifications[i]) === 'object' && (!tempNotifications[i].hasOwnProperty('priority') || !tempNotifications[i].priority)) { tempNotifications.splice(i, 1); if (tempNotifications.length === maxNotifications) { break; } } } } /** * sort the priority notifications to the top */ tempNotifications.sort(function (a, b) { var priorityA = a.priority, priorityB = b.priority; if (!priorityA && priorityB) { return 1; } else if (priorityA && !priorityB) { return -1; } // other cases they are considered same return 0; }); return tempNotifications; }; exports.default = ReactMaterialUiNotifications; var Notification = function (_Component2) { _inherits(Notification, _Component2); function Notification() { var _ref2; var _temp2, _this3, _ret2; _classCallCheck(this, Notification); for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _ret2 = (_temp2 = (_this3 = _possibleConstructorReturn(this, (_ref2 = Notification.__proto__ || Object.getPrototypeOf(Notification)).call.apply(_ref2, [this].concat(args))), _this3), _this3.getStyle = function () { var style = { display: 'block', textAlign: 'left', borderRadius: 3, margin: '12px auto' }; return Object.assign(style, _this3.props.style); }, _this3.onCloseNotification = function () { _this3.props.removeNotification(); }, _this3.getNotificationIcon = function () { /** * only show notification icon if it is passes */ var iconEl = void 0; if (_this3.props.icon) { /** * if personalised then render an avatar with the icon */ if (_this3.props.personalised) { var leftIconBodyStyle = { top: 4, margin: 0, left: 8, width: 'auto', height: 'auto' }, leftAvatarStyle = { textAlign: 'center' }, leftIconStyle = { position: 'absolute', padding: 4, right: -6, bottom: -4, borderRadius: '50%', backgroundColor: _this3.props.iconBadgeColor, justifyContent: 'center', alignItems: 'center', display: 'flex' }, leftIcon = (0, _react.cloneElement)(_this3.props.icon, { color: _this3.props.iconFillColor, style: { width: 12, height: 12 } }); iconEl = _react2.default.createElement( 'div', { style: leftIconBodyStyle }, _react2.default.createElement(_Avatar2.default, { src: _this3.props.avatar, size: 44, style: leftAvatarStyle }), _react2.default.createElement( 'div', { style: leftIconStyle }, leftIcon ) ); } else { var _leftIconBodyStyle = { height: 32, width: 32, top: 4, padding: 6, margin: 0, left: 8, borderRadius: '50%', backgroundColor: _this3.props.iconBadgeColor, justifyContent: 'center', alignItems: 'center', display: 'flex' }, _leftIcon = (0, _react.cloneElement)(_this3.props.icon, { color: _this3.props.iconFillColor, style: { margin: 0 } }); iconEl = _react2.default.createElement( 'div', { style: _leftIconBodyStyle }, _leftIcon ); } } return iconEl; }, _temp2), _possibleConstructorReturn(_this3, _ret2); } /** * these props are named after https://material.google.com/patterns/notifications.html#notifications-content */ /** * default props */ _createClass(Notification, [{ key: 'componentWillMount', value: function componentWillMount() { var _this4 = this; /** * if autohide is set then use it */ if (this.props.autoHide) { this.autoHideTimeout = setTimeout(function () { _this4.props.removeNotification(); }, this.props.autoHide); } } /** * cancel the settimeout function of the autohide method if the open is changed before timeout ends */ }, { key: 'componentWillUnmount', value: function componentWillUnmount() { clearTimeout(this.autoHideTimeout); } /** * merge local styles and overriding styles and return it */ /** * hide notification on click of the close button * cancel the settimeout function of the autohide method if the open is changed before timeout ends */ /** * generate the correct icon body on the left to display in the notification */ }, { key: 'render', value: function render() { var _this5 = this; var iconButtonStyle = { width: 36, height: 36, top: -3, right: 4, padding: 6 }, iconStyle = { height: 18, width: 18 }, listItemStyle = { padding: this.props.icon ? '8px 8px 0 72px' : '8px 8px 0 12px' }, listStyle = { position: 'relative' }, overflowStyle = { padding: '12px 0 12px 72px' }, overflowContentStyle = { paddingLeft: 72 }, secondaryTextStyle = { marginTop: 8, marginBottom: 8 }, timestampStyle = { position: 'absolute', right: this.props.desktop ? 42 : 8, fontSize: 12, top: 14 /** * secondary line text */ };var secondaryText = void 0, expandedText = void 0, expandedAction = void 0, desktopClose = void 0, timestampEl = void 0; if (this.props.additionalText) { secondaryText = _react2.default.createElement( 'div', { style: secondaryTextStyle }, this.props.additionalText ); } /** * if overflow text is present then show these expanded items */ if (this.props.overflowText) { expandedText = _react2.default.createElement( 'span', null, _react2.default.createElement(_Divider2.default, { inset: true }), _react2.default.createElement( 'div', { style: overflowStyle }, this.props.overflowText ) ); } else { expandedText = _react2.default.createElement('span', null); } /** * if overflow content is present then show these expanded items */ if (this.props.overflowContent) { expandedAction = _react2.default.createElement( 'span', null, _react2.default.createElement(_Divider2.default, { inset: true }), _react2.default.createElement( 'div', { style: overflowContentStyle }, this.props.overflowContent ) ); } else { expandedAction = _react2.default.createElement('span', null); } /** * show icon button if on desktop */ if (this.props.desktop) { desktopClose = _react2.default.createElement( _IconButton2.default, { style: iconButtonStyle, iconStyle: iconStyle, onTouchTap: this.onCloseNotification }, _react2.default.createElement(_close2.default, null) ); } /** * show the timestamp if the string is filled */ if (this.props.timestamp) { timestampEl = _react2.default.createElement( 'div', { style: timestampStyle }, this.props.timestamp ); } return _react2.default.createElement( _reactTransitionGroup.CSSTransitionGroup, { transitionName: this.props.transitionName ? this.props.transitionName : "", transitionAppear: this.props.transitionAppear ? this.props.transitionAppear : false, transitionEnter: this.props.transitionEnter ? this.props.transitionEnter : false, transitionLeave: this.props.transitionLeave ? this.props.transitionLeave : false, transitionAppearTimeout: this.props.transitionAppearTimeout ? this.props.transitionAppearTimeout : 0, transitionEnterTimeout: this.props.transitionEnterTimeout ? this.props.transitionEnterTimeout : 0, transitionLeaveTimeout: this.props.transitionLeaveTimeout ? this.props.transitionLeaveTimeout : 0 }, _react2.default.createElement( _Paper2.default, { style: this.getStyle(), zDepth: this.props.zDepth, transitionEnabled: false }, _react2.default.createElement( _List.List, { style: listStyle }, _react2.default.createElement(_List.ListItem, { primaryText: this.props.title, secondaryText: secondaryText, secondaryTextLines: this.props.additionalLines, leftIcon: this.getNotificationIcon(), insetChildren: true, rightIconButton: desktopClose, innerDivStyle: listItemStyle, disabled: this.props.onClick ? false : true, onTouchTap: function onTouchTap() { if (_this5.props.onClick) { _this5.props.onClick(); _this5.props.removeNotification(); } } }), timestampEl ), expandedAction, expandedText ) ); } }]); return Notification; }(_react.Component); Notification.muiPropTypes = { /** * additional text for display */ additionalText: _propTypes2.default.string, /** * number of lines of text for additionalText */ additionalLines: _propTypes2.default.number, /** * autohide timeout to determine whether to hide the notification automatically or nor */ autoHide: _propTypes2.default.number, /** * pass left avatar image url to be displayed in a personalised notification */ avatar: _propTypes2.default.string, /** * notification icon on the left */ icon: _propTypes2.default.element, /* * icon surrounding badge color */ iconBadgeColor: _propTypes2.default.string, /** * icon color */ iconFillColor: _propTypes2.default.string, /** * When the notification is clicked, if not passed it won't be clicakble */ onClick: _propTypes2.default.func, /** * open which tells whether to display the message */ open: _propTypes2.default.bool, /** * additional overflow text */ overflowText: _propTypes2.default.string, /** * additional overflow content, like buttons * TODO implement the on click dismiss action like done in card (material-ui) as actAsExpander */ overflowContent: _propTypes2.default.element, /** * is personalised notification or not */ personalised: _propTypes2.default.bool, /** * it is a priority notification */ priority: _propTypes2.default.bool, /** * Injected from parent, needed to remove the notification */ removeNotification: _propTypes2.default.func, /** * Override the inline-styles of the root element. */ style: _propTypes2.default.object, /** * notification title */ title: _propTypes2.default.string, /** * timestamp you want to display */ timestamp: _propTypes2.default.string, /** * This number represents the zDepth of the paper shadow covering the message. */ zDepth: _propTypes4.default.zDepth }; Notification.defaultProps = { iconFillColor: '#fff', zDepth: 1 }; Notification.contextTypes = { muiTheme: _propTypes2.default.object.isRequired }; ================================================ FILE: package.json ================================================ { "name": "react-materialui-notifications", "version": "0.5.1", "description": "Spec compliant notifications for react and material ui users", "keywords": [ "react", "material", "design", "notification", "material-ui" ], "repository": { "type": "git", "url": "https://github.com/puranjayjain/react-materialui-notifications.git" }, "author": "Puranjay Jain ", "contributors": [ { "name": "Gonçalo Margalho", "email": "gsky89@gmail.com", "url": "https://github.com/DevAlien" } ], "main": "./lib/ReactMaterialUiNotifications.js", "scripts": { "start": "gulp" }, "license": "MIT ", "dependencies": { "material-ui": "^0.18.1", "prop-types": "^15.5.10", "react": "^15.5.4", "react-dom": "^15.5.4", "react-tap-event-plugin": "^2.0.1", "react-transition-group": "^1.1.3" }, "devDependencies": { "babel-core": "^6.24.1", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "babelify": "^7.3.0", "browser-sync": "^2.18.12", "browserify": "^14.4.0", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", "gulp-notify": "^3.0.0", "gulp-rename": "^1.2.2", "gulp-uglify": "^3.0.0", "gulp-util": "^3.0.8", "moment": "^2.18.1", "pretty-hrtime": "^1.0.3", "pump": "^1.0.2", "recompose": "^0.23.4", "require-dir": "^0.3.2", "run-sequence": "^1.2.2", "underscore": "^1.8.3", "vinyl-source-stream": "^1.1.0", "watchify": "^3.9.0" } } ================================================ FILE: src/app/Github.js ================================================ import React from 'react' import pure from 'recompose/pure' import SvgIcon from 'material-ui/SvgIcon' let Github = (props) => ( ) Github = pure(Github) Github.displayName = 'Github' Github.muiName = 'SvgIcon' export default Github ================================================ FILE: src/app/Main.js ================================================ import React, {Component} from 'react' import Paper from 'material-ui/Paper' import RaisedButton from 'material-ui/RaisedButton' import {deepOrange500} from 'material-ui/styles/colors' import IconButton from 'material-ui/IconButton' import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn} from 'material-ui/Table' import getMuiTheme from 'material-ui/styles/getMuiTheme' import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' import AppBar from 'material-ui/AppBar' import FlatButton from 'material-ui/FlatButton' import Close from 'material-ui/svg-icons/navigation/close' import CommunicationCall from 'material-ui/svg-icons/communication/call' import Message from 'material-ui/svg-icons/communication/message' import Github from './Github' import ReactMaterialUiNotifications from './ReactMaterialUiNotifications' import moment from 'moment' import {ComponentData, NotificationData} from './Data' const styles = { appbar: { background: deepOrange500, textAlign: 'left' }, buttonContainer: { display: 'flex', justifyContent: 'space-around' }, footer: { marginTop: 15, width: 'calc(100% - 30px)', fontSize: 16, padding: 15, backgroundColor: '#fff' }, logo: { width: 48 }, paper: { width: '100%', textAlign: 'left', marginBottom: 15, padding: 15, fontSize: 18 }, rightIcon: { width: 36, height: 36, fill: '#fff' }, table: { marginTop: 15 }, headerStyle: { tableLayout: 'auto' }, table1Col1: { width: 137 }, table1Col2: { width: 72 }, table1Col3: { width: 128 }, table1Col2C: { width: 72, color: deepOrange500 }, table2Col3: { width: 36 } }, muiTheme = getMuiTheme({ palette: { accent1Color: deepOrange500, }, }) export default class Main extends Component { state = { count: 0 } showNotification = () => { ReactMaterialUiNotifications.showNotification({ title: 'Title', additionalText: `Some message to be displayed ${this.state.count}`, icon: , iconBadgeColor: deepOrange500, overflowText: "joe@gmail.com", timestamp: moment().format('h:mm A') }) // update notifications count this.setState({ count: ++this.state.count }) } showPersonalisedNotification = () => { // update notifications count this.setState({ count: ++this.state.count }) ReactMaterialUiNotifications.showNotification({ title: 'Title', additionalText: `Some message to be displayed ${this.state.count}`, icon: , iconBadgeColor: deepOrange500, overflowText: "me@gmail.com", timestamp: moment().format('h:mm A'), personalised: true, avatar: "demo.png" }) } showPriorityNotification = () => { // update notifications count this.setState({ count: ++this.state.count }) ReactMaterialUiNotifications.showNotification({ title: 'Title', additionalText: `Some message to be displayed ${this.state.count}`, icon: , iconBadgeColor: deepOrange500, overflowContent:
} /> } />
, timestamp: moment().format('h:mm A'), personalised: true, avatar: "demo.png", priority: true, zDepth: 4 }) } render() { return (
} iconElementRight={ } />

Spec compliant notifications for react and material ui users

Install from npm

npm i react-materialui-notifications

Install from bower

bower install react-materialui-notifications

Usage example

{location.href = 'https://github.com/puranjayjain/react-materialui-notifications/blob/master/src/app/Main.js'}} />
ReactMaterialUiNotifications Component Props Prop Types Default Description {ComponentData.map((row, index) => ( {row.prop} {row.types} {row.default} {row.description} ))}
Children options for each Notification Prop Types Default Description {NotificationData.map((row, index) => ( {row.prop} {row.types} {row.default} {row.description} ))}
Copyright © 2016 Puranjay Jain and Contributors.
) } } ================================================ FILE: src/app/ReactMaterialUiNotifications.js ================================================ /** * material design spec compliant notifications for react and material-ui users */ import React, {cloneElement, Component} from 'react' import PropTypes from 'prop-types' import muiPropTypes from 'material-ui/utils/propTypes' import { CSSTransitionGroup } from 'react-transition-group' import Paper from 'material-ui/Paper' import {List, ListItem} from 'material-ui/List' import Divider from 'material-ui/Divider' import IconButton from 'material-ui/IconButton' import Avatar from 'material-ui/Avatar' // icons import Close from 'material-ui/svg-icons/navigation/close' // this will store the notifications and their count to track them and also maxNotifications for use in internal functions let notifications = [], count = 0, maxNotifications export default class ReactMaterialUiNotifications extends Component { static muiPropTypes = { /** * Desktop device or touch device */ desktop: PropTypes.bool, /** * maximum number of notifications to display */ maxNotifications: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), /** * root component's style */ rootStyle: PropTypes.object } /** * default props */ static defaultProps = { maxNotifications: Infinity, rootStyle: { bottom: 20, right: 25 } } static contextTypes = { muiTheme: PropTypes.object.isRequired } /** * copy some values to global for use in internal functions */ componentWillMount() { notifications = [] maxNotifications = this.props.maxNotifications } // add notification method static showNotification = (notification) => { let tempNotifications = notifications // push a new notification to notifications notification.open = true notification.count = count tempNotifications.push(notification) // filter and keep only the open ones tempNotifications = tempNotifications.filter(ReactMaterialUiNotifications.filterOpen) // shuffle notifications and set actual notifications to the temp ones to update render notifications = ReactMaterialUiNotifications.shuffleNotifications(tempNotifications) // update counter count++ } /** * filter out and only keep the open notifications * @method * @param {object} notification [a notification object] */ static filterOpen = (notification) => notification.open /** * perform operations like capping on the operations before doing them */ static shuffleNotifications = (tempNotifications) => { if (tempNotifications.length > maxNotifications) { for (let i in tempNotifications) { if (typeof tempNotifications[i] === 'object' && (!tempNotifications[i].hasOwnProperty('priority') || !tempNotifications[i].priority)) { tempNotifications.splice(i, 1) if (tempNotifications.length === maxNotifications) { break } } } } /** * sort the priority notifications to the top */ tempNotifications.sort(function (a, b) { const priorityA = a.priority, priorityB = b.priority if (!priorityA && priorityB) { return 1 } else if (priorityA && !priorityB) { return -1 } // other cases they are considered same return 0 }) return tempNotifications } // merge local styles and overriding styles and return it getStyle = () => { const style = { position: 'fixed', zIndex: 1, minWidth: 325 } return Object.assign(style, this.props.rootStyle) } /** * get the props we want to forward to the notification */ getProps = (props) => { let {children, rootStyle, maxNotifications, ...pProps} = this.props return Object.assign(props, pProps) } removeNotification(index) { notifications.splice(index, 1) this.forceUpdate() } render() { return (
{notifications.map((props, index) => { return {this.removeNotification(index)}} open={true} key={props.count} {...this.getProps(props)} /> })}
) } } class Notification extends Component { /** * these props are named after https://material.google.com/patterns/notifications.html#notifications-content */ static muiPropTypes = { /** * additional text for display */ additionalText: PropTypes.string, /** * number of lines of text for additionalText */ additionalLines: PropTypes.number, /** * autohide timeout to determine whether to hide the notification automatically or nor */ autoHide: PropTypes.number, /** * pass left avatar image url to be displayed in a personalised notification */ avatar: PropTypes.string, /** * notification icon on the left */ icon: PropTypes.element, /* * icon surrounding badge color */ iconBadgeColor: PropTypes.string, /** * icon color */ iconFillColor: PropTypes.string, /** * When the notification is clicked, if not passed it won't be clicakble */ onClick: PropTypes.func, /** * open which tells whether to display the message */ open: PropTypes.bool, /** * additional overflow text */ overflowText: PropTypes.string, /** * additional overflow content, like buttons * TODO implement the on click dismiss action like done in card (material-ui) as actAsExpander */ overflowContent: PropTypes.element, /** * is personalised notification or not */ personalised: PropTypes.bool, /** * it is a priority notification */ priority: PropTypes.bool, /** * Injected from parent, needed to remove the notification */ removeNotification: PropTypes.func, /** * Override the inline-styles of the root element. */ style: PropTypes.object, /** * notification title */ title: PropTypes.string, /** * timestamp you want to display */ timestamp: PropTypes.string, /** * This number represents the zDepth of the paper shadow covering the message. */ zDepth: muiPropTypes.zDepth } /** * default props */ static defaultProps = { iconFillColor: '#fff', zDepth: 1 } static contextTypes = { muiTheme: PropTypes.object.isRequired } componentWillMount() { /** * if autohide is set then use it */ if (this.props.autoHide) { this.autoHideTimeout = setTimeout(() => { this.props.removeNotification() }, this.props.autoHide) } } /** * cancel the settimeout function of the autohide method if the open is changed before timeout ends */ componentWillUnmount() { clearTimeout(this.autoHideTimeout) } /** * merge local styles and overriding styles and return it */ getStyle = () => { const style = { display: 'block', textAlign: 'left', borderRadius: 3, margin: '12px auto' } return Object.assign(style, this.props.style) } /** * hide notification on click of the close button * cancel the settimeout function of the autohide method if the open is changed before timeout ends */ onCloseNotification = () => { this.props.removeNotification() } /** * generate the correct icon body on the left to display in the notification */ getNotificationIcon = () => { /** * only show notification icon if it is passes */ let iconEl if (this.props.icon) { /** * if personalised then render an avatar with the icon */ if (this.props.personalised) { let leftIconBodyStyle = { top: 4, margin: 0, left: 8, width: 'auto', height: 'auto' }, leftAvatarStyle = { textAlign: 'center' }, leftIconStyle = { position: 'absolute', padding: 4, right: -6, bottom: -4, borderRadius: '50%', backgroundColor: this.props.iconBadgeColor, justifyContent: 'center', alignItems: 'center', display: 'flex' }, leftIcon = cloneElement(this.props.icon, { color: this.props.iconFillColor, style: { width: 12, height: 12 } }) iconEl =
{leftIcon}
} else { let leftIconBodyStyle = { height: 32, width: 32, top: 4, padding: 6, margin: 0, left: 8, borderRadius: '50%', backgroundColor: this.props.iconBadgeColor, justifyContent: 'center', alignItems: 'center', display: 'flex' }, leftIcon = cloneElement(this.props.icon, { color: this.props.iconFillColor, style: { margin: 0 } }) iconEl =
{leftIcon}
} } return iconEl } render() { const iconButtonStyle = { width: 36, height: 36, top: -3, right: 4, padding: 6 }, iconStyle = { height: 18, width: 18 }, listItemStyle = { padding: this.props.icon ? '8px 8px 0 72px' : '8px 8px 0 12px' }, listStyle = { position: 'relative' }, overflowStyle = { padding: '12px 0 12px 72px' }, overflowContentStyle = { paddingLeft: 72 }, secondaryTextStyle = { marginTop: 8, marginBottom: 8 }, timestampStyle = { position: 'absolute', right: this.props.desktop ? 42 : 8, fontSize: 12, top: 14 } /** * secondary line text */ let secondaryText, expandedText, expandedAction, desktopClose, timestampEl if (this.props.additionalText) { secondaryText =
{this.props.additionalText}
} /** * if overflow text is present then show these expanded items */ if (this.props.overflowText) { expandedText =
{this.props.overflowText}
} else { expandedText = } /** * if overflow content is present then show these expanded items */ if (this.props.overflowContent) { expandedAction =
{this.props.overflowContent}
} else { expandedAction = } /** * show icon button if on desktop */ if (this.props.desktop) { desktopClose = } /** * show the timestamp if the string is filled */ if (this.props.timestamp) { timestampEl =
{this.props.timestamp}
} return ( { if (this.props.onClick) { this.props.onClick() this.props.removeNotification() } }} /> {timestampEl} {expandedAction} {expandedText} ) } } ================================================ FILE: src/app/app.js ================================================ import React from 'react' import {ReactDOM, render} from 'react-dom' import injectTapEventPlugin from 'react-tap-event-plugin' import Main from './Main' // Needed for onTouchTap // http://stackoverflow.com/a/34015469/988941 injectTapEventPlugin() // Render the main app react component into the app div. // For more details see: https://facebook.github.io/react/docs/top-level-api.html#react.render render(
, document.getElementById('app')) ================================================ FILE: src/app/data.js ================================================ // table data for all the options const ComponentData = [ { prop: 'desktop', types: 'bool', default: 'false', description: 'Desktop device or touch device, in Desktop mode you have close button on the right' }, { prop: 'maxNotifications', types: 'number, string', default: 'Infinity', description: 'Maximum number of notifications to display' }, { prop: 'rootStyle', types: 'object', default: '{bottom: 20, right: 25}', description: 'Container of all notifications, component\'s style' }, { prop: 'All react css transition props', types: 'see react css addon\'s docs', default: '..\src\app\ReactMaterialUiNotifications.js#L448', description: 'https://facebook.github.io/react/docs/animation.html' } ] const NotificationData = [ { 'prop': 'additionalText', 'types': 'string', 'default': '', 'description': 'Additional text below the Title of the Notification' }, { 'prop': 'additionalLines', 'types': 'number', 'default': '1', 'description': 'Number of lines to truncate or show ellipsis in the Additional text' }, { 'prop': 'autoHide', 'types': 'number', 'default': 0, 'description': 'Timer in ms after which the notification is hidden automatically, 0 is no timer' }, { 'prop': 'avatar', 'types': 'string', 'default': '', 'description': 'Left avatar image to be displayed in a personalised notification, pass the url of the image' }, { 'prop': 'icon', 'types': 'element', 'default': '', 'description': 'Notification icon on the left' }, { 'prop': 'iconBadgeColor', 'types': 'string', 'default': '', 'description': 'Background color of the notification icon' }, { 'prop': 'iconFillColor', 'types': 'string', 'default': '#fff', 'description': 'Color of the notification icon' }, { 'prop': 'onClick', 'types': 'function', 'default': '', 'description': 'If the onClick is passed then the notification will be clickable and it will close automatically after it was clicked.' }, { 'prop': 'overflowText', 'types': 'string', 'default': '', 'description': 'Text which is displayed below the additional text' }, { 'prop': 'overflowContent', 'types': 'element', 'default': '', 'description': 'Buttons or other useful actions in a notification can be put here' }, { 'prop': 'personalised', 'types': 'bool', 'default': 'false', 'description': 'If the notification is a personalised notification' }, { 'prop': 'priority', 'types': 'bool', 'default': 'false', 'description': 'If a notification is high priority and will not be removed automatically and unless removed forcefully' }, { 'prop': 'style', 'types': 'object', 'default': '', 'description': 'Styles of the notification' }, { 'prop': 'title', 'types': 'string', 'default': '', 'description': 'Title of the Notification' }, { 'prop': 'timestamp', 'types': 'string', 'default': '', 'description': 'To display the timestamp of the notification' }, { 'prop': 'zDepth', 'types': 'zDepth', 'default': 1, 'description': 'This number represents the zDepth of the shadow' } ] export {ComponentData, NotificationData} ================================================ FILE: src/www/index.html ================================================ React MaterialUi Notifications
================================================ FILE: src/www/main.css ================================================ html { font-family: 'Roboto', sans-serif; } body { margin: 0; font-size: 13px; line-height: 20px; background-color: #ccc; } /*animations for the demo*/ /*http://daneden.github.io/animate.css*/ @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } .fadeOut { animation-name: fadeOut; animation-duration: .3s; animation-fill-mode: both; } @keyframes zoomInUp { from { opacity: 0; transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0); animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); } 60% { opacity: 1; transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); } } .zoomInUp { animation-name: zoomInUp; animation-duration: .3s; animation-fill-mode: both; }