UNPKG

neweb

Version:

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] [![experimental](http://badges.github.io/stability-badges/dist/ex

178 lines (152 loc) 663 kB
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./client.neweb.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "../neweb-components/index.js": /*!*****************************!*\ !*** .-components/index.js ***! \*****************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar ClientPageRenderer_1 = __webpack_require__(/*! ./lib/client/ClientPageRenderer */ \"../neweb-components/lib/client/ClientPageRenderer.js\");\r\nexports.ClientPageRenderer = ClientPageRenderer_1.default;\r\nvar Component_1 = __webpack_require__(/*! ./lib/Component */ \"../neweb-components/lib/Component.js\");\r\nexports.Component = Component_1.default;\r\nvar Text_1 = __webpack_require__(/*! ./lib/Text */ \"../neweb-components/lib/Text.js\");\r\nexports.Text = Text_1.default;\r\n\n\n//# sourceURL=webpack:///.-components/index.js?"); /***/ }), /***/ "../neweb-components/lib/Component.js": /*!*************************************!*\ !*** .-components/lib/Component.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst morphdom = __webpack_require__(/*! morphdom */ \"../neweb-components/node_modules/morphdom/dist/morphdom.js\");\r\nconst dom_1 = __webpack_require__(/*! ./dom */ \"../neweb-components/lib/dom.js\");\r\nconst template_1 = __webpack_require__(/*! ./template */ \"../neweb-components/lib/template.js\");\r\nclass Component {\r\n constructor(props) {\r\n this.props = props;\r\n this.elements = {};\r\n this.hasRender = true;\r\n this.isInited = false;\r\n }\r\n init() {\r\n if (this.isInited) {\r\n throw new Error(\"Component already inited\");\r\n }\r\n this.isInited = true;\r\n this.beforeInit();\r\n const html = this.getTemplate();\r\n if (html) {\r\n this.setTemplate(html);\r\n }\r\n else if (!this.rootElement) {\r\n this.currentRender = this.render();\r\n this.rootElement = this.currentRender;\r\n this.update();\r\n }\r\n this.afterInit();\r\n this.getRootElement().onUpdateElement = (newEl) => {\r\n this.rootElement = newEl;\r\n };\r\n }\r\n setTagName(tagName) {\r\n this.tagName = tagName;\r\n }\r\n setChildren(children) {\r\n this.children = children;\r\n }\r\n dispose() {\r\n Object.keys(this.elements).map((name) => this.elements[name].dispose());\r\n }\r\n getElement(name) {\r\n if (!this[name]) {\r\n return null;\r\n }\r\n return this[name];\r\n }\r\n getElements() {\r\n return this.elements;\r\n }\r\n getRootElement() {\r\n return this.rootElement;\r\n }\r\n getTemplate() {\r\n return undefined;\r\n }\r\n setTemplate(html) {\r\n this.rootElement = this.template(html);\r\n }\r\n addElement(name, element) {\r\n this.elements[name] = element;\r\n }\r\n render() {\r\n const root = dom_1.createElement(this.tagName);\r\n if (this.children) {\r\n this.children.map((child) => root.appendChild(child));\r\n }\r\n return root;\r\n }\r\n beforeInit() {\r\n //\r\n }\r\n afterInit() {\r\n //\r\n }\r\n template(html) {\r\n return template_1.fromString(html, this.getElements());\r\n }\r\n update() {\r\n const nextRender = this.render();\r\n morphdom(this.rootElement, nextRender);\r\n }\r\n}\r\nexports.default = Component;\r\n\n\n//# sourceURL=webpack:///.-components/lib/Component.js?"); /***/ }), /***/ "../neweb-components/lib/Text.js": /*!********************************!*\ !*** .-components/lib/Text.js ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst rxjs_1 = __webpack_require__(/*! rxjs */ \"../neweb-components/node_modules/rxjs/_esm5/index.js\");\r\nconst Component_1 = __webpack_require__(/*! ./Component */ \"../neweb-components/lib/Component.js\");\r\nconst dom_1 = __webpack_require__(/*! ./dom */ \"../neweb-components/lib/dom.js\");\r\nclass Text extends Component_1.default {\r\n constructor() {\r\n super(...arguments);\r\n this.isTextNode = true;\r\n }\r\n beforeInit() {\r\n this.isTextNode = !(this.tagName && this.tagName.toLowerCase() !== \"element\");\r\n this.rootElement = this.isTextNode ? dom_1.createTextNode(\"\") : dom_1.createElement(this.tagName);\r\n const value = this.props.value;\r\n if (value instanceof rxjs_1.Observable) {\r\n value.subscribe((v) => {\r\n this.setValue(v);\r\n });\r\n }\r\n else {\r\n this.setValue(value);\r\n }\r\n }\r\n setValue(text) {\r\n if (this.isTextNode) {\r\n this.getRootElement().nodeValue = text;\r\n }\r\n else {\r\n this.getRootElement().innerHTML = text;\r\n }\r\n }\r\n}\r\nexports.default = Text;\r\n\n\n//# sourceURL=webpack:///.-components/lib/Text.js?"); /***/ }), /***/ "../neweb-components/lib/client/ClientPageRenderer.js": /*!*****************************************************!*\ !*** .-components/lib/client/ClientPageRenderer.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst rxjs_1 = __webpack_require__(/*! rxjs */ \"../neweb-components/node_modules/rxjs/_esm5/index.js\");\r\nconst render_1 = __webpack_require__(/*! ../render */ \"../neweb-components/lib/render.js\");\r\nclass ClientPageRenderer {\r\n constructor(config) {\r\n this.config = config;\r\n this.views = {};\r\n this.frames = {};\r\n }\r\n setMethods(params) {\r\n this.navigate = params.navigate;\r\n this.dispatch = params.dispatch;\r\n this.seansStatusEmitter = params.seansStatusEmitter;\r\n this.networkStatusEmitter = params.networkStatusEmitter;\r\n this.historyContext = params.historyContext;\r\n }\r\n loadPage(page) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield this.loadViews(page);\r\n // create all frames\r\n page.frames.map((pageFrame) => {\r\n this.frames[pageFrame.frameId] = this.createFrame(pageFrame);\r\n });\r\n this.renderFrame(page.rootFrame);\r\n this.currentPage = page;\r\n });\r\n }\r\n initialize() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n render_1.hydrate(this.frames[this.currentPage.rootFrame].component, this.config.rootHtmlElement);\r\n });\r\n }\r\n loadViews(page) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n yield Promise.all(page.frames.map((pageFrame) => __awaiter(this, void 0, void 0, function* () {\r\n this.views[pageFrame.frameName] = yield this.config.app.getFrameViewClass(pageFrame);\r\n })));\r\n });\r\n }\r\n renderFrame(frameId) {\r\n const frame = this.frames[frameId];\r\n const pageFrame = this.currentPage.frames.filter((f) => f.frameId === frameId)[0];\r\n Object.keys(pageFrame.frames).map((placeName) => {\r\n const childFrameId = pageFrame.frames[placeName];\r\n this.renderFrame(childFrameId);\r\n const childFrame = this.frames[childFrameId];\r\n frame.children[placeName].next(childFrame.component);\r\n });\r\n frame.component.init();\r\n }\r\n createFrame(pageFrame) {\r\n const ViewClass = this.views[pageFrame.frameName];\r\n const data = {};\r\n Object.keys(pageFrame.data).map((dataName) => {\r\n data[dataName] = new rxjs_1.BehaviorSubject(pageFrame.data[dataName]);\r\n });\r\n const children = {};\r\n Object.keys(pageFrame.frames).map((childName) => {\r\n children[childName] = new rxjs_1.Subject();\r\n });\r\n const component = new ViewClass({\r\n data,\r\n children,\r\n params: pageFrame.params,\r\n navigate: this.navigate,\r\n dispatch: (actionName, ...args) => this.dispatch({\r\n frameId: pageFrame.frameId,\r\n actionName,\r\n args,\r\n }),\r\n });\r\n return {\r\n component,\r\n data,\r\n children,\r\n };\r\n }\r\n}\r\nexports.default = ClientPageRenderer;\r\n\n\n//# sourceURL=webpack:///.-components/lib/client/ClientPageRenderer.js?"); /***/ }), /***/ "../neweb-components/lib/dom.js": /*!*******************************!*\ !*** .-components/lib/dom.js ***! \*******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction createElement(tagName, options) {\r\n return document.createElement(tagName, options);\r\n}\r\nexports.createElement = createElement;\r\nfunction createTextNode(data) {\r\n return document.createTextNode(data);\r\n}\r\nexports.createTextNode = createTextNode;\r\nfunction getDocument() {\r\n return document;\r\n}\r\nexports.getDocument = getDocument;\r\nfunction addEventListener(el, eventName, listener, bubbles) {\r\n el._events = el._events || [];\r\n el._events.push({\r\n eventName,\r\n listener,\r\n bubbles,\r\n });\r\n el.addEventListener(eventName, listener, bubbles);\r\n}\r\nexports.addEventListener = addEventListener;\r\n\n\n//# sourceURL=webpack:///.-components/lib/dom.js?"); /***/ }), /***/ "../neweb-components/lib/render.js": /*!**********************************!*\ !*** .-components/lib/render.js ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst morphdom = __webpack_require__(/*! morphdom */ \"../neweb-components/node_modules/morphdom/dist/morphdom.js\");\r\nfunction render(el, to) {\r\n el.init();\r\n to.appendChild(el.getRootElement());\r\n}\r\nexports.render = render;\r\nfunction replace(el, to) {\r\n to.innerHTML = \"\";\r\n el.init();\r\n to.appendChild(el.getRootElement());\r\n}\r\nexports.replace = replace;\r\nfunction hydrate(el, to) {\r\n el.init();\r\n const root = to.childNodes[0];\r\n morphdom(root, el.getRootElement(), {\r\n onBeforeElUpdated: (oldEl, newEl) => {\r\n if (newEl._events) {\r\n newEl._events.map((event) => {\r\n oldEl.addEventListener(event.eventName, event.listener, event.bubbles);\r\n });\r\n }\r\n if (newEl.onUpdateElement) {\r\n newEl.onUpdateElement(oldEl);\r\n }\r\n },\r\n });\r\n}\r\nexports.hydrate = hydrate;\r\n\n\n//# sourceURL=webpack:///.-components/lib/render.js?"); /***/ }), /***/ "../neweb-components/lib/template.js": /*!************************************!*\ !*** .-components/lib/template.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst dom_1 = __webpack_require__(/*! ./dom */ \"../neweb-components/lib/dom.js\");\r\nfunction fromString(html, elements) {\r\n const div = dom_1.createElement(\"div\");\r\n div.innerHTML = html;\r\n const htmlElements = div.querySelectorAll(\"[name]\");\r\n for (const element of htmlElements) {\r\n const name = element.getAttribute(\"name\");\r\n const childComponent = elements[name];\r\n if (!childComponent) {\r\n throw new Error(\"Not found property with name \" + name);\r\n }\r\n childComponent.setTagName(element.tagName);\r\n childComponent.setChildren(nodesToMap(element.childNodes));\r\n childComponent.init();\r\n const children = childComponent.getRootElement();\r\n const className = element.getAttribute(\"class\");\r\n if (className) {\r\n children.className = className;\r\n }\r\n const style = element.getAttribute(\"style\");\r\n if (style) {\r\n children.setAttribute(\"style\", style);\r\n }\r\n const parent = element.parentElement;\r\n parent.appendChild(children);\r\n parent.insertBefore(children, element);\r\n parent.removeChild(element);\r\n }\r\n if (div.childNodes.length === 1) {\r\n return div.childNodes[0];\r\n }\r\n return div;\r\n}\r\nexports.fromString = fromString;\r\nfunction nodesToMap(listOfNodes) {\r\n const children = [];\r\n for (const node of listOfNodes) {\r\n children.push(node);\r\n }\r\n return children;\r\n}\r\n\n\n//# sourceURL=webpack:///.-components/lib/template.js?"); /***/ }), /***/ "../neweb-components/node_modules/morphdom/dist/morphdom.js": /*!***********************************************************!*\ !*** .-components/node_modules/morphdom/dist/morphdom.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar range; // Create a range object for efficently rendering strings to elements.\nvar NS_XHTML = 'http://www.w3.org/1999/xhtml';\n\nvar doc = typeof document === 'undefined' ? undefined : document;\n\nvar testEl = doc ?\n doc.body || doc.createElement('div') :\n {};\n\n// Fixes <https://github.com/patrick-steele-idem/morphdom/issues/32>\n// (IE7+ support) <=IE7 does not support el.hasAttribute(name)\nvar actualHasAttributeNS;\n\nif (testEl.hasAttributeNS) {\n actualHasAttributeNS = function(el, namespaceURI, name) {\n return el.hasAttributeNS(namespaceURI, name);\n };\n} else if (testEl.hasAttribute) {\n actualHasAttributeNS = function(el, namespaceURI, name) {\n return el.hasAttribute(name);\n };\n} else {\n actualHasAttributeNS = function(el, namespaceURI, name) {\n return el.getAttributeNode(namespaceURI, name) != null;\n };\n}\n\nvar hasAttributeNS = actualHasAttributeNS;\n\n\nfunction toElement(str) {\n if (!range && doc.createRange) {\n range = doc.createRange();\n range.selectNode(doc.body);\n }\n\n var fragment;\n if (range && range.createContextualFragment) {\n fragment = range.createContextualFragment(str);\n } else {\n fragment = doc.createElement('body');\n fragment.innerHTML = str;\n }\n return fragment.childNodes[0];\n}\n\n/**\n * Returns true if two node's names are the same.\n *\n * NOTE: We don't bother checking `namespaceURI` because you will never find two HTML elements with the same\n * nodeName and different namespace URIs.\n *\n * @param {Element} a\n * @param {Element} b The target element\n * @return {boolean}\n */\nfunction compareNodeNames(fromEl, toEl) {\n var fromNodeName = fromEl.nodeName;\n var toNodeName = toEl.nodeName;\n\n if (fromNodeName === toNodeName) {\n return true;\n }\n\n if (toEl.actualize &&\n fromNodeName.charCodeAt(0) < 91 && /* from tag name is upper case */\n toNodeName.charCodeAt(0) > 90 /* target tag name is lower case */) {\n // If the target element is a virtual DOM node then we may need to normalize the tag name\n // before comparing. Normal HTML elements that are in the \"http://www.w3.org/1999/xhtml\"\n // are converted to upper case\n return fromNodeName === toNodeName.toUpperCase();\n } else {\n return false;\n }\n}\n\n/**\n * Create an element, optionally with a known namespace URI.\n *\n * @param {string} name the element name, e.g. 'div' or 'svg'\n * @param {string} [namespaceURI] the element's namespace URI, i.e. the value of\n * its `xmlns` attribute or its inferred namespace.\n *\n * @return {Element}\n */\nfunction createElementNS(name, namespaceURI) {\n return !namespaceURI || namespaceURI === NS_XHTML ?\n doc.createElement(name) :\n doc.createElementNS(namespaceURI, name);\n}\n\n/**\n * Copies the children of one DOM element to another DOM element\n */\nfunction moveChildren(fromEl, toEl) {\n var curChild = fromEl.firstChild;\n while (curChild) {\n var nextChild = curChild.nextSibling;\n toEl.appendChild(curChild);\n curChild = nextChild;\n }\n return toEl;\n}\n\nfunction morphAttrs(fromNode, toNode) {\n var attrs = toNode.attributes;\n var i;\n var attr;\n var attrName;\n var attrNamespaceURI;\n var attrValue;\n var fromValue;\n\n for (i = attrs.length - 1; i >= 0; --i) {\n attr = attrs[i];\n attrName = attr.name;\n attrNamespaceURI = attr.namespaceURI;\n attrValue = attr.value;\n\n if (attrNamespaceURI) {\n attrName = attr.localName || attrName;\n fromValue = fromNode.getAttributeNS(attrNamespaceURI, attrName);\n\n if (fromValue !== attrValue) {\n fromNode.setAttributeNS(attrNamespaceURI, attrName, attrValue);\n }\n } else {\n fromValue = fromNode.getAttribute(attrName);\n\n if (fromValue !== attrValue) {\n fromNode.setAttribute(attrName, attrValue);\n }\n }\n }\n\n // Remove any extra attributes found on the original DOM element that\n // weren't found on the target element.\n attrs = fromNode.attributes;\n\n for (i = attrs.length - 1; i >= 0; --i) {\n attr = attrs[i];\n if (attr.specified !== false) {\n attrName = attr.name;\n attrNamespaceURI = attr.namespaceURI;\n\n if (attrNamespaceURI) {\n attrName = attr.localName || attrName;\n\n if (!hasAttributeNS(toNode, attrNamespaceURI, attrName)) {\n fromNode.removeAttributeNS(attrNamespaceURI, attrName);\n }\n } else {\n if (!hasAttributeNS(toNode, null, attrName)) {\n fromNode.removeAttribute(attrName);\n }\n }\n }\n }\n}\n\nfunction syncBooleanAttrProp(fromEl, toEl, name) {\n if (fromEl[name] !== toEl[name]) {\n fromEl[name] = toEl[name];\n if (fromEl[name]) {\n fromEl.setAttribute(name, '');\n } else {\n fromEl.removeAttribute(name, '');\n }\n }\n}\n\nvar specialElHandlers = {\n /**\n * Needed for IE. Apparently IE doesn't think that \"selected\" is an\n * attribute when reading over the attributes using selectEl.attributes\n */\n OPTION: function(fromEl, toEl) {\n syncBooleanAttrProp(fromEl, toEl, 'selected');\n },\n /**\n * The \"value\" attribute is special for the <input> element since it sets\n * the initial value. Changing the \"value\" attribute without changing the\n * \"value\" property will have no effect since it is only used to the set the\n * initial value. Similar for the \"checked\" attribute, and \"disabled\".\n */\n INPUT: function(fromEl, toEl) {\n syncBooleanAttrProp(fromEl, toEl, 'checked');\n syncBooleanAttrProp(fromEl, toEl, 'disabled');\n\n if (fromEl.value !== toEl.value) {\n fromEl.value = toEl.value;\n }\n\n if (!hasAttributeNS(toEl, null, 'value')) {\n fromEl.removeAttribute('value');\n }\n },\n\n TEXTAREA: function(fromEl, toEl) {\n var newValue = toEl.value;\n if (fromEl.value !== newValue) {\n fromEl.value = newValue;\n }\n\n var firstChild = fromEl.firstChild;\n if (firstChild) {\n // Needed for IE. Apparently IE sets the placeholder as the\n // node value and vise versa. This ignores an empty update.\n var oldValue = firstChild.nodeValue;\n\n if (oldValue == newValue || (!newValue && oldValue == fromEl.placeholder)) {\n return;\n }\n\n firstChild.nodeValue = newValue;\n }\n },\n SELECT: function(fromEl, toEl) {\n if (!hasAttributeNS(toEl, null, 'multiple')) {\n var selectedIndex = -1;\n var i = 0;\n var curChild = toEl.firstChild;\n while(curChild) {\n var nodeName = curChild.nodeName;\n if (nodeName && nodeName.toUpperCase() === 'OPTION') {\n if (hasAttributeNS(curChild, null, 'selected')) {\n selectedIndex = i;\n break;\n }\n i++;\n }\n curChild = curChild.nextSibling;\n }\n\n fromEl.selectedIndex = i;\n }\n }\n};\n\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\n\nfunction noop() {}\n\nfunction defaultGetNodeKey(node) {\n return node.id;\n}\n\nfunction morphdomFactory(morphAttrs) {\n\n return function morphdom(fromNode, toNode, options) {\n if (!options) {\n options = {};\n }\n\n if (typeof toNode === 'string') {\n if (fromNode.nodeName === '#document' || fromNode.nodeName === 'HTML') {\n var toNodeHtml = toNode;\n toNode = doc.createElement('html');\n toNode.innerHTML = toNodeHtml;\n } else {\n toNode = toElement(toNode);\n }\n }\n\n var getNodeKey = options.getNodeKey || defaultGetNodeKey;\n var onBeforeNodeAdded = options.onBeforeNodeAdded || noop;\n var onNodeAdded = options.onNodeAdded || noop;\n var onBeforeElUpdated = options.onBeforeElUpdated || noop;\n var onElUpdated = options.onElUpdated || noop;\n var onBeforeNodeDiscarded = options.onBeforeNodeDiscarded || noop;\n var onNodeDiscarded = options.onNodeDiscarded || noop;\n var onBeforeElChildrenUpdated = options.onBeforeElChildrenUpdated || noop;\n var childrenOnly = options.childrenOnly === true;\n\n // This object is used as a lookup to quickly find all keyed elements in the original DOM tree.\n var fromNodesLookup = {};\n var keyedRemovalList;\n\n function addKeyedRemoval(key) {\n if (keyedRemovalList) {\n keyedRemovalList.push(key);\n } else {\n keyedRemovalList = [key];\n }\n }\n\n function walkDiscardedChildNodes(node, skipKeyedNodes) {\n if (node.nodeType === ELEMENT_NODE) {\n var curChild = node.firstChild;\n while (curChild) {\n\n var key = undefined;\n\n if (skipKeyedNodes && (key = getNodeKey(curChild))) {\n // If we are skipping keyed nodes then we add the key\n // to a list so that it can be handled at the very end.\n addKeyedRemoval(key);\n } else {\n // Only report the node as discarded if it is not keyed. We do this because\n // at the end we loop through all keyed elements that were unmatched\n // and then discard them in one final pass.\n onNodeDiscarded(curChild);\n if (curChild.firstChild) {\n walkDiscardedChildNodes(curChild, skipKeyedNodes);\n }\n }\n\n curChild = curChild.nextSibling;\n }\n }\n }\n\n /**\n * Removes a DOM node out of the original DOM\n *\n * @param {Node} node The node to remove\n * @param {Node} parentNode The nodes parent\n * @param {Boolean} skipKeyedNodes If true then elements with keys will be skipped and not discarded.\n * @return {undefined}\n */\n function removeNode(node, parentNode, skipKeyedNodes) {\n if (onBeforeNodeDiscarded(node) === false) {\n return;\n }\n\n if (parentNode) {\n parentNode.removeChild(node);\n }\n\n onNodeDiscarded(node);\n walkDiscardedChildNodes(node, skipKeyedNodes);\n }\n\n // // TreeWalker implementation is no faster, but keeping this around in case this changes in the future\n // function indexTree(root) {\n // var treeWalker = document.createTreeWalker(\n // root,\n // NodeFilter.SHOW_ELEMENT);\n //\n // var el;\n // while((el = treeWalker.nextNode())) {\n // var key = getNodeKey(el);\n // if (key) {\n // fromNodesLookup[key] = el;\n // }\n // }\n // }\n\n // // NodeIterator implementation is no faster, but keeping this around in case this changes in the future\n //\n // function indexTree(node) {\n // var nodeIterator = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT);\n // var el;\n // while((el = nodeIterator.nextNode())) {\n // var key = getNodeKey(el);\n // if (key) {\n // fromNodesLookup[key] = el;\n // }\n // }\n // }\n\n function indexTree(node) {\n if (node.nodeType === ELEMENT_NODE) {\n var curChild = node.firstChild;\n while (curChild) {\n var key = getNodeKey(curChild);\n if (key) {\n fromNodesLookup[key] = curChild;\n }\n\n // Walk recursively\n indexTree(curChild);\n\n curChild = curChild.nextSibling;\n }\n }\n }\n\n indexTree(fromNode);\n\n function handleNodeAdded(el) {\n onNodeAdded(el);\n\n var curChild = el.firstChild;\n while (curChild) {\n var nextSibling = curChild.nextSibling;\n\n var key = getNodeKey(curChild);\n if (key) {\n var unmatchedFromEl = fromNodesLookup[key];\n if (unmatchedFromEl && compareNodeNames(curChild, unmatchedFromEl)) {\n curChild.parentNode.replaceChild(unmatchedFromEl, curChild);\n morphEl(unmatchedFromEl, curChild);\n }\n }\n\n handleNodeAdded(curChild);\n curChild = nextSibling;\n }\n }\n\n function morphEl(fromEl, toEl, childrenOnly) {\n var toElKey = getNodeKey(toEl);\n var curFromNodeKey;\n\n if (toElKey) {\n // If an element with an ID is being morphed then it is will be in the final\n // DOM so clear it out of the saved elements collection\n delete fromNodesLookup[toElKey];\n }\n\n if (toNode.isSameNode && toNode.isSameNode(fromNode)) {\n return;\n }\n\n if (!childrenOnly) {\n if (onBeforeElUpdated(fromEl, toEl) === false) {\n return;\n }\n\n morphAttrs(fromEl, toEl);\n onElUpdated(fromEl);\n\n if (onBeforeElChildrenUpdated(fromEl, toEl) === false) {\n return;\n }\n }\n\n if (fromEl.nodeName !== 'TEXTAREA') {\n var curToNodeChild = toEl.firstChild;\n var curFromNodeChild = fromEl.firstChild;\n var curToNodeKey;\n\n var fromNextSibling;\n var toNextSibling;\n var matchingFromEl;\n\n outer: while (curToNodeChild) {\n toNextSibling = curToNodeChild.nextSibling;\n curToNodeKey = getNodeKey(curToNodeChild);\n\n while (curFromNodeChild) {\n fromNextSibling = curFromNodeChild.nextSibling;\n\n if (curToNodeChild.isSameNode && curToNodeChild.isSameNode(curFromNodeChild)) {\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue outer;\n }\n\n curFromNodeKey = getNodeKey(curFromNodeChild);\n\n var curFromNodeType = curFromNodeChild.nodeType;\n\n var isCompatible = undefined;\n\n if (curFromNodeType === curToNodeChild.nodeType) {\n if (curFromNodeType === ELEMENT_NODE) {\n // Both nodes being compared are Element nodes\n\n if (curToNodeKey) {\n // The target node has a key so we want to match it up with the correct element\n // in the original DOM tree\n if (curToNodeKey !== curFromNodeKey) {\n // The current element in the original DOM tree does not have a matching key so\n // let's check our lookup to see if there is a matching element in the original\n // DOM tree\n if ((matchingFromEl = fromNodesLookup[curToNodeKey])) {\n if (curFromNodeChild.nextSibling === matchingFromEl) {\n // Special case for single element removals. To avoid removing the original\n // DOM node out of the tree (since that can break CSS transitions, etc.),\n // we will instead discard the current node and wait until the next\n // iteration to properly match up the keyed target element with its matching\n // element in the original tree\n isCompatible = false;\n } else {\n // We found a matching keyed element somewhere in the original DOM tree.\n // Let's moving the original DOM node into the current position and morph\n // it.\n\n // NOTE: We use insertBefore instead of replaceChild because we want to go through\n // the `removeNode()` function for the node that is being discarded so that\n // all lifecycle hooks are correctly invoked\n fromEl.insertBefore(matchingFromEl, curFromNodeChild);\n\n fromNextSibling = curFromNodeChild.nextSibling;\n\n if (curFromNodeKey) {\n // Since the node is keyed it might be matched up later so we defer\n // the actual removal to later\n addKeyedRemoval(curFromNodeKey);\n } else {\n // NOTE: we skip nested keyed nodes from being removed since there is\n // still a chance they will be matched up later\n removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n }\n\n curFromNodeChild = matchingFromEl;\n }\n } else {\n // The nodes are not compatible since the \"to\" node has a key and there\n // is no matching keyed node in the source tree\n isCompatible = false;\n }\n }\n } else if (curFromNodeKey) {\n // The original has a key\n isCompatible = false;\n }\n\n isCompatible = isCompatible !== false && compareNodeNames(curFromNodeChild, curToNodeChild);\n if (isCompatible) {\n // We found compatible DOM elements so transform\n // the current \"from\" node to match the current\n // target DOM node.\n morphEl(curFromNodeChild, curToNodeChild);\n }\n\n } else if (curFromNodeType === TEXT_NODE || curFromNodeType == COMMENT_NODE) {\n // Both nodes being compared are Text or Comment nodes\n isCompatible = true;\n // Simply update nodeValue on the original node to\n // change the text value\n if (curFromNodeChild.nodeValue !== curToNodeChild.nodeValue) {\n curFromNodeChild.nodeValue = curToNodeChild.nodeValue;\n }\n\n }\n }\n\n if (isCompatible) {\n // Advance both the \"to\" child and the \"from\" child since we found a match\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n continue outer;\n }\n\n // No compatible match so remove the old node from the DOM and continue trying to find a\n // match in the original DOM. However, we only do this if the from node is not keyed\n // since it is possible that a keyed node might match up with a node somewhere else in the\n // target tree and we don't want to discard it just yet since it still might find a\n // home in the final DOM tree. After everything is done we will remove any keyed nodes\n // that didn't find a home\n if (curFromNodeKey) {\n // Since the node is keyed it might be matched up later so we defer\n // the actual removal to later\n addKeyedRemoval(curFromNodeKey);\n } else {\n // NOTE: we skip nested keyed nodes from being removed since there is\n // still a chance they will be matched up later\n removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n }\n\n curFromNodeChild = fromNextSibling;\n }\n\n // If we got this far then we did not find a candidate match for\n // our \"to node\" and we exhausted all of the children \"from\"\n // nodes. Therefore, we will just append the current \"to\" node\n // to the end\n if (curToNodeKey && (matchingFromEl = fromNodesLookup[curToNodeKey]) && compareNodeNames(matchingFromEl, curToNodeChild)) {\n fromEl.appendChild(matchingFromEl);\n morphEl(matchingFromEl, curToNodeChild);\n } else {\n var onBeforeNodeAddedResult = onBeforeNodeAdded(curToNodeChild);\n if (onBeforeNodeAddedResult !== false) {\n if (onBeforeNodeAddedResult) {\n curToNodeChild = onBeforeNodeAddedResult;\n }\n\n if (curToNodeChild.actualize) {\n curToNodeChild = curToNodeChild.actualize(fromEl.ownerDocument || doc);\n }\n fromEl.appendChild(curToNodeChild);\n handleNodeAdded(curToNodeChild);\n }\n }\n\n curToNodeChild = toNextSibling;\n curFromNodeChild = fromNextSibling;\n }\n\n // We have processed all of the \"to nodes\". If curFromNodeChild is\n // non-null then we still have some from nodes left over that need\n // to be removed\n while (curFromNodeChild) {\n fromNextSibling = curFromNodeChild.nextSibling;\n if ((curFromNodeKey = getNodeKey(curFromNodeChild))) {\n // Since the node is keyed it might be matched up later so we defer\n // the actual removal to later\n addKeyedRemoval(curFromNodeKey);\n } else {\n // NOTE: we skip nested keyed nodes from being removed since there is\n // still a chance they will be matched up later\n removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n }\n curFromNodeChild = fromNextSibling;\n }\n }\n\n var specialElHandler = specialElHandlers[fromEl.nodeName];\n if (specialElHandler) {\n specialElHandler(fromEl, toEl);\n }\n } // END: morphEl(...)\n\n var morphedNode = fromNode;\n var morphedNodeType = morphedNode.nodeType;\n var toNodeType = toNode.nodeType;\n\n if (!childrenOnly) {\n // Handle the case where we are given two DOM nodes that are not\n // compatible (e.g. <div> --> <span> or <div> --> TEXT)\n if (morphedNodeType === ELEMENT_NODE) {\n if (toNodeType === ELEMENT_NODE) {\n if (!compareNodeNames(fromNode, toNode)) {\n onNodeDiscarded(fromNode);\n morphedNode = moveChildren(fromNode, createElementNS(toNode.nodeName, toNode.namespaceURI));\n }\n } else {\n // Going from an element node to a text node\n morphedNode = toNode;\n }\n } else if (morphedNodeType === TEXT_NODE || morphedNodeType === COMMENT_NODE) { // Text or comment node\n if (toNodeType === morphedNodeType) {\n if (morphedNode.nodeValue !== toNode.nodeValue) {\n morphedNode.nodeValue = toNode.nodeValue;\n }\n\n return morphedNode;\n } else {\n // Text node to something else\n morphedNode = toNode;\n }\n }\n }\n\n if (morphedNode === toNode) {\n // The \"to node\" was not compatible with the \"from node\" so we had to\n // toss out the \"from node\" and use the \"to node\"\n onNodeDiscarded(fromNode);\n } else {\n morphEl(morphedNode, toNode, childrenOnly);\n\n // We now need to loop over any keyed nodes that might need to be\n // removed. We only do the removal if we know that the keyed node\n // never found a match. When a keyed node is matched up we remove\n // it out of fromNodesLookup and we use fromNodesLookup to determine\n // if a keyed node has been matched up or not\n if (keyedRemovalList) {\n for (var i=0, len=keyedRemovalList.length; i<len; i++) {\n var elToRemove = fromNodesLookup[keyedRemovalList[i]];\n if (elToRemove) {\n removeNode(elToRemove, elToRemove.parentNode, false);\n }\n }\n }\n }\n\n if (!childrenOnly && morphedNode !== fromNode && fromNode.parentNode) {\n if (morphedNode.actualize) {\n morphedNode = morphedNode.actualize(fromNode.ownerDocument || doc);\n }\n // If we had to swap out the from node with a new node because the old\n // node was not compatible with the target node then we need to\n // replace the old DOM node in the original DOM tree. This is only\n // possible if the original DOM node was part of a DOM tree which\n // we know is the case if it has a parent node.\n fromNode.parentNode.replaceChild(morphedNode, fromNode);\n }\n\n return morphedNode;\n };\n}\n\nvar morphdom = morphdomFactory(morphAttrs);\n\nmodule.exports = morphdom;\n\n\n//# sourceURL=webpack:///.-components/node_modules/morphdom/dist/morphdom.js?"); /***/ }), /***/ "../neweb-components/node_modules/rxjs/_esm5/index.js": /*!*****************************************************!*\ !*** .-components/node_modules/rxjs/_esm5/index.js ***! \*****************************************************/ /*! exports provided: Observable, ConnectableObservable, GroupedObservable, observable, Subject, BehaviorSubject, ReplaySubject, AsyncSubject, asapScheduler, asyncScheduler, queueScheduler, animationFrameScheduler, VirtualTimeScheduler, VirtualAction, Scheduler, Subscription, Subscriber, Notification, pipe, noop, identity, isObservable, ArgumentOutOfRangeError, EmptyError, ObjectUnsubscribedError, UnsubscriptionError, TimeoutError, bindCallback, bindNodeCallback, combineLatest, concat, defer, empty, forkJoin, from, fromEvent, fromEventPattern, generate, iif, interval, merge, never, of, onErrorResumeNext, pairs, race, range, throwError, timer, using, zip, EMPTY, NEVER, config */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/Observable */ \"../neweb-components/node_modules/rxjs/_esm5/internal/Observable.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Observable\", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__[\"Observable\"]; });\n\n/* harmony import */ var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/observable/ConnectableObservable */ \"../neweb-components/node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ConnectableObservable\", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__[\"ConnectableObservable\"]; });\n\n/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./internal/operators/groupBy */ \"../neweb-components/node_modules/rxjs/_esm5/internal/operators/groupBy.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GroupedObservable\", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__[\"GroupedObservable\"]; });\n\n/* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internal/symbol/observable */ \"../neweb-components/node_modules/rxjs/_esm5/internal/symbol/observable.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__[\"observable\"]; });\n\n/* harmony import */ var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./internal/Subject */ \"../neweb-components/node_modules/rxjs/_esm5/internal/Subject.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Subject\", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__[\"Subject\"]; });\n\n/* harmony import */ var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./internal/BehaviorSubject */ \"../neweb-components/node_modules/rxjs/_esm5/internal/BehaviorSubject.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BehaviorSubject\", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__[\"BehaviorSubject\"]; });\n\n/* harmony import */ var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./internal/ReplaySubject */ \"../neweb-components/node_modules/rxjs/_esm5/internal/ReplaySubject.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ReplaySubject\", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__[\"ReplaySubject\"]; });\n\n/* harmony import */ var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./internal/AsyncSubj