From e2b5c5d669fddeaf851d69c7fc34efe3051c60e3 Mon Sep 17 00:00:00 2001 From: musicode Date: Tue, 13 Sep 2022 14:16:34 +0800 Subject: [PATCH] bump 1.0.0-alpha.256 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复模板中的二元表达式编译错误 2. 修复模板变化后 select 元素未同步双向绑定值的问题 3. 动态组件名支持路径选择 --- dist/legacy/dev/yox.esm.js | 700 ++++++++++++++------------ dist/legacy/dev/yox.esm.js.map | 2 +- dist/legacy/dev/yox.esm.min.js | 2 +- dist/legacy/dev/yox.js | 724 +++++++++++++++------------ dist/legacy/dev/yox.js.map | 2 +- dist/legacy/dev/yox.min.js | 2 +- dist/legacy/prod/yox.esm.js | 690 ++++++++++++++----------- dist/legacy/prod/yox.esm.js.map | 2 +- dist/legacy/prod/yox.esm.min.js | 2 +- dist/legacy/prod/yox.js | 714 ++++++++++++++------------ dist/legacy/prod/yox.js.map | 2 +- dist/legacy/prod/yox.min.js | 2 +- dist/legacy/pure/yox.esm.js | 38 +- dist/legacy/pure/yox.esm.js.map | 2 +- dist/legacy/pure/yox.esm.min.js | 2 +- dist/legacy/pure/yox.js | 38 +- dist/legacy/pure/yox.js.map | 2 +- dist/legacy/pure/yox.min.js | 2 +- dist/legacy/runtime/yox.esm.js | 690 ++++++++++++++----------- dist/legacy/runtime/yox.esm.js.map | 2 +- dist/legacy/runtime/yox.esm.min.js | 2 +- dist/legacy/runtime/yox.js | 714 ++++++++++++++------------ dist/legacy/runtime/yox.js.map | 2 +- dist/legacy/runtime/yox.min.js | 2 +- dist/standard/dev/yox.esm.js | 700 ++++++++++++++------------ dist/standard/dev/yox.esm.js.map | 2 +- dist/standard/dev/yox.esm.min.js | 2 +- dist/standard/dev/yox.js | 724 +++++++++++++++------------ dist/standard/dev/yox.js.map | 2 +- dist/standard/dev/yox.min.js | 2 +- dist/standard/prod/yox.esm.js | 690 ++++++++++++++----------- dist/standard/prod/yox.esm.js.map | 2 +- dist/standard/prod/yox.esm.min.js | 2 +- dist/standard/prod/yox.js | 714 ++++++++++++++------------ dist/standard/prod/yox.js.map | 2 +- dist/standard/prod/yox.min.js | 2 +- dist/standard/pure/yox.esm.js | 4 +- dist/standard/pure/yox.esm.min.js | 2 +- dist/standard/pure/yox.js | 4 +- dist/standard/pure/yox.min.js | 2 +- dist/standard/runtime/yox.esm.js | 658 +++++++++++++----------- dist/standard/runtime/yox.esm.js.map | 2 +- dist/standard/runtime/yox.esm.min.js | 2 +- dist/standard/runtime/yox.js | 680 ++++++++++++++----------- dist/standard/runtime/yox.js.map | 2 +- dist/standard/runtime/yox.min.js | 2 +- package.json | 2 +- 47 files changed, 4734 insertions(+), 3810 deletions(-) diff --git a/dist/legacy/dev/yox.esm.js b/dist/legacy/dev/yox.esm.js index acf80646..ee6abf19 100644 --- a/dist/legacy/dev/yox.esm.js +++ b/dist/legacy/dev/yox.esm.js @@ -1,5 +1,5 @@ /** - * yox.js v1.0.0-alpha.255 + * yox.js v1.0.0-alpha.256 * (c) 2017-2022 musicode * Released under the MIT License. */ @@ -431,7 +431,7 @@ function pop(array) { * @param strict 是否全等判断,默认是全等 * @return 删除的数量 */ -function remove$6(array, target, strict) { +function remove$1(array, target, strict) { let result = 0; each$2(array, function (item, index) { if (strict === FALSE$1 ? item == target : item === target) { @@ -506,7 +506,7 @@ var array = /*#__PURE__*/Object.freeze({ indexOf: indexOf$1, last: last, pop: pop, - remove: remove$6, + remove: remove$1, has: has$2, toArray: toArray, toObject: toObject, @@ -1482,101 +1482,72 @@ class NextTask { } } -// vnode.data 内部使用的几个字段 -const VNODE = '$vnode'; -const LOADING = '$loading'; -const LEAVING = '$leaving'; -const MODEL = '$model'; -const EVENT$1 = '$event'; - -function update$6(api, vnode, oldVNode) { - const { node, nativeAttrs } = vnode, oldNativeAttrs = oldVNode && oldVNode.nativeAttrs; - if (nativeAttrs !== oldNativeAttrs) { - if (nativeAttrs) { - const oldValue = oldNativeAttrs || EMPTY_OBJECT; - for (let name in nativeAttrs) { - if (oldValue[name] === UNDEFINED$1 - || nativeAttrs[name] !== oldValue[name]) { - api.setAttr(node, name, nativeAttrs[name]); - } - } - } - if (oldNativeAttrs) { - const newValue = nativeAttrs || EMPTY_OBJECT; - for (let name in oldNativeAttrs) { - if (newValue[name] === UNDEFINED$1) { - api.removeAttr(node, name); - } - } +function afterCreate$5(api, vnode) { + const { directives } = vnode; + if (directives) { + const node = vnode.component || vnode.node; + for (let name in directives) { + const directive = directives[name], { bind } = directive.hooks; + bind(node, directive, vnode); } } -} - -function update$5(api, vnode, oldVNode) { - const { node, nativeStyles } = vnode, oldNativeStyles = oldVNode && oldVNode.nativeStyles; - if (nativeStyles !== oldNativeStyles) { - const nodeStyle = node.style; - if (nativeStyles) { - const oldValue = oldNativeStyles || EMPTY_OBJECT; - for (let name in nativeStyles) { - if (oldValue[name] === UNDEFINED$1 - || nativeStyles[name] !== oldValue[name]) { - api.setStyle(nodeStyle, name, nativeStyles[name]); +} +function afterUpdate$4(api, vnode, oldVNode) { + const newDirectives = vnode.directives, oldDirectives = oldVNode && oldVNode.directives; + if (newDirectives !== oldDirectives) { + const node = vnode.component || vnode.node; + if (newDirectives) { + const oldValue = oldDirectives || EMPTY_OBJECT; + for (let name in newDirectives) { + const directive = newDirectives[name], oldDirective = oldValue[name], { bind, unbind } = directive.hooks; + if (!oldDirective) { + bind(node, directive, vnode); } - } - } - if (oldNativeStyles) { - const newValue = nativeStyles || EMPTY_OBJECT; - for (let name in oldNativeStyles) { - if (newValue[name] === UNDEFINED$1) { - api.removeStyle(nodeStyle, name); + else if (directive.value !== oldDirective.value) { + if (unbind) { + unbind(node, oldDirective, oldVNode); + } + bind(node, directive, vnode); } - } - } - } -} - -// 删除 ref 的时候,要确保是相同的节点 -// 因为模板中可能出现同一个 ref 名字,出现在不同的地方, -// 这样就可能出现一种特殊情况,即前面刚创建了 ref1,后面又把这个这个新创建的 ref1 删除了 -function update$4(api, vnode, oldVNode) { - const { context, ref } = vnode, oldRef = oldVNode && oldVNode.ref; - if (ref || oldRef) { - let refs = context.$refs, value = vnode.component || vnode.node; - if (ref) { - if (!oldRef) { - if (!refs) { - refs = context.$refs = {}; + else if (oldDirective.runtime && directive.runtime) { + oldDirective.runtime.execute = directive.runtime.execute; + directive.runtime = oldDirective.runtime; } - refs[ref] = value; } - else if (ref !== oldRef) { - if (refs) { - if (refs[ref] === value) { - delete refs[ref]; + } + if (oldDirectives) { + const newValue = newDirectives || EMPTY_OBJECT; + for (let name in oldDirectives) { + if (!newValue[name]) { + const { unbind } = oldDirectives[name].hooks; + if (unbind) { + unbind(node, oldDirectives[name], oldVNode); } } - else { - refs = context.$refs = {}; - } - refs[ref] = value; } } - else if (refs && oldRef && refs[oldRef] === value) { - delete refs[oldRef]; - } } } -function remove$5(api, vnode) { - const { ref } = vnode; - if (ref) { - const refs = vnode.context.$refs, value = vnode.component || vnode.node; - if (refs && refs[ref] === value) { - delete refs[ref]; +function beforeDestroy$3(api, vnode) { + const { directives } = vnode; + if (directives) { + const node = vnode.component || vnode.node; + for (let name in directives) { + const { unbind } = directives[name].hooks; + if (unbind) { + unbind(node, directives[name], vnode); + } } } } +var directiveHook = /*#__PURE__*/Object.freeze({ + __proto__: null, + afterCreate: afterCreate$5, + afterUpdate: afterUpdate$4, + beforeDestroy: beforeDestroy$3 +}); + /** * 节流调用 * @@ -1603,7 +1574,15 @@ function debounce (fn, delay, immediate) { }; } -function addEvent$1(api, element, component, lazy, event) { +// vnode.data 内部使用的几个字段 +const VNODE = '$vnode'; +const LOADING = '$loading'; +const LEAVING = '$leaving'; +const MODEL_CONTROL = '$model_control'; +const MODEL_DESTROY = '$model_destroy'; +const EVENT_DESTROY = '$event_destroy'; + +function addEvent$1(api, element, component, data, key, lazy, event) { let { name, listener } = event; if (lazy) { const value = lazy[name] || lazy[EMPTY_STRING]; @@ -1632,24 +1611,37 @@ function addEvent$1(api, element, component, lazy, event) { }; } api.on(element, name, listener); - return function () { - api.off(element, name, listener); + data[EVENT_DESTROY + key] = function () { + api.off(element, key, listener); + delete data[EVENT_DESTROY + key]; }; } -function update$3(api, vnode, oldVNode) { - const data = vnode.data, lazy = vnode.lazy, events = vnode.events, oldEvents = oldVNode && oldVNode.events; - if (events !== oldEvents) { - const element = vnode.node, component = vnode.component, destroy = data[EVENT$1] || (data[EVENT$1] = {}); - if (events) { +function afterCreate$4(api, vnode) { + const { events } = vnode; + if (events) { + const element = vnode.node, component = vnode.component, lazy = vnode.lazy, data = vnode.data; + for (let key in events) { + addEvent$1(api, element, component, data, key, lazy, events[key]); + } + } +} +function afterUpdate$3(api, vnode, oldVNode) { + const newEvents = vnode.events, oldEvents = oldVNode.events; + if (newEvents !== oldEvents) { + const element = vnode.node, component = vnode.component, lazy = vnode.lazy, data = vnode.data; + if (newEvents) { const oldValue = oldEvents || EMPTY_OBJECT; - for (let key in events) { - const event = events[key], oldEvent = oldValue[key]; + for (let key in newEvents) { + const event = newEvents[key], oldEvent = oldValue[key]; if (!oldEvent) { - destroy[key] = addEvent$1(api, element, component, lazy, event); + addEvent$1(api, element, component, data, key, lazy, event); } else if (event.value !== oldEvent.value) { - destroy[key](); - destroy[key] = addEvent$1(api, element, component, lazy, event); + const destroy = data[EVENT_DESTROY + key]; + if (destroy) { + destroy(); + } + addEvent$1(api, element, component, data, key, lazy, event); } else if (oldEvent.runtime && event.runtime) { oldEvent.runtime.execute = event.runtime.execute; @@ -1658,27 +1650,37 @@ function update$3(api, vnode, oldVNode) { } } if (oldEvents) { - const newValue = events || EMPTY_OBJECT; + const newValue = newEvents || EMPTY_OBJECT; for (let key in oldEvents) { if (!newValue[key]) { - destroy[key](); - delete destroy[key]; + const destroy = data[EVENT_DESTROY + key]; + if (destroy) { + destroy(); + } } } } } } -function remove$4(api, vnode) { - const data = vnode.data, events = vnode.events, destroy = data[EVENT$1]; - if (events && destroy) { +function beforeDestroy$2(api, vnode) { + const events = vnode.events, data = vnode.data; + if (events) { for (let key in events) { - destroy[key](); - delete destroy[key]; + const destroy = data[EVENT_DESTROY + key]; + if (destroy) { + destroy(); + } } } - data[EVENT$1] = UNDEFINED$1; } +var eventHook = /*#__PURE__*/Object.freeze({ + __proto__: null, + afterCreate: afterCreate$4, + afterUpdate: afterUpdate$3, + beforeDestroy: beforeDestroy$2 +}); + function debounceIfNeeded(fn, lazy) { // 应用 lazy return lazy && lazy !== TRUE$1 @@ -1692,7 +1694,6 @@ const inputControl = { sync(node, keypath, context) { context.set(keypath, node.value); }, - name: 'value' }, radioControl = { set(node, value) { node.checked = node.value === toString$1(value); @@ -1702,7 +1703,6 @@ const inputControl = { context.set(keypath, node.value); } }, - name: 'checked' }, checkboxControl = { set(node, value) { node.checked = array$1(value) @@ -1723,52 +1723,49 @@ const inputControl = { context.set(keypath, node.checked); } }, - name: 'checked' }, selectControl = { set(node, value) { - each$2(toArray(node.options), node.multiple - ? function (option) { - option.selected = has$2(value, option.value, FALSE$1); + const { multiple, options } = node; + for (let i = 0, length = options.length; i < length; i++) { + if (multiple) { + options[i].selected = has$2(value, options[i].value, FALSE$1); } - : function (option, index) { - if (option.value == value) { - node.selectedIndex = index; - return FALSE$1; - } - }); + else if (options[i].value == value) { + node.selectedIndex = i; + return; + } + } + if (!multiple) { + node.selectedIndex = -1; + } }, sync(node, keypath, context) { - const { options } = node; - if (node.multiple) { + const { multiple, options } = node; + if (multiple) { const values = []; - each$2(toArray(options), function (option) { - if (option.selected) { - push(values, option.value); + for (let i = 0, length = options.length; i < length; i++) { + if (options[i].selected) { + values.push(options[i].value); } - }); + } context.set(keypath, values); } else { context.set(keypath, options[node.selectedIndex].value); } }, - name: 'value' }; -function addModel(api, element, component, vnode) { - let { context, model, lazy, nativeAttrs } = vnode, { keypath, value } = model, lazyValue = lazy && (lazy[DIRECTIVE_MODEL] || lazy[EMPTY_STRING]), update, destroy; +function addModel(api, element, component, data, vnode) { + let { context, model, lazy, nativeAttrs } = vnode, { keypath, value } = model, lazyValue = lazy && (lazy[DIRECTIVE_MODEL] || lazy[EMPTY_STRING]); if (component) { let viewBinding = component.$model, viewSyncing = debounceIfNeeded(function (newValue) { context.set(keypath, newValue); }, lazyValue); - update = function (newValue) { - if (update) { - component.set(viewBinding, newValue); - } - }; - destroy = function () { + component.watch(viewBinding, viewSyncing); + data[MODEL_DESTROY] = function () { component.unwatch(viewBinding, viewSyncing); + delete data[MODEL_DESTROY]; }; - component.watch(viewBinding, viewSyncing); } else { let control = vnode.tag === 'select' @@ -1791,132 +1788,204 @@ function addModel(api, element, component, vnode) { eventName = EVENT_MODEL; } } - update = function (newValue) { - if (update) { - control.set(element, newValue); - } - }; const sync = debounceIfNeeded(function () { control.sync(element, keypath, context); }, lazyValue); - destroy = function () { - api.off(element, eventName, sync); - }; api.on(element, eventName, sync); control.set(element, value); + data[MODEL_CONTROL] = control; + data[MODEL_DESTROY] = function () { + api.off(element, eventName, sync); + delete data[MODEL_DESTROY]; + delete data[MODEL_CONTROL]; + }; } - // 监听数据,修改界面 - context.watch(keypath, update); - return function () { - context.unwatch(keypath, update); - update = UNDEFINED$1; - destroy(); - }; } -function update$2(api, vnode, oldVNode) { - const data = vnode.data, node = vnode.node, component = vnode.component, model = vnode.model, oldModel = oldVNode && oldVNode.model; +function afterCreate$3(api, vnode) { + const model = vnode.model; if (model) { + addModel(api, vnode.node, vnode.component, vnode.data, vnode); + } +} +function afterUpdate$2(api, vnode, oldVNode) { + const data = vnode.data, newModel = vnode.model, oldModel = oldVNode.model; + if (newModel) { + const element = vnode.node, component = vnode.component; if (!oldModel) { - data[MODEL] = addModel(api, node, component, vnode); + addModel(api, element, component, data, vnode); + } + else if (newModel.keypath !== oldModel.keypath) { + data[MODEL_DESTROY](); + addModel(api, element, component, data, vnode); } - else if (model.keypath !== oldModel.keypath) { - data[MODEL](); - data[MODEL] = addModel(api, node, component, vnode); + else { + if (component) { + component.set(component.$model, newModel.value); + } + else { + const control = data[MODEL_CONTROL]; + if (control) { + control.set(element, newModel.value); + } + } } } else if (oldModel) { - data[MODEL](); - delete data[MODEL]; + data[MODEL_DESTROY](); } } -function remove$3(api, vnode) { - const data = vnode.data; - if (data[MODEL]) { - data[MODEL](); - delete data[MODEL]; +function beforeDestroy$1(api, vnode) { + const data = vnode.data, destroy = data[MODEL_DESTROY]; + if (destroy) { + destroy(); } } -function update$1(api, vnode, oldVNode) { - const { directives } = vnode, oldDirectives = oldVNode && oldVNode.directives; - if (directives !== oldDirectives) { - const node = vnode.component || vnode.node; - if (directives) { - const oldValue = oldDirectives || EMPTY_OBJECT; - for (let name in directives) { - const directive = directives[name], oldDirective = oldValue[name], { bind, unbind } = directive.hooks; - if (!oldDirective) { - bind(node, directive, vnode); - } - else if (directive.value !== oldDirective.value) { - if (unbind) { - unbind(node, oldDirective, oldVNode); - } - bind(node, directive, vnode); - } - else if (oldDirective.runtime && directive.runtime) { - oldDirective.runtime.execute = directive.runtime.execute; - directive.runtime = oldDirective.runtime; +var modelHook = /*#__PURE__*/Object.freeze({ + __proto__: null, + afterCreate: afterCreate$3, + afterUpdate: afterUpdate$2, + beforeDestroy: beforeDestroy$1 +}); + +function afterCreate$2(api, vnode) { + const { nativeAttrs } = vnode; + if (nativeAttrs) { + const element = vnode.node; + for (let name in nativeAttrs) { + api.setAttr(element, name, nativeAttrs[name]); + } + } +} +function afterUpdate$1(api, vnode, oldVNode) { + const newNativeAttrs = vnode.nativeAttrs, oldNativeAttrs = oldVNode.nativeAttrs; + if (newNativeAttrs !== oldNativeAttrs) { + const element = vnode.node; + if (newNativeAttrs) { + const oldValue = oldNativeAttrs || EMPTY_OBJECT; + for (let name in newNativeAttrs) { + if (oldValue[name] === UNDEFINED$1 + || newNativeAttrs[name] !== oldValue[name]) { + api.setAttr(element, name, newNativeAttrs[name]); } } } - if (oldDirectives) { - const newValue = directives || EMPTY_OBJECT; - for (let name in oldDirectives) { - if (!newValue[name]) { - const { unbind } = oldDirectives[name].hooks; - if (unbind) { - unbind(node, oldDirectives[name], oldVNode); - } + if (oldNativeAttrs) { + const newValue = newNativeAttrs || EMPTY_OBJECT; + for (let name in oldNativeAttrs) { + if (newValue[name] === UNDEFINED$1) { + api.removeAttr(element, name); } } } } +} + +var nativeAttrHook = /*#__PURE__*/Object.freeze({ + __proto__: null, + afterCreate: afterCreate$2, + afterUpdate: afterUpdate$1 +}); + +function afterCreate$1(api, vnode) { + const { nativeStyles } = vnode; + if (nativeStyles) { + const elementStyle = vnode.node.style; + for (let name in nativeStyles) { + api.setStyle(elementStyle, name, nativeStyles[name]); + } + } } -function remove$2(api, vnode) { - const { directives } = vnode; - if (directives) { - const node = vnode.component || vnode.node; - for (let name in directives) { - const { unbind } = directives[name].hooks; - if (unbind) { - unbind(node, directives[name], vnode); +function afterUpdate(api, vnode, oldVNode) { + const newNativeStyles = vnode.nativeStyles, oldNativeStyles = oldVNode.nativeStyles; + if (newNativeStyles !== oldNativeStyles) { + const elementStyle = vnode.node.style; + if (newNativeStyles) { + const oldValue = oldNativeStyles || EMPTY_OBJECT; + for (let name in newNativeStyles) { + if (oldValue[name] === UNDEFINED$1 + || newNativeStyles[name] !== oldValue[name]) { + api.setStyle(elementStyle, name, newNativeStyles[name]); + } + } + } + if (oldNativeStyles) { + const newValue = newNativeStyles || EMPTY_OBJECT; + for (let name in oldNativeStyles) { + if (newValue[name] === UNDEFINED$1) { + api.removeStyle(elementStyle, name); + } } } } } -function update(api, vnode, oldVNode) { - const { component, props, slots } = vnode; - // 更新时才要 set - // 因为初始化时,所有这些都经过构造函数完成了 - if (component && oldVNode) { - { - if (props) { - for (let key in props) { - component.checkProp(key, props[key]); +var nativeStyleHook = /*#__PURE__*/Object.freeze({ + __proto__: null, + afterCreate: afterCreate$1, + afterUpdate: afterUpdate +}); + +function afterCreate(api, vnode) { + const ref = vnode.ref; + if (ref) { + const context = vnode.context; + let $refs = context.$refs; + if (!$refs) { + $refs = context.$refs = {}; + } + $refs[ref] = vnode.component || vnode.node; + } +} +// 删除 ref 的时候,要确保是相同的节点 +// 因为模板中可能出现同一个 ref 名字,出现在不同的地方, +// 这样就可能出现一种特殊情况,即前面刚创建了 ref1,后面又把这个这个新创建的 ref1 删除了 +function beforeUpdate(api, vnode, oldVNode) { + const newRef = vnode.ref, oldRef = oldVNode.ref; + if (newRef || oldRef) { + const context = vnode.context, node = vnode.component || vnode.node; + let $refs = context.$refs; + if (newRef) { + if (!oldRef) { + if (!$refs) { + $refs = context.$refs = {}; } + $refs[newRef] = node; + } + else if (newRef !== oldRef) { + if ($refs) { + if ($refs[newRef] === node) { + delete $refs[newRef]; + } + } + else { + $refs = context.$refs = {}; + } + $refs[newRef] = node; } } - let nextProps = props; - if (slots) { - component.renderSlots(nextProps || (nextProps = {}), slots); - } - if (nextProps) { - component.forceUpdate(nextProps); + else if ($refs && oldRef && $refs[oldRef] === node) { + delete $refs[oldRef]; } } } -function remove$1(api, vnode) { - const { component } = vnode; - if (component) { - component.destroy(); - // 移除时,组件可能已经发生过变化,即 shadow 不是创建时那个对象了 - vnode.shadow = component.$vnode; - vnode.component = UNDEFINED$1; +function beforeDestroy(api, vnode) { + const { ref } = vnode; + if (ref) { + const { $refs } = vnode.context, node = vnode.component || vnode.node; + if ($refs && $refs[ref] === node) { + delete $refs[ref]; + } } } +var refHook = /*#__PURE__*/Object.freeze({ + __proto__: null, + afterCreate: afterCreate, + beforeUpdate: beforeUpdate, + beforeDestroy: beforeDestroy +}); + function getFragmentHostNode(api, vnode) { if (vnode.isFragment || vnode.isSlot) { const child = vnode.children[0]; @@ -1970,27 +2039,31 @@ function vnodeLeaveOperator(vnode, done) { done(); } function vnodeCreateChildrenOperator(api, vnode) { - each$2(vnode.children, function (child) { - createVNode(api, child); - }); + const children = vnode.children; + for (let i = 0, length = children.length; i < length; i++) { + createVNode(api, children[i]); + } } function vnodeUpdateChildrenOperator(api, parentNode, vnode, oldVNode) { updateChildren(api, parentNode, vnode.children, oldVNode.children); } function vnodeDestroyChildrenOperator(api, vnode) { - each$2(vnode.children, function (child) { - destroyVNode(api, child); - }); + const children = vnode.children; + for (let i = 0, length = children.length; i < length; i++) { + destroyVNode(api, children[i]); + } } function vnodeInsertChildrenOperator(api, parentNode, vnode, before) { - each$2(vnode.children, function (child) { - insertVNode(api, parentNode, child, before); - }); + const children = vnode.children; + for (let i = 0, length = children.length; i < length; i++) { + insertVNode(api, parentNode, children[i], before); + } } function vnodeRemoveChildrenOperator(api, vnode) { - each$2(vnode.children, function (child) { - removeVNode(api, child); - }); + const children = vnode.children; + for (let i = 0, length = children.length; i < length; i++) { + removeVNode(api, children[i]); + } } const textVNodeOperator = { create(api, vnode) { @@ -2014,6 +2087,23 @@ const commentVNodeOperator = { enter: EMPTY_FUNCTION, leave: vnodeLeaveOperator, }; +const vnodeHooksList = [ + nativeAttrHook, + nativeStyleHook, + refHook, + eventHook, + modelHook, + directiveHook, +]; +const vnodeHooksLength = vnodeHooksList.length; +function callVNodeHooks(name, api, vnode, oldVNode) { + for (let i = 0; i < vnodeHooksLength; i++) { + const hook = vnodeHooksList[i][name]; + if (hook) { + hook(api, vnode, oldVNode); + } + } +} const elementVNodeOperator = { create(api, vnode) { const node = vnode.node = api.createElement(vnode.tag, vnode.isSvg); @@ -2026,29 +2116,17 @@ const elementVNodeOperator = { else if (vnode.html) { api.setHtml(node, vnode.html, vnode.isStyle, vnode.isOption); } - update$6(api, vnode); - update$5(api, vnode); if (!vnode.isPure) { vnode.data = {}; - update$4(api, vnode); - update$3(api, vnode); - update$2(api, vnode); - update$1(api, vnode); } + callVNodeHooks('afterCreate', api, vnode); }, update(api, vnode, oldVNode) { const node = oldVNode.node; vnode.node = node; vnode.parentNode = oldVNode.parentNode; vnode.data = oldVNode.data; - update$6(api, vnode, oldVNode); - update$5(api, vnode, oldVNode); - if (!vnode.isPure) { - update$4(api, vnode, oldVNode); - update$3(api, vnode, oldVNode); - update$2(api, vnode, oldVNode); - update$1(api, vnode, oldVNode); - } + callVNodeHooks('beforeUpdate', api, vnode, oldVNode); const { text, html, children, isStyle, isOption } = vnode, oldText = oldVNode.text, oldHtml = oldVNode.html, oldChildren = oldVNode.children; if (string$1(text)) { if (oldChildren) { @@ -2089,19 +2167,18 @@ const elementVNodeOperator = { else if (oldText || oldHtml) { api.setText(node, EMPTY_STRING, isStyle); } + callVNodeHooks('afterUpdate', api, vnode, oldVNode); }, destroy(api, vnode) { if (vnode.isPure) { return; } - remove$5(api, vnode); - remove$4(api, vnode); - remove$3(api, vnode); - remove$2(api, vnode); - if (vnode.children) { - each$2(vnode.children, function (child) { - destroyVNode(api, child); - }); + callVNodeHooks('beforeDestroy', api, vnode); + const { children } = vnode; + if (children) { + for (let i = 0, length = children.length; i < length; i++) { + destroyVNode(api, children[i]); + } } }, insert: vnodeInsertOperator, @@ -2156,22 +2233,34 @@ const componentVNodeOperator = { data[VNODE] = vnode; return; } - // 先处理 directive 再处理 component - // 因为组件只是单纯的更新 props,而 directive 则有可能要销毁 - // 如果顺序反过来,会导致某些本该销毁的指令先被数据的变化触发执行了 - update$4(api, vnode, oldVNode); - update$3(api, vnode, oldVNode); - update$2(api, vnode, oldVNode); - update$1(api, vnode, oldVNode); - update(api, vnode, oldVNode); + callVNodeHooks('beforeUpdate', api, vnode, oldVNode); + const { component, props, slots } = vnode; + if (component) { + { + if (props) { + for (let key in props) { + component.checkProp(key, props[key]); + } + } + } + let nextProps = props; + if (slots) { + component.renderSlots(nextProps || (nextProps = {}), slots); + } + if (nextProps) { + component.forceUpdate(nextProps); + } + } + callVNodeHooks('afterUpdate', api, vnode, oldVNode); }, destroy(api, vnode) { - if (vnode.component) { - remove$5(api, vnode); - remove$4(api, vnode); - remove$3(api, vnode); - remove$2(api, vnode); - remove$1(api, vnode); + const { component } = vnode; + if (component) { + callVNodeHooks('beforeDestroy', api, vnode); + component.destroy(); + // 移除时,组件可能已经发生过变化,即 shadow 不是创建时那个对象了 + vnode.shadow = component.$vnode; + vnode.component = UNDEFINED$1; } else { vnode.data[LOADING] = FALSE$1; @@ -2260,10 +2349,11 @@ const portalVNodeOperator = { // 用注释占用节点在模板里的位置 // 这样删除或替换节点,才有找到它应该在的位置 vnode.node = api.createComment(EMPTY_STRING); - each$2(vnode.children, function (child) { - createVNode(api, child); - insertVNode(api, target, child); - }); + const children = vnode.children; + for (let i = 0, length = children.length; i < length; i++) { + createVNode(api, children[i]); + insertVNode(api, target, children[i]); + } }, update(api, vnode, oldVNode) { const { target } = oldVNode; @@ -2273,10 +2363,11 @@ const portalVNodeOperator = { vnodeUpdateChildrenOperator(api, target, vnode, oldVNode); }, destroy(api, vnode) { - each$2(vnode.children, function (child) { - destroyVNode(api, child); - removeVNode(api, child); - }); + const children = vnode.children; + for (let i = 0, length = children.length; i < length; i++) { + destroyVNode(api, children[i]); + removeVNode(api, children[i]); + } }, insert: vnodeInsertOperator, remove: vnodeRemoveOperator, @@ -2288,21 +2379,19 @@ const slotVNodeOperator = { vnodeCreateChildrenOperator(api, vnode); vnode.data = {}; vnode.node = getFragmentHostNode(api, vnode); - update$4(api, vnode); - update$3(api, vnode); + callVNodeHooks('afterCreate', api, vnode); }, update(api, vnode, oldVNode) { const { parentNode } = oldVNode; vnode.node = oldVNode.node; vnode.parentNode = parentNode; vnode.data = oldVNode.data; - update$4(api, vnode, oldVNode); - update$3(api, vnode, oldVNode); + callVNodeHooks('beforeUpdate', api, vnode, oldVNode); vnodeUpdateChildrenOperator(api, parentNode, vnode, oldVNode); + callVNodeHooks('afterUpdate', api, vnode, oldVNode); }, destroy(api, vnode) { - remove$5(api, vnode); - remove$4(api, vnode); + callVNodeHooks('beforeDestroy', api, vnode); vnodeDestroyChildrenOperator(api, vnode); }, insert: vnodeInsertChildrenOperator, @@ -2334,11 +2423,7 @@ function createComponent(api, vnode, options) { vnode.component = child; vnode.shadow = child.$vnode; data[LOADING] = FALSE$1; - update$4(api, vnode); - update$3(api, vnode); - update$2(api, vnode); - update$1(api, vnode); - update(api, vnode); + callVNodeHooks('afterCreate', api, vnode); return child; } function createVNode(api, vnode) { @@ -2359,6 +2444,7 @@ function insertVNode(api, parentNode, vnode, before) { const { operator } = vnode; operator.insert(api, parentNode, vnode, before); vnode.parentNode = parentNode; + callVNodeHooks('afterMount', api, vnode); operator.enter(vnode); } function removeVNodes(api, vnodes, startIndex, endIndex) { @@ -4050,7 +4136,8 @@ breaklinePattern = /^\s*[\n\r]\s*|\s*[\n\r]\s*$/g, // 区间遍历 rangePattern = /\s*(=>|->)\s*/, // 标签 -tagPattern = /<(\/)?([$a-z][-a-z0-9]*)/i, +// 动态标签支持路径表达式,比如 $this.name、$../name、$~/name +tagPattern = /<(\/)?([a-z][-a-z0-9]*|\$[^\s]*)/i, // 注释 commentPattern = //g, // 开始注释 @@ -5724,21 +5811,14 @@ function generate$2(args, code) { } /** - * 比较操作符优先级 + * 是否需要给 node 加括号,以提升运算优先级 + * 这里不去比较运算符的优先级,而是根据节点类型判断 + * 因为在 compile 环节会根据运算符优先级或括号,创建不同的节点,节点本身已经是优先级的体现了 * * @param node - * @param operator */ -function compareOperatorPrecedence(node, operator) { - // 三元表达式优先级最低 - if (node.type === TERNARY) { - return -1; - } - // 二元运算要比较优先级 - if (node.type === BINARY) { - return binary[node.operator] - binary[operator]; - } - return 0; +function needOperatorPrecedence(node) { + return node.type === TERNARY || node.type === BINARY; } function generate$1(node, transformIdentifier, generateIdentifier, generateValue, generateCall, holder, parentNode) { let value, hasHolder = FALSE$1, generateNode = function (node, parentNode) { @@ -5760,13 +5840,11 @@ function generate$1(node, transformIdentifier, generateIdentifier, generateValue break; case BINARY: let binaryNode = node, left = generateNode(binaryNode.left), right = generateNode(binaryNode.right); - if (compareOperatorPrecedence(binaryNode.left, binaryNode.operator) < 0) { - left = toPrecedence(left); - } - if (compareOperatorPrecedence(binaryNode.right, binaryNode.operator) < 0) { - right = toPrecedence(right); - } - value = toBinary(left, binaryNode.operator, right); + value = toBinary(needOperatorPrecedence(binaryNode.left) + ? toPrecedence(left) + : left, binaryNode.operator, needOperatorPrecedence(binaryNode.right) + ? toPrecedence(right) + : right); break; case TERNARY: const ternaryNode = node, test = generateNode(ternaryNode.test), yes = generateNode(ternaryNode.yes), no = generateNode(ternaryNode.no); @@ -6617,7 +6695,7 @@ nodeGenerator[ELEMENT] = function (node) { const varName = getTempName(); // temp = vnode push(list, toAssign(varName, result)); - // temp.children && temp.children.length && childre.push(temp) + // temp.children && temp.children.length && children.push(temp) push(list, toBinary(toBinary(toMember(varName, [ toPrimitive(FIELD_CHILDREN) ]), '&&', toMember(varName, [ @@ -7408,7 +7486,7 @@ addElementClass = function (node, className) { }; removeElementClass = function (node, className) { const classes = node.className.split(CHAR_WHITESPACE); - if (remove$6(classes, className)) { + if (remove$1(classes, className)) { node.className = join$1(classes, CHAR_WHITESPACE); } }; @@ -7686,7 +7764,7 @@ function on(node, type, listener) { function off(node, type, listener) { let nativeKey = node[EVENT], nativeListenerMap = nativeListeners[nativeKey], customListenerMap = customListeners[nativeKey], customListenerList = customListenerMap && customListenerMap[type]; if (customListenerList) { - remove$6(customListenerList, listener); + remove$1(customListenerList, listener); if (!customListenerList.length) { customListenerList = UNDEFINED$1; delete customListenerMap[type]; @@ -8431,7 +8509,7 @@ class Observer { let list = this.get(keypath); if (array$1(list)) { list = list.slice(); - if (remove$6(list, item)) { + if (remove$1(list, item)) { this.set(keypath, list); return TRUE$1; } @@ -9238,7 +9316,7 @@ class Yox { lifeCycle.fire(instance, HOOK_BEFORE_DESTROY); const { $vnode } = instance; if ($parent && $parent.$children) { - remove$6($parent.$children, instance); + remove$1($parent.$children, instance); } if ($vnode) { destroy(domApi, $vnode, !$parent); @@ -9353,7 +9431,7 @@ class Yox { /** * core 版本 */ -Yox.version = "1.0.0-alpha.255"; +Yox.version = "1.0.0-alpha.256"; /** * 方便外部共用的通用逻辑,特别是写插件,减少重复代码 */ diff --git a/dist/legacy/dev/yox.esm.js.map b/dist/legacy/dev/yox.esm.js.map index 2fdbbfab..13194b24 100644 --- a/dist/legacy/dev/yox.esm.js.map +++ b/dist/legacy/dev/yox.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"yox.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/legacy/dev/yox.esm.min.js b/dist/legacy/dev/yox.esm.min.js index 783f9ec0..51738b4e 100644 --- a/dist/legacy/dev/yox.esm.min.js +++ b/dist/legacy/dev/yox.esm.min.js @@ -1,2 +1,2 @@ -const e=/^!(?:\s|--)/,t="undefined"!=typeof window?window:undefined,n="undefined"!=typeof document?document:undefined,i=function(){},r=Object.freeze({}),o=Object.freeze([]),s=/yox/.test(i.toString())?2:3,c={leftDelimiter:"{",rightDelimiter:"}",uglifyCompiled:false,minifyCompiled:false,logLevel:s};function a(e){return"function"==typeof e}function u(e){return Array.isArray(e)}function l(e){return null!==e&&"object"==typeof e}function f(e){return"string"==typeof e}function d(e){return"number"==typeof e&&!isNaN(e)}function p(e){return true===e||false===e}function h(e){return!isNaN(e-parseFloat(e))}var m=Object.freeze({__proto__:null,func:a,array:u,object:l,string:f,number:d,boolean:p,numeric:h});function g(e,t,n){return u(n)?e.apply(t,n):undefined!==t?e.call(t,n):undefined!==n?e(n):e()}class y{constructor(e,t){this.type=e,this.phase=y.PHASE_CURRENT,t&&(this.originalEvent=t)}static is(e){return e instanceof y}preventDefault(){const e=this;if(!e.isPrevented){const{originalEvent:t}=e;t&&t.preventDefault(),e.isPrevented=true}return e}stopPropagation(){const e=this;if(!e.isStoped){const{originalEvent:t}=e;t&&t.stopPropagation(),e.isStoped=true}return e}prevent(){return this.preventDefault()}stop(){return this.stopPropagation()}}function v(e,t,n){const{length:i}=e;if(i)if(n)for(let n=i-1;n>=0&&false!==t(e[n],n);n--);else for(let n=0;n0)return e[t-1]}function _(e){const{length:t}=e;if(t>0)return e.pop()}function E(e,t,n){let i=0;return v(e,(function(r,o){(false===n?r==t:r===t)&&(e.splice(o,1),i++)}),true),i}function C(e,t,n){return w(e,t,n)>=0}function N(e){return u(e)?e:g(o.slice,e)}function O(e,t,n){let i={};return v(e,(function(e){i[t?e[t]:e]=n||e})),i}function A(e,t){return e.join(t)}function P(e){return!u(e)||!e.length}y.PHASE_CURRENT=0,y.PHASE_UPWARD=1,y.PHASE_DOWNWARD=-1;var L=Object.freeze({__proto__:null,each:v,push:k,unshift:T,indexOf:w,last:S,pop:_,remove:E,has:C,toArray:N,toObject:O,join:A,falsy:P});function z(e,t){return null!=e&&e.toString?e.toString():undefined!==t?t:""}function D(e){return a(e)&&z(e).indexOf("[native code]")>=0}let I=function(){const e=Object.create(null);return{get:t=>e[t],set(t,n){e[t]=n},has:t=>t in e,keys:()=>Object.keys(e)}};D(Object.create)||(I=function(){const e={};return{get:t=>e.hasOwnProperty(t)?e[t]:undefined,set(t,n){e[t]=n},has:t=>e.hasOwnProperty(t),keys:()=>Object.keys(e)}});var j=I;function V(e){const t=j();return function(n){const i=t.get(n);if(undefined!==i)return i;const r=e(n);return t.set(n,r),r}}function R(e){const t=j();return function(n,i){let r=t.get(n);if(r){const e=r.get(i);if(e)return e}else r=j(),t.set(n,r);const o=e(n,i);return r.set(i,o),o}}const F=/-([a-z])/gi,H=/\B([A-Z])/g,q=/^[a-z]/,M=V((function(e){return e.replace(F,(function(e,t){return te(t)}))})),U=V((function(e){return e.replace(H,(function(e,t){return"-"+ne(t)}))})),W=V((function(e){return e.replace(q,te)}));function B(e,t){return A(new Array(t+1),e)}function K(e){return re(e)?"":e.trim()}function Y(e,t,n){return d(n)?t===n?"":e.slice(t,n):e.slice(t)}function G(e,t,n){return e.indexOf(t,undefined!==n?n:0)}function Z(e,t,n){return e.lastIndexOf(t,undefined!==n?n:e.length)}function J(e,t){return 0===G(e,t)}function Q(e,t){const n=e.length-t.length;return n>=0&&Z(e,t)===n}function X(e,t){return e.charAt(t||0)}function ee(e,t){return e.charCodeAt(t||0)}function te(e){return e.toUpperCase()}function ne(e){return e.toLowerCase()}function ie(e,t){return G(e,t)>=0}function re(e){return!f(e)||!e.length}var oe=Object.freeze({__proto__:null,camelize:M,hyphenate:U,capitalize:W,repeat:B,trim:K,slice:Y,indexOf:G,lastIndexOf:Z,startsWith:J,endsWith:Q,charAt:X,codeAt:ee,upper:te,lower:ne,has:ie,falsy:re});const se=/\./g,ce=/\*/g,ae=/\*\*/g,ue=R((function(e,t){return e===t||J(e,t+=".")?t.length:-1})),le=V((function(e){return G(e,".")<0?[e]:e.split(".")}));function fe(e,t){const n=le(e);for(let e=0,i=n.length-1;e<=i&&false!==t(n[e],e,i);e++);}const de=R((function(e,t){return e&&t?e+"."+t:e||t})),pe=V((function(e){return ie(e,"*")})),he=V((function(e){return new RegExp(`^${e.replace(se,"\\.").replace(ce,"(\\w+)").replace(ae,"([.\\w]+?)")}$`)})),me=R((function(e,t){const n=e.match(he(t));return n?n[1]:undefined})),ge={value:undefined};function ye(e){return Object.keys(e)}function ve(e,t){for(let n in e)if(false===t(e[n],n))break}function $e(e,t){return ve(t,(function(t,n){e[n]=t})),e}function be(e,t){return e&&t?$e($e({},e),t):e||t}function xe(e,t){let n=e;return u(e)?t?(n=[],v(e,(function(e,i){n[i]=xe(e,t)}))):n=e.slice():l(e)&&(n={},ve(e,(function(e,i){n[i]=t?xe(e,t):e}))),n}function ke(e){return a(e.get)?e.get():e}function Te(e,t,n){let i=e;return fe(t,(function(e,t,r){if(null==i)return i=undefined,false;{let o=i[e],s=undefined!==o;o&&(o=(n||ke)(o)),t===r?s?(ge.value=o,i=ge):i=undefined:i=o}})),i}function we(e,t){return undefined!==e[t]}var Se=Object.freeze({__proto__:null,keys:ye,each:ve,extend:$e,merge:be,copy:xe,get:Te,set:function(e,t,n,i){let r=e;fe(t,(function(e,t,o){if(t===o)r[e]=n;else if(r[e])r=r[e];else{if(!i)return false;r=r[e]={}}}))},has:we,falsy:function(e){return!l(e)||u(e)||!ye(e).length}});const _e="undefined"!=typeof console?console:null,Ee=t&&/edge|msie|trident/i.test(t.navigator.userAgent)?"":"%c",Ce=_e?Ee?function(e,t,n){_e.log(Ee+e,n,t)}:function(e,t){_e.log(e,t)}:i;function Ne(){const{logLevel:e}=c;return e>=1&&e<=5?e:s}function Oe(e){return`background-color:${e};border-radius:12px;color:#fff;font-size:10px;padding:3px 6px;`}function Ae(e,t){Ne()<=1&&Ce(t||"Yox debug",e,Oe("#999"))}function Pe(e,t){Ne()<=2&&Ce(t||"Yox info",e,Oe("#2db7f5"))}function Le(e,t){Ne()<=3&&Ce(t||"Yox warn",e,Oe("#f90"))}function ze(e,t){Ne()<=4&&Ce(t||"Yox error",e,Oe("#ed4014"))}function De(e,t){if(Ne()<=5)throw new Error(`[${t||"Yox fatal"}]: ${e}`)}var Ie=Object.freeze({__proto__:null,DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5,debug:Ae,info:Pe,warn:Le,error:ze,fatal:De});class je{constructor(e){this.ns=e||false,this.listeners={}}fire(e,t,n){let i=this,r=f(e)?i.toEvent(e):e,o=i.listeners[r.type],s=true;if(o){o=o.slice();const e=t&&y.is(t[0])?t[0]:undefined;for(let c=0,a=o.length;c1&&null==t&&Le(`emitter.off(type, listener) is invoked, but "listener" is ${t}.`)}else n.listeners={},arguments.length>0&&Le(`emitter.off(type) is invoked, but "type" is ${e}.`)}has(e,t){let n=this.listeners,i=this.toFilter(e,t),r=true,o=function(e){return v(e,(function(e){if(Ve(i.listener,e)&&Re(i.ns,e))return r=false})),r};return i.type?n[i.type]&&o(n[i.type]):i.ns&&ve(n,o),!r}toEvent(e){const t={type:e,ns:""};if(this.ns){const n=G(e,".");n>=0&&(t.type=Y(e,0,n),t.ns=Y(e,n+1))}return t}toFilter(e,t){let n;if(n=t?a(t)?{listener:t}:t:{},f(n.ns))n.type=e;else{const t=this.toEvent(e);n.type=t.type,n.ns=t.ns}return n}}function Ve(e,t){return!e||e===t.listener}function Re(e,t){const{ns:n}=t;return!n||!e||n===e}let Fe;"function"==typeof setImmediate&&D(setImmediate)&&(Fe=setImmediate),Fe="function"==typeof MessageChannel&&D(MessageChannel)?function(e){const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(1)}:setTimeout;var He=Fe;let qe;class Me{constructor(e){this.tasks=[],this.hooks=e||r}static shared(){return qe||(qe=new Me)}append(e,t){const n=this,{tasks:i}=n;k(i,{fn:e,ctx:t}),1===i.length&&He((function(){n.run()}))}prepend(e,t){const n=this,{tasks:i}=n;T(i,{fn:e,ctx:t}),1===i.length&&He((function(){n.run()}))}clear(){this.tasks.length=0}run(){const e=this,{tasks:t,hooks:n}=e,{length:i}=t;if(i){e.tasks=[],n.beforeTask&&n.beforeTask();for(let e=0;e0&&(s=Ye(s,e,"click"===o||"tap"===o))}if(n){if(r.isNative){const t=n.$el;return e.on(t,o,s),function(){e.off(t,o,s)}}return n.on(o,r),function(){n.off(o,r)}}return e.on(t,o,s),function(){e.off(t,o,s)}}function Ze(e,t,n){const i=t.data,o=t.lazy,s=t.events,c=n&&n.events;if(s!==c){const n=t.node,a=t.component,u=i.$event||(i.$event={});if(s){const t=c||r;for(let i in s){const r=s[i],c=t[i];c?r.value!==c.value?(u[i](),u[i]=Ge(e,n,a,o,r)):c.runtime&&r.runtime&&(c.runtime.execute=r.runtime.execute,r.runtime=c.runtime):u[i]=Ge(e,n,a,o,r)}}if(c){const e=s||r;for(let t in c)e[t]||(u[t](),delete u[t])}}}function Je(e,t){const n=t.data,i=t.events,r=n.$event;if(i&&r)for(let e in i)r[e](),delete r[e];n.$event=undefined}function Qe(e,t){return t&&true!==t?Ye(e,t):e}const Xe={set(e,t){e.value=z(t)},sync(e,t,n){n.set(t,e.value)},name:"value"},et={set(e,t){e.checked=e.value===z(t)},sync(e,t,n){e.checked&&n.set(t,e.value)},name:"checked"},tt={set(e,t){e.checked=u(t)?C(t,e.value,false):!!t},sync(e,t,n){const i=n.get(t);u(i)?e.checked?n.append(t,e.value):n.removeAt(t,w(i,e.value,false)):n.set(t,e.checked)},name:"checked"},nt={set(e,t){v(N(e.options),e.multiple?function(e){e.selected=C(t,e.value,false)}:function(n,i){if(n.value==t)return e.selectedIndex=i,false})},sync(e,t,n){const{options:i}=e;if(e.multiple){const e=[];v(N(i),(function(t){t.selected&&k(e,t.value)})),n.set(t,e)}else n.set(t,i[e.selectedIndex].value)},name:"value"};function it(e,t,n,i){let r,o,{context:s,model:c,lazy:a,nativeAttrs:u}=i,{keypath:l,value:f}=c,d=a&&(a.model||a[""]);if(n){let e=n.$model,t=Qe((function(e){s.set(l,e)}),d);r=function(t){r&&n.set(e,t)},o=function(){n.unwatch(e,t)},n.watch(e,t)}else{let n="select"===i.tag?nt:Xe,c="change";if(n===Xe){const e=u&&u.type;"radio"===e?n=et:"checkbox"===e?n=tt:true!==d&&(c="model")}r=function(e){r&&n.set(t,e)};const a=Qe((function(){n.sync(t,l,s)}),d);o=function(){e.off(t,c,a)},e.on(t,c,a),n.set(t,f)}return s.watch(l,r),function(){s.unwatch(l,r),r=undefined,o()}}function rt(e,t,n){const i=t.data,r=t.node,o=t.component,s=t.model,c=n&&n.model;s?c?s.keypath!==c.keypath&&(i.$model(),i.$model=it(e,r,o,t)):i.$model=it(e,r,o,t):c&&(i.$model(),delete i.$model)}function ot(e,t){const n=t.data;n.$model&&(n.$model(),delete n.$model)}function st(e,t,n){const{directives:i}=t,o=n&&n.directives;if(i!==o){const e=t.component||t.node;if(i){const s=o||r;for(let r in i){const o=i[r],c=s[r],{bind:a,unbind:u}=o.hooks;c?o.value!==c.value?(u&&u(e,c,n),a(e,o,t)):c.runtime&&o.runtime&&(c.runtime.execute=o.runtime.execute,o.runtime=c.runtime):a(e,o,t)}}if(o){const t=i||r;for(let i in o)if(!t[i]){const{unbind:t}=o[i].hooks;t&&t(e,o[i],n)}}}}function ct(e,t){const{directives:n}=t;if(n){const e=t.component||t.node;for(let i in n){const{unbind:r}=n[i].hooks;r&&r(e,n[i],t)}}}function at(e,t,n){const{component:i,props:r,slots:o}=t;if(i&&n){if(r)for(let e in r)i.checkProp(e,r[e]);let e=r;o&&i.renderSlots(e||(e={}),o),e&&i.forceUpdate(e)}}function ut(e,t){if(t.isFragment||t.isSlot){const n=t.children[0];return n?ut(e,n):e.createComment("")}return t.node}function lt(e,t,n,i){i?e.before(t,n,i):e.append(t,n)}function ft(e,t,n){const i=n.node;t.node=i,t.parentNode=n.parentNode,t.text!==n.text&&e.setText(i,t.text,t.isStyle,t.isOption)}function dt(e){e.data&&Vt(e,e.node)}function pt(e,t){e.data&&Rt(e,e.node,t)||t()}function ht(e,t,n,i){i?e.before(t,n.node,i.node):e.append(t,n.node)}function mt(e,t){e.remove(t.parentNode,t.node)}function gt(e,t){t()}function yt(e,t){v(t.children,(function(t){Pt(e,t)}))}function vt(e,t,n,i){Ft(e,t,n.children,i.children)}function $t(e,t){v(t.children,(function(t){It(e,t)}))}function bt(e,t,n,i){v(n.children,(function(n){zt(e,t,n,i)}))}function xt(e,t){v(t.children,(function(t){jt(e,t)}))}const kt={create(e,t){t.node=e.createText(t.text)},update:ft,destroy:i,insert:ht,remove:mt,enter:i,leave:gt},Tt={create(e,t){t.node=e.createComment(t.text)},update:ft,destroy:i,insert:ht,remove:mt,enter:i,leave:gt},wt={create(e,t){const n=t.node=e.createElement(t.tag,t.isSvg);t.children?Lt(e,n,t.children):t.text?e.setText(n,t.text,t.isStyle,t.isOption):t.html&&e.setHtml(n,t.html,t.isStyle,t.isOption),Ue(e,t),We(e,t),t.isPure||(t.data={},Be(0,t),Ze(e,t),rt(e,t),st(0,t))},update(e,t,n){const i=n.node;t.node=i,t.parentNode=n.parentNode,t.data=n.data,Ue(e,t,n),We(e,t,n),t.isPure||(Be(0,t,n),Ze(e,t,n),rt(e,t,n),st(0,t,n));const{text:r,html:o,children:s,isStyle:c,isOption:a}=t,u=n.text,l=n.html,d=n.children;f(r)?(d&&Dt(e,d),r!==u&&e.setText(i,r,c,a)):f(o)?(d&&Dt(e,d),o!==l&&e.setHtml(i,o,c,a)):s?d?s!==d&&Ft(e,i,s,d):((u||l)&&e.setText(i,"",c),Lt(e,i,s)):d?Dt(e,d):(u||l)&&e.setText(i,"",c)},destroy(e,t){t.isPure||(Ke(0,t),Je(0,t),ot(0,t),ct(0,t),t.children&&v(t.children,(function(t){It(e,t)})))},insert:ht,remove:mt,enter:dt,leave:pt},St={create(e,t){const n=t.data={};let i=undefined;t.tag&&t.context.loadComponent(t.tag,(function(r){we(n,"$loading")?n.$loading&&(n.$vnode&&(t=n.$vnode,delete n.$vnode),At(e,t,r),t.operator.enter(t)):i=r})),t.node=e.createComment("component"),i?At(e,t,i):n.$loading=true},update(e,t,n){const i=n.data;t.data=i,t.node=n.node,t.parentNode=n.parentNode,t.component=n.component,i.$loading?i.$vnode=t:(Be(0,t,n),Ze(e,t,n),rt(e,t,n),st(0,t,n),at(0,t,n))},destroy(e,t){t.component?(Ke(0,t),Je(0,t),ot(0,t),ct(0,t),function(e,t){const{component:n}=t;n&&(n.destroy(),t.shadow=n.$vnode,t.component=void 0)}(0,t)):t.data.$loading=false},insert(e,t,n,i){const{shadow:r}=n;r?(r.operator.insert(e,t,r,i),r.parentNode=t):ht(e,t,n,i)},remove(e,t){const{shadow:n}=t;n?(n.operator.remove(e,n),n.parentNode=undefined):mt(e,t)},enter(e){const{shadow:t}=e;t&&(e.transition?Vt(e,t.node):t.operator.enter(t))},leave(e,t){const{shadow:n}=e;if(n){if(!e.transition)return void n.operator.leave(n,t);if(Rt(e,n.node,t))return}t()}},_t={create(e,t){yt(e,t),t.node=ut(e,t)},update(e,t,n){const{parentNode:i}=n;t.node=n.node,t.parentNode=i,vt(e,i,t,n)},destroy:$t,insert:bt,remove:xt,enter:i,leave:gt},Et={create(e,t){let n=undefined;t.to&&(n=e.find(t.to),n||De(`Failed to locate portal target with selector "${t.to}".`)),n||(n=e.getBodyElement()),t.target=n,t.node=e.createComment(""),v(t.children,(function(t){Pt(e,t),zt(e,n,t)}))},update(e,t,n){const{target:i}=n;t.node=n.node,t.parentNode=n.parentNode,t.target=i,vt(e,i,t,n)},destroy(e,t){v(t.children,(function(t){It(e,t),jt(e,t)}))},insert:ht,remove:mt,enter:i,leave:gt},Ct={create(e,t){yt(e,t),t.data={},t.node=ut(e,t),Be(0,t),Ze(e,t)},update(e,t,n){const{parentNode:i}=n;t.node=n.node,t.parentNode=i,t.data=n.data,Be(0,t,n),Ze(e,t,n),vt(e,i,t,n)},destroy(e,t){Ke(0,t),Je(0,t),$t(e,t)},insert:bt,remove:xt,enter:dt,leave:pt};function Nt(e,t){return e.type===t.type&&e.tag===t.tag&&e.key===t.key}function Ot(e,t,n){let i,o,s;for(;t<=n;)o=e[t],o&&(s=o.key)&&(i||(i={}),i[s]=t),t++;return i||r}function At(e,t,n){const i=t.data,r=(t.parent||t.context).createComponent(n,t);return t.component=r,t.shadow=r.$vnode,i.$loading=false,Be(0,t),Ze(e,t),rt(e,t),st(0,t),at(0,t),r}function Pt(e,t){t.node||t.operator.create(e,t)}function Lt(e,t,n,i,r,o){let s,c=i||0,a=undefined!==r?r:n.length-1;for(;c<=a;)s=n[c],Pt(e,s),zt(e,t,s,o),c++}function zt(e,t,n,i){const{operator:r}=n;r.insert(e,t,n,i),n.parentNode=t,r.enter(n)}function Dt(e,t,n,i){let r,o=n||0,s=undefined!==i?i:t.length-1;for(;o<=s;)r=t[o],r&&(It(e,r),jt(e,r)),o++}function It(e,t){t.operator.destroy(e,t)}function jt(e,t){const{operator:n}=t;n.leave(t,(function(){n.remove(e,t),t.parentNode=undefined}))}function Vt(e,t){const{context:n,transition:i}=e,r=e.data.$leaving;if(r&&r(),i){const{enter:e}=i;e&&e.call(n,t)}}function Rt(e,t,n){const{context:i,transition:r}=e,o=e.data,s=o.$leaving;if(s&&s(),r){const{leave:e}=r;if(e)return e.call(i,t,o.$leaving=function(){o.$leaving&&(n(),o.$leaving=undefined)}),true}}function Ft(e,t,n,i){let r,o,s=0,c=n.length-1,a=n[s],u=n[c],l=0,f=i.length-1,d=i[l],p=i[f];for(;l<=f&&s<=c;)a?u?d?p?Nt(a,d)?(Ht(e,a,d),a=n[++s],d=i[++l]):Nt(u,p)?(Ht(e,u,p),u=n[--c],p=i[--f]):Nt(u,d)?(Ht(e,u,d),lt(e,t,d.node,e.next(p.node)),u=n[--c],d=i[++l]):Nt(a,p)?(Ht(e,a,p),lt(e,t,p.node,d.node),a=n[++s],p=i[--f]):(r||(r=Ot(i,l,f)),o=a.key?r[a.key]:undefined,undefined!==o?(qt(e,a,i[o]),i[o]=undefined):Pt(e,a),zt(e,t,a,d),a=n[++s]):p=i[--f]:d=i[++l]:u=n[--c]:a=n[++s];l>f?Lt(e,t,n,s,c,n[c+1]):s>c&&Dt(e,i,l,f)}function Ht(e,t,n){t!==n&&t.operator.update(e,t,n)}function qt(e,t,n){if(t!==n){if(!Nt(t,n)){const i=n.parentNode;return Pt(e,t),void(i&&(zt(e,i,t,n),It(e,n),jt(e,n)))}Ht(e,t,n)}}const Mt={},Ut={},Wt={},Bt={};function Kt(e,t){return Ut[t.name]||"portal"===e.tag&&"to"===t.name||"slot"===e.tag&&"name"===t.name||"vnode"===e.tag&&"value"===t.name}function Yt(e,t){const n=e.split(";");for(let e=0,i=n.length;e0){const e=K(i.substr(0,r)),n=K(i.substr(r+1));e&&n&&t(M(e),n)}}}Mt.slot=Mt.vnode=Mt.portal=Mt.fragment=Mt.template=Ut.key=Ut.ref=Ut.slot=true,Wt["if"]=6,Wt.each=9,Wt.partial=10,Bt.fragment=5,Bt.portal=6,Bt.slot=7;function Gt(e,t){return{type:2,isStatic:true,name:e,ns:t}}function Zt(e,t,n){return{type:3,ns:t,name:e,modifier:n}}function Jt(e,t,n,i){return{type:9,from:e,to:t,equal:n||undefined,index:i,isVirtual:true}}function Qt(e){return{type:5,text:e,isStatic:true,isLeaf:true}}function Xt(e){const t=Object.create(null);return v(e.split(","),(function(e){t[e]=true})),t}const en=/^[A-Z]|-/,tn=/&[#\w\d]{2,6};/,nn=Xt("area,base,embed,track,source,param,input,col,img,br,hr"),rn=Xt("svg,g,defs,desc,metadata,symbol,use,image,path,rect,circle,line,ellipse,polyline,polygon,text,tspan,tref,textpath,marker,pattern,clippath,mask,filter,cursor,view,animate,font,font-face,glyph,missing-glyph,animateColor,animateMotion,animateTransform,textPath,foreignObject"),on=Xt("min,minlength,max,maxlength,step,size,rows,cols,tabindex,colspan,rowspan,frameborder"),sn=Xt("disabled,checked,required,multiple,readonly,autofocus,autoplay,reversed,selected,controls,default,loop,muted,novalidate,draggable,contenteditable,hidden,spellcheck,allowfullscreen");function cn(e,t,n){if(e.isComponent)return Gt(M(t),n);if("style"===t)return{type:4,isStatic:!0};const i=Gt(t,n);return ln(t)&&(i.defaultValue="spellcheck"===t||"img"===e.tag&&"draggable"===t),i}function an(e,t,n){return un(e)?fn(e,t):ln(e)?dn(e,t,n):t}function un(e){return on[e]}function ln(e){return sn[e]}function fn(e,t){return h(t)||Le(`The value of "${e}" is not a number: ${t}.`),z(t)}function dn(e,t,n){const i=true===t||"true"===t||t===e;return i===n?undefined:i?"true":"false"}function pn(e){if(1!==e.type)return false;const t=e;return!t.isComponent&&undefined===Mt[t.tag]}function hn(e,t){return f(t)&&tn.test(t)?e.html=t:e.text=t,true}function mn(e){return undefined!==e}const gn={};function yn(e){return e>0&&e<33||160===e}function vn(e){return e>47&&e<58}function $n(e){return 64===e}function bn(e){return 36===e||95===e||e>96&&e<123||e>64&&e<91}function xn(e){return bn(e)||vn(e)}function kn(e,t,n,i){return{type:5,raw:i,left:e,operator:t,right:n}}function Tn(e,t,n){let i=false,r=true,o=0;return"this"===t?(t="",r=false):".."===t?(t="",r=false,o=1):"~"===t?(t="",i=true,r=false):t=Cn(t),n?wn(t,e):_n(e,t,i,r,o)}function wn(e,t){return{type:1,raw:t,value:e}}function Sn(e,t){let n=t.shift(),i=false,r=true,o=0;if(t.length>0){let s=true,c=[],a="",u=[];if(v(t,(function(e){if(s)if(1===e.type){const t=e;if(".."===t.raw)return o+=1,void(a=a?a+"/..":"..");if("this"!==t.raw){const e=z(t.value);k(c,e),a&&(a+=Q(a,"..")?"/":"."),a+=e}}else s=false;s||k(u,e)})),2===n.type){const t=n;i=t.root,r=t.lookup,o+=t.offset;let l=t.name;if(l&&(l=Cn(l,t),T(c,l)),l=A(c,"."),s)n=_n(e,l,i,r,o,c);else{let s=t.raw;if(a){let e=".";"~"!==s&&".."!==s||(e="/"),s+=e+a}n=En(e,_n(s,l,i,r,o,c),undefined,u,i,r,o)}}else n=s?En(e,n,A(c,"."),undefined,i,r,o):En(e,n,undefined,u,i,r,o)}return n}function _n(e,t,n,i,r,o){return{type:2,raw:e,name:t,root:n,lookup:i,offset:r,literals:o&&o.length>1?o:undefined}}function En(e,t,n,i,r,o,s){return{type:3,raw:e,lead:t,keypath:n,nodes:i,root:r,lookup:o,offset:s}}function Cn(e,t){return $n(ee(e,0))&&(e="$slot_"+Y(e,1),t&&(t.name=e)),e}gn["true"]=true,gn["false"]=false,gn["null"]=null,gn[void 0]=undefined;const Nn={"+":true,"-":true,"~":true,"!":true,"!!":true},On={"*":15,"/":15,"%":15,"+":14,"-":14,"<<":13,">>":13,">>>":13,"<":12,"<=":12,">":12,">=":12,"==":11,"!=":11,"===":11,"!==":11,"&":10,"^":9,"|":8,"&&":7,"||":6};class An{constructor(e){const t=this;t.index=-1,t.end=e.length,t.code=0,t.content=e,t.go()}go(e){let t=this,{index:n,end:i}=t;n+=e||1,n>=0&&n0)),n.is(47);){n.go();const{index:t,code:r}=n;let o=false;if($n(r)&&(o=true,n.go()),bn(n.code))return k(i,n.scanIdentifier(t,o,true)),n.scanTail(e,i);if(o&&n.go(-1),!n.is(46)){n.fatal(e,S(i).raw+"/ must be followed by an identifier.");break}n.go()}}scanTail(e,t){let n,i=this;e:for(;;)switch(i.code){case 40:t=[(r=Sn(i.pick(e),t),o=i.scanTuple(i.index,41),s=i.pick(e),{type:9,raw:s,name:r,args:o})];break;case 46:if(i.go(),xn(i.code)){k(t,i.scanIdentifier(i.index,false,true));break}i.fatal(e,"Identifier or number expected.");break e;case 91:if(i.go(),n=i.scanTernary(93),n){k(t,n);break}i.fatal(e,"[] is not allowed.");break e;default:break e}var r,o,s;return Sn(i.pick(e),t)}scanIdentifier(e,t,n){const i=this;do{i.go()}while(xn(i.code));const r=i.pick(e);return t&&1===r.length&&i.fatal(e,"A slot identifier must be followed by its name."),!n&&r in gn?wn(gn[r],r):Tn(r,r,n)}scanOperator(e){const t=this;switch(t.code){case 47:case 37:case 126:case 94:case 42:t.go();break;case 43:t.go(),t.is(43)&&t.fatal(e,'The operator "++" is not supported.');break;case 45:t.go(),t.is(45)&&t.fatal(e,'The operator "--" is not supported.');break;case 33:t.go(),t.is(33)?t.go():t.is(61)&&(t.go(),t.is(61)&&t.go());break;case 38:t.go(),t.is(38)&&t.go();break;case 124:t.go(),t.is(124)&&t.go();break;case 61:t.go(),t.is(61)?(t.go(),t.is(61)&&t.go()):t.fatal(e,"Assignment statements are not supported.");break;case 60:t.go(),(t.is(61)||t.is(60))&&t.go();break;case 62:t.go(),t.is(61)?t.go():t.is(62)&&(t.go(),t.is(62)&&t.go())}if(t.index>e)return t.pick(e)}scanBinary(e){let t,n,i,r,o,s,c=this,a=[];for(;;){if(c.skip(),k(a,c.index),t=c.scanToken(),t){if(k(a,t),k(a,c.index),c.skip(),i=c.scanOperator(c.index),i&&(r=On[i])){for(;n=a.length-4,(o=a[n])&&(s=On[o])&&s>=r;)a.splice(n-2,5,kn(a[n-2],o,a[n+2],c.pick(a[n-3],a[n+3])));k(a,i);continue}i=undefined}else i&&c.fatal(e,"Invalid syntax.");break}for(;;){if(!(a.length>=7))return a[1];n=a.length-4,a.splice(n-2,5,kn(a[n-2],a[n],a[n+2],c.pick(a[n-3],a[n+3])))}}scanTernary(e){const t=this;t.skip();let n,i,r=t.index,o=t.scanBinary(r);return t.is(63)&&(t.go(),n=t.scanTernary(),t.is(58)&&(t.go(),i=t.scanTernary()),o&&n&&i?(t.skip(-1),o=function(e,t,n,i){return{type:6,raw:i,test:e,yes:t,no:n}}(o,n,i,t.pick(r))):t.fatal(r,"Invalid ternary syntax.")),mn(e)&&(t.skip(),t.is(e)?t.go():t.fatal(r,`"${String.fromCharCode(e)}" expected, "${String.fromCharCode(t.code)}" actually.`)),o}fatal(e,t){De(`Error compiling expression\n\n${this.content}\n\nmessage: ${t}\n`)}}const Pn=V((function(e){return new An(e).scanTernary(0)})),Ln={},zn=/\s*:\s*([_$a-z]+)$/i,Dn=/^[_$a-z]([\w]+)?$/i,In=/^[_$a-z]([\w]+)?$/i,jn=/^[_$a-z]([\w]+)?\.[_$a-z]([\w]+)?$/i,Vn=/^\s*[\n\r]\s*|\s*[\n\r]\s*$/g,Rn=/\s*(=>|->)\s*/,Fn=/<(\/)?([$a-z][-a-z0-9]*)/i,Hn=//g,qn=/^([\s\S]*?)([\s\S]*?)$/,Un=/^\s*([-$.:\w]+)(?:=(['"]))?/,Wn=/^[!=]*['"]/,Bn=/^\s*(\/)?>/;function Kn(e,t){return K(Y(e,t.length))}function Yn(e){if(e.safe&&1===e.expr.type)return Qt(z(e.expr.value))}function Gn(e){return e&&12===e.type&&!e.safe}function Zn(e){let t=-1,n="",i=-1,r="";v(e,(function(o,s){if(5===o.type)if(i>=0){for(n=o.text;qn.test(n);)n=RegExp.$1,t=s;if(t>=0){let o=t,s=i;n&&(e[t].text=n,o++),r&&(n?e[t].text+=r:(e[i].text=r,s--)),e.splice(o,s-o+1),t=i=-1}}else for(r=o.text;Mn.test(r);)r=RegExp.$1,i=s}),true)}function Jn(t){let n,i,r,o,s=B(c.leftDelimiter,2),a=B(c.rightDelimiter,2),u=c.leftDelimiter,l=c.rightDelimiter,f=[],p=[],h=[],m=[],g=[],y=[],$=t.length,b=0,x=0,T=0,E=0,C=1,N=[],O=[],A=function(e){De(`Error compiling template\n\n${t}\n\nmessage: ${e}`)},P=function(e){const t=S(p);if(t&&1===t.type){const i=t;i.tag!==e&&(n=i.tag,void 0!==nn[n])&&L(i.type,i.tag)}var n},L=function(e,t){const i=_(p);i&&i.type===e||A("The type of poping node is not expected.");const r=i,o=1===e,s=2===e,c=4===e,a=3===e,u=S(p);o&&t&&r.tag!==t&&A(`End tag is "${t}",but start tag is "${r.tag}".`);let{children:l}=r;if(l&&l.length>1&&(n||(Zn(l),l.length||(l=r.children=undefined))),l){const e=1===l.length&&l[0];if(e)switch(e.type){case 5:o?z(r,e):n&&(s?R(n,r,e):c?j(n,r,e):a&&q(n,r,e));break;case 12:o?D(r,e):n&&(s||c||a)&&F(n,r,e)}}else n&&(s?V(n,r):c?I(n,r):a&&H(n,r));return r.isVirtual&&!r.children&&Q(r),o?W(r):n&&s&&Z(n,r),u&&u.isStatic&&!r.isStatic&&(u.isStatic=false),r},z=function(e,t){pn(e)&&hn(e,t.text)&&(e.children=undefined)},D=function(e,t){pn(e)&&(t.safe&&hn(e,t.expr)||!t.safe&&function(e,t){return e.html=t,!0}(e,t.expr))&&(e.children=undefined)},I=function(e,t){Q(t)},j=function(e,t,n){n.text?(t.value=n.text,t.children=undefined):Q(t)},V=function(e,t){Kt(e,t)?A(`The value of "${t.name}" is empty.`):t.value=function(e,t,n){return!!e.isComponent||(un(t)?void 0:ln(t)?dn(t,!0,n):"")}(e,t.name,t.defaultValue)},R=function(e,t,n){t.value=e.isComponent?n.text:an(t.name,n.text,t.defaultValue),t.children=undefined},F=function(e,t,n){const{expr:i}=n;if(1===i.type){let n=i.value;e.isComponent||2!==t.type||(n=an(t.name,n,t.defaultValue)),t.value=n}else t.expr=i;t.children=undefined},H=function(e,t){t.value=true},q=function(e,t,i){let r,o,{ns:s}=t,{text:c}=i,a="model"===s,u="lazy"===s,l="event"===s,f="o"===s;try{r=Pn(c)}catch(p){o=p}if(r){{const{raw:e}=r;if(u)(1!==r.type||!d(r.value)||r.value<=0)&&A("The value of lazy must be a number greater than 0.");else if(9===r.type){const e=r.name;2!==e.type?A("Invalid method name."):Dn.test(e.name)||A("Invalid method name.")}else l&&(In.test(e)||jn.test(e)?(jn.test(e)&&"native"===e.split(".")[1]&&A('The event namespace "native" is not permitted.'),n&&n.isComponent&&t.name===e&&A("The event name listened and fired can't be the same.")):A("The event name and namespace must be an identifier."));a&&2!==r.type&&A("The value of the model must be an identifier.")}t.expr=r,t.value=1===r.type?r.value:c}else{if(!f)throw o;t.value=c}t.children=undefined},U=function(e){let t=e,n=[],i=false,r=false;for(;k(n,t),t.next;)t=t.next;v(n,(function(e){e.children&&(!i&&e.next&&delete e.next,r=i=true)}),true),r||Q(e)},W=function(e){const{tag:t,slot:n}=e,i="template"===t,r="fragment"===t,o="portal"===t,s="vnode"===t;i?e.key?A('The "key" attribute is not supported in