1 line
80 KiB
Plaintext
1 line
80 KiB
Plaintext
{"version":3,"file":"omi.esm.js","sources":["../src/vnode.js","../src/options.js","../src/h.js","../src/util.js","../src/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","function getGlobal() {\r\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\r\n\t\tif (typeof self !== 'undefined') {\r\n\t\t\treturn self;\r\n\t\t} else if (typeof window !== 'undefined') {\r\n\t\t\treturn window;\r\n\t\t} else if (typeof global !== 'undefined') {\r\n\t\t\treturn global;\r\n\t\t}\r\n\t\treturn (function(){\r\n\t\t\treturn this;\r\n\t\t})();\r\n\t\t\r\n\t}\r\n\treturn global;\r\n}\r\n\r\n/** Global options\r\n *\t@public\r\n *\t@namespace options {Object}\r\n */\r\nexport default {\r\n\r\n\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\r\n\troot: getGlobal(),\r\n\t//styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\r\n\tstyleCache: []\r\n\t//componentChange(component, element) { },\r\n\t/** If `true`, `prop` changes trigger synchronous component updates.\r\n\t *\t@name syncComponentUpdates\r\n\t *\t@type Boolean\r\n\t *\t@default true\r\n\t */\r\n\t//syncComponentUpdates: true,\r\n\r\n\t/** Processes all created VNodes.\r\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\r\n\t */\r\n\t//vnode(vnode) { }\r\n\r\n\t/** Hook invoked after a component is mounted. */\r\n\t//afterMount(component) { },\r\n\r\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\r\n\t//afterUpdate(component) { }\r\n\r\n\t/** Hook invoked immediately before a component is unmounted. */\r\n\t// beforeUnmount(component) { }\r\n};\r\n","import { VNode } from './vnode';\r\nimport options from './options';\r\n\r\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `<div id=\"foo\" name=\"bar\">Hello!</div>`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\r\n */\r\nexport function h(nodeName, attributes) {\r\n\tlet children=EMPTY_CHILDREN, lastSimple, child, simple, i;\r\n\tfor (i=arguments.length; i-- > 2; ) {\r\n\t\tstack.push(arguments[i]);\r\n\t}\r\n\tif (attributes && attributes.children!=null) {\r\n\t\tif (!stack.length) stack.push(attributes.children);\r\n\t\tdelete attributes.children;\r\n\t}\r\n\twhile (stack.length) {\r\n\t\tif ((child = stack.pop()) && child.pop!==undefined) {\r\n\t\t\tfor (i=child.length; i--; ) stack.push(child[i]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (typeof child==='boolean') child = null;\r\n\r\n\t\t\tif ((simple = typeof nodeName!=='function')) {\r\n\t\t\t\tif (child==null) child = '';\r\n\t\t\t\telse if (typeof child==='number') child = String(child);\r\n\t\t\t\telse if (typeof child!=='string') simple = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (simple && lastSimple) {\r\n\t\t\t\tchildren[children.length-1] += child;\r\n\t\t\t}\r\n\t\t\telse if (children===EMPTY_CHILDREN) {\r\n\t\t\t\tchildren = [child];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tchildren.push(child);\r\n\t\t\t}\r\n\r\n\t\t\tlastSimple = simple;\r\n\t\t}\r\n\t}\r\n\r\n\tlet p = new VNode();\r\n\tp.nodeName = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\r\n\tp.key = attributes==null ? undefined : attributes.key;\r\n\r\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\r\n\tif (options.vnode!==undefined) options.vnode(p);\r\n\r\n\treturn p;\r\n}\r\n","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\r\n */\r\nexport function extend(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i];\r\n\treturn obj;\r\n}\r\n\r\n/**\r\n * Call a function asynchronously, as soon as possible. Makes\r\n * use of HTML Promise to schedule the callback if available,\r\n * otherwise falling back to `setTimeout` (mainly for IE<11).\r\n *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\r\n}\r\n","// render modes\r\n\r\nexport const NO_RENDER = 0;\r\nexport const SYNC_RENDER = 1;\r\nexport const FORCE_RENDER = 2;\r\nexport const ASYNC_RENDER = 3;\r\n\r\n\r\nexport const ATTR_KEY = '__preactattr_';\r\n\r\n// DOM properties that should NOT have \"px\" added when numeric\r\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\r\n\r\n","import options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\r\n}\r\n","import { extend } from '../util';\r\n\r\n\r\n/**\r\n * Check if two nodes are equivalent.\r\n *\r\n * @param {Node} node\t\t\tDOM Node to compare\r\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\r\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\r\n * @private\r\n */\r\nexport function isSameNodeType(node, vnode, hydrating) {\r\n\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\t\treturn node.splitText!==undefined;\r\n\t}\r\n\tif (typeof vnode.nodeName==='string') {\r\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\r\n\t}\r\n\treturn hydrating || node._componentConstructor===vnode.nodeName;\r\n}\r\n\r\n\r\n/**\r\n * Check if an Element has a given nodeName, case-insensitively.\r\n *\r\n * @param {Element} node\tA DOM Element to inspect the name of.\r\n * @param {String} nodeName\tUnnormalized name to compare against.\r\n */\r\nexport function isNamedNode(node, nodeName) {\r\n\treturn node.normalizedNodeName===nodeName || node.nodeName.toLowerCase()===nodeName.toLowerCase();\r\n}\r\n\r\n\r\n/**\r\n * Reconstruct Component-style `props` from a VNode.\r\n * Ensures default/fallback values from `defaultProps`:\r\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\r\n *\r\n * @param {VNode} vnode\r\n * @returns {Object} props\r\n */\r\nexport function getNodeProps(vnode) {\r\n\tlet props = extend({}, vnode.attributes);\r\n\tprops.children = vnode.children;\r\n\r\n\tlet defaultProps = vnode.nodeName.defaultProps;\r\n\tif (defaultProps!==undefined) {\r\n\t\tfor (let i in defaultProps) {\r\n\t\t\tif (props[i]===undefined) {\r\n\t\t\t\tprops[i] = defaultProps[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn props;\r\n}\r\n","import { IS_NON_DIMENSIONAL } from '../constants';\r\nimport options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe node to remove\r\n */\r\nexport function removeNode(node) {\r\n\tlet parentNode = node.parentNode;\r\n\tif (parentNode) parentNode.removeChild(node);\r\n}\r\n\r\n\r\n/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@private\r\n */\r\nexport function setAccessor(node, name, old, value, isSvg) {\r\n\tif (name==='className') name = 'class';\r\n\r\n\r\n\tif (name==='key') {\r\n\t\t// ignore\r\n\t}\r\n\telse if (name==='ref') {\r\n\t\tif (old) old(null);\r\n\t\tif (value) value(node);\r\n\t}\r\n\telse if (name==='class' && !isSvg) {\r\n\t\tnode.className = value || '';\r\n\t}\r\n\telse if (name==='style') {\r\n\t\tif (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (name==='dangerouslySetInnerHTML') {\r\n\t\tif (value) node.innerHTML = value.__html || '';\r\n\t}\r\n\telse if (name[0]=='o' && name[1]=='n') {\r\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''));\r\n\t\tname = name.toLowerCase().substring(2);\r\n\t\tif (value) {\r\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\r\n\t\t}\r\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\r\n\t}\r\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\r\n\t\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\r\n\t\tif (value==null || value===false) {\r\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());\r\n\t\t\telse node.removeAttribute(name);\r\n\t\t}\r\n\t\telse if (typeof value!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\r\nimport { removeNode } from '../dom/index';\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = [];\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0;\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false;\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false;\r\n\r\n/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\r\n}\r\n\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n\tif (!diffLevel++) {\r\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\r\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined;\r\n\r\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\r\n\t\thydrating = dom!=null && !(ATTR_KEY in dom);\r\n\t}\r\n\r\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot);\r\n\r\n\t// append the element if its a new parent\r\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret);\r\n\r\n\t// diffLevel being reduced to 0 means we're exiting the diff\r\n\tif (!--diffLevel) {\r\n\t\thydrating = false;\r\n\t\t// invoke queued componentDidMount lifecycle methods\r\n\t\tif (!componentRoot) flushMounts();\r\n\t}\r\n\r\n\treturn ret;\r\n}\r\n\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n\tlet out = dom,\r\n\t\tprevSvgMode = isSvgMode;\r\n\r\n\t// empty values (null, undefined, booleans) render as empty Text nodes\r\n\tif (vnode==null || typeof vnode==='boolean') vnode = '';\r\n\r\n\r\n\t// Fast case: Strings & Numbers create/update Text nodes.\r\n\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\r\n\t\t// update if it's already a Text node:\r\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\r\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n\t\t\tif (dom.nodeValue!=vnode) {\r\n\t\t\t\tdom.nodeValue = vnode;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\r\n\t\t\tout = document.createTextNode(vnode);\r\n\t\t\tif (dom) {\r\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\r\n\t\t\t\trecollectNodeTree(dom, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tout[ATTR_KEY] = true;\r\n\r\n\t\treturn out;\r\n\t}\r\n\r\n\r\n\t// If the VNode represents a Component, perform a component diff:\r\n\tlet vnodeName = vnode.nodeName;\r\n\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\r\n\r\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\r\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode;\r\n\r\n\r\n\t// If there's no existing element or it's the wrong type, create a new one:\r\n\tvnodeName = String(vnodeName);\r\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\r\n\t\tout = createNode(vnodeName, isSvgMode);\r\n\r\n\t\tif (dom) {\r\n\t\t\t// move children into the replacement node\r\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild);\r\n\r\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\r\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\r\n\r\n\t\t\t// recycle the old element (skips non-Element node types)\r\n\t\t\trecollectNodeTree(dom, true);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet fc = out.firstChild,\r\n\t\tprops = out[ATTR_KEY],\r\n\t\tvchildren = vnode.children;\r\n\r\n\tif (props==null) {\r\n\t\tprops = out[ATTR_KEY] = {};\r\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value;\r\n\t}\r\n\r\n\t// Optimization: fast-path for elements containing a single TextNode:\r\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\r\n\t\tif (fc.nodeValue!=vchildren[0]) {\r\n\t\t\tfc.nodeValue = vchildren[0];\r\n\t\t}\r\n\t}\r\n\t// otherwise, if there are existing or new children, diff them:\r\n\telse if (vchildren && vchildren.length || fc!=null) {\r\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null);\r\n\t}\r\n\r\n\r\n\t// Apply attributes/props from VNode to the DOM Element:\r\n\tdiffAttributes(out, vnode.attributes, props);\r\n\r\n\r\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n\tisSvgMode = prevSvgMode;\r\n\r\n\treturn out;\r\n}\r\n\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n\tlet originalChildren = dom.childNodes,\r\n\t\tchildren = [],\r\n\t\tkeyed = {},\r\n\t\tkeyedLen = 0,\r\n\t\tmin = 0,\r\n\t\tlen = originalChildren.length,\r\n\t\tchildrenLen = 0,\r\n\t\tvlen = vchildren ? vchildren.length : 0,\r\n\t\tj, c, f, vchild, child;\r\n\r\n\t// Build up a map of keyed children and an Array of unkeyed children:\r\n\tif (len!==0) {\r\n\t\tfor (let i=0; i<len; i++) {\r\n\t\t\tlet child = originalChildren[i],\r\n\t\t\t\tprops = child[ATTR_KEY],\r\n\t\t\t\tkey = vlen && props ? child._component ? child._component.__key : props.key : null;\r\n\t\t\tif (key!=null) {\r\n\t\t\t\tkeyedLen++;\r\n\t\t\t\tkeyed[key] = child;\r\n\t\t\t}\r\n\t\t\telse if (props || (child.splitText!==undefined ? (isHydrating ? child.nodeValue.trim() : true) : isHydrating)) {\r\n\t\t\t\tchildren[childrenLen++] = child;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (vlen!==0) {\r\n\t\tfor (let i=0; i<vlen; i++) {\r\n\t\t\tvchild = vchildren[i];\r\n\t\t\tchild = null;\r\n\r\n\t\t\t// attempt to find a node based on key matching\r\n\t\t\tlet key = vchild.key;\r\n\t\t\tif (key!=null) {\r\n\t\t\t\tif (keyedLen && keyed[key]!==undefined) {\r\n\t\t\t\t\tchild = keyed[key];\r\n\t\t\t\t\tkeyed[key] = undefined;\r\n\t\t\t\t\tkeyedLen--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// attempt to pluck a node of the same type from the existing children\r\n\t\t\telse if (!child && min<childrenLen) {\r\n\t\t\t\tfor (j=min; j<childrenLen; j++) {\r\n\t\t\t\t\tif (children[j]!==undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\r\n\t\t\t\t\t\tchild = c;\r\n\t\t\t\t\t\tchildren[j] = undefined;\r\n\t\t\t\t\t\tif (j===childrenLen-1) childrenLen--;\r\n\t\t\t\t\t\tif (j===min) min++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\r\n\t\t\tchild = idiff(child, vchild, context, mountAll);\r\n\r\n\t\t\tf = originalChildren[i];\r\n\t\t\tif (child && child!==dom && child!==f) {\r\n\t\t\t\tif (f==null) {\r\n\t\t\t\t\tdom.appendChild(child);\r\n\t\t\t\t}\r\n\t\t\t\telse if (child===f.nextSibling) {\r\n\t\t\t\t\tremoveNode(f);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdom.insertBefore(child, f);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t// remove unused keyed children:\r\n\tif (keyedLen) {\r\n\t\tfor (let i in keyed) if (keyed[i]!==undefined) recollectNodeTree(keyed[i], false);\r\n\t}\r\n\r\n\t// remove orphaned unkeyed children:\r\n\twhile (min<=childrenLen) {\r\n\t\tif ((child = children[childrenLen--])!==undefined) recollectNodeTree(child, false);\r\n\t}\r\n}\r\n\r\n\r\n\r\n/** Recursively recycle (or just unmount) a node and its descendants.\r\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\r\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\r\n */\r\nexport function recollectNodeTree(node, unmountOnly) {\r\n\tlet component = node._component;\r\n\tif (component) {\r\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\r\n\t\tunmountComponent(component);\r\n\t}\r\n\telse {\r\n\t\t// If the node's VNode had a ref function, invoke it with null here.\r\n\t\t// (this is part of the React spec, and smart for unsetting references)\r\n\t\tif (node[ATTR_KEY]!=null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null);\r\n\r\n\t\tif (unmountOnly===false || node[ATTR_KEY]==null) {\r\n\t\t\tremoveNode(node);\r\n\t\t}\r\n\r\n\t\tremoveChildren(node);\r\n\t}\r\n}\r\n\r\n\r\n/** Recollect/unmount all children.\r\n *\t- we use .lastChild here because it causes less reflow than .firstChild\r\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\r\n */\r\nexport function removeChildren(node) {\r\n\tnode = node.lastChild;\r\n\twhile (node) {\r\n\t\tlet next = node.previousSibling;\r\n\t\trecollectNodeTree(node, true);\r\n\t\tnode = next;\r\n\t}\r\n}\r\n\r\n\r\n/** Apply differences in attributes from a VNode to the given DOM Element.\r\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\r\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\r\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\r\n */\r\nfunction diffAttributes(dom, attrs, old) {\r\n\tlet name;\r\n\r\n\t// remove attributes no longer present on the vnode by setting them to undefined\r\n\tfor (name in old) {\r\n\t\tif (!(attrs && attrs[name]!=null) && old[name]!=null) {\r\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\r\n\t\t}\r\n\t}\r\n\r\n\t// add new & update changed attributes\r\n\tfor (name in attrs) {\r\n\t\tif (name!=='children' && name!=='innerHTML' && (!(name in old) || attrs[name]!==(name==='value' || name==='checked' ? dom[name] : old[name]))) {\r\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\r\n\t\t}\r\n\t}\r\n}\r\n","import { Component } from '../component';\r\nimport options from '../options';\r\n/** Retains a pool of Components for re-use, keyed on component name.\r\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\r\n *\t@private\r\n */\r\nconst components = {};\r\n\r\n\r\n/** Reclaim a component for later re-use by the recycler. */\r\nexport function collectComponent(component) {\r\n\tlet name = component.constructor.name;\r\n\t(components[name] || (components[name] = [])).push(component);\r\n}\r\n\r\n/** Create a component. Normalizes differences between PFC's and classful Components. */\r\nexport function createComponent(Ctor, props, context) {\r\n\tlet list = components[Ctor.name],\r\n\t\tinst;\r\n\r\n\tif (Ctor.prototype && Ctor.prototype.render) {\r\n\t\tinst = new Ctor(props, context);\r\n\t\tComponent.call(inst, props, context);\r\n\t}\r\n\telse {\r\n\t\tinst = new Component(props, context);\r\n\t\tinst.constructor = Ctor;\r\n\t\tinst.render = doRender;\r\n\t}\r\n\tinst.$store = options.$store;\r\n\tif (window && window.Omi){\r\n\t\twindow.Omi.instances.push(inst);\r\n\t}\r\n\r\n\tif (list) {\r\n\t\tfor (let i=list.length; i--; ) {\r\n\t\t\tif (list[i].constructor===Ctor) {\r\n\t\t\t\tinst.nextBase = list[i].nextBase;\r\n\t\t\t\tlist.splice(i, 1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn inst;\r\n}\r\n\r\n\r\n/** The `.render()` method for a PFC backing instance. */\r\nfunction doRender(props, state, context) {\r\n\treturn this.constructor(props, context);\r\n}\r\n","import options from './options';\r\n\r\nlet styleId = 0;\r\n\r\nexport function getCtorName(ctor) {\r\n\r\n\tfor (let i = 0, len = options.styleCache.length; i < len; i++) {\r\n\t\tlet item = options.styleCache[i];\r\n\r\n\t\tif (item.ctor === ctor) {\r\n\t\t\treturn item.attrName;\r\n\t\t}\r\n\t}\r\n\r\n\tlet attrName = 'static_' + styleId;\r\n\toptions.styleCache.push({ ctor, attrName });\r\n\tstyleId++;\r\n\r\n\treturn attrName;\r\n}\r\n\r\n// many thanks to https://github.com/thomaspark/scoper/\r\nexport function scoper(css, prefix) {\r\n\tprefix = '['+prefix.toLowerCase()+']';\r\n\t// https://www.w3.org/TR/css-syntax-3/#lexical\r\n\tcss = css.replace(/\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//g, '');\r\n\t// eslint-disable-next-line\r\n let re = new RegExp('([^\\r\\n,{}:]+)(:[^\\r\\n,{}]+)?(,(?=[^{}]*{)|\\s*{)', 'g')\r\n\t/**\r\n * Example:\r\n *\r\n * .classname::pesudo { color:red }\r\n *\r\n * g1 is normal selector `.classname`\r\n * g2 is pesudo class or pesudo element\r\n * g3 is the suffix\r\n */\r\n\tcss = css.replace(re, (g0, g1, g2, g3) => {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic, getCtorName} from '../style';\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_' + getCtorName(component.constructor));\r\n\r\n\t\t}\r\n\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn <div />;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic, getCtorName} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into <body>:\r\n *\trender(<div id=\"hello\">hello!</div>, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => <span>{ name }</span>;\r\n *\trender(<Thing name=\"one\" />, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+getCtorName(vnode.constructor));\r\n\t\t}\r\n\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\r\n","import { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.6';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","document","stack","EMPTY_CHILDREN","map","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","options","isWeb","value","key","vnode","extend","obj","props","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","cloneElement","slice","call","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","list","element","base","componentChange","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","doc","createElementNS","createElement","parseCSSText","cssText","cssTxt","replace","match","a","b","rule","cssToJs","s","toUpperCase","properties","o","x","trim","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","result","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","removeEventListener","_listeners","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","setProperty","e","type","event","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","componentDidMount","installed","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","buildComponentFromVNode","firstChild","fc","vchildren","nextSibling","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","f","vchild","__key","insertBefore","recollectNodeTree","unmountOnly","ref","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","components","collectComponent","constructor","createComponent","Ctor","inst","prototype","render","Component","doRender","$store","Omi","instances","nextBase","splice","state","styleId","getCtorName","ctor","styleCache","item","attrName","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttr","vdom","attr","scopedStyle","_preStyle","addScopedAttrStatic","staticStyleRendered","scopeVdom","forEach","setComponentProps","opts","_disable","__ref","componentWillMount","install","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","renderComponent","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","shouldComponentUpdate","componentWillUpdate","beforeUpdate","staticStyle","_id","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","componentDidUpdate","afterUpdate","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","unmountComponent","beforeUnmount","componentWillUnmount","uninstall","inner","getId","callback","forceUpdate","merge","Object","assign","store","querySelector","empty","ssrData","root","__omiSsrData","version"],"mappings":";;;;;;;;AAAA;AACA,SAAgBA,KAAT,GAAiB;;ACDxB,SAASC,SAAT,GAAqB;KAChB,OAAOC,MAAP,KAAkB,QAAlB,IAA8B,CAACA,MAA/B,IAAyCA,OAAOC,IAAP,KAAgBA,IAAzD,IAAiED,OAAOE,KAAP,KAAiBA,KAAtF,EAA6F;MACxF,OAAOC,IAAP,KAAgB,WAApB,EAAiC;UACzBA,IAAP;GADD,MAEO,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;UAClCA,MAAP;GADM,MAEA,IAAI,OAAOJ,MAAP,KAAkB,WAAtB,EAAmC;UAClCA,MAAP;;SAEO,YAAU;UACV,IAAP;G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