omi/dist/omi.js.map

1 line
69 KiB
Plaintext

{"version":3,"sources":["../src/vnode.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/options.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","undefined","String","p","options","isWeb","map","value","key","vnode","extend","obj","props","cloneElement","h","slice","call","ATTR_KEY","component","debounceRendering","defer","rerender","items","element","base","renderComponent","list","componentChange","hydrating","node","_componentConstructor","normalizedNodeName","toLowerCase","defaultProps","doc","createElementNS","createElement","_ref","createNode","match","a","b","cssTxt","isSvg","rule","properties","o","split","x","trim","s","replace","Array","isArray","Symbol","iterator","_ref3","next","done","_ref2","property","style","parseCSSText","cssText","parentNode","removeChild","setAccessor","name","old","className","IS_NON_DIMENSIONAL","test","oldJson","currentJson","changed","ckey","result","substring","setStyles","addEventListener","eventProxy","useCapture","removeEventListener","innerHTML","_listeners","setProperty","removeAttribute","ns","setAttribute","e","this","type","event","diffLevel","c","mounts","isSvgMode","afterMount","installed","diff","dom","context","mountAll","parent","componentRoot","ret","idiff","ownerSVGElement","out","prevSvgMode","_component","nodeValue","splitText","recollectNodeTree","document","vnodeName","buildComponentFromVNode","replaceChild","appendChild","vchildren","fc","innerDiffNode","isHydrating","j","originalChildren","keyed","keyedLen","childrenLen","vlen","_child","f","__key","vchild","min","nextSibling","removeNode","insertBefore","unmountOnly","removeChildren","previousSibling","attrs","collectComponent","components","Ctor","inst","constructor","render","Component","createComponent","prototype","Omi","nextBase","$store","splice","state","getCtorName","ctor","len","styleCache","item","doRender","attrName","styleId","prefix","re","css","g0","g1","g2","g3","appendClass","addStyle","id","ele","head","getElementsByTagName","someThingStyles","getElementById","textContent","window","ActiveXObject","styleSheet","addStyleWithoutId","attr","scopeVdom","_preStyle","scopedStyle","vdom","staticStyleRendered","setComponentProps","opts","_disable","componentWillReceiveProps","enqueueRender","prevProps","isChild","previousProps","previousState","isUpdate","initialBase","initialChildComponent","previousContext","rendered","shouldComponentUpdate","skip","cbase","componentWillUpdate","beforeUpdate","FORCE_RENDER","prevContext","addScopedAttrStatic","staticStyle","addScopedAttr","_id","childComponent","childProps","getNodeProps","toUnmount","baseParent","SYNC_RENDER","componentRef","t","unshift","_parentComponent","afterUpdate","componentDidUpdate","_renderCallbacks","flushMounts","oldDom","originalComponent","isDirectOwner","isOwner","unmountComponent","beforeUnmount","componentWillUnmount","ref","merge","Object","querySelector","empty","firstChild","store","componentWillMount","install","root","global","Math","self","br","hr","h1","h2","h3","h4","h5","h6","abbr","address","bdi","bdo","blockquote","cite","code","del","ins","dfn","em","strong","samp","kbd","var","mark","pre","q","ruby","rp","rt","small","sub","sup","time","u","wbr","form","input","textarea","button","select","option","optgroup","label","fieldset","datalist","legend","output","iframe","img","canvas","figure","figcaption","audio","source","video","track","nav","link","ul","ol","li","dl","dt","dd","menu","command","table","caption","th","td","tr","thead","tbody","tfoot","col","colgroup","div","main","span","header","footer","section","article","aside","details","dialog","summary","progress","meter","meta","area","script","noscript","embed","object","param","view","scroll-view","swiper","icon","text","checkbox","radio","picker","picker-view","slider","switch","navigator","image","contact-button","block","usePromise","Promise","__config__","platform","systemVersion","resolve","then","bind","setTimeout","ASYNC_RENDER","forceUpdate","callback","update","instances","version","module","exports"],"mappings":";;IACO,SAASA;ICmLT,SAAWC,EAAAA,UAAUC;QAC3B,IAA6BC,YAAYC,OAAOC,QAAQC,GAApDC,WAASC;QACb,KAAKF,IAAEG,UAAUC,QAAQJ,MAAM,KAC9BK,MAAMC,KAAKH,UAAUH;QAEtB,IAAIJ,cAAmC,QAArBA,WAAWK,UAAgB;YAC5C,KAAKI,MAAMD,QAAQC,MAAMC,KAAKV,WAAWK;mBAClCL,WAAWK;;QAEnB,OAAOI,MAAMD,QACZ,KAAKN,QAAQO,MAAME,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,IAAAA;IAEAA,QAAAgP,KAAA9F;;QAEDlH,eAAa+D;QACb/F,cAAQwL;QACRzC,WAAOvE;QACPsE,QAAAA;;iBErEKkO;;;IAILhV,QAAAA,KAAAA,IAFkBiV,UAAA;IAIlBlO,IAAAA;QACAD,GAAAA;QACA7H,eAAAA;QACAjB,cAAAA;QACAgX,WAAAA;QARDlO,QAAAA;;QAWA9I,SAAQgP;;;IAIPhN,IAFc,sBAEdA,QAFckV,OAAAC,UAAAjO,UAAAiG,KAAAjG,MAAAA","file":"omi.js","sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\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","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 { 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"]}