text: /*!
   * sugar.js v1.4.3 (c) 2019 TANG
   * Released under the MIT license
   * Thu Feb 07 2019 16:57:27 GMT+0800 (CST)
   */
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Sugar=e()}(this,function(){"use strict";function t(t,e){return typeof t===e}function e(t){return"[object Object]"===pe.toString.call(t)}function n(t){return Array.isArray(t)}function i(e){return t(e,"function")}function s(e){return t(e,"string")}function r(e){return t(e,"boolean")}function o(e){return t(e,"number")&&!isNaN(e)}function a(t){return!(!t||!e(t)||t.nodeType||t===t.window)&&!(t.constructor&&!ve.call(t.constructor.prototype,"isPrototypeOf"))}function u(t){return 0===Object.keys(t).length}function h(t){return null==t?"":t.toString()}function c(t){if(s(t)){var e=Number(t);return o(e)?e:t}return t}function l(){}function f(){_e&&_e.warn.apply(_e,arguments)}function d(){_e&&_e.error.apply(_e,arguments)}function p(t,e){return t&&ve.call(t,e)}function v(t,e,n,i){return Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!!i,configurable:!0})}function _(t,i,s){var r,o;if(s||(s=this),n(t))for(r=0;r<t.length&&!1!==(o=i.call(s,t[r],r,t));r++)null===o&&(t.splice(r,1),r--);else if(e(t)){var a=Object.keys(t);for(r=0;r<a.length;r++){var u=a[r];if(!1===(o=i.call(s,t[u],u,t)))break;null===o&&delete t[u]}}}function m(t){_(t,function(){return null})}function g(){var t,e,s,o,u,h,c=arguments,l=arguments[0]||{},f=1,d=arguments.length,p=!1;for(r(l)&&(p=l,l=arguments[f]||{},f++),"object"==typeof l||i(l)||(l={}),f===d&&(l=this,f--);f<d;f++)if(null!=(t=c[f]))for(e in t)s=l[e],o=t[e],l!==o&&(p&&o&&(a(o)||(u=n(o)))?(u?(u=!1,h=s&&n(s)?s:[]):h=s&&a(s)?s:{},l[e]=g(p,h,o)):void 0!==o&&(l[e]=o));return l}function b(t){var i;return n(t)?i=g(!0,[],t):e(t)&&(i=g(!0,{},t)),i||t}function y(t){return document.createElement(t)}function w(){return document.createDocumentFragment()}function x(t){for(var e,n=w();e=t.firstChild;)n.appendChild(e);return n}function $(t){return t.replace(me,"")}function C(t,e,n){if(!e)return t;for(var i=e.split(".");i.length>1&&p(t,i[0]);)t=t[i.shift()];return e=i[0],void 0!==n?void(t[e]=n):t[e]}function k(t,e,n,i,s,r){var o=r||this,a=new XMLHttpRequest;return a.open(n,e,!0),a.onreadystatechange=function(){var e=a.status,n=null,i=null;if(4===a.readyState){var r=a.responseText;if("text"!==t)try{r=JSON.parse(r)}catch(t){}200===e?n={success:!0,result:r}:i={result:null,success:!1,status:e},s.call(o,i,n)}},i&&a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(i),a}function O(t,e,n,s,r){var o=[];return i(e)&&(r=s,s=n,n=e,e=null),_(e,function(t,e){o.push(e+"="+encodeURIComponent(t))}),o.length&&(t=t+"?"+o.join("&")),k(r||"json",t,"GET",null,n,s)}function A(t,e,n,i){return k("json",t,"POST",e?JSON.stringify(e):null,n,i)}function N(t,e,n,i){return O(t,e,n,i,"text")}function D(t,e){return i(e)&&we.test(xe.call(e))?function(){this.Super=t,e.apply(this,arguments)}:e}function S(){}function j(t){var e=null;return _(ye,function(n){if((n.__rd__&&n.__rd__.name)===t)return e=n,!1}),e}function I(t,e,n,i){return{type:t,from:e,to:null,count:0,name:n,param:i,returns:null}}function T(t,e){var n=t[e.name];if(i(n))return e.to=t,++e.count,n.call(t,e)}function E(t,e,n){i(e)&&e.call(n,t)}function L(t,e,n,i,s){for(var r=I("fire",t,e,n),o=t.getParent();o;){if(!1===T(o,r))return void E(r,i,s);r.from=o,o=o.getParent()}E(r,i,s)}function P(t,e,n,i,s){for(var r=I("broadcast",t,e,n),o=t.getChilds(!0).slice(0);o.length;){var a=o.shift();!1!==T(a,r)&&(r.from=a,Array.prototype.push.apply(o,a.getChilds(!0)))}E(r,i,s)}function q(t,n,i,r,o,a){if(s(n)){var u,h=n.split("."),c=j(h.shift());h.length?_(h,function(t){return u=c.getChild(t),c=u,null}):u=c,c=null,e(u)&&(n=u)}var l=I("notify",t,i,r);if(!e(n))return E(l,o,a),f("Component: ["+n+"] is not exist!");T(n,l),E(l,o,a)}function R(t,n,i,s){var r=I("globalCast","__core__",t,n);_(ye,function(t,n){e(t)&&"0"!==n&&T(t,r)}),E(r,i,s)}function M(t){this.path=t,this.watchers=[],this.guid=Ae++}function z(t){return t}function U(t){return""}function H(t){var e=t.charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57)return De;switch(e){case 91:case 93:case 46:case 34:case 39:return Se;default:return je}}function F(t){var e=[],n=t.split(""),i=n.length-1,s=H(n[0]);return Te.init(s),_(n,function(t,n){var s=H(t),r=Te.set(s,t);r&&e.push(r),n===i&&Te.saves&&(e.push(Te.saves),Te.reset())}),e}function B(t,e){for(;e.length;)t=t[e.shift()];return t}function V(t){return F($(t))}function G(t,n,i){var s=b(i),r=s.pop(),o=B(t,s);e(o)&&(o[r]=n)}function W(t){var e=ze.length;return ze[e]=t,'"'+e+'"'}function Z(t,e){return ze[e]}function J(t){return 0===t.indexOf("$event")||He.test(t)}function Q(t){var e=t.charAt(0),n=t.slice(1);return J(n)?t:(n=n.indexOf('"')>-1?n.replace(Ee,Z):n,e+"scope."+n)}function X(t){return Re.test(t)&&!Le.test(t)}function K(t){return X(t)?"scope."+t:(t=(" "+t).replace(Pe,W),t=t.replace(qe,Q),t=t.replace(Ee,Z))}function Y(t){if(Fe.test(t))return f("Avoid using unallow keyword in expression ["+t+"]"),l;try{return new Function("scope","return "+K(t)+";")}catch(e){return d("Invalid generated expression: ["+t+"]"),l}}function tt(t){var e=V(t);return e.length?function(t,n){G(t,n,e)}:(d("Invalid setter expression ["+t+"]"),l)}function et(t,e){var n=t&&t.__ob__,i=n&&n.dep.guid;if(i){if(Be.indexOf(i)>-1)return;Be.push(i)}_(t,function(t){et(t,!1)}),e&&(Be.length=0)}function nt(t,e,n,s){this.vm=t,g(this,e),this.callback=n,this.context=s||this,this.depIds=[],this.newDepIds=[],this.shallowIds=[],this.depends=[],this.newDepends=[];var r=e.once,o=e.expression,a=i(o);this.getter=a?o:Y(o),this.setter=!r&&e.duplex?tt(o):null,this.oldVal=null,this.value=r?this.getValue():this.get()}function it(t){this.parser=t,this.scope=t.scope}function st(t,e,n,i){this.vm=t,this.el=e,this.desc=n,this.scope=i,this.parse()}function rt(t){return t.prototype=Object.create(st.prototype)}function ot(t){return 1===t.nodeType}function at(t){return 3===t.nodeType}function ut(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function ht(t,e){return t.getAttribute(e)||""}function ct(t,e){t.removeAttribute(e)}function lt(t,e,n){if(null==n||!1===n)return ct(t,e);!0===n?(t[e]=n,ft(t,e)||t.setAttribute(e,"")):n!==ht(t,e)&&t.setAttribute(e,n)}function ft(t,e){return t.hasAttribute(e)}function dt(t,e){var n,i=t.classList;return i?i.contains(e):(n=" "+ht(t,"class")+" ",n.indexOf(" "+e+" ")>-1)}function pt(t,e){var n,i=t.classList;e&&!dt(t,e)&&(i?i.add(e):(n=" "+ht(t,"class")+" ",-1===n.indexOf(" "+e+" ")&&lt(t,"class",(n+e).trim())))}function vt(t,e){var n,i,s=t.classList;if(e&&dt(t,e)){if(s)s.remove(e);else{for(i=" "+e+" ",n=" "+ht(t,"class")+" ";n.indexOf(i)>-1;)n=n.replace(i," ");lt(t,"class",n.trim())}t.className||ct(t,"class")}}function _t(t,e,n,i){t.addEventListener(e,n,i)}function mt(t,e,n,i){t.removeEventListener(e,n,i)}function gt(){this.empty=ut,this.getAttr=ht,this.removeAttr=ct,this.setAttr=lt,this.hasAttr=ft,this.hasClass=dt,this.addClass=pt,this.removeClass=vt,this.addEvent=_t,this.removeEvent=mt}function bt(t,e){var n=e.split("."),i=n.indexOf("self")>-1,s=n.indexOf("stop")>-1,r=n.indexOf("one")>-1,o=n.indexOf("prevent")>-1,a=n.indexOf("capture")>-1,u=null;return 0===t.indexOf("key")&&_(n,function(t){if(/^(\d)*$/.test(t))return u=+t,!1}),{self:i,stop:s,prevent:o,capture:a,keyCode:u,one:r}}function yt(t){var e=[],n=t.args,i=t.expression.trim();if(n){var s=n.indexOf("."),r=-1===s?n:n.substr(0,s),o=-1===s?"":n.substr(s+1,n.length);e=[{type:r,handler:i,modifier:o}]}else/^{.*}$/.test(i)&&(i=i.substr(1,i.length-2),_($(i).split(","),function(t){var n=t.split(":");e.push({type:n[0],handler:n[1],modifier:""})}));return e}function wt(t){try{return new Function("scope","$event",K(t))}catch(e){return d("Invalid generated expression: ["+t+"]"),l}}function xt(){st.apply(this,arguments)}function $t(){st.apply(this,arguments)}function Ct(t){for(var e=0;e<Ke.length;e++){var n=Ke[e];v(t,n,Xe[n])}}function kt(t){Je?t.__proto__=Xe:Ct(t)}function Ot(t,e){return t?t+"*"+e:e}function At(t,e){_(t,function(n,i){jt(t,i,n,Ot(e,i))})}function Nt(t,e){kt(t),_(t,function(t,n){St(t,Ot(e,n))})}function Dt(t,e){this.dep=new M(e),n(t)?Nt(t,e):At(t,e),v(t,"__ob__",this)}function St(t,i){if(e(t)||n(t))return p(t,"__ob__")?t.__ob__:new Dt(t,i||"")}function jt(t,e,i,s){var r=new M(s),o=Object.getOwnPropertyDescriptor(t,e),a=o&&o.get,u=o&&o.set,h=St(i,s);Object.defineProperty(t,e,{get:function(){var e=a?a.call(t):i;return M.watcher&&(r.depend(),h&&h.dep.depend()),n(e)&&_(e,function(t){var e=t&&t.__ob__;e&&e.dep.depend()}),e},set:function(n){n!==(a?a.call(t):i)&&(r.beforeNotify(),u?u.call(t,n):i=n,h=St(n,e),r.notify())}})}function It(t,e){var n=new nt(t,{expression:e.bind(t)});return function(){return M.watcher&&_(n.depends,function(t){t.depend()}),n.value}}function Tt(t,e){_(e,function(e,n){if(!i(e))return f("computed property ["+n+"] must be a getter function!");Object.defineProperty(t,n,{set:l,get:It(t,e)})})}function Et(t,e){var n,i,s=t.$hooks,r=e.__afterHook__,o=e.__beforeHook__;return r&&(n=s[r]),o&&(i=s[o]),{after:n,before:i}}function Lt(){return Math.random().toString(36).substr(2)}function Pt(){st.apply(this,arguments)}function qt(t,e){for(var n=t.$els,i=e.childNodes,s=0;s<i.length;s++){var r=i[s];if(ot(r)){for(var o=r.attributes,a=0;a<o.length;a++){var u=o[a];"v-el"===u.name&&p(n,u.value)&&(n[u.value]=null)}r.hasChildNodes()&&qt(t,r)}}}function Rt(){return document.createTextNode("")}function Mt(t,e){var n=t.parentNode;n&&n.replaceChild(e,t)}function zt(){st.apply(this,arguments)}function Ut(){st.apply(this,arguments)}function Ht(){st.apply(this,arguments)}function Ft(t){var e=t.style.display;v(t,on,"none"===e?"":e)}function Bt(t,e){t.style.display=e}function Vt(){st.apply(this,arguments)}function Gt(t,i){var s={};return _(t,function(t,r){var o,a=i[r];if(e(t))o=Gt(t,a),u(o)||(s[r]=o);else if(n(t)){var h=[];_(t,function(t,n){var i;e(t)?(i=Gt(t,a[n]),h.push(i)):a.indexOf(t)<0&&h.push(t)}),s[r]=h}else t!==a&&(s[r]=t)}),s}function Wt(t,e){var i=[];return n(t)&&n(e)?(_(t,function(t){e.indexOf(t)<0&&i.push(t)}),i):t}function Zt(t,i){var s=n(t)&&n(i),r=e(t)&&e(i),o=r?Gt:s?Wt:null;return{after:o&&o(t,i)||t,before:o&&o(i,t)||i}}function Jt(t,n){var i=t.style;if(!e(n))return f("v-bind for style must be a type of Object",n);_(n,function(t,e){i[e]!==t&&(i[e]=t)})}function Qt(t,e,n){_(e.split(" "),function(e){n?vt(t,e):pt(t,e)})}function Xt(t,i,r){s(i)?Qt(t,i,r):n(i)?_(i,function(e){Qt(t,e,r)}):e(i)&&_(i,function(e,n){Qt(t,n,r||!e)})}function Kt(){st.apply(this,arguments)}function Yt(t,e){hn=Date.now(),setTimeout(function(){Date.now()-hn>=e&&t.call(t)},e)}function te(t,e){for(var n=[],i=t.options,s=0;s<i.length;s++){var r=i[s],o=r.value;r.selected&&n.push(ee(o,e))}return n}function ee(t,e){return e?c(t):t}function ne(t,e){for(var n=0;n<e.length;n++)if(e[n]==t)return n;return-1}function ie(){st.apply(this,arguments)}function se(){st.apply(this,arguments)}function re(t){return 0===t.indexOf("v-")}function oe(t){return ot(t)&&ft(t,"v-once")}function ae(t){return ft(t,"v-if")||ft(t,"v-for")||ft(t,"v-pre")}function ue(t){if(ot(t)&&t.hasAttributes()){for(var e=t.attributes,n=0;n<e.length;n++)if(re(e[n].name))return!0}else if(at(t)&&wn.test(t.textContent))return!0}function he(t){var e,n,i=t.name,s=t.value,r=i.indexOf(":");return r>-1?(n=i.substr(r+1),e=i.substr(0,r)):e=i,{args:n,attr:i,directive:e,expression:s}}function ce(t){t.__afterHook__||v(t,"__afterHook__",ht(t,"v-hook:after")),t.__beforeHook__||v(t,"__beforeHook__",ht(t,"v-hook:before"))}function le(t,e){var n,i,s;return function(r,o,a){var u=r.path;u===n&&o===i&&a===s||(t.apply(e,arguments),n=u,i=o,s=a)}}function fe(t){var n=t.model,r=t.view,o=t.computed,a=t.watchAll;return s(r)&&(r=document.querySelector(r)),r&&ot(r)?e(n)?(this.$queue=[],this.$data=n,this.$element=r,this.$els={},this.$directives=[],this.$context=t.context||this,St(this.$data),o&&Tt(this.$data,o),this.$afters=[],this.$hooks=t.hooks||{},this.$customs=t.customs||{},this.$watchall=i(a)?le(a,this.$context):null,void(t.lazy||this.mount())):f("model must be a type of Object: ",n):f("view must be a type of DOMElement: ",r)}function de(t){var n=t.context||t.model;_(t.model,function(e,s){i(e)&&(t.model[s]=e.bind(n))}),_(t.methods,function(e,i){t.model[i]=e.bind(n)}),this.__ct__=n,this.__bk__=b(t.model),this.__vm__=new fe(t),this.$data=this.__vm__.$data,this.$els=this.__vm__.$els,_(t.watches,function(t,n){i(t)?this.watch(n,t,!1):e(t)&&this.watch(n,t.handler,t.deep)},this)}var pe=Object.prototype,ve=pe.hasOwnProperty,_e=window.console,me=/\s/g,ge=Object.create(null);ge.def=v,ge.each=_,ge.copy=b,ge.config=C,ge.extend=g,ge.hasOwn=p,ge.isFunc=i,ge.isBool=r,ge.isArray=n,ge.isObject=e,ge.isNumber=o,ge.isString=s,ge.isEmptyObject=u;var be=Object.create(null);be.get=O,be.post=A,be.load=N;var ye={id:1,length:0},we=/\b\.Super\b/,xe=Function.prototype.toString;S.extend=function(t){function e(t,e,n){var r=s[t];i(r)&&r.call(this,g(!0,n,e))}function n(){}var s=this.prototype,r=n.prototype=Object.create(s);return _(t,function(t,n){r[n]=D(e,t)}),t=null,n.extend=this.extend,r.constructor=n,n};var $e={fire:L,broadcast:P,notify:q,globalCast:R},Ce=S.extend({__rd__:{},create:function(t,e,n){if(!s(t))return f("Module name ["+t+"] must be a type of String");if(!i(e))return f("Module Class ["+e+"] must be a type of Component");var r=this.__rd__;if(p(r,"array")||(r.array=[],r.map={}),r.map[t])return f("Module ["+t+"] is already exists!");var o=new e(n),a={name:t,id:ye.id++,pid:r.id||0};return o.__rd__=a,ye[a.id]=o,ye.length++,r.array.push(o),r.map[t]=o,i(o.init)&&o.init(n,this),o},getParent:function(){var t=this.__rd__,e=t&&t.pid;return ye[e]||null},getChild:function(t){var e=this.__rd__;return e&&e.map&&e.map[t]||null},getChilds:function(t){var e=this.__rd__;return t=r(t)&&t,t?e.array||[]:e.map||{}},_removeChild:function(t){for(var e=this.__rd__,n=e.map||{},i=e.array||[],s=n[t],r=0,o=i.length;r<o;r++)if(i[r].id===s.id){delete n[t],i.splice(r,1);break}},destroy:function(t){var e=this.__rd__,n=e.name;i(this.beforeDestroy)&&this.beforeDestroy(),_(this.getChilds(!0),function(t){i(t.destroy)&&t.destroy(1)});var s=this.getParent();1!==t&&s&&s._removeChild(n);var r=e.id;p(ye,r)&&(delete ye[r],ye.length--),i(this._afterDestroy)&&this._afterDestroy(),!0===t&&this.fire("subDestroyed",n),m(this)},fire:function(t,e,n){i(e)&&(n=e,e=null),s(n)&&(n=this[n]),$e.fire(this,t,e,n,this)},broadcast:function(t,e,n){i(e)&&(n=e,e=null),s(n)&&(n=this[n]),$e.broadcast(this,t,e,n,this)},notify:function(t,e,n,r){i(n)&&(r=n,n=null),s(r)&&(r=this[r]),$e.notify(this,t,e,n,r,this)}}),ke=Ce.extend({get:function(t){return this.getChild(t)},globalCast:function(t,e,n,s){i(e)&&(s=n,n=e,e=null),$e.globalCast(t,e,n,s)},destroy:function(){}}),Oe=ye[0]=new ke,Ae=0;M.watcher=null;var Ne=M.prototype;Ne.addWatcher=function(t){this.watchers.push(t)},Ne.removeWatcher=function(t){this.watchers.$remove(t)},Ne.depend=function(){M.watcher&&M.watcher.addDepend(this)},Ne.beforeNotify=function(){_(this.watchers,function(t){t.beforeUpdate()})},Ne.notify=function(t){_(this.watchers,function(e){e.update(t,this)},this)};var De=1,Se=2,je=1,Ie=[0,z,U,z],Te={init:function(t){this.saves="",this.state=t},set:function(t,e){var n=this.get(t),i=n.keepIdent,s=n.tobeQuote,r=n.tobeIdent;if(i)this.save(t,e);else{if(s){var o=this.saves;return this.saves="",this.change(t),o}r&&(this.save(t,e),this.change(t))}},get:function(t){var e=this.state;return{keepIdent:e===De&&t===De,tobeQuote:(e===De||0===e)&&t===Se,keepQuote:e===Se&&t===Se,tobeIdent:(e===Se||0===e)&&t===De}},change:function(t){this.state=t},save:function(t,e){this.saves+=Ie[t](e)},reset:function(){this.saves="",this.state=0}},Ee=/"(\d+)"/g,Le=/^(true|false)$/,Pe=/[\{,]\s*[\w\$_]+\s*:|('[^']*'|"[^"]*")|typeof /g,qe=/[^\w$\.]([A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\])*)/g,Re=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/,Me="var.const.let.if.else.for.in.continue.switch.case.break.default.function.return.do.while.delete.try.catch.throw.finally.with.import.export.instanceof.yield.await",ze=[],Ue="JSON.Math.parseInt.parseFloat.Date.this.true.false.null.undefined.Infinity.NaN.isNaN.isFinite.decodeURI.decodeURIComponent.encodeURI.encodeURIComponent."+Me,He=new RegExp("^("+Ue.replace(/\./g,"\\b|")+"\\b)"),Fe=new RegExp("^("+Me.replace(/\./g,"\\b|")+"\\b)"),Be=[],Ve=nt.prototype;Ve.getScope=function(){return this.context.scope||this.vm.$data},Ve.getValue=function(){var t=this.getScope();return this.getter.call(t,t)},Ve.setValue=function(t){var e=this.getScope();this.setter&&this.setter.call(e,e,t)},Ve.get=function(){this.beforeGet();var t=this.getValue();return this.deep&&(this.shallowIds=b(this.newDepIds),et(t,!0)),this.afterGet(),t},Ve.beforeGet=function(){M.watcher=this},Ve.addDepend=function(t){var e=t.guid,n=this.newDepIds;n.indexOf(e)<0&&(n.push(e),this.newDepends.push(t),this.depIds.indexOf(e)<0&&t.addWatcher(this))},Ve.removeDepends=function(t){_(this.depends,function(e){t?t.call(this,e)&&e.removeWatcher(this):e.removeWatcher(this)},this)},Ve.afterGet=function(){M.watcher=null,this.removeDepends(function(t){return this.newDepIds.indexOf(t.guid)<0}),this.depIds=b(this.newDepIds),this.newDepIds.length=0,this.depends=b(this.newDepends),this.newDepends.length=0},Ve.beforeUpdate=function(){this.oldVal=b(this.value)},Ve.update=function(t,e){var n=this.oldVal,i=this.vm.$watchall,s=this.value=this.get(),r=t&&t.source;if(!r||r===s||"v-for"!==this.directive){var o=this.callback,a=this.deep&&this.shallowIds.indexOf(e.guid)<0;o&&n!==s&&(o.call(this.context,s,n,a,t),r&&(t.source=null)),i&&i({action:t,path:e.path},s,n)}},Ve.destroy=function(){this.value=null,this.removeDepends(),this.getter=this.setter=null,this.vm=this.callback=this.context=null};var Ge=it.prototype;Ge.mount=function(){var t=this.parser,e=this.watcher=new nt(t.vm,t.desc,this.update,this);this.update(e.value)},Ge.destroy=function(){this.watcher.destroy(),this.parser=this.scope=null},Ge.update=function(){var t=this.parser;t.update.apply(t,arguments)},Ge.get=function(){return this.watcher.value},Ge.set=function(t){this.watcher.setValue(t)};var We=st.prototype;We.bind=function(){this.directive=new it(this),this.directive.mount()},We.destroy=function(){var t=this.directive;t&&t.destroy(),this.vm=this.el=this.desc=this.scope=null};var Ze=rt(xt);Ze.parse=function(){_(yt(this.desc),function(t){this.parseEvent(t)},this)},Ze.parseEvent=function(t){var e=t.type,n=t.handler,i=t.modifier,s=bt(e,i);if("$remove"===n)return this.bindRemoveEvent(e,s);var r=X(n)?n+"($event)":n;this.bindEvent(e,wt(r),s)},Ze.bindRemoveEvent=function(t,e){var n=this.scope;if(!n)return f("The specify event $remove must be used in v-for scope");var i=n.__alias__;this.bindEvent(t,function(){n.__viterator__.$remove(n[i])},e)},Ze.bindEvent=function(t,e,n){var i=this.el,s=this.scope||this.vm.$data,r=n.self,o=n.stop,a=n.prevent,u=n.capture,h=n.keyCode,c=n.one,l=function(t){r&&t.target!==i||h&&h!==t.keyCode||(a&&t.preventDefault(),o&&t.stopPropagation(),e.call(s,s,t))},f=c?function(e){l(e),mt(i,t,f,u)}:l;_t(i,t,f,u)},rt($t).parse=function(){this.scope?f("v-el can not be used inside v-for! Consider use v-custom to handle v-for element."):this.vm.$els[this.desc.expression]=this.el};var Je="__proto__"in{},Qe=Array.prototype,Xe=Object.create(Qe);_(["pop","push","sort","shift","splice","unshift","reverse"],function(t){var e=Qe[t];v(Xe,t,function(){for(var n=arguments,i=[],s=this.__ob__,r=0;r<arguments.length;r++)i.push(n[r]);s.dep.beforeNotify();var o,a=e.apply(this,i);switch(t){case"push":case"unshift":o=i;break;case"splice":o=i.slice(2)}return o&&o.length&&Nt(o),s.dep.notify({method:t,args:i,source:this}),a})}),v(Qe,"$set",function(t,e){return t>=this.length&&(t=this.length),this.splice(t,1,e)[0]}),v(Qe,"$remove",function(t){var e=this.indexOf(t);if(e>-1)return this.splice(e,1)});var Ke=Object.getOwnPropertyNames(Xe),Ye=/(.*) (?:in|of) (.*)/,tn="push|pop|shift|unshift|splice".split("|"),en=rt(Pt);en.parse=function(){var t=this.el,e=this.desc,n=t.parentNode,i=e.expression,s=i.match(Ye);if(!s)return f('The format of v-for must be like "item in/of items"!');if(1!==n.nodeType)return f("v-for cannot use in the root element!");if(ft(t,"v-if"))return f("Do not use v-if and v-for on the same element! Consider filtering the source Array instead.");var r=s[1],o=s[2];this.length=0,this.scopes=[],this.init=!0,this.alias=r,this.partly=!1,this.partlyArgs=[],this.$parent=n,this.end=t.nextSibling,this.start=t.previousSibling,this.bodyDirs=t.__dirs__,this.tpl=t.cloneNode(!0),this.hooks=Et(this.vm,t),this.isOption="OPTION"===t.tagName&&"SELECT"===n.tagName,e.expression=o,this.bind(),this.updateModel()},en.updateModel=function(){if(this.isOption){var t=this.$parent.__vmodel__;t&&t.forceUpdate()}},en.hook=function(t,e,n){var s=this.hooks[t];i(s)&&(s.call(this.vm.$context,e,n,e.__vforid__),e=null)},en.update=function(t,e,n,i){this.length=t&&t.length,this.init?(this.$parent.replaceChild(this.buildList(t),this.el),this.el=null,this.init=!1):i&&tn.indexOf(i.method)>-1?(this.partly=!0,this.updatePartly(t,i),this.partly=!1):(this.recompileList(t),this.updateModel())},en.updatePartly=function(t,e){var n=[],i=e.args,s=e.method,r=this.scopes;switch(this[s].call(this,t,i),s){case"pop":case"shift":break;case"push":case"unshift":n=this.partlyArgs;break;case"splice":n=i.slice(0,2),Array.prototype.push.apply(n,this.partlyArgs)}r[s].apply(r,n),this.partlyArgs.length=0,_(r,function(t,e){t.$index=e})},en.recompileList=function(t){for(var e=this,n=0,i=this.$parent,s=i.childNodes,r=0;r<s.length;r++){var o=s[r];o.__vfor__===e.alias&&(e.hook("before",o,n++),i.removeChild(o),r--)}this.scopes.length=0;var a=this.buildList(t);i.insertBefore(a,this.end)},en.buildList=function(t,e){var n=this.vm,i=this.tpl,s=e||0,r=w(),o=this.directive.watcher.value;return _(t,function(t,e){var a=s+e,u=this.alias,h=i.cloneNode(!0),c=this.scope||n.$data,l=Object.create(c);l.$parent=c,jt(l,u,t),jt(l,"$index",a),v(l,"__alias__",u),v(l,"__viterator__",o),this.partly?this.partlyArgs.push(l):this.scopes.push(l),this.init&&this.bodyDirs>1&&n.block(this.el),v(h,"__vfor__",u),v(h,"__vforid__",Lt()),n.compile(h,!0,l,this.desc.once),r.appendChild(h),this.hook("after",h,a)},this),r},en.getChilds=function(){for(var t=this,e=[],n=this.$parent.childNodes,i=0;i<n.length;i++){var s=n[i];s.__vfor__===t.alias&&e.push(s)}return e},en.getFirst=function(){var t=this.start;return t&&t.nextSibling||this.$parent.firstChild},en.getLast=function(){var t=this.end;return t&&t.previousSibling||this.$parent.lastChild},en.getChild=function(t){return this.getChilds()[t]||null},en.removeChild=function(t){t&&this.$parent.removeChild(t)},en.shift=function(){var t=this.getFirst();t&&(this.hook("before",t,0),this.removeChild(t))},en.pop=function(){var t=this.getLast();t&&(this.hook("before",t,this.length),this.removeChild(t))},en.push=function(t,e){var n=this.buildList(e,t.length-1);this.$parent.insertBefore(n,this.end)},en.unshift=function(t,e){var n=this.getFirst(),i=this.buildList(e,0);this.$parent.insertBefore(i,n)},en.splice=function(t,e){var n=e[0],i=e[1],s=e.slice(2),r=s.length;if(0!==i||r){var o=i&&!r,a=!i&&r,u=i&&r;if(o||u){var h=this.getChilds();_(h,function(t,e){e>=n&&e<n+i&&(this.hook("before",t,e),this.removeChild(t))},this),h=null}if(a||u){var c=this.getChild(n)||this.end,l=this.buildList(s,n);this.$parent.insertBefore(l,c)}}};var nn=rt(zt);nn.parse=function(){var t=this.el,e=t.nextElementSibling,n=t.parentNode;if(1!==n.nodeType)return f("v-if cannot use in the root element!");this.$parent=n,this.hooks=Et(this.vm,t),this.elTpl=t.cloneNode(!0),this.elAnchor=Rt(),Mt(t,this.elAnchor),this.el=null,e&&ft(e,"v-else")&&(this.elseTpl=e.cloneNode(!0),this.elseAnchor=Rt(),Mt(e,this.elseAnchor),e=null),this.bind()},nn.hook=function(t,e,n){var s=this.hooks[t];i(s)&&s.call(this.vm.$context,e,n)},nn.update=function(t){var e=this.elseAnchor;this.toggle(this.elAnchor,this.elTpl,t,!1),e&&this.toggle(e,this.elseTpl,!t,!0)},nn.toggle=function(t,e,n,i){var s=this.vm,r=this.$parent,o=e.cloneNode(!0);if(n){s.compile(o,!0,this.scope,this.desc.once);var a=r.insertBefore(o,t);this.hook("after",a,i),v(a,"__vif__",!0)}else{var u=t.previousSibling;u&&u.__vif__&&(this.hook("before",u,i),qt(s,e),r.removeChild(u))}};var sn=rt(Ut);sn.parse=function(){this.bind()},sn.update=function(t){this.el.textContent=h(t)};var rn=rt(Ht);rn.parse=function(){this.bind()},rn.update=function(t){this.el.innerHTML=h(t)};var on="__visible__",an=rt(Vt);an.parse=function(){var t=this.el;Ft(t);var e=t.nextElementSibling;e&&ft(e,"v-else")&&(this.elseEl=e,Ft(e)),this.bind()},an.update=function(t){var e=this.el,n=this.elseEl;Bt(e,t?e[on]:"none"),n&&Bt(n,t?"none":n[on])};var un=rt(Kt);un.parse=function(){this.desc.deep=!0,this.bind()},un.update=function(t,e){var n=this.desc.args;n?this.single(n,t,e):this.multi(t,e)},un.single=function(t,e,n){switch(t){case"class":this.processClass(e,n);break;case"style":this.processStyle(e,n);break;default:this.processAttr(t,e)}},un.multi=function(t,e){if(e){var n=Zt(t,e),i=n.after,s=n.before;this.batch(i,s)}this.batch(t)},un.batch=function(t,e){_(t,function(t,n){this.single(n,t,e&&e[n])},this)},un.processClass=function(t,e){var n=this.el;if(e){var i=Zt(t,e),s=i.after;Xt(n,i.before,!0),Xt(n,s)}else Xt(n,t)},un.processStyle=function(t,e){var n=this.el;e&&(_(e,function(t,n){e[n]=""}),Jt(n,e)),Jt(n,t)},un.processAttr=function(t,e){lt(this.el,t,e)};var hn=0,cn=window.navigator.userAgent.toLowerCase(),ln=cn&&cn.indexOf("msie 9.0")>0,fn={bind:function(){function t(t){i&&(t=t.trim());var e=ee(t,r);o?Yt(function(){n.onDebounce=!0,a.set(e)},c(o)):a.set(e)}var e,n=this,i=this.trim,s=this.lazy,r=this.number,o=this.debounce,a=this.directive;this.on("compositionstart",function(){e=!0}),this.on("compositionend",function(){e=!1,s||t(this.value)}),this.on("input",function(){e||s||t(this.value)}),this.on("blur",function(){t(this.value)}),this.on("change",function(){t(this.value)}),ln&&(this.on("cut",function(){t(this.value)}),this.on("keyup",function(e){var n=e.keyCode;8!==n&&46!==n||t(this.value)}))},update:function(t){var e=this.el,n=h(t);e.value===n||this.onDebounce||(e.value=n)}},dn={bind:function(){var t=this.number,e=this.directive;this.on("change",function(){e.set(ee(this.value,t))})},update:function(t){var e=this.el;e.checked=e.value===h(t)}},pn={bind:function(){var t=this.multi,e=this.number,n=this.directive;this.on("change",function(){var i=t?te(this,e):ee(this.value,e);n.set(i)}),this.vm.after(this.forceUpdate,this)},update:function(t){var e=this.el,i=this.multi,s=this.desc.expression;if(e.selectedIndex=-1,i&&!n(t))return f("<select> cannot be multiple when the model set ["+s+"] as not Array");if(!i&&n(t))return f("The model ["+s+"] cannot set as Array when <select> has no multiple propperty");for(var r=e.options,o=0;o<r.length;o++){var a=r[o],u=a.value;a.selected=i?ne(u,t)>-1:u===h(t)}},forceUpdate:function(){this.update(this.directive.get())}},vn={bind:function(){var t=this.number,e=this.directive;this.on("change",function(){var i=e.get(),s=this.checked;if(r(i))e.set(s);else if(n(i)){var o=ee(this.value,t),a=ne(o,i);s&&-1===a?i.push(o):a>-1&&i.splice(a,1)}})},update:function(t){var e=this.el,i=ee(e.value,this.number);if(!n(t)&&!r(t))return f("Checkbox v-model value must be a type of Boolean or Array");e.checked=r(t)?t:ne(i,t)>-1}},_n=["input","select","textarea"],mn=rt(ie);mn.parse=function(){var t=this.el,e=this.desc,n=t.tagName.toLowerCase(),i="input"===n?ht(t,"type"):n;return _n.indexOf(n)<0?f("v-model only for using in "+_n.join(", ")):X(e.expression)?(e.duplex=!0,void this.bindDuplex(i)):f("v-model directive value can be use by static expression")},mn.bindDuplex=function(t){var e,n=this.el;switch(t){case"text":case"password":case"textarea":e=fn,this.trim=ft(n,"trim"),this.lazy=ft(n,"lazy"),this.debounce=ht(n,"debounce");break;case"radio":e=dn;break;case"checkbox":e=vn;break;case"select":e=pn,v(n,"__vmodel__",this),this.multi=ft(n,"multiple"),this.forceUpdate=pn.forceUpdate.bind(this)}if(!e)return f("Do not use incorrect form-type with v-model: ",n);this.number=ft(n,"number"),this.update=e.update.bind(this),this.bind(),this.desc.once||e.bind.call(this)},mn.on=function(t,e){_t(this.el,t,e,!1)},rt(se).parse=function(){var t=this.desc,e=this.vm.$customs[t.args];if(!i(e))return f("Custom directive ["+t.attr+"] must define with a refresh function!");this.update=e,this.bind()};var gn={von:xt,vel:$t,vif:zt,vfor:Pt,vtext:Ut,vhtml:Ht,vshow:Vt,vbind:Kt,vmodel:ie,vcustom:se},bn=/\n/g,yn=/\{\{(.+?)\}\}/g,wn=/(\{\{.*\}\})/,xn=["velse","vpre","vcloak","vonce","vhook"],$n=fe.prototype;$n.mount=function(){this.$done=!1,this.$fragment=x(this.$element),this.compile(this.$fragment,!0)},$n.compile=function(t,e,n,i){var s=this,r=t.childNodes,o=!!i||oe(t);e&&ue(t)&&this.$queue.push([t,n]),v(t,"__vonce__",o);for(var a=0;a<r.length;a++){var u=r[a],h=u.nodeType;if(1===h||3===h){var c=o||oe(u);ue(u)&&(s.$queue.push([u,n]),v(u,"__vonce__",c)),u.hasChildNodes()&&!ae(u)&&s.compile(u,!1,n,c)}}e&&this.compileAll()},$n.compileAll=function(){_(this.$queue,function(t){return this.compileNode(t),null},this),this.completed()},$n.compileNode=function(t){var e=t[0],n=t[1];if(ot(e)){for(var i,s,r,o,a=[],u=e.attributes,h=0;h<u.length;h++){var c=u[h],l=c.name;re(l)&&("v-for"===l?i=c:"v-model"===l?(s=!0,o=a.length):0===l.indexOf("v-bind")?r=!0:0===l.indexOf("v-hook")&&ce(e),a.push(c))}if(!i&&r&&s&&a.length>1&&o!==a.length-1){var f=a.splice(o,1)[0];a.push(f),f=null}i&&(v(e,"__dirs__",a.length),a=[i],i=null),_(a,function(t){this.parse(e,t,n)},this)}else at(e)&&this.parseText(e,n)},$n.parse=function(t,e,n){var i=t.__vonce__,s=he(e),r=s.directive,o="v"+r.substr(2),a=gn[o];if(ct(t,s.attr),!(xn.indexOf(o)>-1))if(a){s.once=i;var u=new a(this,t,s,n);i?u.destroy():n||this.$directives.push(u)}else f("["+r+"] is an unknown directive!")},$n.parseText=function(t,e){var n=[],i={},s=t.parentNode&&t.parentNode.__vonce__,r=t.textContent.trim().replace(bn,""),o=r.split(yn),a=r.match(yn);_(o,function(t){a.indexOf("{{"+t+"}}")>-1?n.push("("+t+")"):t&&n.push('"'+t+'"')}),i.once=s,i.expression=n.join("+");var u=new gn.vtext(this,t,i,e);s?u.destroy():e||this.$directives.push(u)},$n.block=function(t){_(this.$queue,function(e){if(t===e[0])return null})},$n.after=function(t,e){this.$afters.push([t,e])},$n.completed=function(){0!==this.$queue.length||this.$done||(this.$done=!0,this.$element.appendChild(this.$fragment),delete this.$fragment,_(this.$afters,function(t){return t[0].call(t[1]),null}))},$n.destroy=function(){this.$data=null,ut(this.$element),_(this.$directives,function(t){return t.destroy(),null})};var Cn=de.prototype;Cn.mount=function(){this.__vm__.mount()},Cn.get=function(t){var e=this.$data;return s(t)?C(e,t):e},Cn.getCopy=function(t){return b(this.get(t))},Cn.set=function(t,n){var i=this.$data;s(t)?C(i,t,n):e(t)&&_(t,function(t,e){C(i,e,t)})},Cn.reset=function(t){var e=this.$data,i=b(this.__bk__);s(t)?e[t]=i[t]:n(t)?_(t,function(t){e[t]=i[t]}):_(e,function(t,n){e[n]=i[n]})},Cn.watch=function(t,e,n){return new nt(this,{deep:n,expression:t},e.bind(this.__ct__))},Cn.destroy=function(){this.__vm__.destroy(),this.__vm__=this.__ct__=this.__bk__=this.$data=this.$els=null};var kn=1e3,On=Ce.extend({init:function(t){this.__config__=g(!0,{target:null,replace:!1,tag:"div",css:null,attr:null,class:"",view:"",template:"",tplParam:null,model:null,methods:null,watches:null,watchAll:null,computed:null,customs:null,hooks:null,lazy:!1,childs:null,cbRender:"afterRender"},t),this.el=null,this.vm=null,this.$=new gt,this.__visible__="",this.__ready__=!1,this.__listeners__={},i(this.beforeRender)&&this.beforeRender(),this.getConfig("template")?this._loadTemplate():this._render()},_loadTemplate:function(){var t=this.getConfig(),e=t.template;be.load(e,t.tplParam,function(t,n){var i;t?(i=t.status+": "+e,f(t)):i=n.result,this.setConfig("view",i),this._render()},this)},_render:function(){if(this.__ready__)return this;this.__ready__=!0;var t=this.getConfig(),n=t.target,r=n instanceof HTMLElement
  ;this.el=r?y(t.tag):document.querySelector(n);var o=t.class;o&&s(o)&&_(o.split(" "),function(t){pt(this.el,t)},this),e(t.css)&&_(t.css,function(t,e){this.el.style[e]=t},this),e(t.attr)&&_(t.attr,function(t,e){lt(this.el,e,t)},this),t.view&&(this.el.innerHTML=h(t.view));var a=t.model;e(a)&&(this.vm=new de({view:this.el,model:a,methods:t.methods,watches:t.watches,watchAll:t.watchAll,computed:t.computed,customs:t.customs,hooks:t.hooks,context:this,lazy:t.lazy}));var u=this.el.style.display;this.__visible__="none"===u?"":u,_(t.childs,this._buildBatchChilds,this),r&&(t.replace?n.parentNode.replaceChild(this.el,n):n.appendChild(this.el));var c=this[t.cbRender];i(c)&&c.call(this)},_buildBatchChilds:function(t,e){var n=this,i=this.queryAll(e.toLowerCase());switch(i.length||(i=this.queryAll("[name="+e+"]")),i.length){case 0:f("Cannot find target element for sub component ["+e+"]");break;case 1:this._createChild(i[0],e,t);break;default:for(var s=0;s<i.length;s++)n._createChild(i[s],e+s,t)}},_createChild:function(t,e,s){var r={target:t,replace:!0};i(s)?this.create(e,s,r):n(s)&&this.create(e,s[0],g(s[1],r))},_afterDestroy:function(){var t=this.vm,e=this.el,n=e.parentNode;t&&t.destroy(),n&&n.removeChild(e),this.el=this.vm=null,m(this.__listeners__)},getConfig:function(t){return C(this.__config__,t)},setConfig:function(t,e){return C(this.__config__,t,e)},query:function(t){return this.el.querySelector(t)},queryAll:function(t){return this.el.querySelectorAll(t)},show:function(){return this.el.style.display=this.__visible__,this},hide:function(){return this.el.style.display="none",this},on:function(t,e,n,i){var r=this,o=kn++;s(n)&&(n=this[n]),n.__eventid__=o;var a=function(t){n.call(r,t)};return this.__listeners__[o]=a,_t(t,e,a,i),this},off:function(t,e,n,i){s(n)&&(n=this[n]);var r=n.__eventid__,o=this.__listeners__[r];return o&&mt(t,e,o,i),this}}),An=Object.create(null);return An.extend=function(t){ge.extend.call(this,t)},An.extend({ajax:be,core:Oe,util:ge,Component:On}),An});