diff --git a/dist/regular.js b/dist/regular.js index 0538cf5..d4ed743 100644 --- a/dist/regular.js +++ b/dist/regular.js @@ -880,7 +880,7 @@ return /******/ (function(modules) { // webpackBootstrap } return paramObj; } - _.eventReg = /^on-(\w[-\w]+)$/; + _.eventReg = /^on-(\w[-\w]*)$/; _.toText = function(obj){ return obj == null ? "": "" + obj; @@ -4906,12 +4906,16 @@ return /******/ (function(modules) { // webpackBootstrap value = self._touchExpr(value); // use bit operate to control scope if( !(isolate & 2) ) + // sync data from parent to child this.$watch(value, (function(name, val){ this.data[name] = val; }).bind(component, name), OPTIONS.SYNC) if( value.set && !(isolate & 1 ) ) - // sync the data. it force the component don't trigger attr.name's first dirty echeck - component.$watch(name, self.$update.bind(self, value), OPTIONS.INIT); + // sync data from child to parent. it force the component don't trigger attr.name's first dirty echeck + component.$watch(name, self.$update.bind(self, value), { + init: true, + last: this.data[ name ] + }); } } if(is && is.type === 'expression' ){ diff --git a/dist/regular.min.js b/dist/regular.min.js index a971a1b..c1ba902 100644 --- a/dist/regular.min.js +++ b/dist/regular.min.js @@ -3,7 +3,6 @@ @version 0.6.0 @homepage http://regularjs.github.io */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Regular=e():t.Regular=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r=n(1),i=n(8),o=t.exports=n(9),a=o.Parser,s=o.Lexer;n(29),n(32),n(33),o.dom=n(17),o.env=r,o.util=n(3),o.parse=function(t,e){e=e||{},(e.BEGIN||e.END)&&(e.BEGIN&&(i.BEGIN=e.BEGIN),e.END&&(i.END=e.END),s.setup());var n=new a(t).parse();return e.stringify?JSON.stringify(n):n},o.Cursor=n(25),o.isServer=r.node,o.isRegular=function(t){return t.prototype instanceof o}},function(t,e,n){(function(t){var r=n(3);e.svg=function(){return"undefined"!=typeof document&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}(),e.browser="undefined"!=typeof document&&document.nodeType,e.exprCache=r.cache(1e3),e.node="undefined"!=typeof t&&""+t=="[object process]",e.isRunning=!1}).call(e,n(2))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function o(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function a(){v&&p&&(v=!1,p.length?d=p.concat(d):m=-1,d.length&&s())}function s(){if(!v){var t=i(a);v=!0;for(var e=d.length;e;){for(p=d,d=[];++m1)for(var n=1;nn;n++)if(e(t[n]))return!0},o.varName="d",o.setName="p_",o.ctxName="c",o.extName="e",o.rWord=/^[\$\w]+$/,o.rSimpleAccessor=/^[\$\w]+(\.[\$\w]+)*$/,o.nextTick="function"==typeof r?r.bind(u):function(t){setTimeout(t,0)},o.prefix="'use strict';var "+o.varName+"="+o.ctxName+".data;"+o.extName+"="+o.extName+"||'';",o.slice=function(t,e,n){for(var r=[],i=e||0,o=n||t.length;o>i;i++)r.push(t[i]);return r},o.typeOf=function(t){return null==t?String(t):s.call(t).slice(8,-1).toLowerCase()},o.makePredicate=function(t,e){function n(t){if(1===t.length)return r+="return str === '"+t[0]+"';";r+="switch(str){";for(var e=0;e3){i.sort(function(t,e){return e.length-t.length}),r+="switch(str.length){";for(var o=0;or;r++){var o=(t[r]||"").length;if(n+o>e)return{num:r,line:t[r],start:e-n,prev:t[r-1],next:t[r+1]};n=n+o+1}}function e(t,e,i,s){var u=t.length,c=e-o;0>c&&(c=0);var f=e+a;f>u&&(f=u);var l=t.slice(c,f),h="["+(i+1)+"] "+(c>0?"..":""),p=u>f?"..":"",d=h+r(l)+p;return s&&(d+="\n"+n(r(t.slice(c,e)).length+h.length)+"^"),d}function n(t){return new Array(t+1).join(" ")}function r(t){return t.replace(/^\t+/,function(t){return t.split(" ").join(" ")})}var i=/\r\n|[\n\r\u2028\u2029]/g,o=50,a=20;return function(n,r){r>n.length-1&&(r=n.length-1),i.lastIndex=0;var o=n.split(i),a=t(o,r),s=a.start,u=a.num;return(a.prev?e(a.prev,s,u-1)+"\n":"")+e(a.line,s,u,!0)+"\n"+(a.next?e(a.next,s,u+1)+"\n":"")}}();var f=/\((\?\!|\?\:|\?\=)/g;o.findSubCapture=function(t){var e=0,n=0,r=t.length,i=t.match(f);for(i=i?i.length:0;r--;){var o=t.charAt(r);(0===r||"\\"!==t.charAt(r-1))&&("("===o&&e++,")"===o&&n++)}if(e!==n)throw"RegExp: "+t+"'s bracket is not marched";return e-i},o.escapeRegExp=function(t){return t.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,function(t){return"\\"+t})};var l=new RegExp("&(?:(#x[0-9a-fA-F]+)|(#[0-9]+)|("+o.keys(a).join("|")+"));","gi");o.convertEntity=function(t){return(""+t).replace(l,function(t,e,n,r){var i;return i=n?parseInt(n.slice(1),10):e?parseInt(e.slice(2),16):a[r],String.fromCharCode(i)})},o.createObject=Object.create?function(t){return Object.create(t||null)}:function(){function t(){}return function(e){if(!e)return{};t.prototype=e;var n=new t;return t.prototype=null,n}}(),o.createProto=function(t,e){function n(){this.constructor=t}return n.prototype=e,t.prototype=new n},o.removeOne=function(t,e){for(var n=t.length;n--;)if(e(t[n]))return void t.splice(n,1)},o.clone=function(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t)){for(var e=[],n=0,r=t.length;r>n;n++)e[n]=t[n];return e}var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},o.equals=function(t,e){var n=typeof t;return"number"===n&&"number"==typeof e&&isNaN(t)&&isNaN(e)?!0:t===e};var h=/-([a-z])/g;o.camelCase=function(t){return t.replace(h,function(t,e){return e.toUpperCase()})},o.throttle=function(t,e){var n,r,i,e=e||100,o=null,a=0,s=function(){a=+new Date,o=null,i=t.apply(n,r),n=r=null};return function(){var u=+new Date,c=e-(u-a);return n=this,r=arguments,0>=c||c>e?(clearTimeout(o),o=null,a=u,i=t.apply(n,r),n=r=null):o||(o=setTimeout(s,c)),i}},o.escape=function(){var t=/&/g,e=//g,r=/\'/g,i=/\"/g,o=/[&<>\"\']/;return function(a){return o.test(a)?a.replace(t,"&").replace(e,"<").replace(n,">").replace(r,"'").replace(i,"""):a}}(),o.cache=function(t){t=t||1e3;var e=[],n={};return{set:function(t,r){return e.length>this.max&&(n[e.shift()]=void 0),void 0===n[t]&&e.push(t),n[t]=r,r},get:function(t){return void 0===t?n:n[t]},max:t,len:function(){return e.length}}},o.handleEvent=function(t,e){var n,r=this;return"expression"===t.type&&(n=t.get),n?function(t){r.$update(function(){var e=this.data;e.$event=t;var i=n(r);i===!1&&t&&t.preventDefault&&t.preventDefault(),e.$event=void 0})}:function(){var e=o.slice(arguments);e.unshift(t),r.$update(function(){r.$emit.apply(r,e)})}},o.once=function(t){var e=0;return function(){0===e++&&t.apply(this,arguments)}},o.fixObjStr=function(t){return 0!==t.trim().indexOf("{")?"{"+t+"}":t},o.map=function(t,e){for(var n=[],r=0,i=t.length;i>r;r++)n.push(e(t[r],r));return n},o.log=i,o.normListener=function(t){var e=[],n=o.typeOf(t);if("array"===n)return t;if("object"===n)for(var r in t)t.hasOwnProperty(r)&&e.push({type:r,listener:t[r]});return e},o.isVoidTag=o.makePredicate("area base br col embed hr img input keygen link menuitem meta param source track wbr r-content"),o.isBooleanAttr=o.makePredicate("selected checked disabled readonly required open autofocus controls autoplay compact loop defer multiple"),o.isExpr=function(t){return t&&"expression"===t.type},o.isGroup=function(t){return t.inject||t.$inject},o.blankReg=/^\s*$/,o.getCompileFn=function(t,e,n){return function(r){return r&&n?o.extend(r,n):r=n,e.$compile(t,r)}},o.fixTagAST=function(t,e){if(!t.touched){var n=t.attrs;if(n){var r=n.length;if(r){for(var i=[],a={};r--;){var s=n[r];"type"===s.name&&(s.priority=c+1);var u=e.directive(s.name);u?(s.priority=u.priority||1,s.directive=!0,i.push(s)):"attribute"===s.type&&(a[s.name]=s.value)}i.forEach(function(t){var r=e.directive(t.name),i=r.param;i&&i.length&&(t.param={},i.forEach(function(e){e in a&&(t.param[e]=void 0===a[e]?!0:a[e],o.removeOne(n,function(t){return t.name===e}))}))}),n.sort(function(t,e){var n=t.priority,r=e.priority;return null==n&&(n=c),null==r&&(r=c),r-n}),t.touched=!0}}}},o.findItem=function(t,e){if(t&&t.length)for(var n=t.length;n--;)if(e(t[n]))return t[n]},o.getParamObj=function(t,e){var n={};if(e)for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];n[r]=i&&"expression"===i.type?t.$get(i):i}return n},o.eventReg=/^on-(\w[-\w]+)$/,o.toText=function(t){return null==t?"":""+t},o.escape=function(){function t(t){return String(void 0===t||null==t?"":t)}var e=/&/g,n=//g,i=/\'/g,o=/\"/g,a=/[&<>\"\']/;return function(s){return s=t(s),a.test(s)?s.replace(e,"&").replace(n,"<").replace(r,">").replace(i,"'").replace(o,"""):s}}(),o.simpleDiff=function(t,e){var n=t.length,r=e.length;if(n!==r)return!0;for(var i=0;n>i;i++)if(t[i]!==e[i])return!0;return!1}}).call(e,function(){return this}(),n(4).setImmediate)},function(t,e,n){(function(t){function r(t,e){this._id=t,this._clearFn=e}var i="undefined"!=typeof t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(5),e.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(e,function(){return this}())},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;nn;n++)if(this[n]===t)return n;return-1},forEach:function(t,e){var n=0,r=Object(this),i=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(;i>n;){var o;n in r&&(o=r[n],t.call(e,o,n,r)),n++}},filter:function(t,e){var n=Object(this),r=n.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=[],o=0;r>o;o++)if(o in n){var a=n[o];t.call(e,a,o,n)&&i.push(a)}return i}}),n(Function.prototype,{bind:function(t){var e=this,n=r.call(arguments,1);return function(){var i=n.concat(r.call(arguments));return e.apply(t,i)}},__bind__:function(t){return this.__binding__?this.__binding__:this.__binding__=this.bind.apply(this,arguments)}}),n(Array,{isArray:function(t){return"[object Array]"===i.call(t)}})}},function(t,e){var n={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,fnof:402,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,bull:8226,hellip:8230,prime:8242,Prime:8243,oline:8254,frasl:8260,weierp:8472,image:8465,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,circ:710,tilde:732,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,permil:8240,lsaquo:8249,rsaquo:8250,euro:8364};t.exports=n},function(t,e){t.exports={BEGIN:"{",END:"}",PRECOMPILE:!1}},function(t,e,n){function r(t){var e;return"string"==typeof t&&t.length<16&&(e=h.find(t))?(u.log("pass selector as template has be deprecated, pass node or template string instead","warn"),e):void 0}var i=n(1),o=n(10),a=n(12),s=n(8),u=n(3),c=n(14),f=n(15),l={};if(i.browser){var h=n(17),p=n(19),d=n(24),v=h.doc;l=n(22)}var m=n(26),g=n(27),y=n(16),E=n(28),x=n(18).ERROR,_=n(25),f=n(15),T=function(){},N=function(t,e){var n=i.isRunning;i.isRunning=!0;var o,a,s,c,p,d=this;e=e||{},t=t||{};var v=t.template;if(i.browser){if((o=r(v))&&(v=o),v&&v.nodeType&&(t.template=v.innerHTML),p=t.mountNode,"string"==typeof p&&(p=h.find(p),!p))throw Error("mountNode "+p+" is not found");p?(s=_(p.firstChild,p),delete t.mountNode):s=e.cursor}a=f.initDefinition(d,t),d.$parent&&d.$parent._append(d),d._children=[],d.$refs={},d.$root=d.$root||d;var m,g=e.extra,y=g&&g.$$modify;if(c=d._body){d._body=null;var E=d.modifyBodyComponent;"function"==typeof E?(E=E.bind(this),m=u.createObject(g),m.$$modify=function(t){return E(t,y?y:T)}):m=g,c.ast&&c.ast.length&&(d.$body=u.getCompileFn(c.ast,c.ctx,{outer:d,namespace:e.namespace,extra:m,record:!0}))}if(a){var x={namespace:e.namespace,cursor:s};x.extra={$$modify:g&&g.$$modify},d.group=d.$compile(a,x),l.node(d)}y&&y(this),d.$parent||d.$update(),d.$ready=!0,d.$emit("$init"),d.init&&d.init(d.data),d.$emit("$afterInit"),i.isRunning=n,this.devtools&&this.devtools.emit("init",this)};if("undefined"!=typeof window){var w=window.__REGULAR_DEVTOOLS_GLOBAL_HOOK__;w&&(N.prototype.devtools=w)}p&&(p.Regular=N),u.extend(N,{_directives:{__regexp__:[]},_plugins:{},_protoInheritCache:["directive","use"],__after__:function(t,e){var n;if(this.__after__=t.__after__,e.name&&N.component(e.name,this),n=e.template){var o,u;i.browser&&((o=r(n))&&(n=o),n&&n.nodeType&&((u=h.attr(n,"name"))&&N.component(u,this),n=n.innerHTML)),"string"==typeof n&&(this.prototype.template=s.PRECOMPILE?new a(n).parse():n)}e.computed&&(this.prototype.computed=f.handleComputed(e.computed)),N._inheritConfig(this,t)},directive:function(t,e){if(t){var n=typeof t;if("object"===n&&!e){for(var r in t)t.hasOwnProperty(r)&&this.directive(r,t[r]);return this}var i,o=this._directives;if(null!=e)return"function"==typeof e&&(e={link:e}),"string"===n?o[t]=e:(e.regexp=t,o.__regexp__.push(e)),"function"!=typeof e.link&&(e.link=T),this;if("string"===n){if(i=o[t])return i;for(var a=o.__regexp__,s=0,u=a.length;u>s;s++){i=a[s];var c=i.regexp.test(t);if(c)return i}}}},plugin:function(t,e){var n=this._plugins;return null==e?n[t]:(n[t]=e,this)},use:function(t){return"string"==typeof t&&(t=N.plugin(t)),"function"!=typeof t?this:(t(this,N),this)},config:function(t,e){var n=!1;if("object"==typeof t)for(var r in t)("END"===r||"BEGIN"===r)&&(n=!0),s[r]=t[r];n&&o.setup()},expression:y.expression,Parser:a,Lexer:o,_addProtoInheritCache:function(t,e){if(Array.isArray(t))return t.forEach(N._addProtoInheritCache);var n="_"+t+"s";N._protoInheritCache.push(t),N[n]={},N[t]||(N[t]=function(r,i){var o=this[n];if("object"==typeof r){for(var a in r)r.hasOwnProperty(a)&&this[t](a,r[a]);return this}return null==i?o[r]:(o[r]=e?e(i):i,this)})},_inheritConfig:function(t,e){var n=N._protoInheritCache,r=u.slice(n);return r.forEach(function(n){t[n]=e[n];var r="_"+n+"s";e[r]&&(t[r]=u.createObject(e[r]))}),t}}),c(N),N._addProtoInheritCache("component"),N._addProtoInheritCache("filter",function(t){return"function"==typeof t?{get:t}:t}),m.mixTo(N),g.mixTo(N),N.implement({init:function(){},config:function(){},destroy:function(){this.$emit("$destroy"),this._watchers=null,this._watchersForStable=null,this.group&&this.group.destroy(!0),this.group=null,this.parentNode=null,this._children=null,this.$root=null,this._handles=null,this.$refs=null;var t=this.$parent;if(t&&t._children){var e=t._children.indexOf(this);t._children.splice(e,1)}this.$parent=null,this.devtools&&this.devtools.emit("destroy",this),this._handles=null,this.$phase="destroyed"},$compile:function(t,e){e=e||{},"string"==typeof t&&(t=new a(t).parse());var n,r=this.__ext__,i=e.record;e.extra&&(this.__ext__=e.extra),i&&this._record();var o=this._walk(t,e);if(i){n=this._release();var s=this;n.length&&(o.ondestroy=function(){s.$unwatch(n)})}return e.extra&&(this.__ext__=r),o},$bind:function(t,e,n){var r=u.typeOf(e);if("expression"===e.type||"string"===r)this._bind(t,e,n);else if("array"===r)for(var i=0,o=e.length;o>i;i++)this._bind(t,e[i]);else if("object"===r)for(var i in e)e.hasOwnProperty(i)&&this._bind(t,i,e[i]);return t.$update(),this},$unbind:function(){},$inject:l.inject,$mute:function(t){t=!!t;var e=t===!1&&this._mute;return this._mute=!!t,e&&this.$update(),this},_bind:function(t,e,n){var r=this;if(!(t&&t instanceof N))throw"$bind() should pass Regular component as first argument";if(!e)throw"$bind() should pass as least one expression to bind";if(n||(n=e),e=y.expression(e),n=y.expression(n),n.set){var i=this.$watch(e,function(e){t.$update(n,e)});t.$on("$destroy",function(){r.$unwatch(i)})}if(e.set){var o=t.$watch(n,function(t){r.$update(e,t)});this.$on("$destroy",t.$unwatch.bind(t,o))}n.set(t,e.get(this))},_walk:function(t,e){if(Array.isArray(t)){for(var n=[],r=0,i=t.length;i>r;r++){var o=this._walk(t[r],e);o&&o.code===x.UNMATCHED_AST?(t.splice(r,1),r--,i--):n.push(o)}return new d(n)}return"string"==typeof t?v.createTextNode(t):p[t.type||"default"].call(this,t,e)},_append:function(t){this._children.push(t),t.$parent=this},_handleEvent:function(t,e,n,r){var i,o=this.constructor,a="function"!=typeof n?u.handleEvent.call(this,n,e):n,s=o.event(e);return s?i=s.call(this,t,a,r):h.on(t,e,a),s?i:function(){h.off(t,e,a)}},_touchExpr:function(t,e){var n,e=this.__ext__,r={};if("expression"!==t.type||t.touched)return t;if(n=t.get,n||(n=t.get=new Function(u.ctxName,u.extName,u.prefix+"return ("+t.body+")"),t.body=null),r.get=e?function(t,r){return n(t,r||e)}:n,t.setbody&&!t.set){var i=t.setbody,o=t.filters,a=this;o&&u.some(o,function(t){return!a._f_(t).set})||(t.set=function(e,n,r){return t.set=new Function(u.ctxName,u.setName,u.extName,u.prefix+i),t.set(e,n,r)}),t.filters=t.setbody=null}return t.set&&(r.set=e?function(n,r){return t.set(n,r,e)}:t.set),r.type="expression",r.touched=!0,r.once=t.once||t.constant,r},_f_:function(t){var e=this.constructor,n=e.filter(t);if(!n)throw Error("filter "+t+" is undefined");return n},_sg_:function(t,e,n,r){if(void 0===t)return void 0;if(r&&"object"==typeof r&&void 0!==r[t])return r[t];if(null===e)return void 0;if(e&&"undefined"!=typeof e[t])return e[t];if(null!==e){var i=this.computed,o=i[t];if(o){if("expression"!==o.type||o.get||this._touchExpr(o),o.get)return o.get(this);u.log("the computed '"+t+"' don't define the get function, get data."+t+" altnately","warn")}}return void 0===n?void 0:n[t]},_ss_:function(t,e,n,r,i){var o,i=this.computed,r=r||"=",a=i?i[t]:null;if("="!==r)switch(o=a?a.get(this):n[t],r){case"+=":e=o+e;break;case"-=":e=o-e;break;case"*=":e=o*e;break;case"/=":e=o/e;break;case"%=":e=o%e}return a&&a.set?a.set(this,e):(n[t]=e,e)}}),N.prototype.inject=function(){return u.log("use $inject instead of inject","warn"),this.$inject.apply(this,arguments)},N.filter(E),t.exports=N},function(t,e,n){function r(t){return function(e){return{type:t,value:e}}}function i(t,e){h[f.END]&&(this.markStart=h[f.END],this.markEnd=f.END),this.input=t||"",this.opts=e||{},this.syntaxSets=l(),this.state=l(),this.map=2!==this.opts.mode?s:u,this.syntaxSets.enter("INIT"),e&&e.expression&&(this.syntaxSets.enter("JST"),this.expression=!0)}function o(t){for(var e,n,r={},i=0,o=t.length;o>i;i++)e=t[i],n=e[2]||"INIT",(r[n]||(r[n]={rules:[],links:[]})).rules.push(e);return a(r)}function a(t){function e(t,e){return"string"==typeof p[e]?c.escapeRegExp(p[e]):String(p[e]).slice(1,-1)}var n,i,o,a,s,u,f;for(var l in t){n=t[l],n.curIndex=1,i=n.rules,o=[];for(var h=0,d=i.length;d>h;h++)f=i[h],s=f[0],a=f[1],"string"==typeof a&&(a=r(a)),"regexp"===c.typeOf(s)&&(s=s.toString().slice(1,-1)),s=s.replace(/\{(\w+)\}/g,e),u=c.findSubCapture(s)+1,n.links.push([n.curIndex,u,a]),n.curIndex+=u,o.push(s);n.TRUNK=new RegExp("^(?:("+o.join(")|(")+"))")}return t}var s,u,c=n(3),f=n(8),l=n(11),h={"}":"{","]":"["},p={NAME:/(?:[:_A-Za-z][-\.:_0-9A-Za-z]*)/,IDENT:/[\$_A-Za-z][_0-9A-Za-z\$]*/,SPACE:/[\r\n\t\f ]/},d=/a|(b)/.exec("a"),v=d&&void 0===d[1]?function(t){return void 0!==t}:function(t){return!!t},m=i.prototype;m.lex=function(t){t=t||this.input;var e=/^\s*/.exec(t);t=t.trim();var n,r,i,o,a,s=[];this.input=t,this.marks=0,this.index=e?e[0].length:0;for(var u=0;t;)u++,a=this.syntaxSets.get(),n=this.map[a],r=n.TRUNK.exec(t),r||this.error("Unrecoginized Token"),i=r[0].length,t=t.slice(i),o=this._process.call(this,r,n,t),o&&s.push(o),this.index+=i;return s.push({type:"EOF"}),s},m.error=function(t){throw Error("Parse Error: "+t+":\n"+c.trackErrorPos(this.input,this.index))},m._process=function(t,e,n){for(var r,i=e.links,o=!1,a=i.length,s=0;a>s;s++){var u=i[s],f=u[2],l=u[0];if(v(t[l])){o=!0,f&&(r=f.apply(this,c.slice(t,l,l+u[1])),r&&(r.pos=this.index));break}}if(!o)switch(n.charAt(0)){case"<":this.syntaxSets.enter("TAG");break;default:this.syntaxSets.enter("JST")}return r},i.setup=function(){p.END=f.END,p.BEGIN=f.BEGIN,s=o([g.BODY_END,g.ENTER_JST,g.ENTER_TAG,g.TEXT,g.TAG_NAME,g.TAG_OPEN,g.TAG_CLOSE,g.TAG_PUNCHOR,g.TAG_ENTER_JST,g.TAG_UNQ_VALUE,g.TAG_STRING,g.TAG_SPACE,g.TAG_COMMENT,g.JST_OPEN,g.JST_BODY_OPEN,g.JST_CLOSE,g.JST_EXPR_OPEN,g.JST_IDENT,g.JST_SPACE,g.JST_LEAVE,g.JST_NUMBER,g.JST_PUNCHOR,g.JST_STRING,g.JST_COMMENT]),u=o([g.BODY_END,g.ENTER_JST2,g.TEXT,g.JST_OPEN,g.JST_BODY_OPEN,g.JST_CLOSE,g.JST_EXPR_OPEN,g.JST_IDENT,g.JST_SPACE,g.JST_LEAVE,g.JST_NUMBER,g.JST_PUNCHOR,g.JST_STRING,g.JST_COMMENT])};var g={ENTER_JST:[/[^\x00<]*?(?={BEGIN})/,function(t){return this.syntaxSets.enter("JST"),t?{type:"TEXT",value:t}:void 0}],ENTER_JST2:[/[^\x00]*?(?={BEGIN})/,function(t){return this.syntaxSets.enter("JST"),t?{type:"TEXT",value:t}:void 0}],ENTER_TAG:[/[^\x00]*?(?=<[\w\/\!])/,function(t){return this.syntaxSets.enter("TAG"),t?{type:"TEXT",value:t}:void 0}],BODY_END:[/{SPACE}*{END}/,function(t){var e=this.syntaxSets.all(),n=e.length;return"JST"===e[n-2]?(this.syntaxSets.leave("INIT"),this.syntaxSets.leave("JST"),{type:"END"}):{type:"TEXT",value:t}}],TEXT:[/[^\x00]+/,"TEXT"],TAG_NAME:[/{NAME}/,"NAME","TAG"],TAG_UNQ_VALUE:[/[^\{}&"'=><`\r\n\f\t ]+/,"UNQ","TAG"],TAG_OPEN:[/<({NAME})\s*/,function(t,e){return{type:"TAG_OPEN",value:e}},"TAG"],TAG_CLOSE:[/<\/({NAME})[\r\n\f\t ]*>/,function(t,e){return this.syntaxSets.leave(),{type:"TAG_CLOSE",value:e}},"TAG"],TAG_ENTER_JST:[/(?={BEGIN})/,function(){this.syntaxSets.enter("JST")},"TAG"],TAG_PUNCHOR:[/[\>\/=&]/,function(t){return">"===t&&this.syntaxSets.leave(),{type:t,value:t}},"TAG"],TAG_STRING:[/'([^']*)'|"([^"]*)\"/,function(t,e,n){var r=e||n||"";return{type:"STRING",value:r}},"TAG"],TAG_SPACE:[/{SPACE}+/,null,"TAG"],TAG_COMMENT:[/<\!--([^\x00]*?)--\>/,function(t){this.syntaxSets.leave()},"TAG"],JST_OPEN:["{BEGIN}#{SPACE}*({IDENT})",function(t,e){return this.state.enter("JST_OPEN"),{type:"OPEN",value:e}},"JST"],JST_BODY_OPEN:["{BEGIN}~{SPACE}*",function(t,e){return this.syntaxSets.enter("INIT"),{type:"BODY_OPEN",value:e}},"JST"],JST_LEAVE:[/{END}/,function(t){return this.markEnd===t&&this.expression?{type:this.markEnd,value:this.markEnd}:this.markEnd&&this.marks?(this.marks--,{type:this.markEnd,value:this.markEnd}):(this.state.leave("JST_OPEN"),this.state.leave("JST_EXPR_OPEN"),this.syntaxSets.leave("JST"),{type:"END"})},"JST"],JST_CLOSE:[/{BEGIN}\s*\/({IDENT})\s*{END}/,function(t,e){return this.syntaxSets.leave("JST"),{type:"CLOSE",value:e}},"JST"],JST_COMMENT:[/{BEGIN}\!([^\x00]*?)\!{END}/,function(){this.syntaxSets.leave()},"JST"],JST_EXPR_OPEN:["{BEGIN}",function(t,e){if(t===this.markStart){if(this.expression)return{type:this.markStart,value:this.markStart};if(this.state.is("JST_OPEN")||this.state.is("JST_EXPR_OPEN")||this.marks)return this.marks++,{type:this.markStart,value:this.markStart};this.state.enter("JST_EXPR_OPEN")}return{type:"EXPR_OPEN",escape:!1}},"JST"],JST_IDENT:["{IDENT}","IDENT","JST"],JST_SPACE:[/[ \r\n\f]+/,null,"JST"],JST_PUNCHOR:[/[=!]?==|[-=><+*\/%\!]?\=|\|\||&&|\@\(|\.\.|[<\>\[\]\(\)\-\|\{}\+\*\/%?:\.!,]/,function(t){return{type:t,value:t}},"JST"],JST_STRING:[/'([^']*)'|"([^"]*)"/,function(t,e,n){return{type:"STRING",value:e||n||""}},"JST"],JST_NUMBER:[/(?:[0-9]*\.[0-9]+|[0-9]+)(e\d+)?/,function(t){return{type:"NUMBER",value:parseFloat(t,10)}},"JST"]};i.setup(),t.exports=i},function(t,e){function n(){return{_stack:[],enter:function(t){return this._stack.push(t),this},leave:function(t){var e=this._stack;return t&&e[e.length-1]!==t||e.pop(),this},get:function(){var t=this._stack;return t[t.length-1]},all:function(){return this._stack},is:function(t){var e=this._stack;return e[e.length-1]===t}}}t.exports=n},function(t,e,n){function r(t,e){e=e||{},this.input=t,this.tokens=new s(t,e).lex(),this.pos=0,this.length=this.tokens.length}function i(t,e){return{get:t,set:e}}var o=n(3),a=(n(8),n(13)),s=n(10),u=o.varName,c=o.ctxName,f=o.extName,l=o.makePredicate("STRING IDENT NUMBER"),h=o.makePredicate("true false undefined null this Array Date JSON Math NaN RegExp decodeURI decodeURIComponent encodeURI encodeURIComponent parseFloat parseInt Object"),p=o.makePredicate("script style"),d=/\.bind$/,v=r.prototype;v.parse=function(){this.pos=0;var t=this.program();return"TAG_CLOSE"===this.ll().type&&this.error("You may got a unclosed Tag"),t},v.ll=function(t){t=t||1,0>t&&(t+=1);var e=this.pos+t-1;return e>this.length-1?this.tokens[this.length-1]:this.tokens[e]},v.la=function(t){return(this.ll(t)||"").type},v.match=function(t,e){var n;return(n=this.eat(t,e))?n:(n=this.ll(),void this.error("expect ["+t+(null==e?"":":"+e)+']" -> got "['+n.type+(null==e?"":":"+n.value)+"]",n.pos))},v.error=function(t,e){throw t="\n【 parse failed 】 "+t+":\n\n"+o.trackErrorPos(this.input,"number"==typeof e?e:this.ll().pos||0),new Error(t)},v.next=function(t){t=t||1,this.pos+=t},v.eat=function(t,e){var n=this.ll();if("string"!=typeof t){for(var r=t.length;r--;)if(n.type===t[r])return this.next(),n}else if(n.type===t&&("undefined"==typeof e||n.value===e))return this.next(),n;return!1},v.program=function(t){for(var e=[],n=this.ll();"EOF"!==n.type&&"TAG_CLOSE"!==n.type;)if(e.push(this.statement()),n=this.ll(),t&&"END"===n.type)return this.next(),a.body(e);return e};var m=/\r\n/g;v.statement=function(){var t=this.ll();switch(t.type){case"NAME":case"TEXT":var e=t.value;for(this.next();t=this.eat(["NAME","TEXT"]);)e+=t.value;return a.text(e.replace(m,"\n"));case"TAG_OPEN":return this.xml();case"OPEN":return this.directive();case"EXPR_OPEN":return this.interplation();default:this.error("Unexpected token: "+this.la())}},v.xml=function(){var t,e,n,r;return t=this.match("TAG_OPEN").value,p(t)&&this.error("Invalid Tag: "+t),e=this.attrs(),r=this.eat("/"),this.match(">"),r||o.isVoidTag(t)||(n=this.program(),this.eat("TAG_CLOSE",t)||this.error("expect gotno matched closeTag")),a.element(t,e,n)},v.xentity=function(t){var e,n,r=t.value;if("NAME"===t.type){if(~r.indexOf(".")){var i=r.split(".");r=i[0],n=i[1]}return this.eat("=")&&(e=this.attvalue(n)),a.attribute(r,e,n)}return"if"!==r&&this.error("current version. ONLY RULE #if #else #elseif is valid in tag, the rule #"+r+" is invalid"),this["if"](!0)},v.attrs=function(t){var e;e=t?["NAME"]:["NAME","OPEN"];for(var n,r=[];n=this.eat(e);)r.push(this.xentity(n));return r},v.attvalue=function(t){var e=this.ll();switch(e.type){case"NAME":case"UNQ":case"STRING":this.next(); -var n=e.value;return n;case"EXPR_OPEN":return this.interplation();case"BODY_OPEN":return this.next(),this.program(!0);default:this.error("Unexpected token: "+this.la())}},v.directive=function(){var t=this.ll().value;return this.next(),"function"==typeof this[t]?this[t]():void this.error("Undefined directive["+t+"]")},v.interplation=function(){this.match("EXPR_OPEN");var t=this.expression(!0);return this.match("END"),t},v.inc=v.include=function(){var t=this.expression();return this.match("END"),a.template(t)},v["if"]=function(t){var e=this.expression(),n=[],r=[],i=n,o=t?"attrs":"statement";this.match("END");for(var s,u;!(u=this.eat("CLOSE"));)if(s=this.ll(),"OPEN"===s.type)switch(s.value){case"else":i=r,this.next(),this.match("END");break;case"elseif":return this.next(),r.push(this["if"](t)),a["if"](e,n,r);default:i.push(this[o](!0))}else i.push(this[o](!0));return"if"!==u.value&&this.error("Unmatched if directive"),a["if"](e,n,r)},v.list=function(){var t,e,n,r=this.expression(),i=[],o=[],s=i;for(this.match("IDENT","as"),t=this.match("IDENT").value,this.eat("IDENT","by")&&(this.eat("IDENT",t+"_key")&&this.error("can not track by "+t+"_key in list statement"),this.eat("IDENT",t+"_index")?n=!0:(n=this.expression(),n.constant&&(n=!0))),this.match("END");!(e=this.eat("CLOSE"));)this.eat("OPEN","else")?(s=o,this.match("END")):s.push(this.statement());return"list"!==e.value&&this.error("expect list got /"+e.value+" ",e.pos),a.list(r,t,i,o,n)},v.expression=function(){var t;return this.eat("@(")?(t=this.expr(),t.once=!0,this.match(")")):t=this.expr(),t},v.expr=function(){this.depend=[];var t=this.filter(),e=t.get||t,n=t.set;return a.expression(e,n,!this.depend.length,t.filters)},v.filter=function(){var t,e,n,r,a=this.assign(),s=this.eat("|"),u=[],f="t",l=a.set,h="";if(s){l&&(e=[],t=[]),n="(function("+f+"){";do{var p=this.match("IDENT").value;h=f+" = "+c+"._f_('"+p+"' ).get.call( "+o.ctxName+","+f,h+=this.eat(":")?", "+this.arguments("|").join(",")+");":");",u.push(h),l&&(t.push(p),e.unshift(h.replace(" ).get.call"," ).set.call")))}while(s=this.eat("|"));u.push("return "+f),e&&e.push("return "+f),r=n+u.join("")+"})("+a.get+")",e&&(l=l.replace(o.setName,n+e.join("")+"})("+o.setName+")"));var d=i(r,l);return d.filters=t,d}return a},v.assign=function(){var t,e=this.condition();return(t=this.eat(["=","+=","-=","*=","/=","%="]))?(e.set||this.error("invalid lefthand expression in assignment expression"),i(e.set.replace(","+o.setName,","+this.condition().get).replace("'='","'"+t.type+"'"),e.set)):e},v.condition=function(){var t=this.or();return this.eat("?")?i([t.get+"?",this.assign().get,this.match(":").type,this.assign().get].join("")):t},v.or=function(){var t=this.and();return this.eat("||")?i(t.get+"||"+this.or().get):t},v.and=function(){var t=this.equal();return this.eat("&&")?i(t.get+"&&"+this.and().get):t},v.equal=function(){var t,e=this.relation();return(t=this.eat(["==","!=","===","!=="]))?i(e.get+t.type+this.equal().get):e},v.relation=function(){var t,e=this.additive();return(t=this.eat(["<",">",">=","<="])||this.eat("IDENT","in"))?i(e.get+t.value+this.relation().get):e},v.additive=function(){var t,e=this.multive();return(t=this.eat(["+","-"]))?i(e.get+t.value+this.additive().get):e},v.multive=function(){var t,e=this.range();return(t=this.eat(["*","/","%"]))?i(e.get+t.type+this.multive().get):e},v.range=function(){var t,e,n=this.unary();if(t=this.eat("..")){e=this.unary();var r="(function(start,end){var res = [],step=end>start?1:-1; for(var i = start; end>start?i <= end: i>=end; i=i+step){res.push(i); } return res })("+n.get+","+e.get+")";return i(r)}return n},v.unary=function(){var t;return(t=this.eat(["+","-","~","!"]))?i("("+t.type+this.unary().get+")"):this.member()},v.member=function(t,e,n,r){var i,a,s=!1;if(t)"string"==typeof e&&l(e)?n.push(e):(n&&n.length&&this.depend.push(n),n=null);else{a=this.primary();var h=typeof a;"string"===h?(n=[],n.push(a),e=a,t=c+"._sg_('"+a+"', undefined, "+u+", "+f+")",s=!0):"this"===a.get?(t=c,n=["this"]):(n=null,t=a.get)}if(i=this.eat(["[",".","("]))switch(i.type){case".":var p=this.match("IDENT").value;return r=t,"("!==this.la()?t=c+"._sg_('"+p+"', "+t+" || null)":t+="."+p,this.member(t,p,n,r);case"[":return a=this.assign(),r=t,"("!==this.la()?t=c+"._sg_("+a.get+", "+t+" || null)":t+="["+a.get+"]",this.match("]"),this.member(t,a,n,r);case"(":t=t.replace(d,".__bind__");var v=this.arguments().join(",");return t=t+"("+v+")",this.match(")"),this.member(t,null,n)}n&&n.length&&this.depend.push(n);var m={get:t};return e&&(m.set=c+"._ss_("+(e.get?e.get:"'"+e+"'")+","+o.setName+","+(r?r:o.varName)+", '=', "+(s?1:0)+")"),m},v.arguments=function(t){t=t||")";var e=[];do this.la()!==t&&e.push(this.assign().get);while(this.eat(","));return e},v.primary=function(){var t=this.ll();switch(t.type){case"{":return this.object();case"[":return this.array();case"(":return this.paren();case"STRING":this.next();var e=""+t.value,n=~e.indexOf("'")?'"':"'";return i(n+e+n);case"NUMBER":return this.next(),i(""+t.value);case"IDENT":return this.next(),h(t.value)?i(t.value):t.value;default:this.error("Unexpected Token: "+t.type)}},v.object=function(){for(var t=[this.match("{").type],e=this.eat(["STRING","IDENT","NUMBER"]);e;){t.push("'"+e.value+"'"+this.match(":").type);var n=this.assign().get;t.push(n),e=null,this.eat(",")&&(e=this.eat(["STRING","IDENT","NUMBER"]))&&t.push(",")}return t.push(this.match("}").type),{get:t.join("")}},v.array=function(){var t,e=[this.match("[").type];if(this.eat("]"))e.push("]");else{for(;(t=this.assign())&&(e.push(t.get),this.eat(","));)e.push(",");e.push(this.match("]").type)}return{get:e.join("")}},v.paren=function(){this.match("(");var t=this.filter();return t.get="("+t.get+")",t.set=t.set,this.match(")"),t},t.exports=r},function(t,e){t.exports={element:function(t,e,n){return{type:"element",tag:t,attrs:e,children:n}},attribute:function(t,e,n){return{type:"attribute",name:t,value:e,mdf:n}},"if":function(t,e,n){return{type:"if",test:t,consequent:e,alternate:n}},list:function(t,e,n,r,i){return{type:"list",sequence:t,alternate:r,variable:e,body:n,track:i}},expression:function(t,e,n,r){return{type:"expression",body:t,constant:n||!1,setbody:e||!1,filters:r}},body:function(t){return{type:"body",body:t}},text:function(t){return{type:"text",text:t}},template:function(t){return{type:"template",content:t}}}},function(t,e,n){function r(t,e,n){return function(){var r=this.supr;this.supr=n[t];var i=e.apply(this,arguments);return this.supr=r,i}}function i(t,e,n){for(var i in e)e.hasOwnProperty(i)&&(u.hasOwnProperty(i)&&u[i](e[i],t,n),t[i]=s(e[i])&&s(n[i])&&a.test(e[i])?r(i,e[i],n):e[i])}var o=n(3),a=/xy/.test(function(){"xy"})?/\bsupr\b/:/.*/,s=function(t){return"function"==typeof t},u={events:function(t,e){var n=e._eventListeners||[],r=o.normListener(t);r.length&&(e._eventListeners=n.concat(r)),delete e.events}},c=["data","computed"],f=c.length;t.exports=function l(t){function e(){a.apply(this,arguments)}function n(t){for(var e=f;e--;){var n=c[e];r[n]&&t.hasOwnProperty(n)&&r.hasOwnProperty(n)&&(o.extend(r[n],t[n],!0),delete t[n])}return i(r,t,s),this}t=t||{};var r,a=this,s=a&&a.prototype||{};return"function"==typeof t?(r=t.prototype,t.implement=n,t.extend=l,t):(r=o.createProto(e,s),e.implement=n,e.implement(t),a.__after__&&a.__after__.call(e,a,t),e.extend=l,e)}},function(t,e,n){function r(t,e,n){var r,i=!!e.computed,a="string"==typeof t.template&&!e.template;e.data=e.data||{},e.computed=e.computed||{},t.data&&o.extend(e.data,t.data),t.computed&&o.extend(e.computed,t.computed);var u,f=t._eventListeners||[];e.events&&(u=o.normListener(e.events),u.length&&(f=f.concat(u)),delete e.events),e.data=e.data||{},e.computed=e.computed||{},t.data&&o.extend(e.data,t.data),t.computed&&o.extend(e.computed,t.computed);var a="string"==typeof t.template&&!e.template;return o.extend(t,e,!0),f&&f.length&&f.forEach(function(e){t.$on(e.type,e.listener)}),n&&n(),i&&(t.computed=c(t.computed)),t.$emit("$config",t.data),t.config&&t.config(t.data),t.$emit("$afterConfig",t.data),r=t.template,"string"==typeof r&&(r=s.parse(r),a?t.constructor.prototype.template=r:delete t.template),r}function i(t,e){if(t.parsed)return t;var n,r,i=t.value;t.name;if("string"==typeof i&&~i.indexOf(a.BEGIN)&&~i.indexOf(a.END)&&(!e||!e.nps)){var o=s.parse(i,{mode:2});1===o.length&&"expression"===o[0].type?n=o[0]:(r=!0,n=[],o.forEach(function(t){t.constant||(r=!1),n.push(t.body||"'"+t.text.replace(/'/g,"\\'")+"'")}),n=u.expression("["+n.join(",")+"].join('')",null,r)),t.value=n}return t.parsed=!0,t}var o=n(3),a=n(8),s=n(16),u=n(13),c=function(){function t(t){return function(e){return t.call(e,e.data)}}function e(t){return function(e,n){return t.call(e,n,e.data),n}}return function(n){if(n){var r,i,o,a={};for(var u in n)r=n[u],o=typeof r,"expression"!==r.type?"string"===o?a[u]=s.expression(r):(i=a[u]={type:"expression"},"function"===o?i.get=t(r):(r.get&&(i.get=t(r.get)),r.set&&(i.set=e(r.set)))):a[u]=r;return a}}}();t.exports={initDefinition:r,handleComputed:c,prepareAttr:i}},function(t,e,n){var r=n(1).exprCache,i=(n(3),n(12));t.exports={expression:function(t,e){return"string"==typeof t&&(t=t.trim())&&(t=r.get(t)||r.set(t,new i(t,{mode:2,expression:!0}).expression())),t?t:void 0},parse:function(t){return new i(t).parse()}}},function(t,e,n){function r(t,e){return"undefined"!=typeof t[e]?t[e]:t[e]=f.uid()}function i(t,e){return"change"===e&&u.msie<9&&t&&t.tagName&&"input"===t.tagName.toLowerCase()&&("checkbox"===t.type||"radio"===t.type)?"click":e}function o(t){if(t=t||window.event,t._fixed)return t;this.event=t,this.target=t.target||t.srcElement;var e=this.type=t.type,n=this.button=t.button;if(g.test(e)&&(this.pageX=null!=t.pageX?t.pageX:t.clientX+y.scrollLeft,this.pageY=null!=t.pageX?t.pageY:t.clientY+y.scrollTop,"mouseover"===e||"mouseout"===e)){for(var r=t.relatedTarget||t[("mouseover"===e?"from":"to")+"Element"];r&&3===r.nodeType;)r=r.parentNode;this.relatedTarget=r}("DOMMouseScroll"===e||"mousewheel"===e)&&(this.wheelDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3),this.which=t.which||t.keyCode,this.which||void 0===n||(this.which=1&n?1:2&n?3:4&n?2:0),this._fixed=!0}if("undefined"!=typeof window){var a,s,u=t.exports,c=n(1),f=n(3),l=n(18),h=document.createElement("div"),p=function(){},d=l.NAMESPACE;u.body=document.body,u.doc=document,u.tNode=h;var v=function(t){return(""+t).replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()})};h.addEventListener?(a=function(t,e,n){t.addEventListener(e,n,!1)},s=function(t,e,n){t.removeEventListener(e,n,!1)}):(a=function(t,e,n){t.attachEvent("on"+e,n)},s=function(t,e,n){t.detachEvent("on"+e,n)}),u.msie=parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1]),isNaN(u.msie)&&(u.msie=parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1])),u.find=function(t){if(document.querySelector)try{return document.querySelector(t)}catch(e){}return-1!==t.indexOf("#")?document.getElementById(t.slice(1)):void 0},u.inject=function(t,e,n){if(n=n||"bottom",t){if(Array.isArray(t)){var r=t;t=u.fragment();for(var i=0,o=r.length;o>i;i++)t.appendChild(r[i])}var a,s;switch(n){case"bottom":e.appendChild(t);break;case"top":(a=e.firstChild)?e.insertBefore(t,e.firstChild):e.appendChild(t);break;case"after":(s=e.nextSibling)?s.parentNode.insertBefore(t,s):e.parentNode.appendChild(t);break;case"before":e.parentNode.insertBefore(t,e)}}},u.id=function(t){return document.getElementById(t)},u.create=function(t,e){if("svg"===e){if(!c.svg)throw Error("the env need svg support");e=d.svg}return e?document.createElementNS(e,t):document.createElement(t)},u.fragment=function(){return document.createDocumentFragment()};var m={"class":function(t,e){"className"in t&&(!t.namespaceURI||t.namespaceURI===d.html)?t.className=e||"":t.setAttribute("class",e)},"for":function(t,e){"htmlFor"in t?t.htmlFor=e:t.setAttribute("for",e)},style:function(t,e){t.style?t.style.cssText=e:t.setAttribute("style",e)},value:function(t,e){t.value=null!=e?e:""}};u.attr=function(t,e,n){if(f.isBooleanAttr(e)){if("undefined"==typeof n)return t[e]||(t.attributes.getNamedItem(e)||p).specified?e:void 0;n?(t[e]=!0,t.setAttribute(e,e),u.msie&&u.msie<=7&&"checked"===e&&(t.defaultChecked=!0)):(t[e]=!1,t.removeAttribute(e))}else if("undefined"!=typeof n)m[e]?m[e](t,n):null===n?t.removeAttribute(e):t.setAttribute(e,n);else if(t.getAttribute){var r=t.getAttribute(e,2);return null===r?void 0:r}},u.on=function(t,e,n){var s=e.split(" "),c=function(e){var r=new o(e);r.origin=t,n.call(t,r)},f=r(t,"_nid");return n._events=n._events||{},s.forEach(function(e){e=i(t,e);var r=f+"-"+e;n._events[r]||(n._events[r]=c),a(t,e,n._events[r])}),u},u.off=function(t,e,n){var o=e.split(" "),a=r(t,"_nid");o.forEach(function(e){e=i(t,e);var r=a+"-"+e,o=n._events[r]||n;s(t,e,o)})},u.text=function(){var t={};return u.msie&&u.msie<9?(t[1]="innerText",t[3]="nodeValue"):t[1]=t[3]="textContent",function(e,n){var r=t[e.nodeType];return null==n?r?e[r]:"":void(e[r]=n)}}(),u.html=function(t,e){return"undefined"==typeof e?t.innerHTML:void(t.innerHTML=e)},u.replace=function(t,e){e.parentNode&&e.parentNode.replaceChild(t,e)},u.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)},u.css=function(t,e,n){if("object"==typeof e&&e)for(var r in e)e.hasOwnProperty(r)&&u.css(t,r,e[r]);else{if("undefined"==typeof n){var i;return u.msie<=8&&(i=t.currentStyle&&t.currentStyle[e],""===i&&(i="auto")),i=i||t.style[e],u.msie<=8&&(i=""===i?void 0:i),i}e=v(e),e&&(t.style[e]=n)}},u.addClass=function(t,e){var n=t.className||"";-1===(" "+n+" ").indexOf(" "+e+" ")&&(t.className=n?n+" "+e:e)},u.delClass=function(t,e){var n=t.className||"";t.className=(" "+n+" ").replace(" "+e+" "," ").trim()},u.hasClass=function(t,e){var n=t.className||"";return-1!==(" "+n+" ").indexOf(" "+e+" ")};var g=/^(?:click|dblclick|contextmenu|DOMMouseScroll|mouse(?:\w+))$/,y=document;y=y.compatMode&&"CSS1Compat"!==y.compatMode?y.body:y.documentElement,f.extend(o.prototype,{stop:function(){this.preventDefault().stopPropagation()},preventDefault:function(){return this.event.preventDefault?this.event.preventDefault():this.event.returnValue=!1,this},stopPropagation:function(){return this.event.stopPropagation?this.event.stopPropagation():this.event.cancelBubble=!0,this},stopImmediatePropagation:function(){this.event.stopImmediatePropagation&&this.event.stopImmediatePropagation()}}),u.nextFrame=function(){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return setTimeout(t,16)},e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||function(t){clearTimeout(t)};return function(n){var r=t(n);return function(){e(r)}}}();var E;u.nextReflow=u.msie?function(t){return u.nextFrame(function(){E=document.body.offsetWidth,t()})}:u.nextFrame}},function(t,e){t.exports={COMPONENT_TYPE:1,ELEMENT_TYPE:2,ERROR:{UNMATCHED_AST:101},MSG:{101:"Unmatched ast and mountNode, report issue at https://github.com/regularjs/regular/issues"},NAMESPACE:{html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"},OPTIONS:{STABLE_INIT:{stable:!0,init:!0},FORCE_INIT:{force:!0,init:!0},STABLE:{stable:!0},INIT:{init:!0},SYNC:{sync:!0},FORCE:{force:!0}},DIFF:{REMOVE_ALL:1,ADD_ALL:0}}},function(t,e,n){function r(t,e){return"array"===e?t:"object"===e?h.keys(t):[]}function i(t,e,n){for(var r=[],i=0,o=t.length;o>i;i++){var a=this._walk(t[i],{element:e,fromElement:!0,attrs:t,extra:n});a&&r.push(a)}return r}function o(t,e){e&&(e.node?l.inject(t,e.node,"before"):e.prev?(l.inject(t,e.prev,"after"),e.prev=t):e.parent&&(l.inject(t,e.parent),e.prev=t))}function a(t){for(var e=t.length;e--;){var n=t[e];if("r-html"===n.name)return!0}}var s=n(20).diffArray,u=n(22),c=n(23),f=(n(12),n(13),n(24)),l=n(17),h=n(3),p=n(18),d=p.OPTIONS,v=p.ERROR,m=p.MSG,g=n(25),y=(n(8),n(15)),E=(n(18).DIFF,t.exports={});E.list=function(t,e){function n(t,e,n,r){for(var i=1;e>=i;i++){var o=n[t+i];if(r){var a=y(o.data[O]);if("undefined"!=typeof r[a]){null!==r[a]&&o.inject(!1);continue}}o.destroy(!0)}n.splice(t+1,e)}function i(n,r,i,o,s){for(var f=n;r>f;f++){var p=i[f],d=null;if(s){var v=y(p);d=s[v],d&&(s[v]=null)}var m=!!d;if(m)a(d.data,f,p);else{var g=h.createObject(N);a(g,f,p,o),d=w.$compile(t.body,{extra:g,namespace:T,record:!0,outer:e.outer,cursor:C}),d.data=g}var E=u.last(b.get(f));!E.parentNode||C&&C.node||(m?l:c).inject(u.node(d),E,"after"),S.splice(f+1,0,d)}}function a(t,e,n,r){t[$]=e,r?(t[A]=n,t[O]=r[n]):(t[O]=n,t[A]=null)}function p(t,e,n,r){for(var i=t;e>i;i++){var o=b.get(i+1),s=n[i];a(o.data,i,s,r)}}function d(t,e,r,o){var a=0,u=t.length;if(r||0===u&&0===e.length||(r=s(t,e,!0)),r&&r.length){for(var c=0;ca?0:a}if(u>a)for(var c=a;u>c;c++){var m=b.get(c+1);m.data[$]=c}}}function v(t,e,r){var o=t.length,a=e.length,s=Math.min(o,a);p(0,s,t,r),a>o?n(o,a-o,S):o>a&&i(a,o,t,r)}function m(t,e,r,o,a){for(var s=0,u=r.length;u>s;s++){var c=r[s];switch(c.mode){case 0:n(c.index,c.len,b.children,a);break;case 1:i(c.index,c.index+c.len,t,o,a)}}for(var f=b.children,l=1,h=f.length;h>l;l++){var p=f[l];p&&(p.data[O]=t[l-1],p.data[$]=l-1)}}function g(t,o,a,s,f){var l,p=h.typeOf(t),g=h.typeOf(o),y=r(t,p),E=r(o,g),x=y&&y.length,$=E&&E.length;if("object"===p&&(l=t),!$&&x){if(b.get(1)){var A=S.pop();A.destroy&&A.destroy(!0)}return i(0,x,y,l)}if(x)if(k)if(k===!0||f&&!a.length)v(y,E,l);else{if(s)for(var O in s){var C=s[O];S[C+1]&&(s[O]=S[C+1])}m(y,E,a,l,s)}else d(y,E,a,l);else if($&&n(0,$,b.children),I&&I.length){var P=w.$compile(I,{extra:N,record:!0,outer:e.outer,namespace:T});S.push(P),_.parentNode&&c.inject(u.node(P),_,"after")}}var y,x,_=(E.Regular,document.createComment("Regular list")),T=e.namespace,N=e.extra,w=this,b=new f([_]),S=b.children,$=t.variable+"_index",A=t.variable+"_key",O=t.variable,I=t.alternate,k=t.track,C=e.cursor;return o(_,C),k&&k!==!0&&(k=this._touchExpr(k),x=h.createObject(N),y=function(t,e){return x[O]=t,k.get(w,x)}),this.$watch(t.sequence,g,{init:!0,keyOf:y,diff:k!==!0,deep:!0}),C=null,b},E.template=function(t,e){var n,n,r=t.content,i=document.createComment("inlcude"),a=e.namespace,s=e.extra,u=new f([i]),c=e.cursor;if(o(i,c),r){var l=this;this.$watch(r,function(t){var r=u.get(1),o=typeof t;r&&(r.destroy(!0),u.children.pop()),t&&(u.push(n="function"===o?t(c?{cursor:c}:null):l.$compile("object"!==o?String(t):t,{record:!0,outer:e.outer,namespace:a,cursor:c,extra:s})),i.parentNode&&!c&&n.$inject(i,"before"))},d.INIT),c=null}return u};var x=0;E["if"]=function(t,e){var n,r,i=this,a=e.extra;if(e&&e.element){var s=function(o){o?(r&&u.destroy(r),t.consequent&&(n=i.$compile(t.consequent,{record:!0,element:e.element,extra:a}))):(n&&u.destroy(n),t.alternate&&(r=i.$compile(t.alternate,{record:!0,element:e.element,extra:a})))};return this.$watch(t.test,s,d.FORCE),{destroy:function(){n?u.destroy(n):r&&u.destroy(r)}}}var l=document.createComment("Regular if"+x++),h=new f;h.push(l);var p=null,v=e.namespace,m=e.cursor;o(l,m);var s=function(n,r){var o,s=!!n;if(s!==p){p=s,h.children[1]&&(h.children[1].destroy(!0),h.children.pop());var f={record:!0,outer:e.outer,namespace:v,extra:a,cursor:m};s?t.consequent&&t.consequent.length&&(o=i.$compile(t.consequent,f)):t.alternate&&t.alternate.length&&(o=i.$compile(t.alternate,f)),o&&(h.push(o),l.parentNode&&!m&&c.inject(u.node(o),l,"before")),m=null}};return this.$watch(t.test,s,d.FORCE_INIT),h},E._handleMountText=function(t,e){var n,r=t.node,i=l.text(r);if(i===e)n=r,t.next();else{var o=i.indexOf(e);if(!~o)throw Error(m[v.UNMATCHED_AST]);n=document.createTextNode(e),l.text(r,i.slice(o+e.length)),l.inject(n,r,"before")}return n},E.expression=function(t,e){var n,r=e.cursor,i=r&&r.node;if(i){var o=h.toText(this.$get(t));n=E._handleMountText(r,o)}else n=document.createTextNode("");return this.$watch(t,function(t){l.text(n,h.toText(t))},d.STABLE_INIT),n},E.text=function(t,e){var n,r=e.cursor,i=t.text,o=-1!==i.indexOf("&")?h.convertEntity(i):i;if(r&&r.node){var a=r.node;if(3!==a.nodeType){if(h.blankReg.test(o))return{code:v.UNMATCHED_AST}}else n=E._handleMountText(r,o)}return n||document.createTextNode(o)},E.element=function(t,e){var n,r,o,s=t.attrs,f=this.constructor,p=t.children,d=e.namespace,y=e.extra,x=e.cursor,_=t.tag,T=f.component(_);if("r-content"===_)return h.log("r-content is deprecated, use {#inc this.$body} instead (`{#include}` as same)","warn"),this.$body&&this.$body(x?{cursor:x}:null);if(x&&x.node&&3===x.node.nodeType)if(h.blankReg.test(l.text(x.node)))x.next();else if(!T&&"r-component"!==_)throw Error(m[v.UNMATCHED_AST]);if(T||"r-component"===_)return e.Component=T,E.component.call(this,t,e);if(x&&(o=x.node),"svg"===_&&(d="svg"),p&&p.length&&!a(s)){var N=o?o.firstChild:null;n=this.$compile(p,{extra:y,outer:e.outer,namespace:d,cursor:g(N,o)})}o?(r=o,x.next()):r=l.create(_,d,s),!n||h.isVoidTag(_)||o||c.inject(u.node(n),r),h.fixTagAST(t,f);var w=i.call(this,s,r,y);return{type:"element",group:n,node:function(){return r},last:function(){return r},destroy:function(t){t?c.remove(r,n?n.destroy.bind(n):h.noop):n&&n.destroy(),w.length&&w.forEach(function(t){t&&("function"==typeof t.destroy?t.destroy():t())})}}},E.component=function(t,e){for(var n,r,i,o,a=t.attrs,s=e.Component,c=e.cursor,l=this.constructor,p=e.extra,v=e.namespace,m=E.Regular.directive("ref"),g=this,x={},_=0,T=a.length;T>_;_++){var N=a[_];y.prepareAttr(N,"ref"===N.name&&m);var w=this._touchExpr(void 0===N.value?!0:N.value);w.constant&&(w=N.value=w.get(this)),N.value&&N.value.constant===!0&&(w=w.get(this));var b=N.name;if(!N.event){var S=b.match(h.eventReg);S&&(N.event=S[1])}if("cmpl"===N.mdf&&(w=h.getCompileFn(w,this,{record:!0,namespace:v,extra:p,outer:e.outer})),w&&"body"===w.type&&(w=h.getCompileFn(w.body,this,{record:!0,namespace:v,extra:p,outer:e.outer})),"is"===b&&!s){i=w;var $=this.$get(w,!0);if(s=l.component($),"function"!=typeof s)throw new Error("component "+$+" has not registed!")}var A;(A=N.event)?(o=o||{},o[A]=h.handleEvent.call(this,w,A)):(b=N.name=h.camelCase(b),w&&"expression"===w.type?x[b]=w.get(g):x[b]=w,"ref"===b&&null!=w&&(r=w),"isolate"===b&&(n="expression"===w.type?w.get(g):parseInt(w===!0?3:w,10),x.isolate=n))}var O,I={data:x,events:o,$parent:2&n?null:this,$root:this.$root,$outer:e.outer,_body:{ctx:this,ast:t.children}},e={namespace:v,cursor:c,extra:e.extra},k=new s(I,e);if(r&&this.$refs){O=m.link;var C=O.call(this,k,r);k.$on("$destroy",C)}for(var _=0,T=a.length;T>_;_++){var N=a[_],w=N.value||!0,b=N.name;"expression"!==w.type||N.event||(w=g._touchExpr(w),2&n||this.$watch(w,function(t,e){this.data[t]=e}.bind(k,b),d.SYNC),!w.set||1&n||k.$watch(b,g.$update.bind(g,w),d.INIT))}if(i&&"expression"===i.type){var P=new f;return P.push(k),this.$watch(i,function(t){var e=l.component(t);if(!e)throw new Error("component "+t+" has not registed!");var n=new e(I),i=P.children.pop();if(P.push(n),n.$inject(u.last(i),"after"),i.destroy(),r){var o=r.get?r.get(this):r;g.$refs[o]=n}},d.SYNC),P}return k},E.attribute=function(t,e){var n=t,r=this.constructor,i=n.name,o=r.directive(i);y.prepareAttr(t,o);var a=n.value||"",s=a.constant,u=e.element,c=this;if(a=this._touchExpr(a),s&&(a=a.get(this)),o&&o.link){var f={attrs:e.attrs,param:h.getParamObj(this,n.param)},p=o.link.call(c,u,a,i,f);return"function"==typeof o.update&&(h.isExpr(a)?this.$watch(a,function(t,e){o.update.call(c,u,t,e,f)}):o.update.call(c,u,a,void 0,f)),"function"==typeof p&&(p={destroy:p}),p}return"expression"===a.type?this.$watch(a,function(t,e){l.attr(u,i,t)},d.STABLE_INIT):h.isBooleanAttr(i)?l.attr(u,i,!0):l.attr(u,i,a),e.fromElement?void 0:{destroy:function(){l.attr(u,i,null)}}}},function(t,e,n){function r(t,e){return t===e}function i(t,e,n){for(var i=t.length,o=e.length,n=n||r,a=[],s=0;i>=s;s++)a.push([s]);for(var u=1;o>=u;u++)a[0][u]=u;for(var s=1;i>=s;s++)for(var u=1;o>=u;u++)n(t[s-1],e[u-1])?a[s][u]=a[s-1][u-1]:a[s][u]=Math.min(a[s-1][u]+1,a[s][u-1]+1);return a}function o(t,e,n,r){if(!n)return s.simpleDiff(t,e);for(var o=i(e,t,r),a=e.length,u=a,c=t.length,f=c,l=[],h=o[u][f];u>0||f>0;)if(0!==u)if(0!==f){var p=o[u-1][f-1],d=o[u-1][f],v=o[u][f-1],m=Math.min(v,d,p);m===d?(l.unshift(2),u--,h=d):m===p?(p===h?l.unshift(0):(l.unshift(1),h=p),u--,f--):(l.unshift(3),f--,h=v)}else l.unshift(2),u--;else l.unshift(3),f--;var g=0,y=3,E=2,x=1,a=0;c=0;for(var _=[],T={index:null,add:0,removed:[]},u=0;u0?null===T.index&&(T.index=c):null!=T.index&&(_.push(T),T={index:null,add:0,removed:[]}),l[u]){case g:a++,c++;break;case y:T.add++,c++;break;case E:T.removed.push(e[a]),a++;break;case x:T.add++,T.removed.push(e[a]),a++,c++}return null!=T.index&&_.push(T),_}function a(t,e,n,r,i){if(n){var a=s.values(t),c=s.values(e);return"function"==typeof r?u(a,c,r,i):o(a,c,n)}for(var f in t)if(e[f]!==t[f])return!0;for(var l in e)if(e[l]!==t[l])return!0;return!1}var s=n(3),u=n(21);t.exports={diffArray:o,diffObject:a,diffTrack:u}},function(t,e,n){function r(t,e,n){var r=e.length,c=t.length,f=[],l={isTrack:!0,steps:f};if(!u.simpleDiff(t,e))return l;if(l.dirty=!0,r&&!c)return i(f,0,0,r),l;if(c&&!r)return i(f,1,0,c),l;var h=u.slice(e),p=s(t,n),d=s(e,n),v=p.trackMap,m=d.trackMap,g={},y=d.untrack,E=y.length;if(E)for(;E--;){y[E];a(h,f,y[E])}for(var x=h.length,_=0;x>_;_++){var T=h[_],N=n(T);v.hasOwnProperty(N)||(g[N]=m[N],a(h,f,_),_--,x--)}for(var w=t.length,_=0,b=0;w>b;)if(_>=h.length)o(h,f,_,1),_++,b++;else{var N=n(h[_]),S=t[b],$=n(S);$!==N?(o(h,f,_,1),_++,b++):(_++,b++)}var A=h.length;if(A>b){i(f,0,b,A-b);for(var O=b;A>O;O++){var N=n(h[O]);g[N]=m[N]}}return l.oldKeyMap=g,l}function i(t,e,n,r,i){r=r||1;var o=t[t.length-1];return o&&o.mode===e&&(0===e&&o.index===n||1===e&&o.index+o.len===n)?(o.len++,t):(t.push({mode:e,index:n,len:r}),t)}function o(t,e,n,r){i(e,1,n,r,e),t.splice(n,0,null)}function a(t,e,n,r){i(e,0,n,r),t.splice(n,1)}function s(t,e){for(var n=[],r={},i=0,o=t.length;o>i;i++){var a=(t[i],e(t[i]));r.hasOwnProperty(a)?n.push(i):r[a]=i}return{untrack:n,trackMap:r}}var u=n(3),c=n(18).DIFF;c.ADD_ALL,c.REMOVE_ALL;t.exports=r},function(t,e,n){var r=n(17),i=n(23),o=t.exports={node:function(t){var e,n;if(t){if("function"==typeof t.node)return t.node();if("number"==typeof t.nodeType)return t;if(t.group)return o.node(t.group);if(t=t.children||t,Array.isArray(t)){var r=t.length;if(1===r)return o.node(t[0]);n=[];for(var i=0,r=t.length;r>i;i++)if(e=o.node(t[i]),Array.isArray(e))for(var a=0,s=e.length;s>a;a++)n.push(e[a]);else e&&n.push(e);return n}}},inject:function(t,e){var n=this,a=o.node(n.group||n);if(t===!1)return i.remove(a),n;if(!a)return n;if("string"==typeof t&&(t=r.find(t)),!t)throw Error("injected node is not found");if(i.inject(a,t,e),n.$emit){var s=n.parentNode,u="after"===e||"before"===e?t.parentNode:t;n.parentNode=u,n.$emit("$inject",t,e,s)}return n},last:function(t){var e=t.children;return"function"==typeof t.last?t.last():"number"==typeof t.nodeType?t:e&&e.length?o.last(e[e.length-1]):t.group?o.last(t.group):void 0},destroy:function(t,e){if(t){if("number"==typeof t.nodeType)return e&&r.remove(t);if("function"==typeof t.destroy)return t.destroy(e);if(Array.isArray(t))for(var n=0,i=t.length;i>n;n++)o.destroy(t[n],e)}}};r.element=function(t,e){if(!t)return e?[]:null;var n=o.node(t);if(1===n.nodeType)return e?[n]:n;for(var r=[],i=0;in&&(n=e)}),n):0}var a=n(3),s=n(17),u={},c=n(1);if("undefined"!=typeof window){var f="transitionend",l="animationend",h="transition",p="animation";"ontransitionend"in window||("onwebkittransitionend"in window?(f+=" webkitTransitionEnd",h="webkitTransition"):("onotransitionend"in s.tNode||"Opera"===navigator.appName)&&(f+=" oTransitionEnd",h="oTransition")),"onanimationend"in window||("onwebkitanimationend"in window?(l+=" webkitAnimationEnd",p="webkitAnimation"):"onoanimationend"in s.tNode&&(l+=" oAnimationEnd",p="oAnimation"))}u.inject=function(t,e,n,r){if(r=r||a.noop,Array.isArray(t)){for(var i=s.fragment(),o=0,u=0,c=t.length;c>u;u++)i.appendChild(t[u]);s.inject(i,e,n);var f=function(){o++,o===c&&r()};for(c===o&&r(),u=0;c>u;u++)t[u].onenter?t[u].onenter(f):f()}else{if(!t)return;s.inject(t,e,n),t.onenter?t.onenter(r):r()}},u.remove=function(t,e){function n(){i++,i===a&&e&&e()}if(t){var i=0;if(Array.isArray(t))for(var o=0,a=t.length;a>o;o++)u.remove(t[o],n);else"function"==typeof t.onleave?t.onleave(function(){r(t,e)}):r(t,e)}},u.startClassAnimate=function(t,e,n,r){var o,u,h,p;return!l&&!f||c.isRunning?n():(p=4!==r?a.once(function(){h&&clearTimeout(h),2===r&&s.delClass(t,o),3!==r&&s.delClass(t,e),s.off(t,l,p),s.off(t,f,p),n()}):a.once(function(){h&&clearTimeout(h),n()}),2===r?(s.addClass(t,e),o=a.map(e.split(/\s+/),function(t){return t+"-active"}).join(" "),s.nextReflow(function(){s.addClass(t,o),u=i(t),h=setTimeout(p,u)})):4===r?s.nextReflow(function(){s.delClass(t,e),u=i(t),h=setTimeout(p,u)}):s.nextReflow(function(){s.addClass(t,e),u=i(t),h=setTimeout(p,u)}),s.on(t,l,p),s.on(t,f,p),p)},u.startStyleAnimate=function(t,e,n){var r,o,u;return s.nextReflow(function(){s.css(t,e),r=i(t),u=setTimeout(o,r)}),o=a.once(function(){u&&clearTimeout(u),s.off(t,l,o),s.off(t,f,o),n()}),s.on(t,l,o),s.on(t,f,o),o},t.exports=u},function(t,e,n){function r(t){this.children=t||[]}var i=n(3),o=n(22),a=i.extend(r.prototype,{destroy:function(t){o.destroy(this.children,t),this.ondestroy&&this.ondestroy(),this.children=null},get:function(t){return this.children[t]},push:function(t){this.children.push(t)}});a.inject=a.$inject=o.inject,t.exports=r},function(t,e){function n(t,e){this.node=t,this.parent=e}var r=n.prototype;r.next=function(){return this.prev=this.node,this.node=this.node.nextSibling,this},t.exports=function(t,e){return new n(t,e)}},function(t,e,n){function r(t){return a[t]||t}function i(){}var o=n(3),a={destroy:"$destroy",update:"$update",init:"$init",config:"$config"},s={$on:function(t,e,n){if("object"==typeof t&&t)for(var i in t)this.$on(i,t[i],e);else{n=n||{};var o=this;t=r(t);var a,s=o._handles||(o._handles={}),u=s[t]||(s[t]=[]);n.once&&(a=function(){e.apply(this,arguments),this.$off(t,e)},e.real=a),u.push(a||e)}return this},$off:function(t,e){var n=this;if(n._handles){t||(this._handles={});var i,o=n._handles;if(t=r(t),i=o[t]){if(!e)return o[t]=[],n;e=e.real||e;for(var a=0,s=i.length;s>a;a++)if(e===i[a])return i.splice(a,1),n}return n}},$emit:function(t){var e,n,i,a=this,s=a._handles;if(t){var n=o.slice(arguments,1),i=r(t);if(!s)return a;if(!(e=s[i]))return a;e.length>1&&(e=e.slice());for(var u=0,c=e.length;c>u;u++)"function"==typeof e[u]&&e[u].apply(a,n);return a}},$once:function(t,e){var n=o.slice(arguments);return n.push({once:!0}),this.$on.apply(this,n)}};o.extend(i.prototype,s),i.mixTo=function(t){t="function"==typeof t?t.prototype:t,o.extend(t,s)},t.exports=i},function(t,e,n){function r(){}var i=n(3),o=n(16).expression,a=n(20),s=n(21),u=a.diffArray,c=a.diffObject,f={$watch:function(t,e,n){var r,o,a,s,u=!1,c=this.__ext__;this._watchers||(this._watchers=[]),this._watchersForStable||(this._watchersForStable=[]),n=n||{},n===!0&&(n={deep:!0});var f=i.uid("w_");if(Array.isArray(t)){for(var l=[],h=0,p=t.length;p>h;h++)l.push(this.$expression(t[h]).get);var d=[];a=function(t){for(var e=!0,n=0,r=l.length;r>n;n++){var o=l[n](t,c);i.equals(o,d[n])||(e=!1,d[n]=o)}return e?!1:d}}else"function"==typeof t?r=t.bind(this):(t=this.$expression(t),i.isExpr(t)?(r=t.get,o=t.once):(r=function(){return t},o=!0,u=!0));var v={id:f,get:r,fn:e,once:o,force:n.force,diff:n.diff,keyOf:n.keyOf,test:a,deep:n.deep,last:n.sync?r(this):n.last};if(this[n.stable||u?"_watchersForStable":"_watchers"].push(v), -s=this._records&&this._records.length,s&&this._records[s-1].push(v),n.init===!0){var m=this.$phase;this.$phase="digest",this._checkSingleWatch(v),this.$phase=m}return v},$unwatch:function(t){if(this._watchers&&t){var e=this._watchers,n=typeof t;if("object"===n){var r=t.length;if(r)for(;r-->=0;)this.$unwatch(t[r]);else t.removed=!0}else if("number"===n){var o=t;return t=i.findItem(e,function(t){return t.id===o}),t||(t=i.findItem(this._watchersForStable,function(t){return t.id===o})),this.$unwatch(t)}return this}},$expression:function(t){return this._touchExpr(o(t))},$digest:function(){if("digest"!==this.$phase&&!this._mute){this.$phase="digest";for(var t=!1,e=0;t=this._digest();)if(++e>20)throw Error("there may a circular dependencies reaches");var n=this._digest(!0);(e>0||n)&&this.$emit&&(this.$emit("$update"),this.devtools&&this.devtools.emit("flush",this)),this.$phase=null}},_digest:function(t){if(!this._mute){var e,n,r,i=t?this._watchersForStable:this._watchers,o=!1,a=i&&i.length;if(a)for(var s=0,u=0,c=0;a>c;c++){n=i[c];var f=!n||n.removed;f?u+=1:(r=this._checkSingleWatch(n),r&&(o=!0)),f&&c!==a-1||(u&&(i.splice(s,u),a-=u,c-=u,u=0),s=c+1)}if(e=this._children,e&&e.length)for(var l=0,h=e.length;h>l;l++){var p=e[l];p&&p._digest(t)&&(o=!0)}return o}},_checkSingleWatch:function(t){var e=!1;if(t){var n,r,o,a,f,l,h,p;if(t.test){var d=t.test(this);d&&(e=!0,t.fn.apply(this,d))}else n=t.get(this),r=t.last,h=t.keyOf,(n!==r||t.force)&&(o=i.typeOf(r),a=i.typeOf(n),f=!0,"object"===a&&"object"===o&&t.deep?(l=c(n,r,t.diff,h),l.isTrack&&(p=l,l=p.steps),(l===!0||l.length)&&(e=!0)):"array"!==a||"undefined"!=o&&"array"!==o?(f=i.equals(n,r),(!f||t.force)&&(t.force=null,e=!0)):("function"==typeof h?(p=s(n,t.last||[],h),l=p.steps,p.dirty&&(e=!0)):l=u(n,t.last||[],t.diff),e||"array"===o&&l!==!0&&!l.length||(e=!0)));return e&&!t.test&&("object"===a&&t.deep||"array"===a?t.last=i.clone(n):t.last=n,t.fn.call(this,n,r,l,p&&p.oldKeyMap,p&&p.dirty),t.once&&this.$unwatch(t)),e}},$set:function(t,e){if(null!=t){var n=typeof t;if("string"===n||"expression"===t.type)t=this.$expression(t),t.set(this,e);else if("function"===n)t.call(this,this.data);else for(var r in t)this.$set(r,t[r])}},$get:function(t,e){return e&&"string"==typeof t?t:this.$expression(t).get(this)},$update:function(){var t=this;if("destroyed"===t.$phase)return this;do{if(t.data.isolate||!t.$parent)break;t=t.$parent}while(t);var e=t.$phase;return t.$phase="digest",this.$set.apply(this,arguments),t.$phase=e,t.$digest(),this},_record:function(){this._records||(this._records=[]),this._records.push([])},_release:function(){return this._records.pop()}};i.extend(r.prototype,f),r.mixTo=function(t){return t="function"==typeof t?t.prototype:t,i.extend(t,f)},t.exports=r},function(t,e){var n=t.exports={};n.json={get:function(t){return"undefined"!=typeof JSON?JSON.stringify(t):t},set:function(t){return"undefined"!=typeof JSON?JSON.parse(t):t}},n.last=function(t){return t&&t[t.length-1]},n.average=function(t,e){return t=t||[],t.length?n.total(t,e)/t.length:0},n.total=function(t,e){var n=0;if(t)return t.forEach(function(t){n+=e?t[e]:t}),n}},function(t,e,n){var r=n(3),i=n(17),o=(n(23),n(9)),a=n(18),s=a.NAMESPACE,u=a.OPTIONS,c=u.STABLE,f={deep:!0,stable:!0};n(30),n(31),t.exports={"r-class":function(t,e){"string"==typeof e&&(e=r.fixObjStr(e));var n=t.namespaceURI&&t.namespaceURI!==s.html;this.$watch(e,function(e){var r=n?t.getAttribute("class"):t.className;r=" "+(r||"").replace(/\s+/g," ")+" ";for(var o in e)e.hasOwnProperty(o)&&(r=r.replace(" "+o+" "," "),e[o]===!0&&(r+=o+" "));r=r.trim(),n?i.attr(t,"class",r):t.className=r},f)},"r-style":function(t,e){"string"==typeof e&&(e=r.fixObjStr(e)),this.$watch(e,function(e,n){for(var r in n)n.hasOwnProperty(r)&&!e.hasOwnProperty(r)&&i.css(t,r,"");for(r in e)e.hasOwnProperty(r)&&i.css(t,r,e[r])},f)},"r-hide":{link:function(t,e){var n,i=null;r.isExpr(e)||"string"==typeof e?this.$watch(e,function(e){var r=!!e;r!==i&&(i=r,r?t.onleave?n=t.onleave(function(){t.style.display="none",n=null}):t.style.display="none":(n&&n(),t.style.display="",t.onenter&&t.onenter()))},c):e&&(t.style.display="none")},ssr:function(t){return t?'style="display:none"':""}},"r-html":{ssr:function(t,e){return e.body=t,""},link:function(t,e){this.$watch(e,function(e){e=e||"",i.html(t,e)},{force:!0,stable:!0})}},ref:{accept:a.COMPONENT_TYPE+a.ELEMENT_TYPE,link:function(t,e){var n,i=this.$refs||(this.$refs={});return r.isExpr(e)?this.$watch(e,function(e,r){n=e,i[r]===t&&(i[r]=null),n&&(i[n]=t)},c):i[n=e]=t,function(){i[n]=null}}}},o.directive(t.exports)},function(t,e,n){function r(t,e,n){if(n)for(var r,i=t.target;i&&i!==n;){for(var o=0,a=e.length;a>o;o++)r=e[o],r&&r.element===i&&r.fire(t);i=i.parentNode}}var i=n(3),o=n(17),a=n(9);a._addProtoInheritCache("event"),a.directive(/^on-\w+$/,function(t,e,n,r){if(n&&e){var i=n.split("-")[1];return this._handleEvent(t,i,e,r)}}),a.directive(/^(delegate|de)-\w+$/,function(t,e,n){function a(t){r(t,u[c],s.parentNode)}var s=this.$root,u=s._delegates||(s._delegates={});if(n&&e){var c=n.split("-")[1],f=i.handleEvent.call(this,e,c);u[c]||(u[c]=[],s.parentNode?o.on(s.parentNode,c,a):s.$on("$inject",function(t,e,n){var r=this.parentNode;n&&o.off(n,c,a),r&&o.on(this.parentNode,c,a)}),s.$on("$destroy",function(){s.parentNode&&o.off(s.parentNode,c,a),u[c]=null}));var l={element:t,fire:f};return u[c].push(l),function(){var t=u[c];if(t&&t.length)for(var e=0,n=t.length;n>e;e++)t[e]===l&&t.splice(e,1)}}})},function(t,e,n){function r(t,e,n){function r(){e.set(i,this.value),o.last=this.value,i.$update()}var i=this,o=this.$watch(e,function(e){for(var n=t.getElementsByTagName("option"),r=0,i=n.length;i>r;r++)if(n[r].value==e){t.selectedIndex=r;break}},l);return c.on(t,"change",r),void 0===e.get(i)&&t.value&&e.set(i,t.value),function(){c.off(t,"change",r)}}function i(t,e,n){function r(){d=!0}function i(t){d=!1,v.call(this,t)}var o,a=n.param,f=a.lazy;"throttle"in a&&(o=a.throttle===!0?400:parseInt(a.throttle,10));var h=this,p=this.$watch(e,function(e){t.value!==e&&(t.value=null==e?"":""+e)},l),d=!1,v=function(t){if(!d){d=!1;var n=this;if("cut"===t.type||"paste"===t.type)u.nextTick(function(){var t=n.value;e.set(h,t),p.last=t,h.$update()});else{var r=n.value;e.set(h,r),p.last=r,h.$update()}}};if(o&&!f){v=u.throttle(v,o)}return void 0===s&&(s=9!==c.msie&&"oninput"in document.createElement("input")),f?c.on(t,"change",v):("function"==typeof CompositionEvent&&(t.addEventListener("compositionstart",r),t.addEventListener("compositionend",i)),s?t.addEventListener("input",v):c.on(t,"paste keyup cut change",v)),void 0===e.get(h)&&t.value&&e.set(h,t.value),function(){return f?c.off(t,"change",v):void(s?t.removeEventListener("input",v):c.off(t,"paste keyup cut change",v))}}function o(t,e){var n=this,r=this.$watch(e,function(e){c.attr(t,"checked",!!e)},l),i=function(){var t=this.checked;e.set(n,t),r.last=t,n.$update()};return e.set&&c.on(t,"change",i),void 0===e.get(n)&&e.set(n,!!t.checked),function(){e.set&&c.off(t,"change",i)}}function a(t,e){var n=this,r=(this.$watch(e,function(e){e==t.value?t.checked=!0:t.checked=!1},l),function(){var t=this.value;e.set(n,t),n.$update()});return e.set&&c.on(t,"change",r),void 0===e.get(n)&&t.checked&&e.set(n,t.value),function(){e.set&&c.off(t,"change",r)}}var s,u=n(3),c=n(17),f=n(18).OPTIONS,l=f.STABLE,h=n(9),p={text:i,select:r,checkbox:o,radio:a};h.directive("r-model",{param:["throttle","lazy"],link:function(t,e,n,r){var i=t.tagName.toLowerCase(),o=i;return"input"===o?o=t.type||"text":"textarea"===o&&(o="text"),"string"==typeof e&&(e=this.$expression(e)),p[o]?p[o].call(this,t,e,r):"input"===i?p.text.call(this,t,e,r):void 0}})},function(t,e,n){function r(t){var e,n=[],r=0,i=o.noop,a={type:t,start:function(t){return e=o.uid(),"function"==typeof t&&(i=t),r>0?r=0:a.step(),a.compelete},compelete:function(){e=null,i&&i(),i=o.noop,r=0},step:function(){n[r]&&n[r](a.done.bind(a,e))},done:function(t){t===e&&(rE;E++)if(u=m[E],d=u.split(":"),h=d[0]&&d[0].trim(),p=d[1]&&d[1].trim(),h)if(h!==c)if(h!==f){var v=s.animation(h);if(!v||!l)throw Error(v?"you should start with `on` or `event` in animation":"undefined animator 【"+h+"】");l.push(v.call(this,{element:t,done:l.done,param:p}))}else n(p),"leave"===p?(t.onleave=l.start,y.push(a(t))):"enter"===p?(t.onenter=l.start,y.push(a(t))):"on"+p in t?y.push(this._handleEvent(t,p,l.start)):(this.$on(p,l.start),y.push(this.$off.bind(this,p,l.start)));else n("when"),this.$watch(p,i.bind(this,l.start));return y.length?function(){y.forEach(function(t){t()})}:void 0}var o=n(3),a=n(23),s=(n(17),n(9)),u=/\s+/,c="when",f="on";s._addProtoInheritCache("animation"),s.animation({wait:function(t){var e=parseInt(t.param)||0;return function(t){setTimeout(t,e)}},"class":function(t){var e=t.param.split(","),n=e[0]||"",r=parseInt(e[1])||1;return function(e){a.startClassAnimate(t.element,n,e,r)}},call:function(t){var e=this.$expression(t.param).get,n=this;return function(t){e(n),n.$update(),t()}},emit:function(t){var e=t.param,n=e.split(","),r=n[0]||"",i=n[1]?this.$expression(n[1]).get:null;if(!r)throw Error("you shoud specified a eventname in emit command");var o=this;return function(t){o.$emit(r,i?i(o):void 0),t()}},style:function(t){var e,n={},r=t.param,i=r.split(",");return i.forEach(function(t){if(t=t.trim()){var r=t.split(u),i=r.shift(),o=r.join(" ");if(!i||!o)throw Error("invalid style in command: style");n[i]=o,e=!0}}),function(r){e?a.startStyleAnimate(t.element,n,r):r()}}}),s.directive("r-animation",i),s.directive("r-anim",i)},function(t,e,n){function r(t){t.implement({$timeout:function(t,e){return e=e||0,setTimeout(function(){t.call(this),this.$update()}.bind(this),e)},$interval:function(t,e){return e=e||1e3/60,setInterval(function(){t.call(this),this.$update()}.bind(this),e)}})}var i=n(9);i.plugin("timeout",r),i.plugin("$timeout",r)}])}); - +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Regular=e():t.Regular=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r=n(1),i=n(8),o=t.exports=n(9),a=o.Parser,s=o.Lexer;n(29),n(32),n(33),o.dom=n(17),o.env=r,o.util=n(3),o.parse=function(t,e){e=e||{},(e.BEGIN||e.END)&&(e.BEGIN&&(i.BEGIN=e.BEGIN),e.END&&(i.END=e.END),s.setup());var n=new a(t).parse();return e.stringify?JSON.stringify(n):n},o.Cursor=n(25),o.isServer=r.node,o.isRegular=function(t){return t.prototype instanceof o}},function(t,e,n){(function(t){var r=n(3);e.svg=function(){return"undefined"!=typeof document&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}(),e.browser="undefined"!=typeof document&&document.nodeType,e.exprCache=r.cache(1e3),e.node="undefined"!=typeof t&&""+t=="[object process]",e.isRunning=!1}).call(e,n(2))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function o(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function a(){v&&p&&(v=!1,p.length?d=p.concat(d):m=-1,d.length&&s())}function s(){if(!v){var t=i(a);v=!0;for(var e=d.length;e;){for(p=d,d=[];++m1)for(var n=1;nn;n++)if(e(t[n]))return!0},o.varName="d",o.setName="p_",o.ctxName="c",o.extName="e",o.rWord=/^[\$\w]+$/,o.rSimpleAccessor=/^[\$\w]+(\.[\$\w]+)*$/,o.nextTick="function"==typeof r?r.bind(u):function(t){setTimeout(t,0)},o.prefix="'use strict';var "+o.varName+"="+o.ctxName+".data;"+o.extName+"="+o.extName+"||'';",o.slice=function(t,e,n){for(var r=[],i=e||0,o=n||t.length;o>i;i++)r.push(t[i]);return r},o.typeOf=function(t){return null==t?String(t):s.call(t).slice(8,-1).toLowerCase()},o.makePredicate=function(t,e){function n(t){if(1===t.length)return r+="return str === '"+t[0]+"';";r+="switch(str){";for(var e=0;e3){i.sort(function(t,e){return e.length-t.length}),r+="switch(str.length){";for(var o=0;or;r++){var o=(t[r]||"").length;if(n+o>e)return{num:r,line:t[r],start:e-n,prev:t[r-1],next:t[r+1]};n=n+o+1}}function e(t,e,i,s){var u=t.length,c=e-o;0>c&&(c=0);var f=e+a;f>u&&(f=u);var l=t.slice(c,f),h="["+(i+1)+"] "+(c>0?"..":""),p=u>f?"..":"",d=h+r(l)+p;return s&&(d+="\n"+n(r(t.slice(c,e)).length+h.length)+"^"),d}function n(t){return new Array(t+1).join(" ")}function r(t){return t.replace(/^\t+/,function(t){return t.split(" ").join(" ")})}var i=/\r\n|[\n\r\u2028\u2029]/g,o=50,a=20;return function(n,r){r>n.length-1&&(r=n.length-1),i.lastIndex=0;var o=n.split(i),a=t(o,r),s=a.start,u=a.num;return(a.prev?e(a.prev,s,u-1)+"\n":"")+e(a.line,s,u,!0)+"\n"+(a.next?e(a.next,s,u+1)+"\n":"")}}();var f=/\((\?\!|\?\:|\?\=)/g;o.findSubCapture=function(t){var e=0,n=0,r=t.length,i=t.match(f);for(i=i?i.length:0;r--;){var o=t.charAt(r);(0===r||"\\"!==t.charAt(r-1))&&("("===o&&e++,")"===o&&n++)}if(e!==n)throw"RegExp: "+t+"'s bracket is not marched";return e-i},o.escapeRegExp=function(t){return t.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,function(t){return"\\"+t})};var l=new RegExp("&(?:(#x[0-9a-fA-F]+)|(#[0-9]+)|("+o.keys(a).join("|")+"));","gi");o.convertEntity=function(t){return(""+t).replace(l,function(t,e,n,r){var i;return i=n?parseInt(n.slice(1),10):e?parseInt(e.slice(2),16):a[r],String.fromCharCode(i)})},o.createObject=Object.create?function(t){return Object.create(t||null)}:function(){function t(){}return function(e){if(!e)return{};t.prototype=e;var n=new t;return t.prototype=null,n}}(),o.createProto=function(t,e){function n(){this.constructor=t}return n.prototype=e,t.prototype=new n},o.removeOne=function(t,e){for(var n=t.length;n--;)if(e(t[n]))return void t.splice(n,1)},o.clone=function(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t)){for(var e=[],n=0,r=t.length;r>n;n++)e[n]=t[n];return e}var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},o.equals=function(t,e){var n=typeof t;return"number"===n&&"number"==typeof e&&isNaN(t)&&isNaN(e)?!0:t===e};var h=/-([a-z])/g;o.camelCase=function(t){return t.replace(h,function(t,e){return e.toUpperCase()})},o.throttle=function(t,e){var n,r,i,e=e||100,o=null,a=0,s=function(){a=+new Date,o=null,i=t.apply(n,r),n=r=null};return function(){var u=+new Date,c=e-(u-a);return n=this,r=arguments,0>=c||c>e?(clearTimeout(o),o=null,a=u,i=t.apply(n,r),n=r=null):o||(o=setTimeout(s,c)),i}},o.escape=function(){var t=/&/g,e=//g,r=/\'/g,i=/\"/g,o=/[&<>\"\']/;return function(a){return o.test(a)?a.replace(t,"&").replace(e,"<").replace(n,">").replace(r,"'").replace(i,"""):a}}(),o.cache=function(t){t=t||1e3;var e=[],n={};return{set:function(t,r){return e.length>this.max&&(n[e.shift()]=void 0),void 0===n[t]&&e.push(t),n[t]=r,r},get:function(t){return void 0===t?n:n[t]},max:t,len:function(){return e.length}}},o.handleEvent=function(t,e){var n,r=this;return"expression"===t.type&&(n=t.get),n?function(t){var e=this;r.$update(function(){var i=this.data;i.$event=t,i.$sender=e;var o=n(r);o===!1&&t&&t.preventDefault&&t.preventDefault(),i.$event=void 0,i.$sender=void 0})}:function(){var e=o.slice(arguments);e.unshift(t),r.$update(function(){r.$emit.apply(r,e)})}},o.once=function(t){var e=0;return function(){0===e++&&t.apply(this,arguments)}},o.fixObjStr=function(t){return 0!==t.trim().indexOf("{")?"{"+t+"}":t},o.map=function(t,e){for(var n=[],r=0,i=t.length;i>r;r++)n.push(e(t[r],r));return n},o.log=i,o.normListener=function(t){var e=[],n=o.typeOf(t);if("array"===n)return t;if("object"===n)for(var r in t)t.hasOwnProperty(r)&&e.push({type:r,listener:t[r]});return e},o.isVoidTag=o.makePredicate("area base br col embed hr img input keygen link menuitem meta param source track wbr r-content"),o.isBooleanAttr=o.makePredicate("selected checked disabled readonly required open autofocus controls autoplay compact loop defer multiple"),o.isExpr=function(t){return t&&"expression"===t.type},o.isGroup=function(t){return t.inject||t.$inject},o.blankReg=/^\s*$/,o.getCompileFn=function(t,e,n){return function(r){return r&&n?o.extend(r,n):r=n,e.$compile(t,r)}},o.fixTagAST=function(t,e){if(!t.touched){var n=t.attrs;if(n){var r=n.length;if(r){for(var i=[],a={};r--;){var s=n[r];"type"===s.name&&(s.priority=c+1);var u=e.directive(s.name);u?(s.priority=u.priority||1,s.directive=!0,i.push(s)):"attribute"===s.type&&(a[s.name]=s.value)}i.forEach(function(t){var r=e.directive(t.name),i=r.param;i&&i.length&&(t.param={},i.forEach(function(e){e in a&&(t.param[e]=void 0===a[e]?!0:a[e],o.removeOne(n,function(t){return t.name===e}))}))}),n.sort(function(t,e){var n=t.priority,r=e.priority;return null==n&&(n=c),null==r&&(r=c),r-n}),t.touched=!0}}}},o.findItem=function(t,e){if(t&&t.length)for(var n=t.length;n--;)if(e(t[n]))return t[n]},o.getParamObj=function(t,e){var n={};if(e)for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];n[r]=i&&"expression"===i.type?t.$get(i):i}return n},o.eventReg=/^on-(\w[-\w]*)$/,o.toText=function(t){return null==t?"":""+t},o.escape=function(){function t(t){return String(void 0===t||null==t?"":t)}var e=/&/g,n=//g,i=/\'/g,o=/\"/g,a=/[&<>\"\']/;return function(s){return s=t(s),a.test(s)?s.replace(e,"&").replace(n,"<").replace(r,">").replace(i,"'").replace(o,"""):s}}(),o.simpleDiff=function(t,e){var n=t.length,r=e.length;if(n!==r)return!0;for(var i=0;n>i;i++)if(t[i]!==e[i])return!0;return!1}}).call(e,function(){return this}(),n(4).setImmediate)},function(t,e,n){(function(t){function r(t,e){this._id=t,this._clearFn=e}var i="undefined"!=typeof t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(5),e.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(e,function(){return this}())},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;nn;n++)if(this[n]===t)return n;return-1},forEach:function(t,e){var n=0,r=Object(this),i=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(;i>n;){var o;n in r&&(o=r[n],t.call(e,o,n,r)),n++}},filter:function(t,e){var n=Object(this),r=n.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=[],o=0;r>o;o++)if(o in n){var a=n[o];t.call(e,a,o,n)&&i.push(a)}return i}}),n(Function.prototype,{bind:function(t){var e=this,n=r.call(arguments,1);return function(){var i=n.concat(r.call(arguments));return e.apply(t,i)}},__bind__:function(t){return this.__binding__?this.__binding__:this.__binding__=this.bind.apply(this,arguments)}}),n(Array,{isArray:function(t){return"[object Array]"===i.call(t)}})}},function(t,e){var n={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,fnof:402,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,bull:8226,hellip:8230,prime:8242,Prime:8243,oline:8254,frasl:8260,weierp:8472,image:8465,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,circ:710,tilde:732,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,permil:8240,lsaquo:8249,rsaquo:8250,euro:8364};t.exports=n},function(t,e){t.exports={BEGIN:"{",END:"}",PRECOMPILE:!1}},function(t,e,n){function r(t){var e;return"string"==typeof t&&t.length<16&&(e=h.find(t))?(u.log("pass selector as template has be deprecated, pass node or template string instead","warn"),e):void 0}var i=n(1),o=n(10),a=n(12),s=n(8),u=n(3),c=n(14),f=n(15),l={};if(i.browser){var h=n(17),p=n(19),d=n(24),v=h.doc;l=n(22)}var m=n(26),g=n(27),y=n(16),E=n(28),x=n(18).ERROR,_=n(25),f=n(15),T=function(){},N=function(t,e){var n=i.isRunning;i.isRunning=!0;var o,a,s,c,p,d=this;e=e||{},t=t||{};var v=t.template;if(i.browser){if((o=r(v))&&(v=o),v&&v.nodeType&&(t.template=v.innerHTML),p=t.mountNode,"string"==typeof p&&(p=h.find(p),!p))throw Error("mountNode "+p+" is not found");p?(s=_(p.firstChild,p),delete t.mountNode):s=e.cursor}a=f.initDefinition(d,t),d.$parent&&d.$parent._append(d),d._children=[],d.$refs={},d.$root=d.$root||d;var m,g=e.extra,y=g&&g.$$modify;if(c=d._body){d._body=null;var E=d.modifyBodyComponent;"function"==typeof E?(E=E.bind(this),m=u.createObject(g),m.$$modify=function(t){return E(t,y?y:T)}):m=g,c.ast&&c.ast.length&&(d.$body=u.getCompileFn(c.ast,c.ctx,{outer:d,namespace:e.namespace,extra:m,record:!0}))}if(a){var x={namespace:e.namespace,cursor:s};x.extra={$$modify:g&&g.$$modify},d.group=d.$compile(a,x),l.node(d)}y&&y(this),d.$parent||d.$update(),d.$ready=!0,d.$emit("$init"),d.init&&d.init(d.data),d.$emit("$afterInit"),i.isRunning=n,this.devtools&&this.devtools.emit("init",this)};if("undefined"!=typeof window){var w=window.__REGULAR_DEVTOOLS_GLOBAL_HOOK__;w&&(N.prototype.devtools=w)}p&&(p.Regular=N),u.extend(N,{_directives:{__regexp__:[]},_plugins:{},_protoInheritCache:["directive","use"],__after__:function(t,e){var n;if(this.__after__=t.__after__,e.name&&N.component(e.name,this),n=e.template){var o,u;i.browser&&((o=r(n))&&(n=o),n&&n.nodeType&&((u=h.attr(n,"name"))&&N.component(u,this),n=n.innerHTML)),"string"==typeof n&&(this.prototype.template=s.PRECOMPILE?new a(n).parse():n)}e.computed&&(this.prototype.computed=f.handleComputed(e.computed)),N._inheritConfig(this,t)},directive:function(t,e){if(t){var n=typeof t;if("object"===n&&!e){for(var r in t)t.hasOwnProperty(r)&&this.directive(r,t[r]);return this}var i,o=this._directives;if(null!=e)return"function"==typeof e&&(e={link:e}),"string"===n?o[t]=e:(e.regexp=t,o.__regexp__.push(e)),"function"!=typeof e.link&&(e.link=T),this;if("string"===n){if(i=o[t])return i;for(var a=o.__regexp__,s=0,u=a.length;u>s;s++){i=a[s];var c=i.regexp.test(t);if(c)return i}}}},plugin:function(t,e){var n=this._plugins;return null==e?n[t]:(n[t]=e,this)},use:function(t){return"string"==typeof t&&(t=N.plugin(t)),"function"!=typeof t?this:(t(this,N),this)},config:function(t,e){var n=!1;if("object"==typeof t)for(var r in t)("END"===r||"BEGIN"===r)&&(n=!0),s[r]=t[r];n&&o.setup()},expression:y.expression,Parser:a,Lexer:o,_addProtoInheritCache:function(t,e){if(Array.isArray(t))return t.forEach(N._addProtoInheritCache);var n="_"+t+"s";N._protoInheritCache.push(t),N[n]={},N[t]||(N[t]=function(r,i){var o=this[n];if("object"==typeof r){for(var a in r)r.hasOwnProperty(a)&&this[t](a,r[a]);return this}return null==i?o[r]:(o[r]=e?e(i):i,this)})},_inheritConfig:function(t,e){var n=N._protoInheritCache,r=u.slice(n);return r.forEach(function(n){t[n]=e[n];var r="_"+n+"s";e[r]&&(t[r]=u.createObject(e[r]))}),t}}),c(N),N._addProtoInheritCache("component"),N._addProtoInheritCache("filter",function(t){return"function"==typeof t?{get:t}:t}),m.mixTo(N),g.mixTo(N),N.implement({init:function(){},config:function(){},destroy:function(){this.$emit("$destroy"),this._watchers=null,this._watchersForStable=null,this.group&&this.group.destroy(!0),this.group=null,this.parentNode=null,this._children=null,this.$root=null,this._handles=null,this.$refs=null;var t=this.$parent;if(t&&t._children){var e=t._children.indexOf(this);t._children.splice(e,1)}this.$parent=null,this.devtools&&this.devtools.emit("destroy",this),this._handles=null,this.$phase="destroyed"},$compile:function(t,e){e=e||{},"string"==typeof t&&(t=new a(t).parse());var n,r=this.__ext__,i=e.record;e.extra&&(this.__ext__=e.extra),i&&this._record();var o=this._walk(t,e);if(i){n=this._release();var s=this;n.length&&(o.ondestroy=function(){s.$unwatch(n)})}return e.extra&&(this.__ext__=r),o},$bind:function(t,e,n){var r=u.typeOf(e);if("expression"===e.type||"string"===r)this._bind(t,e,n);else if("array"===r)for(var i=0,o=e.length;o>i;i++)this._bind(t,e[i]);else if("object"===r)for(var i in e)e.hasOwnProperty(i)&&this._bind(t,i,e[i]);return t.$update(),this},$unbind:function(){},$inject:l.inject,$mute:function(t){t=!!t;var e=t===!1&&this._mute;return this._mute=!!t,e&&this.$update(),this},_bind:function(t,e,n){var r=this;if(!(t&&t instanceof N))throw"$bind() should pass Regular component as first argument";if(!e)throw"$bind() should pass as least one expression to bind";if(n||(n=e),e=y.expression(e),n=y.expression(n),n.set){var i=this.$watch(e,function(e){t.$update(n,e)});t.$on("$destroy",function(){r.$unwatch(i)})}if(e.set){var o=t.$watch(n,function(t){r.$update(e,t)});this.$on("$destroy",t.$unwatch.bind(t,o))}n.set(t,e.get(this))},_walk:function(t,e){if(Array.isArray(t)){for(var n=[],r=0,i=t.length;i>r;r++){var o=this._walk(t[r],e);o&&o.code===x.UNMATCHED_AST?(t.splice(r,1),r--,i--):n.push(o)}return new d(n)}return"string"==typeof t?v.createTextNode(t):p[t.type||"default"].call(this,t,e)},_append:function(t){this._children.push(t),t.$parent=this},_handleEvent:function(t,e,n,r){var i,o=this.constructor,a="function"!=typeof n?u.handleEvent.call(this,n,e):n,s=o.event(e);return s?i=s.call(this,t,a,r):h.on(t,e,a),s?i:function(){h.off(t,e,a)}},_touchExpr:function(t,e){var n,e=this.__ext__,r={};if("expression"!==t.type||t.touched)return t;if(n=t.get,n||(n=t.get=new Function(u.ctxName,u.extName,u.prefix+"return ("+t.body+")"),t.body=null),r.get=e?function(t,r){return n(t,r||e)}:n,t.setbody&&!t.set){var i=t.setbody,o=t.filters,a=this;o&&u.some(o,function(t){return!a._f_(t).set})||(t.set=function(e,n,r){return t.set=new Function(u.ctxName,u.setName,u.extName,u.prefix+i),t.set(e,n,r)}),t.filters=t.setbody=null}return t.set&&(r.set=e?function(n,r){return t.set(n,r,e)}:t.set),r.type="expression",r.touched=!0,r.once=t.once||t.constant,r},_f_:function(t){var e=this.constructor,n=e.filter(t);if(!n)throw Error("filter "+t+" is undefined");return n},_sg_:function(t,e,n,r){if(void 0===t)return void 0;if(r&&"object"==typeof r&&void 0!==r[t])return r[t];if(null===e)return void 0;if(e&&"undefined"!=typeof e[t])return e[t];if(null!==e){var i=this.computed,o=i[t];if(o){if("expression"!==o.type||o.get||this._touchExpr(o),o.get)return o.get(this);u.log("the computed '"+t+"' don't define the get function, get data."+t+" altnately","warn")}}return void 0===n?void 0:n[t]},_ss_:function(t,e,n,r,i){var o,i=this.computed,r=r||"=",a=i?i[t]:null;if("="!==r)switch(o=a?a.get(this):n[t],r){case"+=":e=o+e;break;case"-=":e=o-e;break;case"*=":e=o*e;break;case"/=":e=o/e;break;case"%=":e=o%e}return a&&a.set?a.set(this,e):(n[t]=e,e)}}),N.prototype.inject=function(){return u.log("use $inject instead of inject","warn"),this.$inject.apply(this,arguments)},N.filter(E),t.exports=N},function(t,e,n){function r(t){return function(e){return{type:t,value:e}}}function i(t,e){h[f.END]&&(this.markStart=h[f.END],this.markEnd=f.END),this.input=t||"",this.opts=e||{},this.syntaxSets=l(),this.state=l(),this.map=2!==this.opts.mode?s:u,this.syntaxSets.enter("INIT"),e&&e.expression&&(this.syntaxSets.enter("JST"),this.expression=!0)}function o(t){for(var e,n,r={},i=0,o=t.length;o>i;i++)e=t[i],n=e[2]||"INIT",(r[n]||(r[n]={rules:[],links:[]})).rules.push(e);return a(r)}function a(t){function e(t,e){return"string"==typeof p[e]?c.escapeRegExp(p[e]):String(p[e]).slice(1,-1)}var n,i,o,a,s,u,f;for(var l in t){n=t[l],n.curIndex=1,i=n.rules,o=[];for(var h=0,d=i.length;d>h;h++)f=i[h],s=f[0],a=f[1],"string"==typeof a&&(a=r(a)),"regexp"===c.typeOf(s)&&(s=s.toString().slice(1,-1)),s=s.replace(/\{(\w+)\}/g,e),u=c.findSubCapture(s)+1,n.links.push([n.curIndex,u,a]),n.curIndex+=u,o.push(s);n.TRUNK=new RegExp("^(?:("+o.join(")|(")+"))")}return t}var s,u,c=n(3),f=n(8),l=n(11),h={"}":"{","]":"["},p={NAME:/(?:[:_A-Za-z][-\.:_0-9A-Za-z]*)/,IDENT:/[\$_A-Za-z][_0-9A-Za-z\$]*/,SPACE:/[\r\n\t\f ]/},d=/a|(b)/.exec("a"),v=d&&void 0===d[1]?function(t){return void 0!==t}:function(t){return!!t},m=i.prototype;m.lex=function(t){t=t||this.input;var e=/^\s*/.exec(t);t=t.trim();var n,r,i,o,a,s=[];this.input=t,this.marks=0,this.index=e?e[0].length:0;for(var u=0;t;)u++,a=this.syntaxSets.get(),n=this.map[a],r=n.TRUNK.exec(t),r||this.error("Unrecoginized Token"),i=r[0].length,t=t.slice(i),o=this._process.call(this,r,n,t),o&&s.push(o),this.index+=i;return s.push({type:"EOF"}),s},m.error=function(t){throw Error("Parse Error: "+t+":\n"+c.trackErrorPos(this.input,this.index))},m._process=function(t,e,n){for(var r,i=e.links,o=!1,a=i.length,s=0;a>s;s++){var u=i[s],f=u[2],l=u[0];if(v(t[l])){o=!0,f&&(r=f.apply(this,c.slice(t,l,l+u[1])),r&&(r.pos=this.index));break}}if(!o)switch(n.charAt(0)){case"<":this.syntaxSets.enter("TAG");break;default:this.syntaxSets.enter("JST")}return r},i.setup=function(){p.END=f.END,p.BEGIN=f.BEGIN,s=o([g.BODY_END,g.ENTER_JST,g.ENTER_TAG,g.TEXT,g.TAG_NAME,g.TAG_OPEN,g.TAG_CLOSE,g.TAG_PUNCHOR,g.TAG_ENTER_JST,g.TAG_UNQ_VALUE,g.TAG_STRING,g.TAG_SPACE,g.TAG_COMMENT,g.JST_OPEN,g.JST_BODY_OPEN,g.JST_CLOSE,g.JST_EXPR_OPEN,g.JST_IDENT,g.JST_SPACE,g.JST_LEAVE,g.JST_NUMBER,g.JST_PUNCHOR,g.JST_STRING,g.JST_COMMENT]),u=o([g.BODY_END,g.ENTER_JST2,g.TEXT,g.JST_OPEN,g.JST_BODY_OPEN,g.JST_CLOSE,g.JST_EXPR_OPEN,g.JST_IDENT,g.JST_SPACE,g.JST_LEAVE,g.JST_NUMBER,g.JST_PUNCHOR,g.JST_STRING,g.JST_COMMENT])};var g={ENTER_JST:[/[^\x00<]*?(?={BEGIN})/,function(t){return this.syntaxSets.enter("JST"),t?{type:"TEXT",value:t}:void 0}],ENTER_JST2:[/[^\x00]*?(?={BEGIN})/,function(t){return this.syntaxSets.enter("JST"),t?{type:"TEXT",value:t}:void 0}],ENTER_TAG:[/[^\x00]*?(?=<[\w\/\!])/,function(t){return this.syntaxSets.enter("TAG"),t?{type:"TEXT",value:t}:void 0}],BODY_END:[/{SPACE}*{END}/,function(t){var e=this.syntaxSets.all(),n=e.length;return"JST"===e[n-2]?(this.syntaxSets.leave("INIT"),this.syntaxSets.leave("JST"),{type:"END"}):{type:"TEXT",value:t}}],TEXT:[/[^\x00]+/,"TEXT"],TAG_NAME:[/{NAME}/,"NAME","TAG"],TAG_UNQ_VALUE:[/[^\{}&"'=><`\r\n\f\t ]+/,"UNQ","TAG"],TAG_OPEN:[/<({NAME})\s*/,function(t,e){return{type:"TAG_OPEN",value:e}},"TAG"],TAG_CLOSE:[/<\/({NAME})[\r\n\f\t ]*>/,function(t,e){return this.syntaxSets.leave(),{type:"TAG_CLOSE",value:e}},"TAG"],TAG_ENTER_JST:[/(?={BEGIN})/,function(){this.syntaxSets.enter("JST")},"TAG"],TAG_PUNCHOR:[/[\>\/=&]/,function(t){return">"===t&&this.syntaxSets.leave(),{type:t,value:t}},"TAG"],TAG_STRING:[/'([^']*)'|"([^"]*)\"/,function(t,e,n){var r=e||n||"";return{type:"STRING",value:r}},"TAG"],TAG_SPACE:[/{SPACE}+/,null,"TAG"],TAG_COMMENT:[/<\!--([^\x00]*?)--\>/,function(t){this.syntaxSets.leave()},"TAG"],JST_OPEN:["{BEGIN}#{SPACE}*({IDENT})",function(t,e){return this.state.enter("JST_OPEN"),{type:"OPEN",value:e}},"JST"],JST_BODY_OPEN:["{BEGIN}~{SPACE}*",function(t,e){return this.syntaxSets.enter("INIT"),{type:"BODY_OPEN",value:e}},"JST"],JST_LEAVE:[/{END}/,function(t){return this.markEnd===t&&this.expression?{type:this.markEnd,value:this.markEnd}:this.markEnd&&this.marks?(this.marks--,{type:this.markEnd,value:this.markEnd}):(this.state.leave("JST_OPEN"),this.state.leave("JST_EXPR_OPEN"),this.syntaxSets.leave("JST"),{type:"END"})},"JST"],JST_CLOSE:[/{BEGIN}\s*\/({IDENT})\s*{END}/,function(t,e){return this.syntaxSets.leave("JST"),{type:"CLOSE",value:e}},"JST"],JST_COMMENT:[/{BEGIN}\!([^\x00]*?)\!{END}/,function(){this.syntaxSets.leave()},"JST"],JST_EXPR_OPEN:["{BEGIN}",function(t,e){if(t===this.markStart){if(this.expression)return{type:this.markStart,value:this.markStart};if(this.state.is("JST_OPEN")||this.state.is("JST_EXPR_OPEN")||this.marks)return this.marks++,{type:this.markStart,value:this.markStart};this.state.enter("JST_EXPR_OPEN")}return{type:"EXPR_OPEN",escape:!1}},"JST"],JST_IDENT:["{IDENT}","IDENT","JST"],JST_SPACE:[/[ \r\n\f]+/,null,"JST"],JST_PUNCHOR:[/[=!]?==|[-=><+*\/%\!]?\=|\|\||&&|\@\(|\.\.|[<\>\[\]\(\)\-\|\{}\+\*\/%?:\.!,]/,function(t){return{type:t,value:t}},"JST"],JST_STRING:[/'([^']*)'|"([^"]*)"/,function(t,e,n){return{type:"STRING",value:e||n||""}},"JST"],JST_NUMBER:[/(?:[0-9]*\.[0-9]+|[0-9]+)(e\d+)?/,function(t){return{type:"NUMBER",value:parseFloat(t,10)}},"JST"]};i.setup(),t.exports=i},function(t,e){function n(){return{_stack:[],enter:function(t){return this._stack.push(t),this},leave:function(t){var e=this._stack;return t&&e[e.length-1]!==t||e.pop(),this},get:function(){var t=this._stack;return t[t.length-1]},all:function(){return this._stack},is:function(t){var e=this._stack;return e[e.length-1]===t}}}t.exports=n},function(t,e,n){function r(t,e){e=e||{},this.input=t,this.tokens=new s(t,e).lex(),this.pos=0,this.length=this.tokens.length}function i(t,e){return{get:t,set:e}}var o=n(3),a=(n(8),n(13)),s=n(10),u=o.varName,c=o.ctxName,f=o.extName,l=o.makePredicate("STRING IDENT NUMBER"),h=o.makePredicate("true false undefined null this Array Date JSON Math NaN RegExp decodeURI decodeURIComponent encodeURI encodeURIComponent parseFloat parseInt Object"),p=o.makePredicate("script style"),d=/\.bind$/,v=r.prototype;v.parse=function(){this.pos=0;var t=this.program();return"TAG_CLOSE"===this.ll().type&&this.error("You may got a unclosed Tag"),t},v.ll=function(t){t=t||1,0>t&&(t+=1);var e=this.pos+t-1;return e>this.length-1?this.tokens[this.length-1]:this.tokens[e]},v.la=function(t){return(this.ll(t)||"").type},v.match=function(t,e){var n;return(n=this.eat(t,e))?n:(n=this.ll(),void this.error("expect ["+t+(null==e?"":":"+e)+']" -> got "['+n.type+(null==e?"":":"+n.value)+"]",n.pos))},v.error=function(t,e){throw t="\n【 parse failed 】 "+t+":\n\n"+o.trackErrorPos(this.input,"number"==typeof e?e:this.ll().pos||0),new Error(t)},v.next=function(t){t=t||1,this.pos+=t},v.eat=function(t,e){var n=this.ll();if("string"!=typeof t){for(var r=t.length;r--;)if(n.type===t[r])return this.next(),n}else if(n.type===t&&("undefined"==typeof e||n.value===e))return this.next(),n;return!1},v.program=function(t){for(var e=[],n=this.ll();"EOF"!==n.type&&"TAG_CLOSE"!==n.type;)if(e.push(this.statement()),n=this.ll(),t&&"END"===n.type)return this.next(),a.body(e);return e};var m=/\r\n/g;v.statement=function(){var t=this.ll();switch(t.type){case"NAME":case"TEXT":var e=t.value;for(this.next();t=this.eat(["NAME","TEXT"]);)e+=t.value;return a.text(e.replace(m,"\n"));case"TAG_OPEN":return this.xml();case"OPEN":return this.directive();case"EXPR_OPEN":return this.interplation();default:this.error("Unexpected token: "+this.la())}},v.xml=function(){var t,e,n,r;return t=this.match("TAG_OPEN").value,p(t)&&this.error("Invalid Tag: "+t),e=this.attrs(),r=this.eat("/"),this.match(">"),r||o.isVoidTag(t)||(n=this.program(),this.eat("TAG_CLOSE",t)||this.error("expect gotno matched closeTag")),a.element(t,e,n)},v.xentity=function(t){var e,n,r=t.value;if("NAME"===t.type){if(~r.indexOf(".")){var i=r.split(".");r=i[0],n=i[1]}return this.eat("=")&&(e=this.attvalue(n)),a.attribute(r,e,n)}return"if"!==r&&this.error("current version. ONLY RULE #if #else #elseif is valid in tag, the rule #"+r+" is invalid"),this["if"](!0)},v.attrs=function(t){var e;e=t?["NAME"]:["NAME","OPEN"];for(var n,r=[];n=this.eat(e);)r.push(this.xentity(n));return r},v.attvalue=function(t){var e=this.ll();switch(e.type){ +case"NAME":case"UNQ":case"STRING":this.next();var n=e.value;return n;case"EXPR_OPEN":return this.interplation();case"BODY_OPEN":return this.next(),this.program(!0);default:this.error("Unexpected token: "+this.la())}},v.directive=function(){var t=this.ll().value;return this.next(),"function"==typeof this[t]?this[t]():void this.error("Undefined directive["+t+"]")},v.interplation=function(){this.match("EXPR_OPEN");var t=this.expression(!0);return this.match("END"),t},v.inc=v.include=function(){var t=this.expression();return this.match("END"),a.template(t)},v["if"]=function(t){var e=this.expression(),n=[],r=[],i=n,o=t?"attrs":"statement";this.match("END");for(var s,u;!(u=this.eat("CLOSE"));)if(s=this.ll(),"OPEN"===s.type)switch(s.value){case"else":i=r,this.next(),this.match("END");break;case"elseif":return this.next(),r.push(this["if"](t)),a["if"](e,n,r);default:i.push(this[o](!0))}else i.push(this[o](!0));return"if"!==u.value&&this.error("Unmatched if directive"),a["if"](e,n,r)},v.list=function(){var t,e,n,r=this.expression(),i=[],o=[],s=i;for(this.match("IDENT","as"),t=this.match("IDENT").value,this.eat("IDENT","by")&&(this.eat("IDENT",t+"_key")&&this.error("can not track by "+t+"_key in list statement"),this.eat("IDENT",t+"_index")?n=!0:(n=this.expression(),n.constant&&(n=!0))),this.match("END");!(e=this.eat("CLOSE"));)this.eat("OPEN","else")?(s=o,this.match("END")):s.push(this.statement());return"list"!==e.value&&this.error("expect list got /"+e.value+" ",e.pos),a.list(r,t,i,o,n)},v.expression=function(){var t;return this.eat("@(")?(t=this.expr(),t.once=!0,this.match(")")):t=this.expr(),t},v.expr=function(){this.depend=[];var t=this.filter(),e=t.get||t,n=t.set;return a.expression(e,n,!this.depend.length,t.filters)},v.filter=function(){var t,e,n,r,a=this.assign(),s=this.eat("|"),u=[],f="t",l=a.set,h="";if(s){l&&(e=[],t=[]),n="(function("+f+"){";do{var p=this.match("IDENT").value;h=f+" = "+c+"._f_('"+p+"' ).get.call( "+o.ctxName+","+f,h+=this.eat(":")?", "+this.arguments("|").join(",")+");":");",u.push(h),l&&(t.push(p),e.unshift(h.replace(" ).get.call"," ).set.call")))}while(s=this.eat("|"));u.push("return "+f),e&&e.push("return "+f),r=n+u.join("")+"})("+a.get+")",e&&(l=l.replace(o.setName,n+e.join("")+"})("+o.setName+")"));var d=i(r,l);return d.filters=t,d}return a},v.assign=function(){var t,e=this.condition();return(t=this.eat(["=","+=","-=","*=","/=","%="]))?(e.set||this.error("invalid lefthand expression in assignment expression"),i(e.set.replace(","+o.setName,","+this.condition().get).replace("'='","'"+t.type+"'"),e.set)):e},v.condition=function(){var t=this.or();return this.eat("?")?i([t.get+"?",this.assign().get,this.match(":").type,this.assign().get].join("")):t},v.or=function(){var t=this.and();return this.eat("||")?i(t.get+"||"+this.or().get):t},v.and=function(){var t=this.equal();return this.eat("&&")?i(t.get+"&&"+this.and().get):t},v.equal=function(){var t,e=this.relation();return(t=this.eat(["==","!=","===","!=="]))?i(e.get+t.type+this.equal().get):e},v.relation=function(){var t,e=this.additive();return(t=this.eat(["<",">",">=","<="])||this.eat("IDENT","in"))?i(e.get+t.value+this.relation().get):e},v.additive=function(){var t,e=this.multive();return(t=this.eat(["+","-"]))?i(e.get+t.value+this.additive().get):e},v.multive=function(){var t,e=this.range();return(t=this.eat(["*","/","%"]))?i(e.get+t.type+this.multive().get):e},v.range=function(){var t,e,n=this.unary();if(t=this.eat("..")){e=this.unary();var r="(function(start,end){var res = [],step=end>start?1:-1; for(var i = start; end>start?i <= end: i>=end; i=i+step){res.push(i); } return res })("+n.get+","+e.get+")";return i(r)}return n},v.unary=function(){var t;return(t=this.eat(["+","-","~","!"]))?i("("+t.type+this.unary().get+")"):this.member()},v.member=function(t,e,n,r){var i,a,s=!1;if(t)"string"==typeof e&&l(e)?n.push(e):(n&&n.length&&this.depend.push(n),n=null);else{a=this.primary();var h=typeof a;"string"===h?(n=[],n.push(a),e=a,t=c+"._sg_('"+a+"', undefined, "+u+", "+f+")",s=!0):"this"===a.get?(t=c,n=["this"]):(n=null,t=a.get)}if(i=this.eat(["[",".","("]))switch(i.type){case".":var p=this.match("IDENT").value;return r=t,"("!==this.la()?t=c+"._sg_('"+p+"', "+t+" || null)":t+="."+p,this.member(t,p,n,r);case"[":return a=this.assign(),r=t,"("!==this.la()?t=c+"._sg_("+a.get+", "+t+" || null)":t+="["+a.get+"]",this.match("]"),this.member(t,a,n,r);case"(":t=t.replace(d,".__bind__");var v=this.arguments().join(",");return t=t+"("+v+")",this.match(")"),this.member(t,null,n)}n&&n.length&&this.depend.push(n);var m={get:t};return e&&(m.set=c+"._ss_("+(e.get?e.get:"'"+e+"'")+","+o.setName+","+(r?r:o.varName)+", '=', "+(s?1:0)+")"),m},v.arguments=function(t){t=t||")";var e=[];do this.la()!==t&&e.push(this.assign().get);while(this.eat(","));return e},v.primary=function(){var t=this.ll();switch(t.type){case"{":return this.object();case"[":return this.array();case"(":return this.paren();case"STRING":this.next();var e=""+t.value,n=~e.indexOf("'")?'"':"'";return i(n+e+n);case"NUMBER":return this.next(),i(""+t.value);case"IDENT":return this.next(),h(t.value)?i(t.value):t.value;default:this.error("Unexpected Token: "+t.type)}},v.object=function(){for(var t=[this.match("{").type],e=this.eat(["STRING","IDENT","NUMBER"]);e;){t.push("'"+e.value+"'"+this.match(":").type);var n=this.assign().get;t.push(n),e=null,this.eat(",")&&(e=this.eat(["STRING","IDENT","NUMBER"]))&&t.push(",")}return t.push(this.match("}").type),{get:t.join("")}},v.array=function(){var t,e=[this.match("[").type];if(this.eat("]"))e.push("]");else{for(;(t=this.assign())&&(e.push(t.get),this.eat(","));)e.push(",");e.push(this.match("]").type)}return{get:e.join("")}},v.paren=function(){this.match("(");var t=this.filter();return t.get="("+t.get+")",t.set=t.set,this.match(")"),t},t.exports=r},function(t,e){t.exports={element:function(t,e,n){return{type:"element",tag:t,attrs:e,children:n}},attribute:function(t,e,n){return{type:"attribute",name:t,value:e,mdf:n}},"if":function(t,e,n){return{type:"if",test:t,consequent:e,alternate:n}},list:function(t,e,n,r,i){return{type:"list",sequence:t,alternate:r,variable:e,body:n,track:i}},expression:function(t,e,n,r){return{type:"expression",body:t,constant:n||!1,setbody:e||!1,filters:r}},body:function(t){return{type:"body",body:t}},text:function(t){return{type:"text",text:t}},template:function(t){return{type:"template",content:t}}}},function(t,e,n){function r(t,e,n){return function(){var r=this.supr;this.supr=n[t];var i=e.apply(this,arguments);return this.supr=r,i}}function i(t,e,n){for(var i in e)e.hasOwnProperty(i)&&(u.hasOwnProperty(i)&&u[i](e[i],t,n),t[i]=s(e[i])&&s(n[i])&&a.test(e[i])?r(i,e[i],n):e[i])}var o=n(3),a=/xy/.test(function(){"xy"})?/\bsupr\b/:/.*/,s=function(t){return"function"==typeof t},u={events:function(t,e){var n=e._eventListeners||[],r=o.normListener(t);r.length&&(e._eventListeners=n.concat(r)),delete e.events}},c=["data","computed"],f=c.length;t.exports=function l(t){function e(){a.apply(this,arguments)}function n(t){for(var e=f;e--;){var n=c[e];r[n]&&t.hasOwnProperty(n)&&r.hasOwnProperty(n)&&(o.extend(r[n],t[n],!0),delete t[n])}return i(r,t,s),this}t=t||{};var r,a=this,s=a&&a.prototype||{};return"function"==typeof t?(r=t.prototype,t.implement=n,t.extend=l,t):(r=o.createProto(e,s),e.implement=n,e.implement(t),a.__after__&&a.__after__.call(e,a,t),e.extend=l,e)}},function(t,e,n){function r(t,e,n){var r,i=!!e.computed,a="string"==typeof t.template&&!e.template;e.data=e.data||{},e.computed=e.computed||{},t.data&&o.extend(e.data,t.data),t.computed&&o.extend(e.computed,t.computed);var u,f=t._eventListeners||[];e.events&&(u=o.normListener(e.events),u.length&&(f=f.concat(u)),delete e.events),e.data=e.data||{},e.computed=e.computed||{},t.data&&o.extend(e.data,t.data),t.computed&&o.extend(e.computed,t.computed);var a="string"==typeof t.template&&!e.template;return o.extend(t,e,!0),f&&f.length&&f.forEach(function(e){t.$on(e.type,e.listener)}),n&&n(),i&&(t.computed=c(t.computed)),t.$emit("$config",t.data),t.config&&t.config(t.data),t.$emit("$afterConfig",t.data),r=t.template,"string"==typeof r&&(r=s.parse(r),a?t.constructor.prototype.template=r:delete t.template),r}function i(t,e){if(t.parsed)return t;var n,r,i=t.value;t.name;if("string"==typeof i&&~i.indexOf(a.BEGIN)&&~i.indexOf(a.END)&&(!e||!e.nps)){var o=s.parse(i,{mode:2});1===o.length&&"expression"===o[0].type?n=o[0]:(r=!0,n=[],o.forEach(function(t){t.constant||(r=!1),n.push(t.body||"'"+t.text.replace(/'/g,"\\'")+"'")}),n=u.expression("["+n.join(",")+"].join('')",null,r)),t.value=n}return t.parsed=!0,t}var o=n(3),a=n(8),s=n(16),u=n(13),c=function(){function t(t){return function(e){return t.call(e,e.data)}}function e(t){return function(e,n){return t.call(e,n,e.data),n}}return function(n){if(n){var r,i,o,a={};for(var u in n)r=n[u],o=typeof r,"expression"!==r.type?"string"===o?a[u]=s.expression(r):(i=a[u]={type:"expression"},"function"===o?i.get=t(r):(r.get&&(i.get=t(r.get)),r.set&&(i.set=e(r.set)))):a[u]=r;return a}}}();t.exports={initDefinition:r,handleComputed:c,prepareAttr:i}},function(t,e,n){var r=n(1).exprCache,i=(n(3),n(12));t.exports={expression:function(t,e){return"string"==typeof t&&(t=t.trim())&&(t=r.get(t)||r.set(t,new i(t,{mode:2,expression:!0}).expression())),t?t:void 0},parse:function(t){return new i(t).parse()}}},function(t,e,n){function r(t,e){return"undefined"!=typeof t[e]?t[e]:t[e]=f.uid()}function i(t,e){return"change"===e&&u.msie<9&&t&&t.tagName&&"input"===t.tagName.toLowerCase()&&("checkbox"===t.type||"radio"===t.type)?"click":e}function o(t){if(t=t||window.event,t._fixed)return t;this.event=t,this.target=t.target||t.srcElement;var e=this.type=t.type,n=this.button=t.button;if(g.test(e)&&(this.pageX=null!=t.pageX?t.pageX:t.clientX+y.scrollLeft,this.pageY=null!=t.pageX?t.pageY:t.clientY+y.scrollTop,"mouseover"===e||"mouseout"===e)){for(var r=t.relatedTarget||t[("mouseover"===e?"from":"to")+"Element"];r&&3===r.nodeType;)r=r.parentNode;this.relatedTarget=r}("DOMMouseScroll"===e||"mousewheel"===e)&&(this.wheelDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3),this.which=t.which||t.keyCode,this.which||void 0===n||(this.which=1&n?1:2&n?3:4&n?2:0),this._fixed=!0}if("undefined"!=typeof window){var a,s,u=t.exports,c=n(1),f=n(3),l=n(18),h=document.createElement("div"),p=function(){},d=l.NAMESPACE;u.body=document.body,u.doc=document,u.tNode=h;var v=function(t){return(""+t).replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()})};h.addEventListener?(a=function(t,e,n){t.addEventListener(e,n,!1)},s=function(t,e,n){t.removeEventListener(e,n,!1)}):(a=function(t,e,n){t.attachEvent("on"+e,n)},s=function(t,e,n){t.detachEvent("on"+e,n)}),u.msie=parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1]),isNaN(u.msie)&&(u.msie=parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1])),u.find=function(t){if(document.querySelector)try{return document.querySelector(t)}catch(e){}return-1!==t.indexOf("#")?document.getElementById(t.slice(1)):void 0},u.inject=function(t,e,n){if(n=n||"bottom",t){if(Array.isArray(t)){var r=t;t=u.fragment();for(var i=0,o=r.length;o>i;i++)t.appendChild(r[i])}var a,s;switch(n){case"bottom":e.appendChild(t);break;case"top":(a=e.firstChild)?e.insertBefore(t,e.firstChild):e.appendChild(t);break;case"after":(s=e.nextSibling)?s.parentNode.insertBefore(t,s):e.parentNode.appendChild(t);break;case"before":e.parentNode.insertBefore(t,e)}}},u.id=function(t){return document.getElementById(t)},u.create=function(t,e){if("svg"===e){if(!c.svg)throw Error("the env need svg support");e=d.svg}return e?document.createElementNS(e,t):document.createElement(t)},u.fragment=function(){return document.createDocumentFragment()};var m={"class":function(t,e){"className"in t&&(!t.namespaceURI||t.namespaceURI===d.html)?t.className=e||"":t.setAttribute("class",e)},"for":function(t,e){"htmlFor"in t?t.htmlFor=e:t.setAttribute("for",e)},style:function(t,e){t.style?t.style.cssText=e:t.setAttribute("style",e)},value:function(t,e){t.value=null!=e?e:""}};u.attr=function(t,e,n){if(f.isBooleanAttr(e)){if("undefined"==typeof n)return t[e]||(t.attributes.getNamedItem(e)||p).specified?e:void 0;n?(t[e]=!0,t.setAttribute(e,e),u.msie&&u.msie<=7&&"checked"===e&&(t.defaultChecked=!0)):(t[e]=!1,t.removeAttribute(e))}else if("undefined"!=typeof n)m[e]?m[e](t,n):null===n?t.removeAttribute(e):t.setAttribute(e,n);else if(t.getAttribute){var r=t.getAttribute(e,2);return null===r?void 0:r}},u.on=function(t,e,n){var s=e.split(" "),c=function(e){var r=new o(e);r.origin=t,n.call(t,r)},f=r(t,"_nid");return n._events=n._events||{},s.forEach(function(e){e=i(t,e);var r=f+"-"+e;n._events[r]||(n._events[r]=c),a(t,e,n._events[r])}),u},u.off=function(t,e,n){var o=e.split(" "),a=r(t,"_nid");o.forEach(function(e){e=i(t,e);var r=a+"-"+e,o=n._events[r]||n;s(t,e,o)})},u.text=function(){var t={};return u.msie&&u.msie<9?(t[1]="innerText",t[3]="nodeValue"):t[1]=t[3]="textContent",function(e,n){var r=t[e.nodeType];return null==n?r?e[r]:"":void(e[r]=n)}}(),u.html=function(t,e){return"undefined"==typeof e?t.innerHTML:void(t.innerHTML=e)},u.replace=function(t,e){e.parentNode&&e.parentNode.replaceChild(t,e)},u.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)},u.css=function(t,e,n){if("object"==typeof e&&e)for(var r in e)e.hasOwnProperty(r)&&u.css(t,r,e[r]);else{if("undefined"==typeof n){var i;return u.msie<=8&&(i=t.currentStyle&&t.currentStyle[e],""===i&&(i="auto")),i=i||t.style[e],u.msie<=8&&(i=""===i?void 0:i),i}e=v(e),e&&(t.style[e]=n)}},u.addClass=function(t,e){var n=t.className||"";-1===(" "+n+" ").indexOf(" "+e+" ")&&(t.className=n?n+" "+e:e)},u.delClass=function(t,e){var n=t.className||"";t.className=(" "+n+" ").replace(" "+e+" "," ").trim()},u.hasClass=function(t,e){var n=t.className||"";return-1!==(" "+n+" ").indexOf(" "+e+" ")};var g=/^(?:click|dblclick|contextmenu|DOMMouseScroll|mouse(?:\w+))$/,y=document;y=y.compatMode&&"CSS1Compat"!==y.compatMode?y.body:y.documentElement,f.extend(o.prototype,{stop:function(){this.preventDefault().stopPropagation()},preventDefault:function(){return this.event.preventDefault?this.event.preventDefault():this.event.returnValue=!1,this},stopPropagation:function(){return this.event.stopPropagation?this.event.stopPropagation():this.event.cancelBubble=!0,this},stopImmediatePropagation:function(){this.event.stopImmediatePropagation&&this.event.stopImmediatePropagation()}}),u.nextFrame=function(){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){return setTimeout(t,16)},e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||function(t){clearTimeout(t)};return function(n){var r=t(n);return function(){e(r)}}}();var E;u.nextReflow=u.msie?function(t){return u.nextFrame(function(){E=document.body.offsetWidth,t()})}:u.nextFrame}},function(t,e){t.exports={COMPONENT_TYPE:1,ELEMENT_TYPE:2,ERROR:{UNMATCHED_AST:101},MSG:{101:"Unmatched ast and mountNode, report issue at https://github.com/regularjs/regular/issues"},NAMESPACE:{html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"},OPTIONS:{STABLE_INIT:{stable:!0,init:!0},FORCE_INIT:{force:!0,init:!0},STABLE:{stable:!0},INIT:{init:!0},SYNC:{sync:!0},FORCE:{force:!0}},DIFF:{REMOVE_ALL:1,ADD_ALL:0}}},function(t,e,n){function r(t,e){return"array"===e?t:"object"===e?h.keys(t):[]}function i(t,e,n){for(var r=[],i=0,o=t.length;o>i;i++){var a=this._walk(t[i],{element:e,fromElement:!0,attrs:t,extra:n});a&&r.push(a)}return r}function o(t,e){e&&(e.node?l.inject(t,e.node,"before"):e.prev?(l.inject(t,e.prev,"after"),e.prev=t):e.parent&&(l.inject(t,e.parent),e.prev=t))}function a(t){for(var e=t.length;e--;){var n=t[e];if("r-html"===n.name)return!0}}var s=n(20).diffArray,u=n(22),c=n(23),f=(n(12),n(13),n(24)),l=n(17),h=n(3),p=n(18),d=p.OPTIONS,v=p.ERROR,m=p.MSG,g=n(25),y=(n(8),n(15)),E=(n(18).DIFF,t.exports={});E.list=function(t,e){function n(t,e,n,r){for(var i=1;e>=i;i++){var o=n[t+i];if(r){var a=y(o.data[O]);if("undefined"!=typeof r[a]){null!==r[a]&&o.inject(!1);continue}}o.destroy(!0)}n.splice(t+1,e)}function i(n,r,i,o,s){for(var f=n;r>f;f++){var p=i[f],d=null;if(s){var v=y(p);d=s[v],d&&(s[v]=null)}var m=!!d;if(m)a(d.data,f,p);else{var g=h.createObject(N);a(g,f,p,o),d=w.$compile(t.body,{extra:g,namespace:T,record:!0,outer:e.outer,cursor:C}),d.data=g}var E=u.last(b.get(f));!E.parentNode||C&&C.node||(m?l:c).inject(u.node(d),E,"after"),S.splice(f+1,0,d)}}function a(t,e,n,r){t[$]=e,r?(t[A]=n,t[O]=r[n]):(t[O]=n,t[A]=null)}function p(t,e,n,r){for(var i=t;e>i;i++){var o=b.get(i+1),s=n[i];a(o.data,i,s,r)}}function d(t,e,r,o){var a=0,u=t.length;if(r||0===u&&0===e.length||(r=s(t,e,!0)),r&&r.length){for(var c=0;ca?0:a}if(u>a)for(var c=a;u>c;c++){var m=b.get(c+1);m.data[$]=c}}}function v(t,e,r){var o=t.length,a=e.length,s=Math.min(o,a);p(0,s,t,r),a>o?n(o,a-o,S):o>a&&i(a,o,t,r)}function m(t,e,r,o,a){for(var s=0,u=r.length;u>s;s++){var c=r[s];switch(c.mode){case 0:n(c.index,c.len,b.children,a);break;case 1:i(c.index,c.index+c.len,t,o,a)}}for(var f=b.children,l=1,h=f.length;h>l;l++){var p=f[l];p&&(p.data[O]=t[l-1],p.data[$]=l-1)}}function g(t,o,a,s,f){var l,p=h.typeOf(t),g=h.typeOf(o),y=r(t,p),E=r(o,g),x=y&&y.length,$=E&&E.length;if("object"===p&&(l=t),!$&&x){if(b.get(1)){var A=S.pop();A.destroy&&A.destroy(!0)}return i(0,x,y,l)}if(x)if(k)if(k===!0||f&&!a.length)v(y,E,l);else{if(s)for(var O in s){var C=s[O];S[C+1]&&(s[O]=S[C+1])}m(y,E,a,l,s)}else d(y,E,a,l);else if($&&n(0,$,b.children),I&&I.length){var P=w.$compile(I,{extra:N,record:!0,outer:e.outer,namespace:T});S.push(P),_.parentNode&&c.inject(u.node(P),_,"after")}}var y,x,_=(E.Regular,document.createComment("Regular list")),T=e.namespace,N=e.extra,w=this,b=new f([_]),S=b.children,$=t.variable+"_index",A=t.variable+"_key",O=t.variable,I=t.alternate,k=t.track,C=e.cursor;return o(_,C),k&&k!==!0&&(k=this._touchExpr(k),x=h.createObject(N),y=function(t,e){return x[O]=t,k.get(w,x)}),this.$watch(t.sequence,g,{init:!0,keyOf:y,diff:k!==!0,deep:!0}),C=null,b},E.template=function(t,e){var n,n,r=t.content,i=document.createComment("inlcude"),a=e.namespace,s=e.extra,u=new f([i]),c=e.cursor;if(o(i,c),r){var l=this;this.$watch(r,function(t){var r=u.get(1),o=typeof t;r&&(r.destroy(!0),u.children.pop()),t&&(u.push(n="function"===o?t(c?{cursor:c}:null):l.$compile("object"!==o?String(t):t,{record:!0,outer:e.outer,namespace:a,cursor:c,extra:s})),i.parentNode&&!c&&n.$inject(i,"before"))},d.INIT),c=null}return u};var x=0;E["if"]=function(t,e){var n,r,i=this,a=e.extra;if(e&&e.element){var s=function(o){o?(r&&u.destroy(r),t.consequent&&(n=i.$compile(t.consequent,{record:!0,element:e.element,extra:a}))):(n&&u.destroy(n),t.alternate&&(r=i.$compile(t.alternate,{record:!0,element:e.element,extra:a})))};return this.$watch(t.test,s,d.FORCE),{destroy:function(){n?u.destroy(n):r&&u.destroy(r)}}}var l=document.createComment("Regular if"+x++),h=new f;h.push(l);var p=null,v=e.namespace,m=e.cursor;o(l,m);var s=function(n,r){var o,s=!!n;if(s!==p){p=s,h.children[1]&&(h.children[1].destroy(!0),h.children.pop());var f={record:!0,outer:e.outer,namespace:v,extra:a,cursor:m};s?t.consequent&&t.consequent.length&&(o=i.$compile(t.consequent,f)):t.alternate&&t.alternate.length&&(o=i.$compile(t.alternate,f)),o&&(h.push(o),l.parentNode&&!m&&c.inject(u.node(o),l,"before")),m=null}};return this.$watch(t.test,s,d.FORCE_INIT),h},E._handleMountText=function(t,e){var n,r=t.node,i=l.text(r);if(i===e)n=r,t.next();else{var o=i.indexOf(e);if(!~o)throw Error(m[v.UNMATCHED_AST]);n=document.createTextNode(e),l.text(r,i.slice(o+e.length)),l.inject(n,r,"before")}return n},E.expression=function(t,e){var n,r=e.cursor,i=r&&r.node;if(i){var o=h.toText(this.$get(t));n=E._handleMountText(r,o)}else n=document.createTextNode("");return this.$watch(t,function(t){l.text(n,h.toText(t))},d.STABLE_INIT),n},E.text=function(t,e){var n,r=e.cursor,i=t.text,o=-1!==i.indexOf("&")?h.convertEntity(i):i;if(r&&r.node){var a=r.node;if(3!==a.nodeType){if(h.blankReg.test(o))return{code:v.UNMATCHED_AST}}else n=E._handleMountText(r,o)}return n||document.createTextNode(o)},E.element=function(t,e){var n,r,o,s=t.attrs,f=this.constructor,p=t.children,d=e.namespace,y=e.extra,x=e.cursor,_=t.tag,T=f.component(_);if("r-content"===_)return h.log("r-content is deprecated, use {#inc this.$body} instead (`{#include}` as same)","warn"),this.$body&&this.$body(x?{cursor:x}:null);if(x&&x.node&&3===x.node.nodeType)if(h.blankReg.test(l.text(x.node)))x.next();else if(!T&&"r-component"!==_)throw Error(m[v.UNMATCHED_AST]);if(T||"r-component"===_)return e.Component=T,E.component.call(this,t,e);if(x&&(o=x.node),"svg"===_&&(d="svg"),p&&p.length&&!a(s)){var N=o?o.firstChild:null;n=this.$compile(p,{extra:y,outer:e.outer,namespace:d,cursor:g(N,o)})}o?(r=o,x.next()):r=l.create(_,d,s),!n||h.isVoidTag(_)||o||c.inject(u.node(n),r),h.fixTagAST(t,f);var w=i.call(this,s,r,y);return{type:"element",group:n,node:function(){return r},last:function(){return r},destroy:function(t){t?c.remove(r,n?n.destroy.bind(n):h.noop):n&&n.destroy(),w.length&&w.forEach(function(t){t&&("function"==typeof t.destroy?t.destroy():t())})}}},E.component=function(t,e){for(var n,r,i,o,a=t.attrs,s=e.Component,c=e.cursor,l=this.constructor,p=e.extra,v=e.namespace,m=E.Regular.directive("ref"),g=this,x={},_=0,T=a.length;T>_;_++){var N=a[_];y.prepareAttr(N,"ref"===N.name&&m);var w=this._touchExpr(void 0===N.value?!0:N.value);w.constant&&(w=N.value=w.get(this)),N.value&&N.value.constant===!0&&(w=w.get(this));var b=N.name;if(!N.event){var S=b.match(h.eventReg);S&&(N.event=S[1])}if("cmpl"===N.mdf&&(w=h.getCompileFn(w,this,{record:!0,namespace:v,extra:p,outer:e.outer})),w&&"body"===w.type&&(w=h.getCompileFn(w.body,this,{record:!0,namespace:v,extra:p,outer:e.outer})),"is"===b&&!s){i=w;var $=this.$get(w,!0);if(s=l.component($),"function"!=typeof s)throw new Error("component "+$+" has not registed!")}var A;(A=N.event)?(o=o||{},o[A]=h.handleEvent.call(this,w,A)):(b=N.name=h.camelCase(b),w&&"expression"===w.type?x[b]=w.get(g):x[b]=w,"ref"===b&&null!=w&&(r=w),"isolate"===b&&(n="expression"===w.type?w.get(g):parseInt(w===!0?3:w,10),x.isolate=n))}var O,I={data:x,events:o,$parent:2&n?null:this,$root:this.$root,$outer:e.outer,_body:{ctx:this,ast:t.children}},e={namespace:v,cursor:c,extra:e.extra},k=new s(I,e);if(r&&this.$refs){O=m.link;var C=O.call(this,k,r);k.$on("$destroy",C)}for(var _=0,T=a.length;T>_;_++){var N=a[_],w=N.value||!0,b=N.name;"expression"!==w.type||N.event||(w=g._touchExpr(w),2&n||this.$watch(w,function(t,e){this.data[t]=e}.bind(k,b),d.SYNC),!w.set||1&n||k.$watch(b,g.$update.bind(g,w),{init:!0,last:this.data[b]}))}if(i&&"expression"===i.type){var P=new f;return P.push(k),this.$watch(i,function(t){var e=l.component(t);if(!e)throw new Error("component "+t+" has not registed!");var n=new e(I),i=P.children.pop();if(P.push(n),n.$inject(u.last(i),"after"),i.destroy(),r){var o=r.get?r.get(this):r;g.$refs[o]=n}},d.SYNC),P}return k},E.attribute=function(t,e){var n=t,r=this.constructor,i=n.name,o=r.directive(i);y.prepareAttr(t,o);var a=n.value||"",s=a.constant,u=e.element,c=this;if(a=this._touchExpr(a),s&&(a=a.get(this)),o&&o.link){var f={attrs:e.attrs,param:h.getParamObj(this,n.param)},p=o.link.call(c,u,a,i,f);return"function"==typeof o.update&&(h.isExpr(a)?this.$watch(a,function(t,e){o.update.call(c,u,t,e,f)}):o.update.call(c,u,a,void 0,f)),"function"==typeof p&&(p={destroy:p}),p}return"expression"===a.type?this.$watch(a,function(t,e){l.attr(u,i,t)},d.STABLE_INIT):h.isBooleanAttr(i)?l.attr(u,i,!0):l.attr(u,i,a),e.fromElement?void 0:{destroy:function(){l.attr(u,i,null)}}}},function(t,e,n){function r(t,e){return t===e}function i(t,e,n){for(var i=t.length,o=e.length,n=n||r,a=[],s=0;i>=s;s++)a.push([s]);for(var u=1;o>=u;u++)a[0][u]=u;for(var s=1;i>=s;s++)for(var u=1;o>=u;u++)n(t[s-1],e[u-1])?a[s][u]=a[s-1][u-1]:a[s][u]=Math.min(a[s-1][u]+1,a[s][u-1]+1);return a}function o(t,e,n,r){if(!n)return s.simpleDiff(t,e);for(var o=i(e,t,r),a=e.length,u=a,c=t.length,f=c,l=[],h=o[u][f];u>0||f>0;)if(0!==u)if(0!==f){var p=o[u-1][f-1],d=o[u-1][f],v=o[u][f-1],m=Math.min(v,d,p);m===d?(l.unshift(2),u--,h=d):m===p?(p===h?l.unshift(0):(l.unshift(1),h=p),u--,f--):(l.unshift(3),f--,h=v)}else l.unshift(2),u--;else l.unshift(3),f--;var g=0,y=3,E=2,x=1,a=0;c=0;for(var _=[],T={index:null,add:0,removed:[]},u=0;u0?null===T.index&&(T.index=c):null!=T.index&&(_.push(T),T={index:null,add:0,removed:[]}),l[u]){case g:a++,c++;break;case y:T.add++,c++;break;case E:T.removed.push(e[a]),a++;break;case x:T.add++,T.removed.push(e[a]),a++,c++}return null!=T.index&&_.push(T),_}function a(t,e,n,r,i){if(n){var a=s.values(t),c=s.values(e);return"function"==typeof r?u(a,c,r,i):o(a,c,n)}for(var f in t)if(e[f]!==t[f])return!0;for(var l in e)if(e[l]!==t[l])return!0;return!1}var s=n(3),u=n(21);t.exports={diffArray:o,diffObject:a,diffTrack:u}},function(t,e,n){function r(t,e,n){var r=e.length,c=t.length,f=[],l={isTrack:!0,steps:f};if(!u.simpleDiff(t,e))return l;if(l.dirty=!0,r&&!c)return i(f,0,0,r),l;if(c&&!r)return i(f,1,0,c),l;var h=u.slice(e),p=s(t,n),d=s(e,n),v=p.trackMap,m=d.trackMap,g={},y=d.untrack,E=y.length;if(E)for(;E--;){y[E];a(h,f,y[E])}for(var x=h.length,_=0;x>_;_++){var T=h[_],N=n(T);v.hasOwnProperty(N)||(g[N]=m[N],a(h,f,_),_--,x--)}for(var w=t.length,_=0,b=0;w>b;)if(_>=h.length)o(h,f,_,1),_++,b++;else{var N=n(h[_]),S=t[b],$=n(S);$!==N?(o(h,f,_,1),_++,b++):(_++,b++)}var A=h.length;if(A>b){i(f,0,b,A-b);for(var O=b;A>O;O++){var N=n(h[O]);g[N]=m[N]}}return l.oldKeyMap=g,l}function i(t,e,n,r,i){r=r||1;var o=t[t.length-1];return o&&o.mode===e&&(0===e&&o.index===n||1===e&&o.index+o.len===n)?(o.len++,t):(t.push({mode:e,index:n,len:r}),t)}function o(t,e,n,r){i(e,1,n,r,e),t.splice(n,0,null)}function a(t,e,n,r){i(e,0,n,r),t.splice(n,1)}function s(t,e){for(var n=[],r={},i=0,o=t.length;o>i;i++){var a=(t[i],e(t[i]));r.hasOwnProperty(a)?n.push(i):r[a]=i}return{untrack:n,trackMap:r}}var u=n(3),c=n(18).DIFF;c.ADD_ALL,c.REMOVE_ALL;t.exports=r},function(t,e,n){var r=n(17),i=n(23),o=t.exports={node:function(t){var e,n;if(t){if("function"==typeof t.node)return t.node();if("number"==typeof t.nodeType)return t;if(t.group)return o.node(t.group);if(t=t.children||t,Array.isArray(t)){var r=t.length;if(1===r)return o.node(t[0]);n=[];for(var i=0,r=t.length;r>i;i++)if(e=o.node(t[i]),Array.isArray(e))for(var a=0,s=e.length;s>a;a++)n.push(e[a]);else e&&n.push(e);return n}}},inject:function(t,e){var n=this,a=o.node(n.group||n);if(t===!1)return i.remove(a),n;if(!a)return n;if("string"==typeof t&&(t=r.find(t)),!t)throw Error("injected node is not found");if(i.inject(a,t,e),n.$emit){var s=n.parentNode,u="after"===e||"before"===e?t.parentNode:t;n.parentNode=u,n.$emit("$inject",t,e,s)}return n},last:function(t){var e=t.children;return"function"==typeof t.last?t.last():"number"==typeof t.nodeType?t:e&&e.length?o.last(e[e.length-1]):t.group?o.last(t.group):void 0},destroy:function(t,e){if(t){if("number"==typeof t.nodeType)return e&&r.remove(t);if("function"==typeof t.destroy)return t.destroy(e);if(Array.isArray(t))for(var n=0,i=t.length;i>n;n++)o.destroy(t[n],e)}}};r.element=function(t,e){if(!t)return e?[]:null;var n=o.node(t);if(1===n.nodeType)return e?[n]:n;for(var r=[],i=0;in&&(n=e)}),n):0}var a=n(3),s=n(17),u={},c=n(1);if("undefined"!=typeof window){var f="transitionend",l="animationend",h="transition",p="animation";"ontransitionend"in window||("onwebkittransitionend"in window?(f+=" webkitTransitionEnd",h="webkitTransition"):("onotransitionend"in s.tNode||"Opera"===navigator.appName)&&(f+=" oTransitionEnd",h="oTransition")),"onanimationend"in window||("onwebkitanimationend"in window?(l+=" webkitAnimationEnd",p="webkitAnimation"):"onoanimationend"in s.tNode&&(l+=" oAnimationEnd",p="oAnimation"))}u.inject=function(t,e,n,r){if(r=r||a.noop,Array.isArray(t)){for(var i=s.fragment(),o=0,u=0,c=t.length;c>u;u++)i.appendChild(t[u]);s.inject(i,e,n);var f=function(){o++,o===c&&r()};for(c===o&&r(),u=0;c>u;u++)t[u].onenter?t[u].onenter(f):f()}else{if(!t)return;s.inject(t,e,n),t.onenter?t.onenter(r):r()}},u.remove=function(t,e){function n(){i++,i===a&&e&&e()}if(t){var i=0;if(Array.isArray(t))for(var o=0,a=t.length;a>o;o++)u.remove(t[o],n);else"function"==typeof t.onleave?t.onleave(function(){r(t,e)}):r(t,e)}},u.startClassAnimate=function(t,e,n,r){var o,u,h,p;return!l&&!f||c.isRunning?n():(p=4!==r?a.once(function(){h&&clearTimeout(h),2===r&&s.delClass(t,o),3!==r&&s.delClass(t,e),s.off(t,l,p),s.off(t,f,p),n()}):a.once(function(){h&&clearTimeout(h),n()}),2===r?(s.addClass(t,e),o=a.map(e.split(/\s+/),function(t){return t+"-active"}).join(" "),s.nextReflow(function(){s.addClass(t,o),u=i(t),h=setTimeout(p,u)})):4===r?s.nextReflow(function(){s.delClass(t,e),u=i(t),h=setTimeout(p,u)}):s.nextReflow(function(){s.addClass(t,e),u=i(t),h=setTimeout(p,u)}),s.on(t,l,p),s.on(t,f,p),p)},u.startStyleAnimate=function(t,e,n){var r,o,u;return s.nextReflow(function(){s.css(t,e),r=i(t),u=setTimeout(o,r)}),o=a.once(function(){u&&clearTimeout(u),s.off(t,l,o),s.off(t,f,o),n()}),s.on(t,l,o),s.on(t,f,o),o},t.exports=u},function(t,e,n){function r(t){this.children=t||[]}var i=n(3),o=n(22),a=i.extend(r.prototype,{destroy:function(t){o.destroy(this.children,t),this.ondestroy&&this.ondestroy(),this.children=null},get:function(t){return this.children[t]},push:function(t){this.children.push(t)}});a.inject=a.$inject=o.inject,t.exports=r},function(t,e){function n(t,e){this.node=t,this.parent=e}var r=n.prototype;r.next=function(){return this.prev=this.node,this.node=this.node.nextSibling,this},t.exports=function(t,e){return new n(t,e)}},function(t,e,n){function r(t){return a[t]||t}function i(){}var o=n(3),a={destroy:"$destroy",update:"$update",init:"$init",config:"$config"},s={$on:function(t,e,n){if("object"==typeof t&&t)for(var i in t)this.$on(i,t[i],e);else{n=n||{};var o=this;t=r(t);var a,s=o._handles||(o._handles={}),u=s[t]||(s[t]=[]);n.once&&(a=function(){e.apply(this,arguments),this.$off(t,e)},e.real=a),u.push(a||e)}return this},$off:function(t,e){var n=this;if(n._handles){t||(this._handles={});var i,o=n._handles;if(t=r(t),i=o[t]){if(!e)return o[t]=[],n;e=e.real||e;for(var a=0,s=i.length;s>a;a++)if(e===i[a])return i.splice(a,1),n}return n}},$emit:function(t){var e,n,i,a=this,s=a._handles;if(t){var n=o.slice(arguments,1),i=r(t);if(!s)return a;if(!(e=s[i]))return a;e.length>1&&(e=e.slice());for(var u=0,c=e.length;c>u;u++)"function"==typeof e[u]&&e[u].apply(a,n);return a}},$once:function(t,e){var n=o.slice(arguments);return n.push({once:!0}),this.$on.apply(this,n)}};o.extend(i.prototype,s),i.mixTo=function(t){t="function"==typeof t?t.prototype:t,o.extend(t,s)},t.exports=i},function(t,e,n){function r(){}var i=n(3),o=n(16).expression,a=n(20),s=n(21),u=a.diffArray,c=a.diffObject,f={$watch:function(t,e,n){var r,o,a,s,u=!1,c=this.__ext__;this._watchers||(this._watchers=[]),this._watchersForStable||(this._watchersForStable=[]),n=n||{},n===!0&&(n={deep:!0});var f=i.uid("w_");if(Array.isArray(t)){for(var l=[],h=0,p=t.length;p>h;h++)l.push(this.$expression(t[h]).get);var d=[];a=function(t){for(var e=!0,n=0,r=l.length;r>n;n++){var o=l[n](t,c);i.equals(o,d[n])||(e=!1,d[n]=o)}return e?!1:d}}else"function"==typeof t?r=t.bind(this):(t=this.$expression(t),i.isExpr(t)?(r=t.get,o=t.once):(r=function(){return t},o=!0,u=!0));var v={id:f,get:r,fn:e,once:o,force:n.force,diff:n.diff,keyOf:n.keyOf,test:a,deep:n.deep,last:n.sync?r(this):n.last +};if(this[n.stable||u?"_watchersForStable":"_watchers"].push(v),s=this._records&&this._records.length,s&&this._records[s-1].push(v),n.init===!0){var m=this.$phase;this.$phase="digest",this._checkSingleWatch(v),this.$phase=m}return v},$unwatch:function(t){if(this._watchers&&t){var e=this._watchers,n=typeof t;if("object"===n){var r=t.length;if(r)for(;r-->=0;)this.$unwatch(t[r]);else t.removed=!0}else if("number"===n){var o=t;return t=i.findItem(e,function(t){return t.id===o}),t||(t=i.findItem(this._watchersForStable,function(t){return t.id===o})),this.$unwatch(t)}return this}},$expression:function(t){return this._touchExpr(o(t))},$digest:function(){if("digest"!==this.$phase&&!this._mute){this.$phase="digest";for(var t=!1,e=0;t=this._digest();)if(++e>20)throw Error("there may a circular dependencies reaches");var n=this._digest(!0);(e>0||n)&&this.$emit&&(this.$emit("$update"),this.devtools&&this.devtools.emit("flush",this)),this.$phase=null}},_digest:function(t){if(!this._mute){var e,n,r,i=t?this._watchersForStable:this._watchers,o=!1,a=i&&i.length;if(a)for(var s=0,u=0,c=0;a>c;c++){n=i[c];var f=!n||n.removed;f?u+=1:(r=this._checkSingleWatch(n),r&&(o=!0)),f&&c!==a-1||(u&&(i.splice(s,u),a-=u,c-=u,u=0),s=c+1)}if(e=this._children,e&&e.length)for(var l=0,h=e.length;h>l;l++){var p=e[l];p&&p._digest(t)&&(o=!0)}return o}},_checkSingleWatch:function(t){var e=!1;if(t){var n,r,o,a,f,l,h,p;if(t.test){var d=t.test(this);d&&(e=!0,t.fn.apply(this,d))}else n=t.get(this),r=t.last,h=t.keyOf,(n!==r||t.force)&&(o=i.typeOf(r),a=i.typeOf(n),f=!0,"object"===a&&"object"===o&&t.deep?(l=c(n,r,t.diff,h),l.isTrack&&(p=l,l=p.steps),(l===!0||l.length)&&(e=!0)):"array"!==a||"undefined"!=o&&"array"!==o?(f=i.equals(n,r),(!f||t.force)&&(t.force=null,e=!0)):("function"==typeof h?(p=s(n,t.last||[],h),l=p.steps,p.dirty&&(e=!0)):l=u(n,t.last||[],t.diff),e||"array"===o&&l!==!0&&!l.length||(e=!0)));return e&&!t.test&&("object"===a&&t.deep||"array"===a?t.last=i.clone(n):t.last=n,t.fn.call(this,n,r,l,p&&p.oldKeyMap,p&&p.dirty),t.once&&this.$unwatch(t)),e}},$set:function(t,e){if(null!=t){var n=typeof t;if("string"===n||"expression"===t.type)t=this.$expression(t),t.set(this,e);else if("function"===n)t.call(this,this.data);else for(var r in t)this.$set(r,t[r])}},$get:function(t,e){return e&&"string"==typeof t?t:this.$expression(t).get(this)},$update:function(){var t=this;if("destroyed"===t.$phase)return this;do{if(t.data.isolate||!t.$parent)break;t=t.$parent}while(t);var e=t.$phase;return t.$phase="digest",this.$set.apply(this,arguments),t.$phase=e,t.$digest(),this},_record:function(){this._records||(this._records=[]),this._records.push([])},_release:function(){return this._records.pop()}};i.extend(r.prototype,f),r.mixTo=function(t){return t="function"==typeof t?t.prototype:t,i.extend(t,f)},t.exports=r},function(t,e){var n=t.exports={};n.json={get:function(t){return"undefined"!=typeof JSON?JSON.stringify(t):t},set:function(t){return"undefined"!=typeof JSON?JSON.parse(t):t}},n.last=function(t){return t&&t[t.length-1]},n.average=function(t,e){return t=t||[],t.length?n.total(t,e)/t.length:0},n.total=function(t,e){var n=0;if(t)return t.forEach(function(t){n+=e?t[e]:t}),n}},function(t,e,n){var r=n(3),i=n(17),o=(n(23),n(9)),a=n(18),s=a.NAMESPACE,u=a.OPTIONS,c=u.STABLE,f={deep:!0,stable:!0};n(30),n(31),t.exports={"r-class":function(t,e){"string"==typeof e&&(e=r.fixObjStr(e));var n=t.namespaceURI&&t.namespaceURI!==s.html;this.$watch(e,function(e){var r=n?t.getAttribute("class"):t.className;r=" "+(r||"").replace(/\s+/g," ")+" ";for(var o in e)e.hasOwnProperty(o)&&(r=r.replace(" "+o+" "," "),e[o]===!0&&(r+=o+" "));r=r.trim(),n?i.attr(t,"class",r):t.className=r},f)},"r-style":function(t,e){"string"==typeof e&&(e=r.fixObjStr(e)),this.$watch(e,function(e,n){for(var r in n)n.hasOwnProperty(r)&&!e.hasOwnProperty(r)&&i.css(t,r,"");for(r in e)e.hasOwnProperty(r)&&i.css(t,r,e[r])},f)},"r-hide":{link:function(t,e){var n,i=null;r.isExpr(e)||"string"==typeof e?this.$watch(e,function(e){var r=!!e;r!==i&&(i=r,r?t.onleave?n=t.onleave(function(){t.style.display="none",n=null}):t.style.display="none":(n&&n(),t.style.display="",t.onenter&&t.onenter()))},c):e&&(t.style.display="none")},ssr:function(t){return t?'style="display:none"':""}},"r-html":{ssr:function(t,e){return e.body=t,""},link:function(t,e){this.$watch(e,function(e){e=e||"",i.html(t,e)},{force:!0,stable:!0})}},ref:{accept:a.COMPONENT_TYPE+a.ELEMENT_TYPE,link:function(t,e){var n,i=this.$refs||(this.$refs={});return r.isExpr(e)?this.$watch(e,function(e,r){n=e,i[r]===t&&(i[r]=null),n&&(i[n]=t)},c):i[n=e]=t,function(){i[n]=null}}}},o.directive(t.exports)},function(t,e,n){function r(t,e,n){if(n)for(var r,i=t.target;i&&i!==n;){for(var o=0,a=e.length;a>o;o++)r=e[o],r&&r.element===i&&r.fire(t);i=i.parentNode}}var i=n(3),o=n(17),a=n(9);a._addProtoInheritCache("event"),a.directive(/^on-\w+$/,function(t,e,n,r){if(n&&e){var i=n.split("-")[1];return this._handleEvent(t,i,e,r)}}),a.directive(/^(delegate|de)-\w+$/,function(t,e,n){function a(t){r(t,u[c],s.parentNode)}var s=this.$root,u=s._delegates||(s._delegates={});if(n&&e){var c=n.split("-")[1],f=i.handleEvent.call(this,e,c);u[c]||(u[c]=[],s.parentNode?o.on(s.parentNode,c,a):s.$on("$inject",function(t,e,n){var r=this.parentNode;n&&o.off(n,c,a),r&&o.on(this.parentNode,c,a)}),s.$on("$destroy",function(){s.parentNode&&o.off(s.parentNode,c,a),u[c]=null}));var l={element:t,fire:f};return u[c].push(l),function(){var t=u[c];if(t&&t.length)for(var e=0,n=t.length;n>e;e++)t[e]===l&&t.splice(e,1)}}})},function(t,e,n){function r(t,e,n){function r(){e.set(i,this.value),o.last=this.value,i.$update()}var i=this,o=this.$watch(e,function(e){for(var n=t.getElementsByTagName("option"),r=0,i=n.length;i>r;r++)if(n[r].value==e){t.selectedIndex=r;break}},l);return c.on(t,"change",r),void 0===e.get(i)&&t.value&&e.set(i,t.value),function(){c.off(t,"change",r)}}function i(t,e,n){function r(){d=!0}function i(t){d=!1,v.call(this,t)}var o,a=n.param,f=a.lazy;"throttle"in a&&(o=a.throttle===!0?400:parseInt(a.throttle,10));var h=this,p=this.$watch(e,function(e){t.value!==e&&(t.value=null==e?"":""+e)},l),d=!1,v=function(t){if(!d){d=!1;var n=this;if("cut"===t.type||"paste"===t.type)u.nextTick(function(){var t=n.value;e.set(h,t),p.last=t,h.$update()});else{var r=n.value;e.set(h,r),p.last=r,h.$update()}}};if(o&&!f){v=u.throttle(v,o)}return void 0===s&&(s=9!==c.msie&&"oninput"in document.createElement("input")),f?c.on(t,"change",v):("function"==typeof CompositionEvent&&(t.addEventListener("compositionstart",r),t.addEventListener("compositionend",i)),s?t.addEventListener("input",v):c.on(t,"paste keyup cut change",v)),void 0===e.get(h)&&t.value&&e.set(h,t.value),function(){return f?c.off(t,"change",v):void(s?t.removeEventListener("input",v):c.off(t,"paste keyup cut change",v))}}function o(t,e){var n=this,r=this.$watch(e,function(e){c.attr(t,"checked",!!e)},l),i=function(){var t=this.checked;e.set(n,t),r.last=t,n.$update()};return e.set&&c.on(t,"change",i),void 0===e.get(n)&&e.set(n,!!t.checked),function(){e.set&&c.off(t,"change",i)}}function a(t,e){var n=this,r=(this.$watch(e,function(e){e==t.value?t.checked=!0:t.checked=!1},l),function(){var t=this.value;e.set(n,t),n.$update()});return e.set&&c.on(t,"change",r),void 0===e.get(n)&&t.checked&&e.set(n,t.value),function(){e.set&&c.off(t,"change",r)}}var s,u=n(3),c=n(17),f=n(18).OPTIONS,l=f.STABLE,h=n(9),p={text:i,select:r,checkbox:o,radio:a};h.directive("r-model",{param:["throttle","lazy"],link:function(t,e,n,r){var i=t.tagName.toLowerCase(),o=i;return"input"===o?o=t.type||"text":"textarea"===o&&(o="text"),"string"==typeof e&&(e=this.$expression(e)),p[o]?p[o].call(this,t,e,r):"input"===i?p.text.call(this,t,e,r):void 0}})},function(t,e,n){function r(t){var e,n=[],r=0,i=o.noop,a={type:t,start:function(t){return e=o.uid(),"function"==typeof t&&(i=t),r>0?r=0:a.step(),a.compelete},compelete:function(){e=null,i&&i(),i=o.noop,r=0},step:function(){n[r]&&n[r](a.done.bind(a,e))},done:function(t){t===e&&(rE;E++)if(u=m[E],d=u.split(":"),h=d[0]&&d[0].trim(),p=d[1]&&d[1].trim(),h)if(h!==c)if(h!==f){var v=s.animation(h);if(!v||!l)throw Error(v?"you should start with `on` or `event` in animation":"undefined animator 【"+h+"】");l.push(v.call(this,{element:t,done:l.done,param:p}))}else n(p),"leave"===p?(t.onleave=l.start,y.push(a(t))):"enter"===p?(t.onenter=l.start,y.push(a(t))):"on"+p in t?y.push(this._handleEvent(t,p,l.start)):(this.$on(p,l.start),y.push(this.$off.bind(this,p,l.start)));else n("when"),this.$watch(p,i.bind(this,l.start));return y.length?function(){y.forEach(function(t){t()})}:void 0}var o=n(3),a=n(23),s=(n(17),n(9)),u=/\s+/,c="when",f="on";s._addProtoInheritCache("animation"),s.animation({wait:function(t){var e=parseInt(t.param)||0;return function(t){setTimeout(t,e)}},"class":function(t){var e=t.param.split(","),n=e[0]||"",r=parseInt(e[1])||1;return function(e){a.startClassAnimate(t.element,n,e,r)}},call:function(t){var e=this.$expression(t.param).get,n=this;return function(t){e(n),n.$update(),t()}},emit:function(t){var e=t.param,n=e.split(","),r=n[0]||"",i=n[1]?this.$expression(n[1]).get:null;if(!r)throw Error("you shoud specified a eventname in emit command");var o=this;return function(t){o.$emit(r,i?i(o):void 0),t()}},style:function(t){var e,n={},r=t.param,i=r.split(",");return i.forEach(function(t){if(t=t.trim()){var r=t.split(u),i=r.shift(),o=r.join(" ");if(!i||!o)throw Error("invalid style in command: style");n[i]=o,e=!0}}),function(r){e?a.startStyleAnimate(t.element,n,r):r()}}}),s.directive("r-animation",i),s.directive("r-anim",i)},function(t,e,n){function r(t){t.implement({$timeout:function(t,e){return e=e||0,setTimeout(function(){t.call(this),this.$update()}.bind(this),e)},$interval:function(t,e){return e=e||1e3/60,setInterval(function(){t.call(this),this.$update()}.bind(this),e)}})}var i=n(9);i.plugin("timeout",r),i.plugin("$timeout",r)}])}); \ No newline at end of file diff --git a/lib/walkers.js b/lib/walkers.js index 1f34c33..75700ca 100644 --- a/lib/walkers.js +++ b/lib/walkers.js @@ -713,12 +713,16 @@ walkers.component = function(ast, options){ value = self._touchExpr(value); // use bit operate to control scope if( !(isolate & 2) ) + // sync data from parent to child this.$watch(value, (function(name, val){ this.data[name] = val; }).bind(component, name), OPTIONS.SYNC) if( value.set && !(isolate & 1 ) ) - // sync the data. it force the component don't trigger attr.name's first dirty echeck - component.$watch(name, self.$update.bind(self, value), OPTIONS.INIT); + // sync data from child to parent. it force the component don't trigger attr.name's first dirty echeck + component.$watch(name, self.$update.bind(self, value), { + init: true, + last: this.data[ name ] + }); } } if(is && is.type === 'expression' ){