{"version":3,"file":"ef.min.js","sources":["../node_modules/eft-parser/src/escape-parser.js","../node_modules/eft-parser/src/eft-parser.js","../src/lib/parser.js","../src/lib/utils/array-helper.js","../src/lib/utils/literals-mix.js","../src/lib/utils/polyfills.js","../src/lib/utils/render-query.js","../src/lib/utils/resolver.js","../src/lib/utils/binding.js","../src/lib/utils/event-helper.js","../src/lib/utils/element-creator.js","../src/lib/utils/dom-helper.js","../src/lib/utils/dom-arr-helper.js","../src/lib/utils/type-of.js","../src/lib/utils/creator.js","../src/lib/renderer.js","../src/ef.js"],"sourcesContent":["// Set the escape character\nconst char = '&'\n\n// Initlize RegExp\nconst oct = new RegExp(`\\\\${char}[0-7]{1,3}`, 'g')\nconst ucp = new RegExp(`\\\\${char}u\\\\[.*?\\\\]`, 'g')\nconst uni = new RegExp(`\\\\${char}u.{0,4}`, 'g')\nconst hex = new RegExp(`\\\\${char}x.{0,2}`, 'g')\nconst esc = new RegExp(`\\\\${char}`, 'g')\nconst b = new RegExp(`\\\\${char}b`, 'g')\nconst t = new RegExp(`\\\\${char}t`, 'g')\nconst n = new RegExp(`\\\\${char}n`, 'g')\nconst v = new RegExp(`\\\\${char}v`, 'g')\nconst f = new RegExp(`\\\\${char}f`, 'g')\nconst r = new RegExp(`\\\\${char}r`, 'g')\n\n// Escape octonary sequence\nconst O2C = () => {\n\tthrow new SyntaxError('Octal escape sequences are not allowed in EFML.')\n}\n\n// Escape unicode code point sequence\nconst UC2C = (val) => {\n\tval = val.substr(3, val.length - 4)\n\tval = parseInt(val, 16)\n\tif (!val) throw new SyntaxError('Invalid Unicode escape sequence')\n\ttry {\n\t\treturn String.fromCodePoint(val)\n\t} catch (err) {\n\t\tthrow new SyntaxError('Undefined Unicode code-point')\n\t}\n}\n\n// Escape unicode sequence\nconst U2C = (val) => {\n\tval = val.substring(2)\n\tval = parseInt(val, 16)\n\tif (!val) throw new SyntaxError('Invalid Unicode escape sequence')\n\treturn String.fromCharCode(val)\n}\n\n// Escape hexadecimal sequence\nconst X2C = (val) => {\n\tval = `00${val.substring(2)}`\n\tval = parseInt(val, 16)\n\tif (!val) throw new SyntaxError('Invalid hexadecimal escape sequence')\n\treturn String.fromCharCode(val)\n}\n\nconst ESCAPE = (string) => {\n\t// Split strings\n\tconst splited = string.split(char + char)\n\tconst escaped = []\n\n\t// Escape all known escape characters\n\tfor (let i of splited) {\n\t\tconst escapedStr = i\n\t\t\t.replace(oct, O2C)\n\t\t\t.replace(ucp, UC2C)\n\t\t\t.replace(uni, U2C)\n\t\t\t.replace(hex, X2C)\n\t\t\t.replace(b, '\\b')\n\t\t\t.replace(t, '\\t')\n\t\t\t.replace(n, '\\n')\n\t\t\t.replace(v, '\\v')\n\t\t\t.replace(f, '\\f')\n\t\t\t.replace(r, '\\r')\n\t\t\t// Remove all useless escape characters\n\t\t\t.replace(esc, '')\n\t\tescaped.push(escapedStr)\n\t}\n\t// Return escaped string\n\treturn escaped.join(char)\n}\n\n// export default ESCAPE\nmodule.exports = ESCAPE\n","import ESCAPE from './escape-parser.js'\n\nconst typeSymbols = '>#%@.-+'.split('')\nconst reserved = '__EFPLACEHOLDER__ $parent $key $data $element $refs $methods $mount $umount $subscribe $unsubscribe $update $destroy __DIRECTMOUNT__'.split(' ')\nconst mustache = /\\{\\{.+?\\}\\}/g\nconst spaceIndent = /^(\\t*)( *).*/\nconst hashref = /#([^}]|}[^}])*$/\n\nconst getErrorMsg = (msg, line = -2) => `Failed to parse eft template: ${msg}. at line ${line + 1}`\n\nconst isEmpty = string => !string.replace(/\\s/, '')\n\nconst getOffset = (string, parsingInfo) => {\n\tif (parsingInfo.offset !== null) return\n\tparsingInfo.offset = string.match(/\\s*/)[0]\n\tif (parsingInfo.offset) parsingInfo.offsetReg = new RegExp(`^${parsingInfo.offset}`)\n}\n\nconst removeOffset = (string, parsingInfo, i) => {\n\tif (parsingInfo.offsetReg) {\n\t\tlet removed = false\n\t\tstring = string.replace(parsingInfo.offsetReg, () => {\n\t\t\tremoved = true\n\t\t\treturn ''\n\t\t})\n\t\tif (!removed) throw new SyntaxError(getErrorMsg(`Expected indent to be grater than 0 and less than ${parsingInfo.prevDepth + 1}, but got -1`, i))\n\t}\n\treturn string\n}\n\nconst getIndent = (string, parsingInfo) => {\n\tif (parsingInfo.indentReg) return\n\tconst spaces = string.match(spaceIndent)[2]\n\tif (spaces) {\n\t\tparsingInfo.indentReg = new RegExp(spaces, 'g')\n\t}\n}\n\nconst getDepth = (string, parsingInfo, i) => {\n\tlet depth = 0\n\tif (parsingInfo.indentReg) string = string.replace(/^\\s*/, str => str.replace(parsingInfo.indentReg, '\\t'))\n\tconst content = string.replace(/^\\t*/, (str) => {\n\t\tdepth = str.length\n\t\treturn ''\n\t})\n\tif (/^\\s/.test(content)) throw new SyntaxError(getErrorMsg('Bad indent', i))\n\treturn { depth, content }\n}\n\nconst resolveDepth = (ast, depth) => {\n\tlet currentNode = ast\n\tfor (let i = 0; i < depth; i++) currentNode = currentNode[currentNode.length - 1]\n\treturn currentNode\n}\n\nconst splitDefault = (string) => {\n\tstring = string.slice(2, string.length - 2)\n\tconst [_path, ..._default] = string.split('=')\n\tconst pathArr = _path.trim().split('.')\n\tconst defaultVal = ESCAPE(_default.join('=').trim())\n\tif (defaultVal) return [pathArr, defaultVal]\n\treturn [pathArr]\n}\n\nconst splitLiterals = (string) => {\n\tconst strs = string.split(mustache)\n\tif (strs.length === 1) return ESCAPE(string)\n\tconst tmpl = []\n\tif (strs.length === 2 && !strs[0] && !strs[1]) tmpl.push(0)\n\telse tmpl.push(strs.map(ESCAPE))\n\tconst mustaches = string.match(mustache)\n\tif (mustaches) tmpl.push(...mustaches.map(splitDefault))\n\treturn tmpl\n}\n\nconst pushStr = (textArr, str) => {\n\tif (str) textArr.push(str)\n}\n\nconst parseText = (string) => {\n\tconst result = splitLiterals(string)\n\tif (typeof result === 'string') return [result]\n\tconst [strs, ...exprs] = result\n\tconst textArr = []\n\tfor (let i = 0; i < exprs.length; i++) {\n\t\tpushStr(textArr, strs[i])\n\t\ttextArr.push(exprs[i])\n\t}\n\tpushStr(textArr, strs[strs.length - 1])\n\treturn textArr\n}\n\nconst dotToSpace = val => val.replace(/\\./g, ' ')\n\nconst parseTag = (string) => {\n\tconst tagInfo = {}\n\tconst [tag, ...content] = string.replace(hashref, (val) => {\n\t\ttagInfo.ref = val.slice(1)\n\t\treturn ''\n\t}).split('.')\n\ttagInfo.tag = tag\n\ttagInfo.class = splitLiterals(content.join('.'))\n\tif (typeof tagInfo.class === 'string') tagInfo.class = dotToSpace(tagInfo.class).trim()\n\telse if (tagInfo.class[0]) tagInfo.class[0] = tagInfo.class[0].map(dotToSpace)\n\treturn tagInfo\n}\n\nconst parseNodeProps = (string) => {\n\tconst splited = string.split('=')\n\treturn {\n\t\tname: splited.shift().trim(),\n\t\tvalue: splitLiterals(splited.join('=').trim())\n\t}\n}\n\nconst parseEvent = (string) => {\n\tconst splited = string.split('=')\n\treturn {\n\t\tname: splited.shift().trim(),\n\t\tvalue: splited.join('=').trim()\n\t}\n}\n\nconst setOption = (options, option) => {\n\tswitch (option) {\n\t\tcase 'stop': {\n\t\t\toptions.s = 1\n\t\t\tbreak\n\t\t}\n\t\tcase 'stopImmediate': {\n\t\t\toptions.i = 1\n\t\t\tbreak\n\t\t}\n\t\tcase 'prevent': {\n\t\t\toptions.p = 1\n\t\t\tbreak\n\t\t}\n\t\tcase 'shift': {\n\t\t\toptions.h = 1\n\t\t\tbreak\n\t\t}\n\t\tcase 'alt': {\n\t\t\toptions.a = 1\n\t\t\tbreak\n\t\t}\n\t\tcase 'ctrl': {\n\t\t\toptions.c = 1\n\t\t\tbreak\n\t\t}\n\t\tcase 'meta': {\n\t\t\toptions.t = 1\n\t\t\tbreak\n\t\t}\n\t\tcase 'capture': {\n\t\t\toptions.u = 1\n\t\t\tbreak\n\t\t}\n\t\tdefault: {\n\t\t\tconsole.warn(`Abandoned unsupported event option '${option}'.`)\n\t\t}\n\t}\n}\n\nconst getOption = (options, keys, option) => {\n\tconst keyCode = parseInt(option, 10)\n\tif (isNaN(keyCode)) return setOption(options, option)\n\tkeys.push(keyCode)\n}\n\nconst getEventOptions = (name) => {\n\tconst options = {}\n\tconst keys = []\n\tconst [listener, ...ops] = name.split('.')\n\toptions.l = listener\n\tfor (let i of ops) getOption(options, keys, i)\n\tif (keys.length > 0) options.k = keys\n\treturn options\n}\n\nconst splitEvents = (string) => {\n\tconst [name, ...value] = string.split(':')\n\tconst content = value.join(':')\n\tif (content) return [name.trim(), splitLiterals(content)]\n\treturn [name.trim()]\n}\n\nconst parseLine = ({line, ast, parsingInfo, i}) => {\n\tif (isEmpty(line)) return\n\tgetIndent(line, parsingInfo)\n\tgetOffset(line, parsingInfo)\n\n\tlet { depth, content } = getDepth(removeOffset(line, parsingInfo, i), parsingInfo, i)\n\n\tif (content) {\n\t\tif (depth < 0 || depth - parsingInfo.prevDepth > 1 || (depth - parsingInfo.prevDepth === 1 && ['comment', 'tag'].indexOf(parsingInfo.prevType) === -1) || (parsingInfo.prevType !== 'comment' && depth === 0 && parsingInfo.topExists)) throw new SyntaxError(getErrorMsg(`Expected indent to be grater than 0 and less than ${parsingInfo.prevDepth + 1}, but got ${depth}`, i))\n\t\tconst type = content[0]\n\t\tcontent = content.slice(1)\n\t\tif (!parsingInfo.topExists && typeSymbols.indexOf(type) >= 0 && type !== '>') throw new SyntaxError(getErrorMsg('No top level entry', i))\n\t\tif (!content && typeSymbols.indexOf(type) >= 0) throw new SyntaxError(getErrorMsg('Empty content', i))\n\t\t// Jump back to upper level\n\t\tif (depth < parsingInfo.prevDepth || (depth === parsingInfo.prevDepth && parsingInfo.prevType === 'tag')) parsingInfo.currentNode = resolveDepth(ast, depth)\n\t\tparsingInfo.prevDepth = depth\n\n\t\tswitch (type) {\n\t\t\tcase '>': {\n\t\t\t\tif (!parsingInfo.topExists) {\n\t\t\t\t\tparsingInfo.topExists = true\n\t\t\t\t\tparsingInfo.minDepth = depth\n\t\t\t\t}\n\t\t\t\tconst info = parseTag(content)\n\t\t\t\tconst newNode = [{\n\t\t\t\t\tt: info.tag\n\t\t\t\t}]\n\t\t\t\tif (info.class) {\n\t\t\t\t\tnewNode[0].a = {}\n\t\t\t\t\tnewNode[0].a.class = info.class\n\t\t\t\t}\n\t\t\t\tif (info.ref) newNode[0].r = info.ref\n\t\t\t\tparsingInfo.currentNode.push(newNode)\n\t\t\t\tparsingInfo.currentNode = newNode\n\t\t\t\tparsingInfo.prevType = 'tag'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase '#': {\n\t\t\t\tconst { name, value } = parseNodeProps(content)\n\t\t\t\tif (!parsingInfo.currentNode[0].a) parsingInfo.currentNode[0].a = {}\n\t\t\t\tparsingInfo.currentNode[0].a[name] = value\n\t\t\t\tparsingInfo.prevType = 'attr'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase '%': {\n\t\t\t\tconst { name, value } = parseNodeProps(content)\n\t\t\t\tif (!parsingInfo.currentNode[0].p) parsingInfo.currentNode[0].p = {}\n\t\t\t\tparsingInfo.currentNode[0].p[name] = value\n\t\t\t\tparsingInfo.prevType = 'prop'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase '@': {\n\t\t\t\tconst { name, value } = parseEvent(content)\n\t\t\t\tif (!parsingInfo.currentNode[0].e) parsingInfo.currentNode[0].e = []\n\t\t\t\tconst options = getEventOptions(name)\n\t\t\t\tconst [method, _value] = splitEvents(value)\n\t\t\t\toptions.m = method\n\t\t\t\tif (_value) options.v = _value\n\t\t\t\tparsingInfo.currentNode[0].e.push(options)\n\t\t\t\tparsingInfo.prevType = 'event'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase '.': {\n\t\t\t\tparsingInfo.currentNode.push(...parseText(content))\n\t\t\t\tparsingInfo.prevType = 'text'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase '-': {\n\t\t\t\tif (reserved.indexOf(content) !== -1) throw new SyntaxError(getErrorMsg(`Reserved name '${content}' should not be used`, i))\n\t\t\t\tparsingInfo.currentNode.push({\n\t\t\t\t\tn: content,\n\t\t\t\t\tt: 0\n\t\t\t\t})\n\t\t\t\tparsingInfo.prevType = 'node'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase '+': {\n\t\t\t\tparsingInfo.currentNode.push({\n\t\t\t\t\tn: content,\n\t\t\t\t\tt: 1\n\t\t\t\t})\n\t\t\t\tparsingInfo.prevType = 'list'\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tparsingInfo.prevType = 'comment'\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst parseEft = (template) => {\n\tif (!template) throw new TypeError(getErrorMsg('Template required, but nothing present'))\n\tconst tplType = typeof template\n\tif (tplType !== 'string') throw new TypeError(getErrorMsg(`Expected a string, but got a(n) ${tplType}`))\n\tconst lines = template.split(/\\r?\\n/)\n\tconst ast = []\n\tconst parsingInfo = {\n\t\tindentReg: null,\n\t\tprevDepth: 0,\n\t\toffset: null,\n\t\toffsetReg: null,\n\t\tprevType: 'comment',\n\t\tcurrentNode: ast,\n\t\ttopExists: false,\n\t}\n\tfor (let i = 0; i < lines.length; i++) parseLine({line: lines[i], ast, parsingInfo, i})\n\n\tif (ast[0]) return ast[0]\n\tthrow new SyntaxError(getErrorMsg('Nothing to be parsed', lines.length - 1))\n}\n\nexport default parseEft\n","import eftParser from 'eft-parser'\n\nconst parse = (template, parser) => {\n\tif (!parser) parser = eftParser\n\treturn parser(template)\n}\n\nexport default parse\n","const proto = Array.prototype\n\nconst ARR = {\n\tcopy(arr) {\n\t\treturn proto.slice.call(arr, 0)\n\t},\n\tempty(arr) {\n\t\tarr.length = 0\n\t\treturn arr\n\t},\n\tequals(left, right) {\n\t\tif (!Array.isArray(right)) return false\n\t\tif (left === right) return true\n\t\tif (left.length !== right.length) return false\n\t\tfor (let i in left) if (left[i] !== right[i]) return false\n\t\treturn true\n\t},\n\tpop(arr) {\n\t\treturn proto.pop.call(arr)\n\t},\n\tpush(arr, ...items) {\n\t\treturn proto.push.apply(arr, items)\n\t},\n\tremove(arr, item) {\n\t\tconst index = proto.indexOf.call(arr, item)\n\t\tif (index > -1) {\n\t\t\tproto.splice.call(arr, index, 1)\n\t\t\treturn item\n\t\t}\n\t},\n\treverse(arr) {\n\t\treturn proto.reverse.call(arr)\n\t},\n\trightUnique(arr) {\n\t\tconst newArr = []\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tfor (let j = i + 1; j < arr.length; j++) if (arr[i] === arr[j]) j = i += 1\n\t\t\tnewArr.push(arr[i])\n\t\t}\n\t\treturn newArr\n\t},\n\tshift(arr) {\n\t\treturn proto.shift.call(arr)\n\t},\n\tslice(arr, index, length) {\n\t\treturn proto.slice.call(arr, index, length)\n\t},\n\tsort(arr, fn) {\n\t\treturn proto.sort.call(arr, fn)\n\t},\n\tsplice(arr, ...args) {\n\t\treturn proto.splice.apply(arr, args)\n\t},\n\tunshift(arr, ...items) {\n\t\treturn proto.unshift.apply(arr, items)\n\t}\n}\n\nif (window.Set) ARR.unique = arr => Array.from(new Set(arr))\nelse ARR.unique = ARR.rightUnique\n\nexport default ARR\n","const mixStr = (strs, ...exprs) => {\n\tlet string = ''\n\tfor (let i = 0; i < exprs.length; i++) string += (strs[i] + exprs[i])\n\treturn string + strs[strs.length - 1]\n}\n\nconst getVal = ({dataNode, _key}) => dataNode[_key]\n\nconst mixVal = (strs, ...exprs) => {\n\tif (!strs) return getVal(exprs[0])\n\tconst template = [strs]\n\ttemplate.push(...exprs.map(getVal))\n\treturn mixStr(...template)\n}\n\nexport { mixStr, mixVal }\n","// Enough for ef's usage, so no need for a full polyfill\nconst _assign = (ee, er) => {\n\tfor (let i in er) ee[i] = er[i]\n\treturn ee\n}\n\nconst assign = Object.assign || _assign\n\nexport { assign }\n","import ARR from './array-helper.js'\n\nconst query = []\nconst domQuery = []\nconst userQuery = []\nlet count = 0\n\nconst queue = handlers => query.push(...handlers)\nconst queueDom = handler => domQuery.push(handler)\nconst onNextRender = handler => userQuery.push(handler)\n\nconst inform = () => {\n\tcount += 1\n\treturn count\n}\n\nconst execUserQuery = () => {\n\tconst userFnQuery = ARR.unique(userQuery)\n\tfor (let i of userFnQuery) i()\n\tif (ENV !== 'production') console.info('[EF]', `${userQuery.length} user operations cached, ${userFnQuery.length} executed.`)\n\tARR.empty(userQuery)\n}\n\nconst exec = (immediate) => {\n\tif (!immediate && (count -= 1) > 0) return count\n\tcount = 0\n\n\tif (query.length > 0) {\n\t\tconst renderQuery = ARR.unique(query)\n\t\tfor (let i of renderQuery) i()\n\t\tif (ENV !== 'production') console.info('[EF]', `${query.length} modification operations cached, ${renderQuery.length} executed.`)\n\t\tARR.empty(query)\n\t}\n\n\tif (domQuery.length > 0) {\n\t\tconst domRenderQuery = ARR.rightUnique(domQuery)\n\t\tfor (let i of domRenderQuery) i()\n\t\tif (ENV !== 'production') console.info('[EF]', `${domQuery.length} DOM operations cached, ${domRenderQuery.length} executed.`)\n\t\tARR.empty(domQuery)\n\t}\n\n\t// Execute user query after DOM update\n\tif (userQuery.length > 0) setTimeout(execUserQuery, 0)\n\n\treturn count\n}\n\nconst bundle = (cb) => {\n\tinform()\n\treturn exec(cb(inform, exec))\n}\n\nexport { queue, queueDom, onNextRender, inform, exec, bundle }\n","import { assign } from './polyfills.js'\nimport { inform, exec } from './render-query.js'\n\nconst resolveAllPath = ({_path, handlers, subscribers, innerData}) => {\n\tfor (let i of _path) {\n\t\tif (!handlers[i]) handlers[i] = {}\n\t\tif (!subscribers[i]) subscribers[i] = {}\n\t\tif (!innerData[i]) innerData[i] = {}\n\t\thandlers = handlers[i]\n\t\tsubscribers = subscribers[i]\n\t\tinnerData = innerData[i]\n\t}\n\treturn {\n\t\thandlerNode: handlers,\n\t\tsubscriberNode: subscribers,\n\t\tdataNode: innerData\n\t}\n}\n\nconst resolveReactivePath = (_path, obj, enume) => {\n\tfor (let i of _path) {\n\t\tif (!obj[i]) {\n\t\t\tconst node = {}\n\t\t\tObject.defineProperty(obj, i, {\n\t\t\t\tget() {\n\t\t\t\t\treturn node\n\t\t\t\t},\n\t\t\t\tset(data) {\n\t\t\t\t\tinform()\n\t\t\t\t\tassign(node, data)\n\t\t\t\t\texec()\n\t\t\t\t},\n\t\t\t\tconfigurable: !enume,\n\t\t\t\tenumerable: enume\n\t\t\t})\n\t\t}\n\t\tobj = obj[i]\n\t}\n\treturn obj\n}\n\nconst resolve = ({ _path, _key, data, handlers, subscribers, innerData }) => {\n\tconst parentNode = resolveReactivePath(_path, data, true)\n\tconst {handlerNode, subscriberNode, dataNode} = resolveAllPath({_path, handlers, subscribers, innerData})\n\tif (!handlerNode[_key]) handlerNode[_key] = []\n\tif (!subscriberNode[_key]) subscriberNode[_key] = []\n\tif (!Object.prototype.hasOwnProperty.call(dataNode, _key)) dataNode[_key] = ''\n\treturn { parentNode, handlerNode: handlerNode[_key], subscriberNode: subscriberNode[_key], dataNode }\n}\n\nconst resolveSubscriber = (_path, subscribers) => {\n\tconst pathArr = _path.split('.')\n\tconst key = pathArr.pop()\n\tfor (let i of pathArr) {\n\t\tif (!subscribers[i]) subscribers[i] = {}\n\t\tsubscribers = subscribers[i]\n\t}\n\treturn subscribers[key]\n}\n\nexport { resolveReactivePath, resolve, resolveSubscriber }\n","import ARR from './array-helper.js'\nimport { resolve } from './resolver.js'\nimport { queue, inform, exec } from './render-query.js'\n\nconst initDataNode = ({parentNode, dataNode, handlerNode, subscriberNode, state, _key}) => {\n\tObject.defineProperty(parentNode, _key, {\n\t\tget() {\n\t\t\treturn dataNode[_key]\n\t\t},\n\t\tset(value) {\n\t\t\tif (dataNode[_key] === value) return\n\t\t\tdataNode[_key] = value\n\t\t\tqueue(handlerNode)\n\t\t\tinform()\n\t\t\tfor (let j of subscriberNode) j({state, value})\n\t\t\texec()\n\t\t},\n\t\tenumerable: true\n\t})\n}\n\nconst initBinding = ({bind, state, handlers, subscribers, innerData}) => {\n\tconst _path = ARR.copy(bind[0])\n\tconst _default = bind[1]\n\tconst _key = _path.pop()\n\tconst { parentNode, handlerNode, subscriberNode, dataNode } = resolve({\n\t\t_path,\n\t\t_key,\n\t\tdata: state.$data,\n\t\thandlers,\n\t\tsubscribers,\n\t\tinnerData\n\t})\n\n\t// Initlize data binding node if not exist\n\tif (!Object.prototype.hasOwnProperty.call(parentNode, _key)) initDataNode({parentNode, dataNode, handlerNode, subscriberNode, state, _key})\n\t// Update default value\n\tif (_default) parentNode[_key] = _default\n\n\treturn {dataNode, handlerNode, subscriberNode, _key}\n}\n\nexport default initBinding\n","/* Get new events that works in all target browsers\n * though a little bit old-fashioned\n */\nconst getEvent = (name, props = {\n\tbubbles: false,\n\tcancelable: false\n}) => {\n\tconst event = document.createEvent('Event')\n\tevent.initEvent(name, props.bubbles, props.cancelable)\n\treturn event\n}\n\nexport default getEvent\n","import ARR from './array-helper.js'\nimport { mixVal } from './literals-mix.js'\nimport initBinding from './binding.js'\nimport { queue, inform, exec } from './render-query.js'\nimport getEvent from './event-helper.js'\n\nconst getElement = (tag, ref, refs) => {\n\tconst element = document.createElement(tag)\n\tif (ref) Object.defineProperty(refs, ref, {\n\t\tvalue: element,\n\t\tenumerable: true\n\t})\n\treturn element\n}\n\nconst regTmpl = ({val, state, handlers, subscribers, innerData, handler}) => {\n\tif (Array.isArray(val)) {\n\t\tconst [strs, ...exprs] = val\n\t\tconst tmpl = [strs]\n\t\tconst _handler = () => handler(mixVal(...tmpl))\n\t\ttmpl.push(...exprs.map((item) => {\n\t\t\tconst {dataNode, handlerNode, _key} = initBinding({bind: item, state, handlers, subscribers, innerData})\n\t\t\thandlerNode.push(_handler)\n\t\t\treturn {dataNode, _key}\n\t\t}))\n\t\treturn _handler\n\t}\n\treturn () => val\n}\n\nconst updateOthers = ({dataNode, handlerNode, subscriberNode, _handler, state, _key, value}) => {\n\tif (dataNode[_key] === value) return\n\tdataNode[_key] = value\n\tconst query = ARR.copy(handlerNode)\n\tARR.remove(query, _handler)\n\tqueue(query)\n\tinform()\n\tfor (let i of subscriberNode) i({state, value})\n\texec()\n}\n\nconst addValListener = ({_handler, state, handlers, subscribers, innerData, element, key, expr}) => {\n\tconst {dataNode, handlerNode, subscriberNode, _key} = initBinding({bind: expr, state, handlers, subscribers, innerData})\n\tconst _update = () => updateOthers({dataNode, handlerNode, subscriberNode, _handler, state, _key, value: element.value})\n\tif (key === 'value') {\n\t\t// Listen to input, keyup and change events in order to work in most browsers.\n\t\telement.addEventListener('input', _update, true)\n\t\telement.addEventListener('keyup', _update, true)\n\t\telement.addEventListener('change', _update, true)\n\t} else {\n\t\telement.addEventListener('change', () => {\n\t\t\t// Trigger change to the element it-self\n\t\t\telement.dispatchEvent(getEvent('ef-change-event'))\n\t\t\tif (element.tagName === 'INPUT' && element.type === 'radio' && element.name !== '') {\n\t\t\t\t// Trigger change to the the same named radios\n\t\t\t\tconst radios = document.querySelectorAll(`input[name=${element.name}]`)\n\t\t\t\tif (radios) {\n\t\t\t\t\tconst selected = Array.from(radios)\n\t\t\t\t\tARR.remove(selected, element)\n\n\t\t\t\t\t/* Event triggering could cause unwanted render triggers\n\t\t\t\t\t * no better ways came up at the moment\n\t\t\t\t\t */\n\t\t\t\t\tfor (let i of selected) i.dispatchEvent(getEvent('ef-change-event'))\n\t\t\t\t}\n\t\t\t}\n\t\t}, true)\n\t\t// Use custom event to avoid loops and conflicts\n\t\telement.addEventListener('ef-change-event', () => updateOthers({dataNode, handlerNode, subscriberNode, _handler, state, _key, value: element.checked}))\n\t}\n}\n\nconst getAttrHandler = (element, key) => {\n\tif (key === 'class') return (val) => {\n\t\tval = `${val}`.replace(/\\s+/g, ' ').trim()\n\t\t// Remove attribute when value is empty\n\t\tif (!val) return element.removeAttribute(key)\n\t\telement.setAttribute(key, val)\n\t}\n\treturn (val) => {\n\t\t// Remove attribute when value is empty\n\t\tif (val === '') return element.removeAttribute(key)\n\t\telement.setAttribute(key, val)\n\t}\n}\n\nconst addAttr = ({element, attr, key, state, handlers, subscribers, innerData}) => {\n\tif (typeof attr === 'string') element.setAttribute(key, attr)\n\telse {\n\t\tconst handler = getAttrHandler(element, key)\n\t\tqueue([regTmpl({val: attr, state, handlers, subscribers, innerData, handler})])\n\t}\n}\n\nconst addProp = ({element, prop, key, state, handlers, subscribers, innerData}) => {\n\tif (typeof prop === 'string') element[key] = prop\n\telse {\n\t\tconst handler = (val) => {\n\t\t\telement[key] = val\n\t\t}\n\t\tconst _handler = regTmpl({val: prop, state, handlers, subscribers, innerData, handler})\n\t\tif ((key === 'value' ||\n\t\t\tkey === 'checked') &&\n\t\t\t!prop[0]) addValListener({_handler, state, handlers, subscribers, innerData, element, key, expr: prop[1]})\n\t\tqueue([_handler])\n\t}\n}\n\n\nconst rawHandler = val => val\n\nconst addEvent = ({element, event, state, handlers, subscribers, innerData}) => {\n\n\t/**\n\t * l: listener\t\t\t\t\t\t\t\t\t: string\n\t * m: method : string\n\t * s: stopPropagation : number/undefined\n\t * i: stopImmediatePropagation : number/undefined\n\t * p: preventDefault : number/undefined\n\t * h: shiftKey : number/undefined\n\t * a: altKey : number/undefined\n\t * c: ctrlKey : number/undefined\n\t * t: metaKey : number/undefined\n\t * u: capture : number/undefined\n\t * k: keyCodes : array/undefined\n\t * v: value : string/array/undefined\n\t */\n\tconst {l, m, s, i, p, h, a, c, t, u, k, v} = event\n\tconst _handler = regTmpl({val: v, state, handlers, subscribers, innerData, handler: rawHandler})\n\telement.addEventListener(l, (e) => {\n\t\tif (!!h !== !!e.shiftKey ||\n\t\t\t!!a !== !!e.altKey ||\n\t\t\t!!c !== !!e.ctrlKey ||\n\t\t\t!!t !== !!e.metaKey ||\n\t\t\t(k && k.indexOf(e.which) === -1)) return\n\t\tif (s) e.stopPropagation()\n\t\tif (i) e.stopImmediatePropagation()\n\t\tif (p) e.preventDefault()\n\t\tif (state.$methods[m]) state.$methods[m]({e, value: _handler(), state})\n\t\telse if (ENV !== 'production') console.warn('[EF]', `Method named '${m}' not found!`)\n\t}, !!u)\n}\n\nconst createElement = ({info, state, innerData, refs, handlers, subscribers}) => {\n\n\t/**\n\t * t: tag : string\n\t * a: attr : object\n\t * p: prop : object\n\t * e: event : array\n\t * r: reference : string\n\t */\n\tconst {t, a, p, e, r} = info\n\tconst element = getElement(t, r, refs)\n\tfor (let i in a) addAttr({element, attr: a[i], key: i, state, handlers, subscribers, innerData})\n\tfor (let i in p) addProp({element, prop: p[i], key: i, state, handlers, subscribers, innerData})\n\tfor (let i in e) addEvent({element, event: e[i], state, handlers, subscribers, innerData})\n\treturn element\n}\n\nexport default createElement\n","const proto = Node.prototype\n// const safeZone = document.createDocumentFragment()\n\nconst DOM = {\n\t// addClass(node, className) {\n\t// \tconst classes = className.split(' ')\n\t// \tnode.classList.add(...classes)\n\t// },\n\n\t// removeClass(node, className) {\n\t// \tconst classes = className.split(' ')\n\t// \tnode.classList.remove(...classes)\n\t// },\n\n\t// toggleClass(node, className) {\n\t// \tconst classes = className.split(' ')\n\t// \tconst classArr = node.className.split(' ')\n\t// \tfor (let i of classes) {\n\t// \t\tconst classIndex = classArr.indexOf(i)\n\t// \t\tif (classIndex > -1) {\n\t// \t\t\tclassArr.splice(classIndex, 1)\n\t// \t\t} else {\n\t// \t\t\tclassArr.push(i)\n\t// \t\t}\n\t// \t}\n\t// \tnode.className = classArr.join(' ').trim()\n\t// },\n\n\t// replaceWith(node, newNode) {\n\t// \tconst parent = node.parentNode\n\t// \tif (parent) proto.replaceChild.call(parent, newNode, node)\n\t// },\n\n\t// swap(node, newNode) {\n\t// \tconst nodeParent = node.parentNode\n\t// \tconst newNodeParent = newNode.parentNode\n\t// \tconst nodeSibling = node.nextSibling\n\t// \tconst newNodeSibling = newNode.nextSibling\n\t// \tif (nodeParent && newNodeParent) {\n\t// \t\tproto.insertBefore.call(nodeParent, newNode, nodeSibling)\n\t// \t\tproto.insertBefore.call(newNodeParent, node, newNodeSibling)\n\t// \t}\n\t// },\n\n\tbefore(node, ...nodes) {\n\t\tconst tempFragment = document.createDocumentFragment()\n\t\tnodes.reverse()\n\t\tfor (let i of nodes) proto.appendChild.call(tempFragment, i)\n\t\tproto.insertBefore.call(node.parentNode, tempFragment, node)\n\t},\n\n\tafter(node, ...nodes) {\n\t\tconst tempFragment = document.createDocumentFragment()\n\t\tfor (let i of nodes) proto.appendChild.call(tempFragment, i)\n\t\tif (node.nextSibling) proto.insertBefore.call(node.parentNode, tempFragment, node.nextSibling)\n\t\telse proto.appendChild.call(node.parentNode, tempFragment)\n\t},\n\n\tappend(node, ...nodes) {\n\t\tif ([1,9,11].indexOf(node.nodeType) === -1) return\n\t\tconst tempFragment = document.createDocumentFragment()\n\t\tfor (let i of nodes) proto.appendChild.call(tempFragment, i)\n\t\tproto.appendChild.call(node, tempFragment)\n\t},\n\n\t// prepend(node, ...nodes) {\n\t// \tif ([1,9,11].indexOf(node.nodeType) === -1) {\n\t// \t\treturn\n\t// \t}\n\t// \tconst tempFragment = document.createDocumentFragment()\n\t// \tnodes.reverse()\n\t// \tfor (let i of nodes) {\n\t// \t\tproto.appendChild.call(tempFragment, i)\n\t// \t}\n\t// \tif (node.firstChild) {\n\t// \t\tproto.insertBefore.call(node, tempFragment, node.firstChild)\n\t// \t} else {\n\t// \t\tproto.appendChild.call(node, tempFragment)\n\t// \t}\n\t// },\n\n\t// appendTo(node, newNode) {\n\t// \tproto.appendChild.call(newNode, node)\n\t// },\n\n\t// prependTo(node, newNode) {\n\t// \tif (newNode.firstChild) {\n\t// \t\tproto.insertBefore.call(newNode, node, node.firstChild)\n\t// \t} else {\n\t// \t\tproto.appendChild.call(newNode, node)\n\t// \t}\n\t// },\n\n\t// empty(node) {\n\t// \tnode.innerHTML = ''\n\t// },\n\n\tremove(node) {\n\t\tproto.removeChild.call(node.parentNode, node)\n\t},\n\n\t// safeRemove(node) {\n\t// \tproto.appendChild.call(safeZone, node)\n\t// }\n}\n\nexport default DOM\n","import DOM from './dom-helper.js'\nimport ARR from './array-helper.js'\nimport { inform, exec } from './render-query.js'\n\nconst DOMARR = {\n\tempty() {\n\t\tinform()\n\t\tfor (let i of ARR.copy(this)) i.$destroy()\n\t\texec()\n\t\tARR.empty(this)\n\t},\n\tpop() {\n\t\tif (this.length === 0) return\n\t\tconst poped = ARR.pop(this)\n\t\tpoped.$umount()\n\t\treturn poped\n\t},\n\tpush({state, key, anchor}, ...items) {\n\t\tconst elements = []\n\t\tinform()\n\t\tfor (let i of items) ARR.push(elements, i.$mount({parent: state, key}))\n\t\tif (this.length === 0) DOM.after(anchor, ...elements)\n\t\telse DOM.after(this[this.length - 1].$avatar, ...elements)\n\t\texec()\n\t\treturn ARR.push(this, ...items)\n\t},\n\tremove(item) {\n\t\tif (this.indexOf(item) === -1) return\n\t\titem.$umount()\n\t\treturn item\n\t},\n\treverse({state, key, anchor}) {\n\t\tif (this.length === 0) return this\n\t\tconst tempArr = ARR.copy(this)\n\t\tconst elements = []\n\t\tinform()\n\t\tfor (let i = tempArr.length - 1; i >= 0; i--) {\n\t\t\ttempArr[i].$umount()\n\t\t\tARR.push(elements, tempArr[i].$mount({parent: state, key}))\n\t\t}\n\t\tARR.push(this, ...ARR.reverse(tempArr))\n\t\tDOM.after(anchor, ...elements)\n\t\texec()\n\t\treturn this\n\t},\n\tshift() {\n\t\tif (this.length === 0) return\n\t\tconst shifted = ARR.shift(this)\n\t\tshifted.$umount()\n\t\treturn shifted\n\t},\n\tsort({state, key, anchor}, fn) {\n\t\tif (this.length === 0) return this\n\t\tconst sorted = ARR.copy(ARR.sort(this, fn))\n\t\tconst elements = []\n\t\tinform()\n\t\tfor (let i of sorted) {\n\t\t\ti.$umount()\n\t\t\tARR.push(elements, i.$mount({parent: state, key}))\n\t\t}\n\t\tARR.push(this, ...sorted)\n\t\tDOM.after(anchor, ...elements)\n\t\texec()\n\t\treturn this\n\t},\n\tsplice(...args) {\n\t\tif (this.length === 0) return this\n\t\tconst spliced = ARR.splice(ARR.copy(this), ...args)\n\t\tinform()\n\t\tfor (let i of spliced) i.$umount()\n\t\texec()\n\t\treturn spliced\n\t},\n\tunshift({state, key, anchor}, ...items) {\n\t\tif (this.length === 0) return this.push(...items).length\n\t\tconst elements = []\n\t\tinform()\n\t\tfor (let i of items) {\n\t\t\tif (i.$parent) {\n\t\t\t\tif (ENV !== 'production') console.warn('[EF]', 'Better detach the component before attaching it to a new component!')\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti.$umount()\n\t\t\tARR.push(elements, i.$mount({parent: state, key}))\n\t\t}\n\t\tDOM.after(anchor, ...elements)\n\t\texec()\n\t\treturn ARR.unshift(this, ...items)\n\t}\n}\n\nconst defineArr = (arr, info) => {\n\tObject.defineProperties(arr, {\n\t\tempty: {value: DOMARR.empty},\n\t\tpop: {value: DOMARR.pop},\n\t\tpush: {value: DOMARR.push.bind(arr, info)},\n\t\tremove: {value: DOMARR.remove},\n\t\treverse: {value: DOMARR.reverse.bind(arr, info)},\n\t\tshift: {value: DOMARR.shift},\n\t\tsort: {value: DOMARR.sort.bind(arr, info)},\n\t\tsplice: {value: DOMARR.splice},\n\t\tunshift: {value: DOMARR.unshift.bind(arr, info)}\n\t})\n\treturn arr\n}\n\nexport default defineArr\n","const typeOf = (obj) => {\n\tif (Array.isArray(obj)) return 'array'\n\treturn typeof obj\n}\n\nexport default typeOf\n","import createElement from './element-creator.js'\nimport DOM from './dom-helper.js'\nimport ARR from './array-helper.js'\nimport defineArr from './dom-arr-helper.js'\nimport typeOf from './type-of.js'\nimport initBinding from './binding.js'\nimport { queue, inform, exec } from './render-query.js'\n\nconst bindTextNode = ({node, state, handlers, subscribers, innerData, element}) => {\n\t// Data binding text node\n\tconst textNode = document.createTextNode('')\n\tconst { dataNode, handlerNode, _key } = initBinding({bind: node, state, handlers, subscribers, innerData})\n\tconst handler = () => {\n\t\ttextNode.textContent = dataNode[_key]\n\t}\n\thandlerNode.push(handler)\n\tqueue([handler])\n\n\t// Append element to the component\n\tDOM.append(element, textNode)\n}\n\nconst updateMountingNode = ({state, children, key, anchor, value}) => {\n\tif (children[key] === value) return\n\tif (value) {\n\t\tif (value.$parent && ENV !== 'production') console.warn('[EF]', 'Better detach the component before attaching it to a new component!')\n\t\tif (value.$element.contains(state.$element)) {\n\t\t\tif (ENV !== 'production') console.warn('[EF]', 'Cannot mount a component to it\\'s child component!')\n\t\t\treturn\n\t\t}\n\t}\n\n\tinform()\n\t// Update component\n\tif (children[key]) children[key].$umount()\n\t// Update stored value\n\tchildren[key] = value\n\tif (value) value.$mount({target: anchor, parent: state, option: 'before', key})\n\texec()\n}\n\nconst bindMountingNode = ({state, key, children, anchor}) => {\n\tObject.defineProperty(state, key, {\n\t\tget() {\n\t\t\treturn children[key]\n\t\t},\n\t\tset(value) {\n\t\t\tupdateMountingNode({state, children, key, anchor, value})\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true\n\t})\n}\n\nconst updateMountingList = ({state, children, key, anchor, value}) => {\n\tif (value) value = ARR.copy(value)\n\telse value = []\n\tconst fragment = document.createDocumentFragment()\n\t// Update components\n\tinform()\n\tif (children[key]) {\n\t\tfor (let j of value) {\n\t\t\tif (j.$element.contains(state.$element)) {\n\t\t\t\tif (ENV !== 'production') console.warn('[EF]', 'Cannot mount a component to it\\'s child component!')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tj.$umount()\n\t\t\tDOM.append(fragment, j.$mount({parent: state, key}))\n\t\t}\n\t\tfor (let j of ARR.copy(children[key])) j.$umount()\n\t} else for (let j of value) DOM.append(fragment, j.$mount({parent: state, key}))\n\t// Update stored value\n\tchildren[key].length = 0\n\tARR.push(children[key], ...value)\n\t// Append to current component\n\tDOM.after(anchor, fragment)\n\texec()\n}\n\nconst bindMountingList = ({state, key, children, anchor}) => {\n\tchildren[key] = defineArr([], {state, key, anchor})\n\tObject.defineProperty(state, key, {\n\t\tget() {\n\t\t\treturn children[key]\n\t\t},\n\t\tset(value) {\n\t\t\tif (children[key] && ARR.equals(children[key], value)) return\n\t\t\tupdateMountingList({state, children, key, anchor, value})\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true\n\t})\n}\n\nconst resolveAST = ({node, nodeType, element, state, innerData, refs, children, handlers, subscribers, create}) => {\n\tswitch (nodeType) {\n\t\tcase 'string': {\n\t\t\t// Static text node\n\t\t\tDOM.append(element, document.createTextNode(node))\n\t\t\tbreak\n\t\t}\n\t\tcase 'array': {\n\t\t\tif (typeOf(node[0]) === 'object') DOM.append(element, create({ast: node, state, innerData, refs, children, handlers, subscribers, create}))\n\t\t\telse bindTextNode({node, state, handlers, subscribers, innerData, element})\n\t\t\tbreak\n\t\t}\n\t\tcase 'object': {\n\t\t\tconst anchor = document.createTextNode('')\n\t\t\tif (node.t === 0) bindMountingNode({state, key: node.n, children, anchor})\n\t\t\telse if (node.t === 1) bindMountingList({state, key: node.n, children, anchor})\n\t\t\telse throw new TypeError(`Not a standard ef.js AST: Unknown mounting point type '${node.t}'`)\n\t\t\t// Append anchor\n\t\t\tDOM.append(element, anchor)\n\t\t\t// Display anchor indicator in development mode\n\t\t\tif (ENV !== 'production') {\n\t\t\t\tDOM.before(anchor, document.createComment(`Start of mounting point '${node.n}'`))\n\t\t\t\tDOM.after(anchor, document.createComment(`End of mounting point '${node.n}'`))\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tdefault: {\n\t\t\tthrow new TypeError(`Not a standard ef.js AST: Unknown node type '${nodeType}'`)\n\t\t}\n\t}\n}\n\nconst create = ({ast, state, innerData, refs, children, handlers, subscribers, create}) => {\n\t// First create an element according to the description\n\tconst element = createElement({info: ast[0], state, innerData, refs, handlers, subscribers})\n\n\t// Append child nodes\n\tfor (let i = 1; i < ast.length; i++) resolveAST({node: ast[i], nodeType: typeOf(ast[i]), element, state, innerData, refs, children, handlers, subscribers, create})\n\n\treturn element\n}\n\nexport default create\n","import create from './utils/creator.js'\nimport { resolveReactivePath, resolveSubscriber } from './utils/resolver.js'\nimport initBinding from './utils/binding.js'\nimport ARR from './utils/array-helper.js'\nimport DOM from './utils/dom-helper.js'\nimport { assign } from './utils/polyfills.js'\nimport { queueDom, inform, exec } from './utils/render-query.js'\n\nconst unsubscribe = (_path, fn, subscribers) => {\n\tconst subscriberNode = resolveSubscriber(_path, subscribers)\n\tARR.remove(subscriberNode, fn)\n}\n\nconst update = function(newState) {\n\tinform()\n\tconst tmpState = assign({}, newState)\n\tif (tmpState.$data) {\n\t\tassign(this.$data, tmpState.$data)\n\t\tdelete(tmpState.$data)\n\t}\n\tif (tmpState.$methods) {\n\t\tassign(this.$methods, tmpState.$methods)\n\t\tdelete(tmpState.$methods)\n\t}\n\tassign(this, tmpState)\n\texec()\n}\n\nconst destroy = function() {\n\tconst {$element, __EFPLACEHOLDER__} = this\n\tinform()\n\tthis.$umount()\n\tfor (let i in this) {\n\t\tthis[i] = null\n\t\tdelete this[i]\n\t}\n\t// Push DOM removement operation to query\n\tqueueDom(() => {\n\t\tDOM.remove($element)\n\t\tDOM.remove(__EFPLACEHOLDER__)\n\t})\n\n\t// Remove all references for memory recycling\n\tdelete this.$element\n\tdelete this.__EFPLACEHOLDER__\n\tdelete this.$parent\n\tdelete this.$key\n\tdelete this.$data\n\tdelete this.$methods\n\tdelete this.$refs\n\tdelete this.$mount\n\tdelete this.$umount\n\tdelete this.$subscribe\n\tdelete this.$unsubscribe\n\t// Render\n\treturn exec()\n}\n\nconst state = class {\n\tconstructor (ast) {\n\t\tconst children = {}\n\t\tconst refs = {}\n\t\tconst innerData = {}\n\t\tconst methods = {}\n\t\tconst handlers = {}\n\t\tconst subscribers = {}\n\t\tconst nodeInfo = {\n\t\t\tplaceholder: document.createTextNode(''),\n\t\t\treplace: [],\n\t\t\tparent: null,\n\t\t\tkey: null\n\t\t}\n\n\t\t/* Detatched components will be put in the safe zone.\n\t\t * Split safe zone to each component in order to make\n\t\t * the component memory recycleable when lost reference\n\t\t */\n\t\tconst safeZone = document.createDocumentFragment()\n\n\t\tif (ENV !== 'production') nodeInfo.placeholder = document.createComment('EF COMPONENT PLACEHOLDER')\n\n\t\tconst mount = () => {\n\t\t\tif (nodeInfo.replace.length > 0) {\n\t\t\t\tfor (let i of nodeInfo.replace) DOM.remove(i)\n\t\t\t\tARR.empty(nodeInfo.replace)\n\t\t\t}\n\t\t\tDOM.before(nodeInfo.placeholder, nodeInfo.element)\n\t\t}\n\n\t\tinform()\n\t\tObject.defineProperties(this, {\n\t\t\t$element: {\n\t\t\t\tget() {\n\t\t\t\t\treturn nodeInfo.element\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t__EFPLACEHOLDER__: {\n\t\t\t\tget() {\n\t\t\t\t\treturn nodeInfo.placeholder\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$parent: {\n\t\t\t\tget() {\n\t\t\t\t\treturn nodeInfo.parent\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$key: {\n\t\t\t\tget() {\n\t\t\t\t\treturn nodeInfo.key\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$methods: {\n\t\t\t\tget() {\n\t\t\t\t\treturn methods\n\t\t\t\t},\n\t\t\t\tset(newMethods) {\n\t\t\t\t\tassign(methods, newMethods)\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$refs: {\n\t\t\t\tvalue: refs,\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$mount: {\n\t\t\t\tvalue: function({target, option, parent, key}) {\n\t\t\t\t\tif (typeof target === 'string') target = document.querySelector(target)\n\n\t\t\t\t\tinform()\n\t\t\t\t\tif (nodeInfo.parent) {\n\t\t\t\t\t\tthis.$umount()\n\t\t\t\t\t\tif (ENV !== 'production') console.warn('[EF]', 'Component detached from previous mounting point.')\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!parent) parent = target\n\t\t\t\t\tif (!key) key = '__DIRECTMOUNT__'\n\t\t\t\t\tnodeInfo.parent = parent\n\t\t\t\t\tnodeInfo.key = key\n\t\t\t\t\tqueueDom(mount)\n\n\t\t\t\t\tif (!target) {\n\t\t\t\t\t\texec()\n\t\t\t\t\t\treturn nodeInfo.placeholder\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (option) {\n\t\t\t\t\t\tcase 'before': {\n\t\t\t\t\t\t\tDOM.before(target, nodeInfo.placeholder)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase 'after': {\n\t\t\t\t\t\t\tDOM.after(target, nodeInfo.placeholder)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase 'replace': {\n\t\t\t\t\t\t\tDOM.before(target, nodeInfo.placeholder)\n\t\t\t\t\t\t\tnodeInfo.replace.push(target)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\tDOM.append(target, nodeInfo.placeholder)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn exec()\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$umount: {\n\t\t\t\tvalue: function() {\n\t\t\t\t\tconst {parent, key} = nodeInfo\n\t\t\t\t\tnodeInfo.parent = null\n\t\t\t\t\tnodeInfo.key = null\n\n\t\t\t\t\tinform()\n\t\t\t\t\tif (parent && key !== '__DIRECTMOUNT__' && parent[key]) {\n\t\t\t\t\t\tif (Array.isArray(parent[key])) ARR.remove(parent[key], this)\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tparent[key] = null\n\t\t\t\t\t\t\treturn exec()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tDOM.append(safeZone, nodeInfo.placeholder)\n\t\t\t\t\tqueueDom(mount)\n\t\t\t\t\treturn exec()\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$subscribe: {\n\t\t\t\tvalue: (pathStr, subscriber) => {\n\t\t\t\t\tconst _path = pathStr.split('.')\n\t\t\t\t\tconst { dataNode, subscriberNode, _key } = initBinding({bind: [_path], state: this, handlers, subscribers, innerData})\n\t\t\t\t\t// Execute subscriber immediately\n\t\t\t\t\tsubscriber({state: this, value: dataNode[_key]})\n\t\t\t\t\tsubscriberNode.push(subscriber)\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t},\n\t\t\t$unsubscribe: {\n\t\t\t\tvalue: (_path, fn) => {\n\t\t\t\t\tunsubscribe(_path, fn, subscribers)\n\t\t\t\t},\n\t\t\t\tconfigurable: true\n\t\t\t}\n\t\t})\n\t\t// Init root data node\n\t\tresolveReactivePath(['$data'], this, false)\n\n\t\tnodeInfo.element = create({ast, state: this, innerData, refs, children, handlers, subscribers, create})\n\t\tDOM.append(safeZone, nodeInfo.placeholder)\n\t\tqueueDom(mount)\n\t\texec()\n\t}\n}\n\n// Add $update and $destroy method\nObject.defineProperties(state.prototype, {\n\t$update: {value: update},\n\t$destroy: {value: destroy}\n})\n\nexport default state\n","// Import everything\nimport parse from './lib/parser.js'\nimport state from './lib/renderer.js'\nimport typeOf from './lib/utils/type-of.js'\nimport { mixStr } from './lib/utils/literals-mix.js'\nimport parseEft from 'eft-parser'\nimport { onNextRender, inform, exec, bundle } from './lib/utils/render-query.js'\nimport { version } from '../package.json'\n\n// Set parser\nlet parser = parseEft\n\nconst create = (value) => {\n\tconst valType = typeOf(value)\n\tif (valType === 'string') value = parse(value, parser)\n\telse if (valType !== 'array') throw new TypeError('Cannot create new component without proper template or AST!')\n\n\tconst ast = value\n\tconst ef = class extends state {\n\t\tconstructor(newState) {\n\t\t\tinform()\n\t\t\tsuper(ast)\n\t\t\tif (newState) this.$update(newState)\n\t\t\texec()\n\t\t}\n\t}\n\treturn ef\n}\n\n// Change parser\nconst setParser = (newParser) => {\n\tparser = newParser\n}\n\nconst t = (...args) => create(mixStr(...args))\n\nexport { create, onNextRender, inform, exec, bundle, setParser, parseEft, t, version }\n\nif (ENV !== 'production') console.info('[EF]', `ef.js v${version} initialized!`)\n"],"names":["const","oct","RegExp","ucp","uni","hex","esc","b","t","n","v","f","r","O2C","SyntaxError","UC2C","val","substr","length","parseInt","String","fromCodePoint","err","U2C","substring","fromCharCode","X2C","module","string","escaped","split","char","let","escapedStr","replace","push","join","typeSymbols","reserved","mustache","spaceIndent","hashref","getErrorMsg","msg","line","isEmpty","getOffset","parsingInfo","offset","match","offsetReg","removeOffset","i","removed","prevDepth","getIndent","indentReg","spaces","getDepth","depth","str","content","test","resolveDepth","ast","currentNode","splitDefault","slice","_path","_default","pathArr","trim","defaultVal","ESCAPE","splitLiterals","strs","tmpl","map","mustaches","pushStr","textArr","parseText","result","exprs","dotToSpace","parseTag","tagInfo","ref","tag","class","parseNodeProps","splited","name","shift","value","parseEvent","setOption","options","option","s","p","h","a","c","u","console","warn","getOption","keys","keyCode","isNaN","getEventOptions","listener","ops","l","k","splitEvents","parseLine","indexOf","prevType","topExists","type","minDepth","info","newNode","e","method","_value","m","ref$6","parseEft","template","TypeError","tplType","lines","parse","parser","eftParser","proto","Array","prototype","ARR","copy","arr","call","empty","equals","left","right","isArray","pop","apply","items","remove","item","index","splice","reverse","rightUnique","newArr","j","sort","fn","args","unshift","window","Set","unique","from","mixStr","getVal","mixVal","assign","Object","ee","er","query","domQuery","userQuery","count","queue","handlers","queueDom","handler","inform","execUserQuery","exec","immediate","setTimeout","resolveAllPath","subscribers","innerData","handlerNode","subscriberNode","dataNode","resolveReactivePath","obj","enume","node","defineProperty","get","set","data","configurable","enumerable","resolve","_key","parentNode","hasOwnProperty","resolveSubscriber","key","initDataNode","state","initBinding","bind","$data","getEvent","props","bubbles","cancelable","event","document","createEvent","initEvent","getElement","refs","element","createElement","regTmpl","_handler","updateOthers","addValListener","expr","_update","addEventListener","dispatchEvent","tagName","radios","querySelectorAll","selected","checked","getAttrHandler","removeAttribute","setAttribute","addAttr","attr","addProp","prop","rawHandler","addEvent","shiftKey","altKey","ctrlKey","metaKey","which","stopPropagation","stopImmediatePropagation","preventDefault","$methods","Node","DOM","before","tempFragment","createDocumentFragment","nodes","appendChild","insertBefore","after","nextSibling","append","nodeType","removeChild","DOMARR","this","$destroy","poped","$umount","anchor","elements","$mount","parent","$avatar","tempArr","shifted","sorted","spliced","ref$1","$parent","defineArr","defineProperties","typeOf","bindTextNode","textNode","createTextNode","textContent","updateMountingNode","children","$element","contains","target","bindMountingNode","updateMountingList","fragment","bindMountingList","resolveAST","create","unsubscribe","methods","nodeInfo","placeholder","safeZone","mount","__EFPLACEHOLDER__","$key","newMethods","$refs","querySelector","$subscribe","pathStr","subscriber","$unsubscribe","$update","newState","tmpState","valType","super","cb","newParser"],"mappings":"qQACAA,IAGMC,EAAM,IAAIC,uBAA8B,KACxCC,EAAM,IAAID,uBAA8B,KACxCE,EAAM,IAAIF,oBAA2B,KACrCG,EAAM,IAAIH,oBAA2B,KACrCI,EAAM,IAAIJ,aAAoB,KAC9BK,EAAI,IAAIL,cAAqB,KAC7BM,EAAI,IAAIN,cAAqB,KAC7BO,EAAI,IAAIP,cAAqB,KAC7BQ,EAAI,IAAIR,cAAqB,KAC7BS,EAAI,IAAIT,cAAqB,KAC7BU,EAAI,IAAIV,cAAqB,KAG7BW,EAAM,WACX,MAAM,IAAIC,YAAY,oDAIjBC,EAAO,SAACC,GAGb,GAFAA,EAAMA,EAAIC,OAAO,EAAGD,EAAIE,OAAS,KACjCF,EAAMG,SAASH,EAAK,KACV,MAAM,IAAIF,YAAY,mCAChC,IACC,OAAOM,OAAOC,cAAcL,GAC3B,MAAOM,GACR,MAAM,IAAIR,YAAY,kCAKlBS,EAAM,SAACP,GAGZ,GAFAA,EAAMA,EAAIQ,UAAU,KACpBR,EAAMG,SAASH,EAAK,KACV,MAAM,IAAIF,YAAY,mCAChC,OAAOM,OAAOK,aAAaT,IAItBU,EAAM,SAACV,GAGZ,GAFAA,EAAM,KAAKA,EAAIQ,UAAU,KACzBR,EAAMG,SAASH,EAAK,KACV,MAAM,IAAIF,YAAY,uCAChC,OAAOM,OAAOK,aAAaT,IA8B5BW,UA3Be,SAACC,GAMf,IAAU,IAHJC,WADUD,EAAOE,MAAMC,sBAIN,CAAlBC,IACEC,OACJC,QAAQjC,EAAKY,GACbqB,Q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