frontexpress/frontexpress.min.js.map

1 line
109 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["webpack:///frontexpress.min.js","webpack:///webpack/bootstrap 6e232a70da6c5e1dc870","webpack:///./index.js","webpack:///./lib/middleware.js","webpack:///./lib/methods.js","webpack:///./lib/router.js","webpack:///./lib/application.js","webpack:///./lib/frontexpress.js","webpack:///./lib/requester.js","webpack:///./lib/settings.js","webpack:///./lib/frontexpress.js?48e6"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","_frontexpress","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","Middleware","name","arguments","undefined","this","request","response","_methods","_methods2","_middleware","_middleware2","Route","router","uriPart","method","middleware","visited","get","RegExp","baseUri","trim","replace","Router","uri","_baseUri","_routes","route","push","filter","uriToCheck","questionMarkIndex","indexOf","slice","hashIndex","match","_add","_len","args","Array","_key","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","Symbol","iterator","next","done","toLowerCase","apply","err","set","toString","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_loop","methodName","_len2","_key2","_iterator2","_toConsumableArray","arr","isArray","arr2","from","_settings","_settings2","_router","_router2","Application","routers","isDOMLoaded","isDOMReady","settings","_name","callback","_this","window","onbeforeunload","_callMiddlewareExited","onpopstate","event","state","_event$state","currentRoutes","_callMiddlewareEntered","_callMiddlewareUpdated","document","onreadystatechange","location","pathname","search","status","statusText","readyState","which","routes","_iteratorNormalCompletion3","_didIteratorError3","_iteratorError3","_step3","_iterator3","entered","_iteratorNormalCompletion4","_didIteratorError4","_iteratorError4","_step4","_iterator4","updated","breakMiddlewareLoop","_iteratorNormalCompletion5","_didIteratorError5","_iteratorError5","_step5","_iterator5","_iteratorNormalCompletion6","_didIteratorError6","_iteratorError6","_step6","_iterator6","exited","_iteratorNormalCompletion7","_didIteratorError7","_iteratorError7","_step7","_iterator7","failed","resolve","reject","_this2","headers","data","history","httpMethodTransformer","fetch","req","res","pushState","title","_callMiddlewareFailed","reduce","reqProto","middlewareMethodName","_len3","_key3","httpMethodName","charAt","toUpperCase","_fetch","_application","_application2","frontexpress","Requester","success","responseText","fail","_ref","errorThrown","errors","_analyzeErrors","xmlhttp","XMLHttpRequest","open","keys","header","setRequestHeader","send","_requester","_requester2","Settings","http requester","http GET transformer","_uri","anchor","uriWithoutAnchor","gUri","d","index","_ref2","rules","requester","checkRules","global"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDMM,SAASI,EAAQD,EAASH,GAE/B,YAMA,SAASW,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAASF,GEpDxF,GAAAG,GAAAf,EAAA,EFkDsBW,GAAuBI,IAMvC,SAASX,EAAQD,GAEtB,YAQA,SAASa,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCANhHC,OAAOC,eAAelB,EAAS,cAC7BmB,OAAO,GAGT,IAAIC,GAAe,WAAc,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,GAAIE,GAAaH,EAAMC,EAAIE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AElBG,wBACIvJ,IADoB,SAAAwI,GACM,GAArBgB,GAAqBhB,EAArBxI,IAAc+G,GAAOyB,EAAhB1B,QAAgB0B,EAAPzB,KACf,KAAKA,EACD,MAAOyC,EAGX,IAAIC,GAAS,GACTC,EAAmBF,EACjB9I,EAAY8I,EAAIhJ,QAAQ,IAgB9B,OAfIE,IAAY,IACZgJ,EAAmBF,EAAI/I,MAAM,EAAGC,GAChC+I,EAASD,EAAI/I,MAAMC,EAAW8I,EAAIxL,SAGtC0L,EAAmBlM,OAAOuL,KAAKhC,GAAMS,OAAO,SAACmC,EAAMC,EAAGC,GAOlD,MALIF,IADU,IAAVE,GAAeF,EAAKnJ,QAAQ,UACpB,IAEA,IAEZmJ,GAAWC,EAAX,IAAgB7C,EAAK6C,IAEtBF,GAEIA,EAAmBD,GAE9B1C,KA1BoB,SAAA+C,GA0BOA,EAArB9J,IAAqB8J,EAAhBhD,QAAgBgD,EAAP/C,QAM5BlI,KAAKkL,OACDT,iBAAkB,SAACU,GACf,GAA8B,kBAApBA,GAAU9C,MAChB,KAAM,IAAI3J,WAAU,gDTmgDnC,MAxBAI,GAAa0L,IACThL,IAAK,MACLX,MAAO,SS99CRgB,EAAMhB,GACN,GAAMuM,GAAapL,KAAKkL,MAAMrL,EAC1BuL,IACAA,EAAWvM,GAEfmB,KAAKwE,SAAS3E,GAAQhB,KTy+CrBW,IAAK,MACLX,MAAO,SS/9CRgB,GACA,MAAOG,MAAKwE,SAAS3E,OTm+CjB2K,IAGX9M,cSzjDoB8M,ET2jDpB7M,EAAOD,QAAUA,EAAQ,YAIpB,SAASC,EAAQD,EAASH,IU5kDhC,SAAA8N,GAAA1N,EAAAD,QAAA2N,EAAA,aAAA9N,EAAA,KV+kD8BO,KAAKJ,EAAU,WAAa,MAAOsC","file":"frontexpress.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _frontexpress = __webpack_require__(8);\n\t\n\tvar _frontexpress2 = _interopRequireDefault(_frontexpress);\n\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Middleware object.\n\t * @public\n\t */\n\t\n\tvar Middleware = function () {\n\t\n\t /**\n\t * Middleware initialization\n\t *\n\t * @param {String} middleware name\n\t */\n\t\n\t function Middleware() {\n\t var name = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];\n\t\n\t _classCallCheck(this, Middleware);\n\t\n\t this.name = name;\n\t }\n\t\n\t /**\n\t * Invoked by the app before an ajax request is sent or\n\t * during the DOM loading (document.readyState === 'loading').\n\t * See Application#_callMiddlewareEntered documentation for details.\n\t *\n\t * Override this method to add your custom behaviour\n\t *\n\t * @param {Object} request\n\t * @public\n\t */\n\t\n\t _createClass(Middleware, [{\n\t key: 'entered',\n\t value: function entered(request) {}\n\t\n\t /**\n\t * Invoked by the app before a new ajax request is sent or before the DOM is unloaded.\n\t * See Application#_callMiddlewareExited documentation for details.\n\t *\n\t * Override this method to add your custom behaviour\n\t *\n\t * @param {Object} request\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'exited',\n\t value: function exited(request) {}\n\t\n\t /**\n\t * Invoked by the app after an ajax request has responded or on DOM ready\n\t * (document.readyState === 'interactive').\n\t * See Application#_callMiddlewareUpdated documentation for details.\n\t *\n\t * Override this method to add your custom behaviour\n\t *\n\t * @param {Object} request\n\t * @param {Object} response\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'updated',\n\t value: function updated(request, response) {}\n\t\n\t /**\n\t * Invoked by the app when an ajax request has failed.\n\t *\n\t * Override this method to add your custom behaviour\n\t *\n\t * @param {Object} request\n\t * @param {Object} response\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'failed',\n\t value: function failed(request, response) {}\n\t\n\t /**\n\t * Allow the hand over to the next middleware object or function.\n\t *\n\t * Override this method and return `false` to break execution of\n\t * middleware chain.\n\t *\n\t * @return {Boolean} `true` by default\n\t *\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'next',\n\t value: function next() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return Middleware;\n\t}();\n\t\n\texports.default = Middleware;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/**\n\t * HTTP method list\n\t * @private\n\t */\n\t\n\texports.default = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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; }; }(); /**\n\t * Module dependencies.\n\t * @private\n\t */\n\t\n\tvar _methods = __webpack_require__(2);\n\t\n\tvar _methods2 = _interopRequireDefault(_methods);\n\t\n\tvar _middleware = __webpack_require__(1);\n\t\n\tvar _middleware2 = _interopRequireDefault(_middleware);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Route object.\n\t * @private\n\t */\n\t\n\tvar Route = function () {\n\t\n\t /**\n\t * Initialize the route.\n\t *\n\t * @private\n\t */\n\t\n\t function Route(router, uriPart, method, middleware) {\n\t _classCallCheck(this, Route);\n\t\n\t this.router = router;\n\t this.uriPart = uriPart;\n\t this.method = method;\n\t this.middleware = middleware;\n\t this.visited = false;\n\t }\n\t\n\t /**\n\t * Return route's uri.\n\t *\n\t * @private\n\t */\n\t\n\t _createClass(Route, [{\n\t key: 'uri',\n\t get: function get() {\n\t if (!this.uriPart && !this.method) {\n\t return undefined;\n\t }\n\t\n\t if (this.uriPart instanceof RegExp) {\n\t return this.uriPart;\n\t }\n\t\n\t if (this.router.baseUri instanceof RegExp) {\n\t return this.router.baseUri;\n\t }\n\t\n\t if (this.router.baseUri && this.uriPart) {\n\t return (this.router.baseUri.trim() + this.uriPart.trim()).replace(/\\/{2,}/, '/');\n\t }\n\t\n\t if (this.router.baseUri) {\n\t return this.router.baseUri.trim();\n\t }\n\t\n\t return this.uriPart;\n\t }\n\t }]);\n\t\n\t return Route;\n\t}();\n\t\n\t/**\n\t * Router object.\n\t * @public\n\t */\n\t\n\tvar Router = function () {\n\t\n\t /**\n\t * Initialize the router.\n\t *\n\t * @private\n\t */\n\t\n\t function Router(uri) {\n\t _classCallCheck(this, Router);\n\t\n\t if (uri) {\n\t this._baseUri = uri;\n\t }\n\t this._routes = [];\n\t }\n\t\n\t /**\n\t * Do some checks and set _baseUri.\n\t *\n\t * @private\n\t */\n\t\n\t _createClass(Router, [{\n\t key: '_add',\n\t\n\t\n\t /**\n\t * Add a route to the router.\n\t *\n\t * @private\n\t */\n\t\n\t value: function _add(route) {\n\t this._routes.push(route);\n\t return this;\n\t }\n\t\n\t /**\n\t * Gather routes from routers filtered by _uri_ and HTTP _method_.\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'routes',\n\t value: function routes(uri, method) {\n\t return this._routes.filter(function (route) {\n\t if (!route.uri && !route.method) {\n\t return true;\n\t }\n\t if (route.method !== method) {\n\t return false;\n\t }\n\t\n\t if (!route.uri) {\n\t return true;\n\t }\n\t\n\t var uriToCheck = uri;\n\t\n\t //remove query string from uri to test\n\t var questionMarkIndex = uriToCheck.indexOf('?');\n\t if (questionMarkIndex >= 0) {\n\t uriToCheck = uriToCheck.slice(0, questionMarkIndex);\n\t }\n\t\n\t //remove anchor from uri to test\n\t var hashIndex = uriToCheck.indexOf('#');\n\t if (hashIndex >= 0) {\n\t uriToCheck = uriToCheck.slice(0, hashIndex);\n\t }\n\t\n\t if (route.uri instanceof RegExp) {\n\t return uriToCheck.match(route.uri);\n\t }\n\t\n\t return route.uri === uriToCheck;\n\t });\n\t }\n\t\n\t /**\n\t * Gather visited routes from routers.\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'visited',\n\t value: function visited() {\n\t return this._routes.filter(function (route) {\n\t return route.visited;\n\t });\n\t }\n\t\n\t /**\n\t * Use the given middleware function or object on this router.\n\t *\n\t * // middleware function\n\t * router.use((req, res, next) => {console.log('Hello')});\n\t *\n\t * // middleware object\n\t * router.use(new Middleware());\n\t *\n\t * @param {Middleware|Function} middleware object or function\n\t * @return {Router} for chaining\n\t *\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'use',\n\t value: function use(middleware) {\n\t if (!(middleware instanceof _middleware2.default) && typeof middleware !== 'function') {\n\t throw new TypeError('use method takes at least a middleware');\n\t }\n\t\n\t this._add(new Route(this, undefined, undefined, middleware));\n\t\n\t return this;\n\t }\n\t\n\t /**\n\t * Use the given middleware function or object on this router for\n\t * all HTTP methods.\n\t *\n\t * // middleware function\n\t * router.all((req, res, next) => {console.log('Hello')});\n\t *\n\t * // middleware object\n\t * router.all(new Middleware());\n\t *\n\t * @param {Middleware|Function} middleware object or function\n\t * @return {Router} for chaining\n\t *\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'all',\n\t value: function all() {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t if (args.length === 0) {\n\t throw new TypeError('use all method takes at least a middleware');\n\t }\n\t var middleware = void 0;\n\t\n\t if (args.length === 1) {\n\t middleware = args[0];\n\t } else {\n\t middleware = args[1];\n\t }\n\t\n\t if (!(middleware instanceof _middleware2.default) && typeof middleware !== 'function') {\n\t throw new TypeError('use all method takes at least a middleware');\n\t }\n\t\n\t var _iteratorNormalCompletion = true;\n\t var _didIteratorError = false;\n\t var _iteratorError = undefined;\n\t\n\t try {\n\t for (var _iterator = _methods2.default[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t var method = _step.value;\n\t\n\t this[method.toLowerCase()].apply(this, args);\n\t }\n\t } catch (err) {\n\t _didIteratorError = true;\n\t _iteratorError = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion && _iterator.return) {\n\t _iterator.return();\n\t }\n\t } finally {\n\t if (_didIteratorError) {\n\t throw _iteratorError;\n\t }\n\t }\n\t }\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'baseUri',\n\t set: function set(uri) {\n\t if (!uri) {\n\t return;\n\t }\n\t\n\t if (!this._baseUri) {\n\t this._baseUri = uri;\n\t return;\n\t }\n\t\n\t if (this._baseUri instanceof RegExp) {\n\t throw new TypeError('the router already contains a regexp uri ' + this._baseUri.toString() + ' It cannot be mixed with ' + uri.toString());\n\t }\n\t\n\t if (uri instanceof RegExp) {\n\t throw new TypeError('the router already contains an uri ' + this._baseUri.toString() + ' It cannot be mixed with regexp ' + uri.toString());\n\t }\n\t }\n\t\n\t /**\n\t * Return router's _baseUri.\n\t *\n\t * @private\n\t */\n\t\n\t ,\n\t get: function get() {\n\t return this._baseUri;\n\t }\n\t }]);\n\t\n\t return Router;\n\t}();\n\t\n\texports.default = Router;\n\tvar _iteratorNormalCompletion2 = true;\n\tvar _didIteratorError2 = false;\n\tvar _iteratorError2 = undefined;\n\t\n\ttry {\n\t var _loop = function _loop() {\n\t var method = _step2.value;\n\t\n\t\n\t /**\n\t * Use the given middleware function or object, with optional _uri_ on\n\t * HTTP methods: get, post, put, delete...\n\t * Default _uri_ is \"/\".\n\t *\n\t * // middleware function will be applied on path \"/\"\n\t * router.get((req, res, next) => {console.log('Hello')});\n\t *\n\t * // middleware object will be applied on path \"/\" and\n\t * router.get(new Middleware());\n\t *\n\t * // middleware function will be applied on path \"/user\"\n\t * router.post('/user', (req, res, next) => {console.log('Hello')});\n\t *\n\t * // middleware object will be applied on path \"/user\" and\n\t * router.post('/user', new Middleware());\n\t *\n\t * @param {String} uri\n\t * @param {Middleware|Function} middleware object or function\n\t * @return {Router} for chaining\n\t * @public\n\t */\n\t\n\t var methodName = method.toLowerCase();\n\t Router.prototype[methodName] = function () {\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t if (args.length === 0) {\n\t throw new TypeError('use ' + methodName + ' method takes at least a middleware');\n\t }\n\t var uri = void 0,\n\t middleware = void 0;\n\t\n\t if (args.length === 1) {\n\t middleware = args[0];\n\t } else {\n\t uri = args[0];\n\t middleware = args[1];\n\t }\n\t\n\t if (!(middleware instanceof _middleware2.default) && typeof middleware !== 'function') {\n\t throw new TypeError('use ' + methodName + ' method takes at least a middleware');\n\t }\n\t\n\t if (uri && this._baseUri && this._baseUri instanceof RegExp) {\n\t throw new TypeError('router contains a regexp cannot mix with route uri/regexp');\n\t }\n\t\n\t this._add(new Route(this, uri, method, middleware));\n\t\n\t return this;\n\t };\n\t };\n\t\n\t for (var _iterator2 = _methods2.default[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t _loop();\n\t }\n\t} catch (err) {\n\t _didIteratorError2 = true;\n\t _iteratorError2 = err;\n\t} finally {\n\t try {\n\t if (!_iteratorNormalCompletion2 && _iterator2.return) {\n\t _iterator2.return();\n\t }\n\t } finally {\n\t if (_didIteratorError2) {\n\t throw _iteratorError2;\n\t }\n\t }\n\t}\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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; }; }(); /**\n\t * Module dependencies.\n\t * @private\n\t */\n\t\n\tvar _methods = __webpack_require__(2);\n\t\n\tvar _methods2 = _interopRequireDefault(_methods);\n\t\n\tvar _settings = __webpack_require__(7);\n\t\n\tvar _settings2 = _interopRequireDefault(_settings);\n\t\n\tvar _router = __webpack_require__(3);\n\t\n\tvar _router2 = _interopRequireDefault(_router);\n\t\n\tvar _middleware = __webpack_require__(1);\n\t\n\tvar _middleware2 = _interopRequireDefault(_middleware);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(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 Array.from(arr); } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Application class.\n\t */\n\t\n\tvar Application = function () {\n\t\n\t /**\n\t * Initialize the application.\n\t *\n\t * - setup default configuration\n\t *\n\t * @private\n\t */\n\t\n\t function Application() {\n\t _classCallCheck(this, Application);\n\t\n\t this.routers = [];\n\t this.isDOMLoaded = false;\n\t this.isDOMReady = false;\n\t this.settings = new _settings2.default();\n\t }\n\t\n\t /**\n\t * Assign `setting` to `val`, or return `setting`'s value.\n\t *\n\t * app.set('foo', 'bar');\n\t * app.set('foo');\n\t * // => \"bar\"\n\t *\n\t * @param {String} setting\n\t * @param {*} [val]\n\t * @return {app} for chaining\n\t * @public\n\t */\n\t\n\t _createClass(Application, [{\n\t key: 'set',\n\t value: function set() {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t // get behaviour\n\t if (args.length === 1) {\n\t var _name = [args];\n\t return this.settings.get(_name);\n\t }\n\t\n\t // set behaviour\n\t var name = args[0];\n\t var value = args[1];\n\t\n\t this.settings.set(name, value);\n\t\n\t return this;\n\t }\n\t\n\t /**\n\t * Listen for DOM initialization and history state changes.\n\t *\n\t * The callback function is called once the DOM has\n\t * the `document.readyState` equals to 'interactive'.\n\t *\n\t * app.listen(()=> {\n\t * console.log('App is listening requests');\n\t * console.log('DOM is ready!');\n\t * });\n\t *\n\t *\n\t * @param {Function} callback\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'listen',\n\t value: function listen(callback) {\n\t var _this = this;\n\t\n\t window.onbeforeunload = function () {\n\t _this._callMiddlewareExited();\n\t };\n\t\n\t window.onpopstate = function (event) {\n\t if (event.state) {\n\t var _event$state = event.state;\n\t var request = _event$state.request;\n\t var response = _event$state.response;\n\t\n\t var currentRoutes = _this._routes(request.uri, request.method);\n\t\n\t _this._callMiddlewareEntered(currentRoutes, request);\n\t _this._callMiddlewareUpdated(currentRoutes, request, response);\n\t }\n\t };\n\t\n\t document.onreadystatechange = function () {\n\t var request = { method: 'GET', uri: window.location.pathname + window.location.search };\n\t var response = { status: 200, statusText: 'OK' };\n\t var currentRoutes = _this._routes();\n\t // DOM state\n\t if (document.readyState === 'loading' && !_this.isDOMLoaded) {\n\t _this.isDOMLoaded = true;\n\t _this._callMiddlewareEntered(currentRoutes, request);\n\t } else if (document.readyState === 'interactive' && !_this.isDOMReady) {\n\t if (!_this.isDOMLoaded) {\n\t _this.isDOMLoaded = true;\n\t _this._callMiddlewareEntered(currentRoutes, request);\n\t }\n\t _this.isDOMReady = true;\n\t _this._callMiddlewareUpdated(currentRoutes, request, response);\n\t if (callback) {\n\t callback(request, response);\n\t }\n\t }\n\t };\n\t }\n\t\n\t /**\n\t * Returns a new `Router` instance for the _uri_.\n\t * See the Router api docs for details.\n\t *\n\t * app.route('/');\n\t * // => new Router instance\n\t *\n\t * @param {String} uri\n\t * @return {Router} for chaining\n\t *\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'route',\n\t value: function route(uri) {\n\t var router = new _router2.default(uri);\n\t this.routers.push(router);\n\t return router;\n\t }\n\t\n\t /**\n\t * Use the given middleware function or object, with optional _uri_.\n\t * Default _uri_ is \"/\".\n\t *\n\t * // middleware function will be applied on path \"/\"\n\t * app.use((req, res, next) => {console.log('Hello')});\n\t *\n\t * // middleware object will be applied on path \"/\"\n\t * app.use(new Middleware());\n\t *\n\t * @param {String} uri\n\t * @param {Middleware|Function} middleware object or function\n\t * @return {app} for chaining\n\t *\n\t * @public\n\t */\n\t\n\t }, {\n\t key: 'use',\n\t value: function use() {\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t if (args.length === 0) {\n\t throw new TypeError('use method takes at least a middleware or a router');\n\t }\n\t\n\t var baseUri = void 0,\n\t middleware = void 0,\n\t router = void 0,\n\t which = void 0;\n\t\n\t if (args.length === 1) {\n\t which = args[0];\n\t } else {\n\t baseUri = args[0];\n\t which = args[1];\n\t }\n\t\n\t if (!(which instanceof _middleware2.default) && typeof which !== 'function' && !(which instanceof _router2.default)) {\n\t throw new TypeError('use method takes at least a middleware or a router');\n\t }\n\t\n\t if (which instanceof _router2.default) {\n\t router = which;\n\t router.baseUri = baseUri;\n\t } else {\n\t middleware = which;\n\t router = new _router2.default(baseUri);\n\t var _iteratorNormalCompletion = true;\n\t var _didIteratorError = false;\n\t var _iteratorError = undefined;\n\t\n\t try {\n\t for (var _iterator = _methods2.default[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t var method = _step.value;\n\t\n\t router[method.toLowerCase()](middleware);\n\t }\n\t } catch (err) {\n\t _didIteratorError = true;\n\t _iteratorError = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion && _iterator.return) {\n\t _iterator.return();\n\t }\n\t } finally {\n\t if (_didIteratorError) {\n\t throw _iteratorError;\n\t }\n\t }\n\t }\n\t }\n\t this.routers.push(router);\n\t\n\t return this;\n\t }\n\t\n\t /**\n\t * Gather routes from all routers filtered by _uri_ and HTTP _method_.\n\t * See Router#routes() documentation for details.\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_routes',\n\t value: function _routes() {\n\t var uri = arguments.length <= 0 || arguments[0] === undefined ? window.location.pathname + window.location.search : arguments[0];\n\t var method = arguments.length <= 1 || arguments[1] === undefined ? 'GET' : arguments[1];\n\t\n\t var currentRoutes = [];\n\t var _iteratorNormalCompletion2 = true;\n\t var _didIteratorError2 = false;\n\t var _iteratorError2 = undefined;\n\t\n\t try {\n\t for (var _iterator2 = this.routers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t var router = _step2.value;\n\t\n\t var routes = router.routes(uri, method);\n\t currentRoutes.push.apply(currentRoutes, _toConsumableArray(routes));\n\t }\n\t } catch (err) {\n\t _didIteratorError2 = true;\n\t _iteratorError2 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion2 && _iterator2.return) {\n\t _iterator2.return();\n\t }\n\t } finally {\n\t if (_didIteratorError2) {\n\t throw _iteratorError2;\n\t }\n\t }\n\t }\n\t\n\t return currentRoutes;\n\t }\n\t\n\t /**\n\t * Call `Middleware#entered` on _currentRoutes_.\n\t * Invoked before sending ajax request or when DOM\n\t * is loading (document.readyState === 'loading').\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callMiddlewareEntered',\n\t value: function _callMiddlewareEntered(currentRoutes, request) {\n\t var _iteratorNormalCompletion3 = true;\n\t var _didIteratorError3 = false;\n\t var _iteratorError3 = undefined;\n\t\n\t try {\n\t for (var _iterator3 = currentRoutes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t var route = _step3.value;\n\t\n\t if (route.middleware.entered) {\n\t route.middleware.entered(request);\n\t }\n\t if (route.middleware.next && !route.middleware.next()) {\n\t break;\n\t }\n\t }\n\t } catch (err) {\n\t _didIteratorError3 = true;\n\t _iteratorError3 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion3 && _iterator3.return) {\n\t _iterator3.return();\n\t }\n\t } finally {\n\t if (_didIteratorError3) {\n\t throw _iteratorError3;\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Call `Middleware#updated` or middleware function on _currentRoutes_.\n\t * Invoked on ajax request responding or on DOM ready\n\t * (document.readyState === 'interactive').\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callMiddlewareUpdated',\n\t value: function _callMiddlewareUpdated(currentRoutes, request, response) {\n\t var _iteratorNormalCompletion4 = true;\n\t var _didIteratorError4 = false;\n\t var _iteratorError4 = undefined;\n\t\n\t try {\n\t for (var _iterator4 = currentRoutes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n\t var route = _step4.value;\n\t\n\t route.visited = request;\n\t // calls middleware updated method\n\t if (route.middleware.updated) {\n\t route.middleware.updated(request, response);\n\t if (route.middleware.next && !route.middleware.next()) {\n\t break;\n\t }\n\t } else {\n\t // calls middleware method\n\t var breakMiddlewareLoop = true;\n\t var next = function next() {\n\t breakMiddlewareLoop = false;\n\t };\n\t route.middleware(request, response, next);\n\t if (breakMiddlewareLoop) {\n\t break;\n\t }\n\t }\n\t }\n\t } catch (err) {\n\t _didIteratorError4 = true;\n\t _iteratorError4 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion4 && _iterator4.return) {\n\t _iterator4.return();\n\t }\n\t } finally {\n\t if (_didIteratorError4) {\n\t throw _iteratorError4;\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Call `Middleware#exited` on _currentRoutes_.\n\t * Invoked before sending a new ajax request or before DOM unloading.\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callMiddlewareExited',\n\t value: function _callMiddlewareExited() {\n\t // calls middleware exited method\n\t var _iteratorNormalCompletion5 = true;\n\t var _didIteratorError5 = false;\n\t var _iteratorError5 = undefined;\n\t\n\t try {\n\t for (var _iterator5 = this.routers[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n\t var router = _step5.value;\n\t\n\t var routes = router.visited();\n\t var _iteratorNormalCompletion6 = true;\n\t var _didIteratorError6 = false;\n\t var _iteratorError6 = undefined;\n\t\n\t try {\n\t for (var _iterator6 = routes[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n\t var route = _step6.value;\n\t\n\t if (route.middleware.exited) {\n\t route.middleware.exited(route.visited);\n\t route.visited = null;\n\t }\n\t }\n\t } catch (err) {\n\t _didIteratorError6 = true;\n\t _iteratorError6 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion6 && _iterator6.return) {\n\t _iterator6.return();\n\t }\n\t } finally {\n\t if (_didIteratorError6) {\n\t throw _iteratorError6;\n\t }\n\t }\n\t }\n\t }\n\t } catch (err) {\n\t _didIteratorError5 = true;\n\t _iteratorError5 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion5 && _iterator5.return) {\n\t _iterator5.return();\n\t }\n\t } finally {\n\t if (_didIteratorError5) {\n\t throw _iteratorError5;\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Call `Middleware#failed` or middleware function on _currentRoutes_.\n\t * Invoked when ajax request fails.\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_callMiddlewareFailed',\n\t value: function _callMiddlewareFailed(currentRoutes, request, response) {\n\t var _iteratorNormalCompletion7 = true;\n\t var _didIteratorError7 = false;\n\t var _iteratorError7 = undefined;\n\t\n\t try {\n\t for (var _iterator7 = currentRoutes[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n\t var route = _step7.value;\n\t\n\t // calls middleware failed method\n\t if (route.middleware.failed) {\n\t route.middleware.failed(request, response);\n\t if (route.middleware.next && !route.middleware.next()) {\n\t break;\n\t }\n\t } else {\n\t // calls middleware method\n\t var breakMiddlewareLoop = true;\n\t var next = function next() {\n\t breakMiddlewareLoop = false;\n\t };\n\t route.middleware(request, response, next);\n\t if (breakMiddlewareLoop) {\n\t break;\n\t }\n\t }\n\t }\n\t } catch (err) {\n\t _didIteratorError7 = true;\n\t _iteratorError7 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion7 && _iterator7.return) {\n\t _iterator7.return();\n\t }\n\t } finally {\n\t if (_didIteratorError7) {\n\t throw _iteratorError7;\n\t }\n\t }\n\t }\n\t }\n\t\n\t /**\n\t * Make an ajax request. Manage History#pushState if history object set.\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_fetch',\n\t value: function _fetch(request, resolve, reject) {\n\t var _this2 = this;\n\t\n\t var method = request.method;\n\t var uri = request.uri;\n\t var headers = request.headers;\n\t var data = request.data;\n\t var history = request.history;\n\t\n\t\n\t var httpMethodTransformer = this.get('http ' + method + ' transformer');\n\t if (httpMethodTransformer) {\n\t uri = httpMethodTransformer.uri ? httpMethodTransformer.uri({ uri: uri, headers: headers, data: data }) : uri;\n\t headers = httpMethodTransformer.headers ? httpMethodTransformer.headers({ uri: uri, headers: headers, data: data }) : headers;\n\t data = httpMethodTransformer.data ? httpMethodTransformer.data({ uri: uri, headers: headers, data: data }) : data;\n\t }\n\t\n\t // calls middleware exited method\n\t this._callMiddlewareExited();\n\t\n\t // gathers all routes impacted by the uri\n\t var currentRoutes = this._routes(uri, method);\n\t\n\t // calls middleware entered method\n\t this._callMiddlewareEntered(currentRoutes, request);\n\t\n\t // invokes http request\n\t this.settings.get('http requester').fetch(request, function (req, res) {\n\t if (history) {\n\t window.history.pushState({ request: req, response: res }, history.title, history.uri);\n\t }\n\t _this2._callMiddlewareUpdated(currentRoutes, req, res);\n\t if (resolve) {\n\t resolve(req, res);\n\t }\n\t }, function (req, res) {\n\t _this2._callMiddlewareFailed(currentRoutes, req, res);\n\t if (reject) {\n\t reject(req, res);\n\t }\n\t });\n\t }\n\t }]);\n\t\n\t return Application;\n\t}();\n\t\n\texports.default = Application;\n\t\n\t\n\t_methods2.default.reduce(function (reqProto, method) {\n\t\n\t /**\n\t * Use the given middleware function or object, with optional _uri_ on\n\t * HTTP methods: get, post, put, delete...\n\t * Default _uri_ is \"/\".\n\t *\n\t * // middleware function will be applied on path \"/\"\n\t * app.get((req, res, next) => {console.log('Hello')});\n\t *\n\t * // middleware object will be applied on path \"/\" and\n\t * app.get(new Middleware());\n\t *\n\t * // get a setting value\n\t * app.set('foo', 'bar');\n\t * app.get('foo');\n\t * // => \"bar\"\n\t *\n\t * @param {String} uri or setting\n\t * @param {Middleware|Function} middleware object or function\n\t * @return {app} for chaining\n\t * @public\n\t */\n\t\n\t var middlewareMethodName = method.toLowerCase();\n\t reqProto[middlewareMethodName] = function () {\n\t for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n\t args[_key3] = arguments[_key3];\n\t }\n\t\n\t if (middlewareMethodName === 'get') {\n\t if (args.length === 0) {\n\t throw new TypeError(middlewareMethodName + ' method takes at least a string or a middleware');\n\t } else if (args.length === 1) {\n\t var name = args[0];\n\t\n\t if (typeof name === 'string') {\n\t return this.settings.get(name);\n\t }\n\t }\n\t } else if (args.length === 0) {\n\t throw new TypeError(middlewareMethodName + ' method takes at least a middleware');\n\t }\n\t\n\t var baseUri = void 0,\n\t middleware = void 0,\n\t which = void 0;\n\t\n\t if (args.length === 1) {\n\t which = args[0];\n\t } else {\n\t baseUri = args[0];\n\t which = args[1];\n\t }\n\t\n\t if (!(which instanceof _middleware2.default) && typeof which !== 'function') {\n\t throw new TypeError(middlewareMethodName + ' method takes at least a middleware');\n\t }\n\t\n\t var router = new _router2.default();\n\t middleware = which;\n\t router[middlewareMethodName](baseUri, middleware);\n\t\n\t this.routers.push(router);\n\t\n\t return this;\n\t };\n\t\n\t /**\n\t * Ajax request (get, post, put, delete...).\n\t *\n\t * // HTTP GET method\n\t * httpGet('/route1');\n\t *\n\t * // HTTP GET method\n\t * httpGet({uri: '/route1', data: {'p1': 'val1'});\n\t * // uri invoked => /route1?p1=val1\n\t *\n\t * // HTTP GET method with browser history management\n\t * httpGet({uri: '/api/users', history: {state: {foo: \"bar\"}, title: 'users page', uri: '/view/users'});\n\t *\n\t * Samples above can be applied on other HTTP methods.\n\t *\n\t * @param {String|Object} uri or object containing uri, http headers, data, history\n\t * @param {Function} success callback\n\t * @param {Function} failure callback\n\t * @public\n\t */\n\t var httpMethodName = 'http' + method.charAt(0).toUpperCase() + method.slice(1).toLowerCase();\n\t reqProto[httpMethodName] = function (request, resolve, reject) {\n\t var uri = request.uri;\n\t var headers = request.headers;\n\t var data = request.data;\n\t var history = request.history;\n\t\n\t if (!uri) {\n\t uri = request;\n\t }\n\t return this._fetch({\n\t uri: uri,\n\t method: method,\n\t headers: headers,\n\t data: data,\n\t history: history\n\t }, resolve, reject);\n\t };\n\t\n\t return reqProto;\n\t}, Application.prototype);\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _application = __webpack_require__(4);\n\t\n\tvar _application2 = _interopRequireDefault(_application);\n\t\n\tvar _router = __webpack_require__(3);\n\t\n\tvar _router2 = _interopRequireDefault(_router);\n\t\n\tvar _middleware = __webpack_require__(1);\n\t\n\tvar _middleware2 = _interopRequireDefault(_middleware);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t/**\n\t * Create a frontexpress application.\n\t *\n\t * @return {Function}\n\t * @api public\n\t */\n\t\n\tvar frontexpress = function frontexpress() {\n\t return new _application2.default();\n\t};\n\t\n\t/**\n\t * Expose Router, Middleware constructors.\n\t */\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tfrontexpress.Router = function (baseUri) {\n\t return new _router2.default(baseUri);\n\t};\n\tfrontexpress.Middleware = function (name) {\n\t return new _middleware2.default(name);\n\t};\n\t\n\texports.default = frontexpress;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Module dependencies.\n\t * @private\n\t */\n\t\n\tvar Requester = function () {\n\t function Requester() {\n\t _classCallCheck(this, Requester);\n\t }\n\t\n\t _createClass(Requester, [{\n\t key: 'fetch',\n\t\n\t\n\t /**\n\t * Make an ajax request.\n\t *\n\t * @param {Object} request\n\t * @param {Function} success callback\n\t * @param {Function} failure callback\n\t * @private\n\t */\n\t\n\t value: function fetch(request, resolve, reject) {\n\t var _this = this;\n\t\n\t var method = request.method;\n\t var uri = request.uri;\n\t var headers = request.headers;\n\t var data = request.data;\n\t\n\t\n\t var success = function success(responseText) {\n\t resolve(request, { status: 200, statusText: 'OK', responseText: responseText });\n\t };\n\t\n\t var fail = function fail(_ref) {\n\t var status = _ref.status;\n\t var statusText = _ref.statusText;\n\t var errorThrown = _ref.errorThrown;\n\t\n\t var errors = _this._analyzeErrors({ status: status, statusText: statusText, errorThrown: errorThrown });\n\t reject(request, { status: status, statusText: statusText, errorThrown: errorThrown, errors: errors });\n\t };\n\t\n\t var xmlhttp = new XMLHttpRequest();\n\t xmlhttp.onreadystatechange = function () {\n\t if (xmlhttp.readyState === 4) {\n\t if (xmlhttp.status === 200) {\n\t success(xmlhttp.responseText);\n\t } else {\n\t fail({ status: xmlhttp.status, statusText: xmlhttp.statusText });\n\t }\n\t }\n\t };\n\t try {\n\t xmlhttp.open(method, uri, true);\n\t if (headers) {\n\t var _iteratorNormalCompletion = true;\n\t var _didIteratorError = false;\n\t var _iteratorError = undefined;\n\t\n\t try {\n\t for (var _iterator = Object.keys(headers)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t var header = _step.value;\n\t\n\t xmlhttp.setRequestHeader(header, headers[header]);\n\t }\n\t } catch (err) {\n\t _didIteratorError = true;\n\t _iteratorError = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion && _iterator.return) {\n\t _iterator.return();\n\t }\n\t } finally {\n\t if (_didIteratorError) {\n\t throw _iteratorError;\n\t }\n\t }\n\t }\n\t }\n\t if (data) {\n\t xmlhttp.send(data);\n\t } else {\n\t xmlhttp.send();\n\t }\n\t } catch (errorThrown) {\n\t fail({ errorThrown: errorThrown });\n\t }\n\t }\n\t\n\t /**\n\t * Analyse response errors.\n\t *\n\t * @private\n\t */\n\t\n\t }, {\n\t key: '_analyzeErrors',\n\t value: function _analyzeErrors(response) {\n\t // manage exceptions\n\t if (response.errorThrown) {\n\t if (response.errorThrown.name === 'SyntaxError') {\n\t return 'Problem during data decoding [JSON]';\n\t }\n\t if (response.errorThrown.name === 'TimeoutError') {\n\t return 'Server is taking too long to reply';\n\t }\n\t if (response.errorThrown.name === 'AbortError') {\n\t return 'Request cancelled on server';\n\t }\n\t if (response.errorThrown.name === 'NetworkError') {\n\t return 'A network error occurred';\n\t }\n\t throw response.errorThrown;\n\t }\n\t\n\t // manage status\n\t if (response.status === 0) {\n\t return 'Server access problem. Check your network connection';\n\t }\n\t if (response.status === 401) {\n\t return 'Your session has expired, Please reconnect. [code: 401]';\n\t }\n\t if (response.status === 404) {\n\t return 'Page not found on server. [code: 404]';\n\t }\n\t if (response.status === 500) {\n\t return 'Internal server error. [code: 500]';\n\t }\n\t return 'Unknown error. ' + (response.statusText ? response.statusText : '');\n\t }\n\t }]);\n\t\n\t return Requester;\n\t}();\n\t\n\texports.default = Requester;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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; }; }(); /**\n\t * Module dependencies.\n\t * @private\n\t */\n\t\n\tvar _requester = __webpack_require__(6);\n\t\n\tvar _requester2 = _interopRequireDefault(_requester);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/**\n\t * Settings object.\n\t * @private\n\t */\n\t\n\tvar Settings = function () {\n\t\n\t /**\n\t * Initialize the settings.\n\t *\n\t * - setup default configuration\n\t *\n\t * @private\n\t */\n\t\n\t function Settings() {\n\t _classCallCheck(this, Settings);\n\t\n\t // default settings\n\t this.settings = {\n\t 'http requester': new _requester2.default(),\n\t\n\t 'http GET transformer': {\n\t uri: function uri(_ref) {\n\t var _uri = _ref.uri;\n\t var headers = _ref.headers;\n\t var data = _ref.data;\n\t\n\t if (!data) {\n\t return _uri;\n\t }\n\t\n\t var anchor = '';\n\t var uriWithoutAnchor = _uri;\n\t var hashIndex = _uri.indexOf('#');\n\t if (hashIndex >= 1) {\n\t uriWithoutAnchor = _uri.slice(0, hashIndex);\n\t anchor = _uri.slice(hashIndex, _uri.length);\n\t }\n\t\n\t uriWithoutAnchor = Object.keys(data).reduce(function (gUri, d, index) {\n\t if (index === 0 && gUri.indexOf('?') === -1) {\n\t gUri += '?';\n\t } else {\n\t gUri += '&';\n\t }\n\t gUri += d + '=' + data[d];\n\t return gUri;\n\t }, uriWithoutAnchor);\n\t\n\t return uriWithoutAnchor + anchor;\n\t },\n\t data: function data(_ref2) {\n\t var uri = _ref2.uri;\n\t var headers = _ref2.headers;\n\t var _data = _ref2.data;\n\t\n\t return undefined;\n\t }\n\t }\n\t };\n\t\n\t this.rules = {\n\t 'http requester': function httpRequester(requester) {\n\t if (typeof requester.fetch !== 'function') {\n\t throw new TypeError('setting http requester has no fetch method');\n\t }\n\t }\n\t };\n\t }\n\t\n\t /**\n\t * Assign `setting` to `val`\n\t *\n\t * @param {String} setting\n\t * @param {*} [val]\n\t * @private\n\t */\n\t\n\t _createClass(Settings, [{\n\t key: 'set',\n\t value: function set(name, value) {\n\t var checkRules = this.rules[name];\n\t if (checkRules) {\n\t checkRules(value);\n\t }\n\t this.settings[name] = value;\n\t }\n\t\n\t /**\n\t * Return `setting`'s value.\n\t *\n\t * @param {String} setting\n\t * @private\n\t */\n\t\n\t }, {\n\t key: 'get',\n\t value: function get(name) {\n\t return this.settings[name];\n\t }\n\t }]);\n\t\n\t return Settings;\n\t}();\n\t\n\texports.default = Settings;\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {module.exports = global[\"frontexpress\"] = __webpack_require__(5);\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** frontexpress.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 6e232a70da6c5e1dc870\n **/","import frontexpress from 'expose?frontexpress!./lib/frontexpress.js';\n\n\n/** WEBPACK FOOTER **\n ** ./index.js\n **/","/**\n * Middleware object.\n * @public\n */\n\nexport default class Middleware {\n\n\n /**\n * Middleware initialization\n *\n * @param {String} middleware name\n */\n\n constructor(name='') {\n this.name = name;\n }\n\n /**\n * Invoked by the app before an ajax request is sent or\n * during the DOM loading (document.readyState === 'loading').\n * See Application#_callMiddlewareEntered documentation for details.\n *\n * Override this method to add your custom behaviour\n *\n * @param {Object} request\n * @public\n */\n\n entered(request) { }\n\n\n /**\n * Invoked by the app before a new ajax request is sent or before the DOM is unloaded.\n * See Application#_callMiddlewareExited documentation for details.\n *\n * Override this method to add your custom behaviour\n *\n * @param {Object} request\n * @public\n */\n\n exited(request) { }\n\n\n /**\n * Invoked by the app after an ajax request has responded or on DOM ready\n * (document.readyState === 'interactive').\n * See Application#_callMiddlewareUpdated documentation for details.\n *\n * Override this method to add your custom behaviour\n *\n * @param {Object} request\n * @param {Object} response\n * @public\n */\n\n updated(request, response) { }\n\n\n /**\n * Invoked by the app when an ajax request has failed.\n *\n * Override this method to add your custom behaviour\n *\n * @param {Object} request\n * @param {Object} response\n * @public\n */\n failed(request, response) { }\n\n\n /**\n * Allow the hand over to the next middleware object or function.\n *\n * Override this method and return `false` to break execution of\n * middleware chain.\n *\n * @return {Boolean} `true` by default\n *\n * @public\n */\n\n next() {\n return true;\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/middleware.js\n **/","/**\n * HTTP method list\n * @private\n */\n\n export default ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'];\n\n\n/** WEBPACK FOOTER **\n ** ./lib/methods.js\n **/","/**\n * Module dependencies.\n * @private\n */\n\nimport HTTP_METHODS from './methods';\nimport Middleware from './middleware';\n\n\n/**\n * Route object.\n * @private\n */\n\nclass Route {\n\n\n /**\n * Initialize the route.\n *\n * @private\n */\n\n constructor(router, uriPart, method, middleware) {\n this.router = router;\n this.uriPart = uriPart;\n this.method = method;\n this.middleware = middleware;\n this.visited = false;\n }\n\n\n /**\n * Return route's uri.\n *\n * @private\n */\n\n get uri() {\n if (!this.uriPart && !this.method) {\n return undefined;\n }\n\n if (this.uriPart instanceof RegExp) {\n return this.uriPart;\n }\n\n if (this.router.baseUri instanceof RegExp) {\n return this.router.baseUri;\n }\n\n if (this.router.baseUri && this.uriPart) {\n return (this.router.baseUri.trim() + this.uriPart.trim()).replace(/\\/{2,}/, '/');\n }\n\n if (this.router.baseUri) {\n return this.router.baseUri.trim();\n }\n\n return this.uriPart;\n }\n}\n\n\n/**\n * Router object.\n * @public\n */\n\nexport default class Router {\n\n\n /**\n * Initialize the router.\n *\n * @private\n */\n\n constructor(uri) {\n if (uri) {\n this._baseUri = uri;\n }\n this._routes = [];\n }\n\n\n /**\n * Do some checks and set _baseUri.\n *\n * @private\n */\n\n set baseUri(uri) {\n if (!uri) {\n return;\n }\n\n if (!this._baseUri) {\n this._baseUri = uri;\n return;\n }\n\n if (this._baseUri instanceof RegExp) {\n throw new TypeError(`the router already contains a regexp uri ${this._baseUri.toString()} It cannot be mixed with ${uri.toString()}`);\n }\n\n if (uri instanceof RegExp) {\n throw new TypeError(`the router already contains an uri ${this._baseUri.toString()} It cannot be mixed with regexp ${uri.toString()}`);\n }\n }\n\n\n /**\n * Return router's _baseUri.\n *\n * @private\n */\n\n get baseUri() {\n return this._baseUri;\n }\n\n\n /**\n * Add a route to the router.\n *\n * @private\n */\n\n _add(route) {\n this._routes.push(route);\n return this;\n }\n\n\n /**\n * Gather routes from routers filtered by _uri_ and HTTP _method_.\n *\n * @private\n */\n\n routes(uri, method) {\n return this._routes.filter((route) => {\n if (!route.uri && !route.method) {\n return true;\n }\n if (route.method !== method) {\n return false;\n }\n\n if (!route.uri) {\n return true;\n }\n\n let uriToCheck = uri;\n\n //remove query string from uri to test\n const questionMarkIndex = uriToCheck.indexOf('?');\n if (questionMarkIndex >= 0) {\n uriToCheck = uriToCheck.slice(0, questionMarkIndex);\n }\n\n //remove anchor from uri to test\n const hashIndex = uriToCheck.indexOf('#');\n if (hashIndex >= 0) {\n uriToCheck = uriToCheck.slice(0, hashIndex);\n }\n\n if (route.uri instanceof RegExp) {\n return uriToCheck.match(route.uri);\n }\n\n return route.uri === uriToCheck;\n });\n }\n\n\n /**\n * Gather visited routes from routers.\n *\n * @private\n */\n\n visited() {\n return this._routes.filter((route) => {\n return route.visited;\n });\n }\n\n\n /**\n * Use the given middleware function or object on this router.\n *\n * // middleware function\n * router.use((req, res, next) => {console.log('Hello')});\n *\n * // middleware object\n * router.use(new Middleware());\n *\n * @param {Middleware|Function} middleware object or function\n * @return {Router} for chaining\n *\n * @public\n */\n\n use(middleware) {\n if (!(middleware instanceof Middleware) && (typeof middleware !== 'function') ) {\n throw new TypeError('use method takes at least a middleware');\n }\n\n this._add(new Route(this, undefined, undefined, middleware));\n\n return this;\n }\n\n\n /**\n * Use the given middleware function or object on this router for\n * all HTTP methods.\n *\n * // middleware function\n * router.all((req, res, next) => {console.log('Hello')});\n *\n * // middleware object\n * router.all(new Middleware());\n *\n * @param {Middleware|Function} middleware object or function\n * @return {Router} for chaining\n *\n * @public\n */\n\n all(...args) {\n if (args.length === 0) {\n throw new TypeError('use all method takes at least a middleware');\n }\n let middleware;\n\n if (args.length === 1) {\n [middleware,] = args;\n } else {\n [, middleware,] = args;\n }\n\n if (!(middleware instanceof Middleware) && (typeof middleware !== 'function') ) {\n throw new TypeError('use all method takes at least a middleware');\n }\n\n for (const method of HTTP_METHODS) {\n this[method.toLowerCase()](...args);\n }\n return this;\n }\n}\n\nfor (const method of HTTP_METHODS) {\n\n\n /**\n * Use the given middleware function or object, with optional _uri_ on\n * HTTP methods: get, post, put, delete...\n * Default _uri_ is \"/\".\n *\n * // middleware function will be applied on path \"/\"\n * router.get((req, res, next) => {console.log('Hello')});\n *\n * // middleware object will be applied on path \"/\" and\n * router.get(new Middleware());\n *\n * // middleware function will be applied on path \"/user\"\n * router.post('/user', (req, res, next) => {console.log('Hello')});\n *\n * // middleware object will be applied on path \"/user\" and\n * router.post('/user', new Middleware());\n *\n * @param {String} uri\n * @param {Middleware|Function} middleware object or function\n * @return {Router} for chaining\n * @public\n */\n\n const methodName = method.toLowerCase();\n Router.prototype[methodName] = function(...args) {\n if (args.length === 0) {\n throw new TypeError(`use ${methodName} method takes at least a middleware`);\n }\n let uri, middleware;\n\n if (args.length === 1) {\n [middleware,] = args;\n } else {\n [uri, middleware,] = args;\n }\n\n if (!(middleware instanceof Middleware) && (typeof middleware !== 'function') ) {\n throw new TypeError(`use ${methodName} method takes at least a middleware`);\n }\n\n if (uri && this._baseUri && this._baseUri instanceof RegExp) {\n throw new TypeError('router contains a regexp cannot mix with route uri/regexp');\n }\n\n this._add(new Route(this, uri, method, middleware));\n\n return this;\n };\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/router.js\n **/","/**\n * Module dependencies.\n * @private\n */\n\nimport HTTP_METHODS from './methods';\nimport Settings from './settings';\nimport Router, {Route} from './router';\nimport Middleware from './middleware';\n\n\n/**\n * Application class.\n */\n\nexport default class Application {\n\n\n /**\n * Initialize the application.\n *\n * - setup default configuration\n *\n * @private\n */\n\n constructor() {\n this.routers = [];\n this.isDOMLoaded = false;\n this.isDOMReady = false;\n this.settings = new Settings();\n }\n\n\n /**\n * Assign `setting` to `val`, or return `setting`'s value.\n *\n * app.set('foo', 'bar');\n * app.set('foo');\n * // => \"bar\"\n *\n * @param {String} setting\n * @param {*} [val]\n * @return {app} for chaining\n * @public\n */\n\n set(...args) {\n // get behaviour\n if (args.length === 1) {\n const name = [args];\n return this.settings.get(name);\n }\n\n // set behaviour\n const [name, value] = args;\n this.settings.set(name, value);\n\n return this;\n }\n\n\n /**\n * Listen for DOM initialization and history state changes.\n *\n * The callback function is called once the DOM has\n * the `document.readyState` equals to 'interactive'.\n *\n * app.listen(()=> {\n * console.log('App is listening requests');\n * console.log('DOM is ready!');\n * });\n *\n *\n * @param {Function} callback\n * @public\n */\n\n listen(callback) {\n window.onbeforeunload = () => {\n this._callMiddlewareExited();\n };\n\n window.onpopstate = (event) => {\n if (event.state) {\n const {request, response} = event.state;\n const currentRoutes = this._routes(request.uri, request.method);\n\n this._callMiddlewareEntered(currentRoutes, request);\n this._callMiddlewareUpdated(currentRoutes, request, response);\n }\n };\n\n document.onreadystatechange = () => {\n const request = {method: 'GET', uri: window.location.pathname + window.location.search};\n const response = {status: 200, statusText: 'OK'};\n const currentRoutes = this._routes();\n // DOM state\n if (document.readyState === 'loading' && !this.isDOMLoaded) {\n this.isDOMLoaded = true;\n this._callMiddlewareEntered(currentRoutes, request);\n } else if (document.readyState === 'interactive' && !this.isDOMReady) {\n if (!this.isDOMLoaded) {\n this.isDOMLoaded = true;\n this._callMiddlewareEntered(currentRoutes, request);\n }\n this.isDOMReady = true;\n this._callMiddlewareUpdated(currentRoutes, request, response);\n if (callback) {\n callback(request, response);\n }\n }\n };\n }\n\n\n /**\n * Returns a new `Router` instance for the _uri_.\n * See the Router api docs for details.\n *\n * app.route('/');\n * // => new Router instance\n *\n * @param {String} uri\n * @return {Router} for chaining\n *\n * @public\n */\n\n route(uri) {\n const router = new Router(uri);\n this.routers.push(router);\n return router;\n }\n\n\n /**\n * Use the given middleware function or object, with optional _uri_.\n * Default _uri_ is \"/\".\n *\n * // middleware function will be applied on path \"/\"\n * app.use((req, res, next) => {console.log('Hello')});\n *\n * // middleware object will be applied on path \"/\"\n * app.use(new Middleware());\n *\n * @param {String} uri\n * @param {Middleware|Function} middleware object or function\n * @return {app} for chaining\n *\n * @public\n */\n\n use(...args) {\n if (args.length === 0) {\n throw new TypeError('use method takes at least a middleware or a router');\n }\n\n let baseUri, middleware, router, which;\n\n if (args.length === 1) {\n [which,] = args;\n } else {\n [baseUri, which,] = args;\n }\n\n if (!(which instanceof Middleware) && (typeof which !== 'function') && !(which instanceof Router)) {\n throw new TypeError('use method takes at least a middleware or a router');\n }\n\n if (which instanceof Router) {\n router = which;\n router.baseUri = baseUri;\n } else {\n middleware = which;\n router = new Router(baseUri);\n for (const method of HTTP_METHODS) {\n router[method.toLowerCase()](middleware);\n }\n }\n this.routers.push(router);\n\n return this;\n }\n\n\n /**\n * Gather routes from all routers filtered by _uri_ and HTTP _method_.\n * See Router#routes() documentation for details.\n *\n * @private\n */\n\n _routes(uri=window.location.pathname + window.location.search, method='GET') {\n const currentRoutes = [];\n for (const router of this.routers) {\n const routes = router.routes(uri, method);\n currentRoutes.push(...routes);\n }\n\n return currentRoutes;\n }\n\n\n /**\n * Call `Middleware#entered` on _currentRoutes_.\n * Invoked before sending ajax request or when DOM\n * is loading (document.readyState === 'loading').\n *\n * @private\n */\n\n _callMiddlewareEntered(currentRoutes, request) {\n for (const route of currentRoutes) {\n if (route.middleware.entered) {\n route.middleware.entered(request);\n }\n if (route.middleware.next && !route.middleware.next()) {\n break;\n }\n }\n }\n\n\n /**\n * Call `Middleware#updated` or middleware function on _currentRoutes_.\n * Invoked on ajax request responding or on DOM ready\n * (document.readyState === 'interactive').\n *\n * @private\n */\n\n _callMiddlewareUpdated(currentRoutes, request, response) {\n for (const route of currentRoutes) {\n route.visited = request;\n // calls middleware updated method\n if (route.middleware.updated) {\n route.middleware.updated(request, response);\n if (route.middleware.next && !route.middleware.next()) {\n break;\n }\n } else {\n // calls middleware method\n let breakMiddlewareLoop = true;\n const next = () => {\n breakMiddlewareLoop = false;\n };\n route.middleware(request, response, next);\n if (breakMiddlewareLoop) {\n break;\n }\n }\n }\n }\n\n\n /**\n * Call `Middleware#exited` on _currentRoutes_.\n * Invoked before sending a new ajax request or before DOM unloading.\n *\n * @private\n */\n\n _callMiddlewareExited() {\n // calls middleware exited method\n for (const router of this.routers) {\n const routes = router.visited();\n for (const route of routes) {\n if (route.middleware.exited) {\n route.middleware.exited(route.visited);\n route.visited = null;\n }\n }\n }\n }\n\n\n /**\n * Call `Middleware#failed` or middleware function on _currentRoutes_.\n * Invoked when ajax request fails.\n *\n * @private\n */\n\n _callMiddlewareFailed(currentRoutes, request, response) {\n for (const route of currentRoutes) {\n // calls middleware failed method\n if (route.middleware.failed) {\n route.middleware.failed(request, response);\n if (route.middleware.next && !route.middleware.next()) {\n break;\n }\n } else {\n // calls middleware method\n let breakMiddlewareLoop = true;\n const next = () => {\n breakMiddlewareLoop = false;\n };\n route.middleware(request, response, next);\n if (breakMiddlewareLoop) {\n break;\n }\n }\n }\n }\n\n\n /**\n * Make an ajax request. Manage History#pushState if history object set.\n *\n * @private\n */\n\n _fetch(request, resolve, reject) {\n let {method, uri, headers, data, history} = request;\n\n const httpMethodTransformer = this.get(`http ${method} transformer`);\n if (httpMethodTransformer) {\n uri = httpMethodTransformer.uri ? httpMethodTransformer.uri({uri, headers, data}) : uri;\n headers = httpMethodTransformer.headers ? httpMethodTransformer.headers({uri, headers, data}) : headers;\n data = httpMethodTransformer.data ? httpMethodTransformer.data({uri, headers, data}) : data;\n }\n\n // calls middleware exited method\n this._callMiddlewareExited();\n\n // gathers all routes impacted by the uri\n const currentRoutes = this._routes(uri, method);\n\n // calls middleware entered method\n this._callMiddlewareEntered(currentRoutes, request);\n\n // invokes http request\n this.settings.get('http requester').fetch(request,\n (req, res) => {\n if (history) {\n window.history.pushState({request: req, response: res}, history.title, history.uri);\n }\n this._callMiddlewareUpdated(currentRoutes, req, res);\n if (resolve) {\n resolve(req, res);\n }\n },\n (req, res) => {\n this._callMiddlewareFailed(currentRoutes, req, res);\n if (reject) {\n reject(req, res);\n }\n });\n }\n}\n\nHTTP_METHODS.reduce((reqProto, method) => {\n\n\n /**\n * Use the given middleware function or object, with optional _uri_ on\n * HTTP methods: get, post, put, delete...\n * Default _uri_ is \"/\".\n *\n * // middleware function will be applied on path \"/\"\n * app.get((req, res, next) => {console.log('Hello')});\n *\n * // middleware object will be applied on path \"/\" and\n * app.get(new Middleware());\n *\n * // get a setting value\n * app.set('foo', 'bar');\n * app.get('foo');\n * // => \"bar\"\n *\n * @param {String} uri or setting\n * @param {Middleware|Function} middleware object or function\n * @return {app} for chaining\n * @public\n */\n\n const middlewareMethodName = method.toLowerCase();\n reqProto[middlewareMethodName] = function(...args) {\n if (middlewareMethodName === 'get') {\n if (args.length === 0) {\n throw new TypeError(`${middlewareMethodName} method takes at least a string or a middleware`);\n } else if (args.length === 1) {\n const [name] = args;\n if (typeof name === 'string') {\n return this.settings.get(name);\n }\n }\n } else if (args.length === 0) {\n throw new TypeError(`${middlewareMethodName} method takes at least a middleware`);\n }\n\n let baseUri, middleware, which;\n\n if (args.length === 1) {\n [which,] = args;\n } else {\n [baseUri, which,] = args;\n }\n\n if (!(which instanceof Middleware) && (typeof which !== 'function')) {\n throw new TypeError(`${middlewareMethodName} method takes at least a middleware`);\n }\n\n const router = new Router();\n middleware = which;\n router[middlewareMethodName](baseUri, middleware);\n\n this.routers.push(router);\n\n return this;\n };\n\n /**\n * Ajax request (get, post, put, delete...).\n *\n * // HTTP GET method\n * httpGet('/route1');\n *\n * // HTTP GET method\n * httpGet({uri: '/route1', data: {'p1': 'val1'});\n * // uri invoked => /route1?p1=val1\n *\n * // HTTP GET method with browser history management\n * httpGet({uri: '/api/users', history: {state: {foo: \"bar\"}, title: 'users page', uri: '/view/users'});\n *\n * Samples above can be applied on other HTTP methods.\n *\n * @param {String|Object} uri or object containing uri, http headers, data, history\n * @param {Function} success callback\n * @param {Function} failure callback\n * @public\n */\n const httpMethodName = 'http'+method.charAt(0).toUpperCase() + method.slice(1).toLowerCase();\n reqProto[httpMethodName] = function(request, resolve, reject) {\n let {uri, headers, data, history} = request;\n if (!uri) {\n uri = request;\n }\n return this._fetch({\n uri,\n method,\n headers,\n data,\n history\n }, resolve, reject);\n };\n\n return reqProto;\n}, Application.prototype);\n\n\n/** WEBPACK FOOTER **\n ** ./lib/application.js\n **/","/**\n * Module dependencies.\n */\n\nimport Application from './application';\nimport Router from './router';\nimport Middleware from './middleware';\n\n\n/**\n * Create a frontexpress application.\n *\n * @return {Function}\n * @api public\n */\n\nconst frontexpress = () => new Application();\n\n/**\n * Expose Router, Middleware constructors.\n */\nfrontexpress.Router = (baseUri) => new Router(baseUri);\nfrontexpress.Middleware = (name) => new Middleware(name);\n\nexport default frontexpress;\n\n\n\n/** WEBPACK FOOTER **\n ** ./lib/frontexpress.js\n **/","/**\n * Module dependencies.\n * @private\n */\n\nexport default class Requester {\n\n /**\n * Make an ajax request.\n *\n * @param {Object} request\n * @param {Function} success callback\n * @param {Function} failure callback\n * @private\n */\n\n fetch(request, resolve, reject) {\n const {method, uri, headers, data} = request;\n\n const success = (responseText) => {\n resolve(\n request,\n {status: 200, statusText: 'OK', responseText}\n );\n };\n\n const fail = ({status, statusText, errorThrown}) => {\n const errors = this._analyzeErrors({status, statusText, errorThrown});\n reject(\n request,\n {status, statusText, errorThrown, errors}\n );\n };\n\n const xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = () => {\n if (xmlhttp.readyState === 4) {\n if (xmlhttp.status === 200) {\n success(xmlhttp.responseText);\n } else {\n fail({status: xmlhttp.status, statusText: xmlhttp.statusText});\n }\n }\n };\n try {\n xmlhttp.open(method, uri, true);\n if (headers) {\n for (const header of Object.keys(headers)) {\n xmlhttp.setRequestHeader(header, headers[header]);\n }\n }\n if (data) {\n xmlhttp.send(data);\n } else {\n xmlhttp.send();\n }\n } catch (errorThrown) {\n fail({errorThrown});\n }\n }\n\n\n /**\n * Analyse response errors.\n *\n * @private\n */\n\n _analyzeErrors(response) {\n // manage exceptions\n if (response.errorThrown) {\n if (response.errorThrown.name === 'SyntaxError') {\n return 'Problem during data decoding [JSON]';\n }\n if (response.errorThrown.name === 'TimeoutError') {\n return 'Server is taking too long to reply';\n }\n if (response.errorThrown.name === 'AbortError') {\n return 'Request cancelled on server';\n }\n if (response.errorThrown.name === 'NetworkError') {\n return 'A network error occurred';\n }\n throw response.errorThrown;\n }\n\n // manage status\n if (response.status === 0) {\n return 'Server access problem. Check your network connection';\n }\n if (response.status === 401) {\n return 'Your session has expired, Please reconnect. [code: 401]';\n }\n if (response.status === 404) {\n return 'Page not found on server. [code: 404]';\n }\n if (response.status === 500) {\n return 'Internal server error. [code: 500]';\n }\n return `Unknown error. ${response.statusText?response.statusText:''}`;\n }\n}\n\n\n/** WEBPACK FOOTER **\n ** ./lib/requester.js\n **/","/**\n * Module dependencies.\n * @private\n */\n\nimport Requester from './requester';\n\n\n/**\n * Settings object.\n * @private\n */\n\nexport default class Settings {\n\n\n /**\n * Initialize the settings.\n *\n * - setup default configuration\n *\n * @private\n */\n\n constructor() {\n // default settings\n this.settings = {\n 'http requester': new Requester(),\n\n 'http GET transformer': {\n uri({uri, headers, data}) {\n if (!data) {\n return uri;\n }\n\n let anchor = '';\n let uriWithoutAnchor = uri;\n const hashIndex = uri.indexOf('#');\n if (hashIndex >=1) {\n uriWithoutAnchor = uri.slice(0, hashIndex);\n anchor = uri.slice(hashIndex, uri.length);\n }\n\n uriWithoutAnchor = Object.keys(data).reduce((gUri, d, index) => {\n if (index === 0 && gUri.indexOf('?') === -1) {\n gUri += '?';\n } else {\n gUri += '&';\n }\n gUri += `${d}=${data[d]}`;\n return gUri;\n }, uriWithoutAnchor);\n\n return uriWithoutAnchor + anchor;\n },\n data({uri, headers, data}) {\n return undefined;\n }\n }\n };\n\n this.rules = {\n 'http requester': (requester) => {\n if(typeof requester.fetch !== 'function') {\n throw new TypeError('setting http requester has no fetch method');\n }\n }\n };\n }\n\n\n /**\n * Assign `setting` to `val`\n *\n * @param {String} setting\n * @param {*} [val]\n * @private\n */\n\n set(name, value) {\n const checkRules = this.rules[name];\n if (checkRules) {\n checkRules(value);\n }\n this.settings[name] = value;\n }\n\n\n /**\n * Return `setting`'s value.\n *\n * @param {String} setting\n * @private\n */\n\n get(name) {\n return this.settings[name];\n }\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/settings.js\n **/","module.exports = global[\"frontexpress\"] = require(\"-!/home/caissani/dev/github/frontexpress/node_modules/babel-loader/index.js!/home/caissani/dev/github/frontexpress/lib/frontexpress.js\");\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/expose-loader?frontexpress!./lib/frontexpress.js\n ** module id = 8\n ** module chunks = 0\n **/"],"sourceRoot":""}