-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathdomvm.full.iife.min.js
2 lines (2 loc) · 18.4 KB
/
domvm.full.iife.min.js
1
2
// https://github.com/domvm/domvm (v3.4.14, full build)
var domvm=function(n){"use strict";const e="undefined"!=typeof window?document:{},t={};function l(){}const r=Array.isArray;function o(n){return null!=n&&n.constructor===Object}function a(n,e,t,l){n.splice.apply(n,[t,l].concat(e))}function u(n){return"function"==typeof n}function i(n){for(var e=arguments,t=1;e.length>t;t++)for(var l in e[t])n[l]=e[t][l];return n}function f(n,e){for(var t=[],l=e;n.length>l;l++)t.push(n[l]);return t}function d(n,e){return n===e||null!=e&&null!=n&&(r(n)?function(n,e){const t=n.length;if(e.length!==t)return!1;for(var l=0;t>l;l++)if(n[l]!==e[l])return!1;return!0}(n,e):!!o(n)&&function(n,e){for(var t in n)if(n[t]!==e[t])return!1;return!0}(n,e))}function s(n){return"."===n[0]}function c(n){return"o"===n[0]&&"n"===n[1]}function v(n){return"_"===n[0]}function y(n){return"style"===n}function p(n){n&&n.el&&n.el.getBoundingClientRect()}function h(n){return null!=n.node&&null!=n.node.el}function m(n,e){switch(e){case"value":case"checked":case"selected":return!0}return!1}function b(n){for(n=n||t;null==n.vm&&n.parent;)n=n.parent;return n.vm}function g(){}const k=g.prototype={constructor:g,type:null,vm:null,key:null,ref:null,data:null,hooks:null,ns:null,el:null,tag:null,attrs:null,body:null,flags:0,_diff:null,_dead:!1,_lis:!1,idx:null,parent:null};function w(n){let e=new g;return e.type=2,e.body=n,e}k._class=null;const _={},x=/\[([^=\]]+)=?([^\]]+)?\]/g;function N(n,e,t,l){let r=new g;r.type=1,r.flags=l||0,r.attrs=e||null;var o=function(n){var e,t,l,r,o=_[n];if(null==o)for(_[n]=o={tag:(e=n.match(/^[-\w]+/))?e[0]:"div",id:(t=n.match(/#([-\w]+)/))?t[1]:null,class:(l=n.match(/\.([-\w.]+)/))?l[1].replace(/\./g," "):null,attrs:null};r=x.exec(n);)null==o.attrs&&(o.attrs={}),o.attrs[r[1]]=r[2]||"";return o}(n);n=o.tag;var a=null!=o.id,u=null!=o.class,i=null!=o.attrs;if(a||u||i){var f=r.attrs||{};if(a&&null==f.id&&(f.id=o.id),u&&(r._class=o.class,f.class=o.class+(null!=f.class?" "+f.class:"")),i)for(var d in o.attrs)null==f[d]&&(f[d]=o.attrs[d]);r.attrs=f}if(r.tag=n,null!=r.attrs){var s=r.attrs;null!=s._key&&(r.key=s._key),null!=s._ref&&(r.ref=s._ref),null!=s._hooks&&(r.hooks=s._hooks),null!=s._data&&(r.data=s._data),null!=s._flags&&(r.flags=s._flags),null==r.key&&(null!=r.ref?r.key=r.ref:null!=s.id?r.key=s.id:null!=s.name&&(r.key=s.name+("radio"===s.type||"checkbox"===s.type?s.value:"")))}return null!=t&&(r.body=t,t instanceof C&&(r.flags=t.flags)),r}function C(n,e,t){var l,r=this,o=n.length;r.flags=8,r.items=n,r.length=o,r.key=()=>null,r.diff={val:function(t,l){return e.val(n[t],l)},eq:function(n,t){return e.eq(t._diff,r.diff.val(n))}},r.tpl=e=>l(n[e],e),r.map=n=>(l=n,r),r.body=function(n){for(var e=[],t=0;o>t;t++){var l=r.tpl(t);4!=l.type&&(l._diff=r.diff.val(t,n)),e.push(l)}n.body=e,L(n)},null!=t&&(r.flags|=4,r.key=e=>t(n[e],e)),u(e)&&(r.diff={val:function(t){return e(n[t])},eq:function(n,e){return d(e._diff,r.diff.val(n))}})}let S=function(n){return n},R=l,E=l;var I={};let M=l,O=!1,q=l,A=l;function V(n){M=n.onevent||M,null!=n.onvnode&&(A=n.onvnode),null!=n.syncRedraw&&(O=n.syncRedraw),null!=n.didRedraws&&(q=n.didRedraws),n.onemit&&function(n){i(I,n)}(n.onemit),n.stream&&function(n){S=n.val,R=n.on,E=n.off}(n.stream)}function D(n,e,t,l){if(A(n,e,t,l),5!==n.type&&4!==n.type){n.parent=e,n.idx=t,n.vm=l,null!=n.ref&&function(n,e,t){!function(n,e,t){for(var l;l=e.shift();)n[l]=0===e.length?t:n=n[l]||{}}(n,("refs."+e).split("."),t)}(b(n),n.ref,n);var o=n.hooks,a=l&&l.hooks;(o&&(o.willRemove||o.didRemove)||a&&(a.willUnmount||a.didUnmount))&&function(n){for(;n=n.parent;)n.flags|=1}(n),r(n.body)?L(n):""===n.body?n.body=null:(n.body=S(n.body,b(n)._stream),null==n.body||n.body instanceof C||(n.body=""+n.body))}}function L(n){for(var e=n.body,t=0;e.length>t;t++){var l=e[t];!1===l||null==l?e.splice(t--,1):r(l)?a(e,l,t--,1):(null==l.type&&(e[t]=l=w(l)),2===l.type?null==l.body||""===l.body?e.splice(t--,1):t>0&&2===e[t-1].type?(e[t-1].body+=l.body,e.splice(t--,1)):D(l,n,t,null):D(l,n,t,null))}}const T={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,order:!0,lineClamp:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function j(n,e){return isNaN(e)||T[n]?e:e+"px"}function U(n,e){var l=(n.attrs||t).style,r=e?(e.attrs||t).style:null;if(null==l||function(n){var e=typeof n;return"string"===e||"number"===e}(l))n.el.style.cssText=l;else{for(var o in l){var a=l[o];l[o]=a=S(a,b(n)._stream),(null==r||null!=a&&a!==r[o])&&(n.el.style[o]=j(o,a))}if(r)for(var u in r)null==l[u]&&(n.el.style[u]="")}}function z(n){let e=n.currentTarget,l=e._node.attrs["on"+n.type];if(r(l)){let r,o,a=l[0],u=l.slice(1),i=function(n){for(n=n||t;null==n._node&&n.parentNode;)n=n.parent;return n._node}(n.target),f=b(i),d=a.apply(e,u.concat([n,i,f,f.data]));r=f.onevent(n,i,f,f.data,u),o=M(n,i,f,f.data,u),!1!==d&&!1!==r&&!1!==o||n.preventDefault()}else l.call(e,n)}function F(n,e,t,l){if(t==l)return;let r=n.el;null==t?r.removeEventListener(e.slice(2),z):null==l&&r.addEventListener(e.slice(2),z)}function B(n,e,t){s(e)&&(e=e.substr(1),t=!0),t?n.el[e]="":n.el.removeAttribute(e)}function G(n,e,t,l){var r=n.el;null!=n.ns?r.setAttribute(e,t):"class"===e?r.className=t:"id"===e||"boolean"==typeof t||l?r[e]=t:"."===e[0]?r[e.substr(1)]=t:r.setAttribute(e,t)}function H(n,e){const l=n.attrs||t,r=e.attrs||t;if(l===r);else{for(var o in l){var a=l[o];if(null!=a){var u=m(0,o),i=u?n.el[o]:r[o];l[o]=a=S(a,(b(n)||t)._stream),a===i||(y(o)?U(n,e):v(o)||(c(o)?F(n,o,a,i):G(n,o,a,u)))}}for(var o in r)null==l[o]&&(c(o)?F(n,o,l[o],r[o]):v(o)||B(n,o,m(0,o)))}}function W(n,e,t,l){return 4===n.type&&(e=n.data,t=n.key,l=n.opts,n=n.view),new wn(n,e,t,l)}const Y=[];function $(n,e,t,l,r){if(null!=n){var o=t.hooks[e];if(o){if("d"!==e[0]||"i"!==e[1]||"d"!==e[2])return o(t,l);r?(p(t.parent),o(t,l)):Y.push([o,t,l])}}}function K(n,e){var t;if(Y.length)for(e&&p(n.node);t=Y.shift();)t[0](t[1],t[2])}function P(n){return n.nextSibling}function X(n){var e=n.vm,t=null!=e&&$(e.hooks,"willUnmount",e,e.data),l=$(n.hooks,"willRemove",n);if(1==(1&n.flags)&&r(n.body))for(var o=0;n.body.length>o;o++)X(n.body[o]);return t||l}function Z(n,e){if(e){var t=n.vm;null!=t&&(t.node=t.refs=null)}var l=n.body;if(r(l))for(var o=0;l.length>o;o++)Z(l[o],!0)}function J(n,e,t){var l=e._node,r=l.vm;if(Z(l,!0),1==(1&l.flags))for(var o=0;l.body.length>o;o++)J(e,l.body[o].el);delete e._node,n.removeChild(e),$(l.hooks,"didRemove",l,null,t),null!=r&&($(r.hooks,"didUnmount",r,r.data,t),r.node=null)}function Q(n,e){var t=e._node;if(null==t)n.removeChild(e);else{if(t._dead)return;var l=X(t);null!=l&&function(n){return"object"==typeof n&&u(n.then)}(l)?(t._dead=!0,l.then(function(n,e){return function(){return n.apply(undefined,e)}}(J,[n,e,!0]))):J(n,e)}}function nn(n){var e=n.el;if(0==(1&n.flags))Z(n,!1),e.textContent=null;else{var t=e.firstChild;if(null!=t)do{var l=P(t);Q(e,t)}while(t=l)}}function en(n,e,t){var l=e._node,r=null!=e.parentNode,o=e!==t&&r?null:l.vm;null!=o&&$(o.hooks,"willMount",o,o.data),$(l.hooks,r?"willReinsert":"willInsert",l),n.insertBefore(e,t),$(l.hooks,r?"didReinsert":"didInsert",l),null!=o&&$(o.hooks,"didMount",o,o.data)}function tn(n,e,t){en(n,e,t?P(t):null)}function ln(n){for(var e=0;n.body.length>e;e++){var t=n.body[e],l=t.type;if(l>3){if(4===l)l=(r=W(t.view,t.data,t.key,t.opts)._redraw(n,e,!1)).node.type,en(n.el,rn(r.node));else if(5===l){var r;(r=t.vm)._update(t.data,n,e,!0,!0),l=r.node.type,en(n.el,r.node.el)}}else en(n.el,rn(t))}}function rn(n,l){return null==n.el&&(1===n.type?(n.el=l||function(n,t){return null!=t?e.createElementNS(t,n):e.createElement(n)}(n.tag,n.ns),null!=n.attrs&&H(n,t),8==(8&n.flags)&&n.body.body(n),r(n.body)?ln(n):null!=n.body&&(n.el.textContent=n.body)):2===n.type?n.el=l||function(n){return e.createTextNode(n)}(n.body):3===n.type&&(n.el=l||function(n){return e.createComment(n)}(n.body))),n.el._node=n,n.el}function on(n,e,t,l,r,o,a,u){return function(i,f,d,s,c,v){var y,p;if(null!=s[l]){if(null==(y=s[l]._node))return void(s[l]=n(s[l]));if(function(n){return n.parent}(y)!==i)return p=n(s[l]),null!=y.vm?y.vm.unmount(!0):Q(f,s[l]),void(s[l]=p)}if(s[r]==c)return 2;if(null==s[r].el)t(f,rn(s[r]),s[l]),s[r]=e(s[r],d);else if(s[r].el===s[l])s[r]=e(s[r],d),s[l]=n(s[l]);else{if(v||y!==s[a])return v&&null!=s[l]?function(n,e,t,l,r,o,a,u,i){if(u._lis)t(o,i[r].el,i[l]),i[r]=e(i[r],a);else{var f=function(n,e){for(var t,l=0,r=e.length-1,o=2147483647>=r;r>=l;){if(e[t=o?l+r>>1:Math.floor((l+r)/2)]===n)return t;n>e[t]?l=t+1:r=t-1}return l==e.length?null:l}(u.idx,i.tombs);u._lis=!0;var d=n(i[l]);t(o,i[l],null!=f?a[i.tombs[f]].el:f),null==f?i.tombs.push(u.idx):i.tombs.splice(f,0,u.idx),i[l]=d}}(n,e,t,l,r,f,d,y,s):1;s[l]=n(p=s[l]),u(f,p,s[o]),s[o]=p}}}var an=on(P,(function(n,e){return e[n.idx+1]}),en,"lftSib","lftNode","rgtSib","rgtNode",tn),un=on((function(n){return n.previousSibling}),(function(n,e){return e[n.idx-1]}),tn,"rgtSib","rgtNode","lftSib","lftNode",en);function fn(n,e,t,l){var r=[],o=e.firstChild;do{var a=o._node;a.parent===n&&r.push(a.idx)}while(o=P(o));for(var u=function(n){const e=n.slice(),t=[];t[0]=0;let l,r,o,a=0,u=0;for(;n.length>u;++u){const i=n[u];if(o=t[a],i>n[o])e[u]=o,t[++a]=u;else{for(l=0,r=a;r>l;)o=l+r>>1,i>n[t[o]]?l=o+1:r=o;n[t[l]]>i&&(l>0&&(e[u]=t[l-1]),t[l]=u)}}for(r=t[a];a>=0;)t[a--]=r,r=e[r];return t}(r).map((n=>r[n])),i=0;u.length>i;i++)t[u[i]]._lis=!0;for(l.tombs=u;2!==an(n,e,t,l,null,!0););}function dn(n){return n.el._node.parent!==n.parent}function sn(n,e,t){return e[t]}function cn(n,e,t){for(;e.length>t;t++){var l=e[t];if(null!=l.vm){if(4===n.type&&l.vm.view===n.view&&l.vm.key===n.key||5===n.type&&l.vm===n.vm)return l}else if(!dn(l)&&n.tag===l.tag&&n.type===l.type&&n.key===l.key&&(-2&n.flags)==(-2&l.flags))return l}return null}function vn(n,e,t){if(null==e._keys){if(e[t].key===n.key)return e[t];for(var l={},r=0;e.length>r;r++)l[e[r].key]=r;e._keys=l}return e[e._keys[n.key]]}function yn(n,e){$(e.hooks,"willRecycle",e,n);var o=n.el=e.el,a=e.body,u=n.body;if(o._node=n,2!==n.type||u===a){null==n.attrs&&null==e.attrs||H(n,e);var i=r(a),f=r(u);i?f||8==(8&n.flags)?function(n,e){var r=n.body,o=r.length,a=e.body,u=a.length,i=8==(8&n.flags),f=2==(2&n.flags),d=4==(4&n.flags),s=!f&&1===n.type,c=!0,v=0===u?l:d?vn:f||i?sn:cn;if(s&&0===o)return nn(e),void(i&&(n.body=[]));var y,p,m=0,b=!1,g=0;if(i)var k={key:null},w=n.body=Array(o);for(var _=0;o>_;_++){if(i){var x=!1;c&&(d&&(k.key=r.key(_)),y=v(k,a,g)),null!=y?(p=y.idx,r.diff.eq(_,y)?((N=y).parent=n,N.idx=_,N._lis=!1):x=!0):x=!0,x&&(4===(N=r.tpl(_)).type?N=null!=y?y.vm._update(N.data,n,_,!0,!0).node:W(N.view,N.data,N.key,N.opts)._redraw(n,_,!1).node:(D(N,n,_),N._diff=r.diff.val(_,n),null!=y&&yn(N,y))),w[_]=N}else{var N,C=(N=r[_]).type;if(C>3){if(4===C)(y=c&&v(N,a,g))?(p=y.idx,y.vm._update(N.data,n,_,!0,!0)):W(N.view,N.data,N.key,N.opts)._redraw(n,_,!1);else if(5===C){var S=N.vm,R=h(S);R&&S.node.parent!=e&&(S.unmount(!0),R=!1),S._update(N.data,n,_,R,!0)}}else(y=c&&v(N,a,g))&&(yn(N,y),p=y.idx)}if(null!=y&&(p===g?++g===u&&o>u&&(y=null,c=!1):b=!0,!d&&u>100&&b&&++m%10==0))for(;u>g&&dn(a[g]);)g++}s&&function(n,e){var l=e.body,r=n.el,o=n.body,a={lftNode:o[0],rgtNode:o[o.length-1],lftSib:(l[0]||t).el,rgtSib:(l[l.length-1]||t).el};n:for(;;){for(;;){var u=an(n,r,o,a,null,!1);if(1===u)break;if(2===u)break n}for(;;){var i=un(n,r,o,a,a.lftNode,!1);if(1===i)break;if(2===i)break n}fn(n,r,o,a);break}}(n,e)}(n,e):u!==a&&(null!=u?o.textContent=u:nn(e)):f?(nn(e),ln(n)):u!==a&&(null!=u&&null!=a?o.firstChild.nodeValue=u:o.textContent=u),$(e.hooks,"didRecycle",e,n)}else o.nodeValue=u}function pn(n,e,t,l){var r,a;return null==t?o(e)?r=e:a=e:(r=e,a=t),N(n,r,a,l)}var hn=new Set,mn=0;function bn(){hn.forEach((n=>{if(null!=n.node){for(var e=n;e=e.parent();)if(hn.has(e))return;n.redraw(!0)}})),q(hn),hn.clear(),mn=0}var gn={class:"domvm-err",style:{color:"#fff",background:"#f00"}};function kn(n){var e="[DOMVM] "+n;return console.error(e),pn("div",gn,e)}function wn(n,e,t,l){var r,a,i,f=this;f.view=n,f.data=e,f.key=t,l&&(f.opts=l,f.cfg(l));try{r=o(n)?n:n.call(f,f,e,t,l)}catch(n){a=n}r&&(u(r)?i=r:(i=r.render,f.cfg(r))),f.render=function(){if(a)return kn(a);try{return i.apply(this,arguments)}catch(n){return kn(n)}},f.init&&f.init.call(f,f,f.data,f.key,l)}function _n(n,e,t){return d(e,t)}function xn(n){var e=this;return n.init&&(e.init=n.init),n.diff&&(e.diff=u(n.diff)?{val:n.diff,eq:_n}:n.diff),n.onevent&&(e.onevent=n.onevent),n.hooks&&(e.hooks=i(e.hooks||{},n.hooks)),n.onemit&&(e.onemit=i(e.onemit||{},n.onemit)),e}const Nn=wn.prototype={constructor:wn,init:null,view:null,key:null,data:null,state:null,api:null,opts:null,node:null,hooks:null,refs:null,render:null,mount:function(n,e){var t=this;return e?(nn({el:n,flags:0}),t._redraw(null,null,!1),n.nodeName.toLowerCase()!==t.node.tag?(rn(t.node),en(n.parentNode,t.node.el,n),n.parentNode.removeChild(n)):en(n.parentNode,rn(t.node,n),n)):(t._redraw(null,null),n&&en(n,t.node.el)),n&&K(t,!0),t},unmount:function(n){var e=this;E(e._stream),e._stream=null;var t=e.node;Q(t.el.parentNode,t.el),t.el=null,n||K(e,!0)},cfg:xn,config:xn,parent:function(){return b(this.node.parent)},root:function(){for(var n=this.node;n.parent;)n=n.parent;return n.vm},redraw:function(n){var e=this;return null==n&&(n=O),n?e._redraw(null,null,h(e)):(hn.add(e),0===mn&&(mn=requestAnimationFrame(bn))),e},update:function(n,e){var t=this;return null==e&&(e=O),t._update(n,null,null,h(t),e),e||t.redraw(),t},_update:function(n,e,t,l,r){var o=this;return null!=n&&o.data!==n&&($(o.hooks,"willUpdate",o,n),o.data=n),r?o._redraw(e,t,l):o},_redraw:function(n,e,t){const l=null==n;var r,o=this,a=o.node&&o.node.el&&o.node.el.parentNode,u=null!=o.diff,i=o.node;if(null!=i&&l&&(n=i.parent,e=i.idx),u&&(r=o.diff.val(o,o.data,o.key,n,e),null!=i&&o.diff.eq(o,i._diff,r)))return i._diff=r,Cn(o,i,n,e);a&&$(o.hooks,"willRedraw",o,o.data);var f=o.render.call(o,o,o.data,o.key,n,e);if(u&&(f._diff=r),f===i)return Cn(o,i,n,e);if(o.refs=null,null!=o.key&&f.key!==o.key&&(f.key=o.key),o.node=f,o._stream=[],n?(D(f,n,e,o),n.body[e]=f):i&&i.parent?(D(f,i.parent,i.idx,o),i.parent.body[i.idx]=f):D(f,null,null,o),!1!==t)if(i)if(i.tag!==f.tag||i.key!==f.key){i.vm=f.vm=null;var d=i.el.parentNode,s=P(i.el);Q(d,i.el),en(d,rn(f),s),i.el=f.el,f.vm=o}else yn(f,i);else rn(f);return S(o.data,o._stream),o._stream=R(o._stream,o),a&&$(o.hooks,"didRedraw",o,o.data),l&&a&&K(o,!0),o}};function Cn(n,e,t,l){return null!=t&&(t.body[l]=e,e.idx=l,e.parent=t,e._lis=!1),n}Nn.onevent=l;const Sn="http://www.w3.org/2000/svg";function Rn(n,e,t,l){this.view=n,this.data=e,this.key=t,this.opts=l}function En(n,e){this.vm=n,this.data=e}function In(n){var e,t,l=arguments,r=l.length;if(r>1){var a=1;o(l[1])&&(t=l[1],a=2),e=r!==a+1||l[a]instanceof g||l[a]instanceof Rn||l[a]instanceof En?f(l,a):l[a]}return N(n,t,e)}function Mn(n,e){var t=n.body;if(r(t))for(var l=0;t.length>l;l++){var o=t[l];null!=o.vm?e.push(o.vm):Mn(o,e)}return e}function On(n,e){n.el=e,e._node=n;var t=n.attrs;for(var l in t){var o=t[l],a=m(0,l);y(l)||v(l)||(c(l)?F(n,l,o):null!=o&&a&&G(n,l,o,a))}if(8==(8&n.flags)&&n.body.body(n),r(n.body)&&n.body.length>0){var u=e.firstChild,i=0,f=n.body[i];do{4===f.type?f=W(f.view,f.data,f.key,f.opts)._redraw(n,i,!1).node:5===f.type&&(f=f.vm.node||f.vm._update(f.data,n,i,!1,!0).node),On(f,u)}while((u=u.nextSibling)&&(f=n.body[++i]))}var d=n.vm;null!=d&&$(d.hooks,"willMount",d,d.data),$(n.hooks,"willInsert",n),$(n.hooks,"didInsert",n),null!=d&&$(d.hooks,"didMount",d,d.data)}function qn(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function An(n){var e="";for(var t in n)null!=n[t]&&(e+=qn(t)+": "+j(t,n[t])+"; ");return e}function Vn(n){return null==n?"":""+n}Rn.prototype={constructor:Rn,type:4,view:null,data:null,key:null,opts:null},En.prototype={constructor:En,type:5,vm:null,data:null},k.patch=function(n,e){!function(n,e,t){if(o(e)){var l=Object.create(n);l.attrs=i({},n.attrs),null!=e.class&&null!=n._class&&(e.class=n._class+" "+e.class),i(n.attrs,e),H(n,l),t&&p(n)}else{if(null!=n.vm)return;D(e,n.parent,n.idx,null),n.parent.body[n.idx]=e,yn(e,n),t&&p(e),K(b(e),!1)}}(this,n,e)},Nn.emit=function(n){var e=this,t=e,l=f(arguments,1).concat(t,t.data);do{var r=e.onemit,o=r?r[n]:null;if(o){o.apply(e,l);break}}while(e=e.parent());I[n]&&I[n].apply(e,l)},Nn.onemit=null,Nn.body=function(){return Mn(this.node,[])},Nn._stream=null;const Dn={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};function Ln(n){n=Vn(n);for(var e=0,t="";n.length>e;e++)switch(n[e]){case"&":t+="&";break;case"<":t+="<";break;case">":t+=">";break;default:t+=n[e]}return t}function Tn(n){n=Vn(n);for(var e=0,t="";n.length>e;e++)t+='"'===n[e]?""":n[e];return t}function jn(n,e,t){for(var l="",r=0;n.length>r;r++)l+=zn(n[r],e,t,r);return l}const Un=".innerHTML";function zn(n,e,t,l){var o,a;switch(n.type){case 4:o=W(n.view,n.data,n.key,n.opts).html(e,t,l);break;case 5:o=n.vm.html(e,t,l);break;case 1:case 0:if(null!=n.el&&null==n.tag){o=n.el.outerHTML;break}var u="";u+="<"+n.tag;var i=n.attrs,f=null!=i;if(f){for(var d in i)if(!(c(d)||s(d)||v(d)||!1===e&&m(0,d))){var y=i[d];"style"!==d||null==y?!0===y?u+=" "+Ln(d):!1===y||null!=y&&(u+=" "+Ln(d)+'="'+Tn(y)+'"'):a="object"==typeof y?An(y):y}null!=a&&(u+=' style="'+Tn(a.trim())+'"')}if(null==n.body&&null!=n.ns&&"svg"!==n.tag)return u+"/>";u+=">",Dn[n.tag]||(f&&null!=i[Un]?u+=i[Un]:r(n.body)?u+=jn(n.body,e,n):8==(8&n.flags)?(n.body.body(n),u+=jn(n.body,e,n)):u+=Ln(n.body),u+="</"+n.tag+">"),o=u;break;case 2:o=Ln(n.body);break;case 3:o="\x3c!--"+Ln(n.body)+"--\x3e"}return o}return Nn.attach=function(n){var e=this;return null==e.node&&e._redraw(null,null,!1),On(e.node,n),K(e,!1),e},Nn.html=function(n,e,t){var l=this;null==l.node&&l._redraw(e,t,!1);var r=zn(l.node,n,e,t);return Y.length=0,r},k.html=function(n,e,t){return zn(this,n,e,t)},n.FIXED_BODY=2,n.KEYED_LIST=4,n.VNode=g,n.ViewModel=wn,n.cfg=V,n.config=V,n.createView=W,n.defineComment=function(n){let e=new g;return e.type=3,e.body=n,e},n.defineElement=pn,n.defineElementSpread=In,n.defineSvgElement=function(n,e,t,l){var r=pn(n,e,t,l);return r.ns=Sn,r},n.defineSvgElementSpread=function(){var n=In.apply(null,arguments);return n.ns=Sn,n},n.defineText=w,n.defineView=function(n,e,t,l){return new Rn(n,e,t,l)},n.injectElement=function(n){let e=new g;return e.type=0,e.el=e.key=n,e},n.injectView=function(n,e){return new En(n,e)},n.list=function(n,e,t){return new C(n,e,t)},n}({});