text: /* zUIx v1.0.1 18.08.30 21:48:09 */
  
  /*
   @license
   Copyright 2015-2018 G-Labs. All Rights Reserved.
           https://zuixjs.github.io/zuix
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  */
  'use strict';(function(m){"object"===typeof exports&&"undefined"!==typeof module?module.exports=m():"function"===typeof define&&define.amd?define([],m):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).zuix=m()})(function(){return function(){function m(r,x,a){function l(e,h){if(!x[e]){if(!r[e]){var b="function"==typeof require&&require;if(!h&&b)return b(e,!0);if(k)return k(e,!0);h=Error("Cannot find module '"+e+"'");throw h.code="MODULE_NOT_FOUND",
  h;}h=x[e]={exports:{}};r[e][0].call(h.exports,function(b){return l(r[e][1][b]||b)},h,h.exports,m,r,x,a)}return x[e].exports}for(var k="function"==typeof require&&require,f=0;f<a.length;f++)l(a[f]);return l}return m}()({1:[function(m,r,x){function a(d){b=d}function l(){null!==d&&(cancelAnimationFrame(d),d=null);h++;if(h<e.length&&!b.willBreak())return f(),!0;(h>=e.length||b.willBreak())&&k();return!1}function k(d){h=-1;e.length=0;e=[];b.status(null!=d?d:"done")}function f(){const a=e[h];if(null==a)return!1;
  const f=function(){null!==d&&(cancelAnimationFrame(d),d=null);b.doWork(a.item,function(){d=requestAnimationFrame(l)})||l()};if(a.cancelable)if(b.willBreak())k("stopped");else if(null==d)d=requestAnimationFrame(f);else return!1;else f();return!0}a.prototype.isReady=function(){return 0===e.length||-1===h};a.prototype.getJobs=function(){return e};a.prototype.setJobs=function(d){0<e.length?(h=-1,e.length=0):(e=d.slice(),b.status("start",e),l())};a.prototype.append=function(b){this.isReady()?this.setJobs(b):
  Array.prototype.push.apply(e,b)};let e=[],h=-1,b=null,d=null;r.exports=function(b){return new a(b)}},{}],2:[function(m,r,x){function a(a){k=window?window.console:{};f=window?window:{};this._timers={};this.args=function(b,d,a){b="%c "+d+" %c"+(new Date).toISOString()+" %c"+b;d=["background-color:rgba(200,200,200,0.2);color:#8a53ff;","background-color:rgba(200,200,200,0.2);color:#777777","background-color:rgba(200,200,200,0.2);color:#888888;"];for(var e=0;e<a.length;e++)if("string"==typeof a[e]&&0===
  a[e].indexOf("timer:")){const f=a[e].split(":");if(3===f.length){let c;switch(f[2]){case "start":this._timers[f[1]]=(new Date).getTime();b+=" %cSTART "+f[1];d.push("background-color:rgba(200,200,200,0.2);color:#999900;");break;case "stop":c=(new Date).getTime()-this._timers[f[1]],b+=" %cSTOP "+f[1]+" "+c+" ms",200<c?d.push("background-color:rgba(200,200,200,0.2);color:#ff0000;"):100<c?d.push("background-color:rgba(200,200,200,0.2);color:#ff7700;"):d.push("background-color:rgba(200,200,200,0.2);color:#00aa00;")}}}b+=
  " \n%c ";d.push("background-color:transparent;color:inherit;");for(e=d.length-1;0<=e;e--)Array.prototype.unshift.call(a,d[e]);Array.prototype.unshift.call(a,b);Array.prototype.push.call(a,"\n\n")};this.log=function(b,d){"function"===typeof e&&e.call(a,b,d);f.zuixNoConsoleOutput||(this.args(a,b,d),k.log.apply(k,d))}}const l="log info warn error debug trace dir group groupCollapsed groupEnd time timeEnd profile profileEnd dirxml assert count markTimeline timeStamp clear".split(" ");let k=null,f=null,
  e=null;a.prototype.monitor=function(a){e=a};a.prototype.console=function(a){if(a)window.console=k;else for(window.console={},a=0;a<l.length;a++)window.console[l[a]]||(window.console[l[a]]=function(){})};a.prototype.i=a.prototype.info=a.prototype.l=a.prototype.log=function(){this.log("INFO",arguments);return this};a.prototype.w=a.prototype.warn=function(){this.log("WARN",arguments);return this};a.prototype.e=a.prototype.error=function(){this.log("ERROR",arguments);return this};a.prototype.d=a.prototype.debug=
  function(){this.log("DEBUG",arguments);return this};a.prototype.t=a.prototype.trace=function(){this.log("TRACE",arguments);return this};r.exports=function(e){return new a(e)}},{}],3:[function(m,r,x){function a(a){const f=this;f._worker=null;f._taskList=[];f._requests=[];null==a&&(a=function(){});f.taskQueue=function(e,k,b){f._taskList.push({tid:e,fn:k,status:0,priority:b,step:function(b){l.t(b,"load:step");a(f,"load:step",{task:b})},end:function(){this.status=2;l.t(this.tid,"load:next","timer:task:stop");
  a(f,"load:next",{task:this.tid});f._taskList.splice(this.index,1);f.taskCheck();null!=this._callback&&this._callback.call(this)},callback:function(b){this._callback=b}});l.t(e,"task added",b,"priority");f._taskList.sort(function(b,a){return b.priority>a.priority?1:a.priority>b.priority?-1:0});f.taskCheck()};f.taskCheck=function(){for(let e=0;e<f._taskList.length;e++){if(0===f._taskList[e].status){f._taskList[e].status=1;l.t(f._taskList[e].tid,"load:begin","timer:task:start");a(f,"load:begin",{task:f._taskList[e].tid});
  f._taskList[e].index=e;f._taskList[e].fn.call(f._taskList[e]);return}if(1===f._taskList[e].status||2===f._taskList[e].status)return}l.t("load:end");a(f,"load:end")}}const l=m("./Logger")("TaskQueue.js");a.prototype.callback=function(a){};a.prototype.queue=function(a,f,e){return this.taskQueue(a,f,e)};r.exports=a},{"./Logger":2}],4:[function(m,r,x){r.exports={isIE:function(){return 0<window.navigator.userAgent.indexOf("Trident")},isNoU:function(a){return"undefined"===typeof a||null===a},isFunction:function(a){return"function"===
  typeof a},objectEquals:function(a,l){if(null===a||void 0===a||null===l||void 0===l)return a===l;if(a.constructor!==l.constructor)return!1;if(a instanceof Function||a instanceof RegExp)return a===l;if(a===l||a.valueOf()===l.valueOf())return!0;if(Array.isArray(a)&&a.length!==l.length||a instanceof Date||!(a instanceof Object)||!(l instanceof Object))return!1;const k=Object.keys(a);return Object.keys(l).every(function(a){return-1!==k.indexOf(a)})&&k.every(function(f){return util.objectEquals(a[f],l[f])})},
  propertyFromPath:function(a,l){if("string"===typeof l){l=l.replace(/\[(\w+)\]/g,".$1");l=l.replace(/^\./,"");l=l.split(".");for(let k=0;k<l.length;++k){const f=l[k];if("undefined"!==typeof a[f])a=a[f];else return}return a}},cloneObject:function k(l){if(null===l||"object"!==typeof l)return l;let f=l;try{f=l.constructor();for(let e in l)l.hasOwnProperty(e)&&(f[e]=k(l[e]))}catch(e){}return f},hasPassiveEvents:function(){let l=!1;try{const k=Object.defineProperty({},"passive",{get:function(){l=!0}});
  window.addEventListener("testPassive",null,k);window.removeEventListener("testPassive",null,k)}catch(k){}return l}}},{}],5:[function(m,r,x){function a(c){f(this,c.type,c)}function l(c,d,e,f){let C=!1;g.each(z,function(){if(this.element===c&&this.path===d&&this.handler===e)return b.w("Handler already registered",c,d,e),C=!0,!1});C||(z.push({element:c,path:d,handler:e,opgions:f}),c.addEventListener(d,a,!B||null!=f&&!1===f.passive?!1:{passive:!0}))}function k(c,b,d){let C=1,e=-1;g.each(z,function(a){this.element===
  c&&this.path===b&&this.handler===d&&(C--,e=a)});-1!==e&&z.splice(e,1);0===C&&c.removeEventListener(b,a)}function f(c,b,d){const a=g(c);g.each(z,function(){this.element===c&&this.path===b&&this.handler.call(a,d,a)})}function e(c){g.each(z,function(){this.element===c&&(b.t("Removing event handler",this.element,this.path,this.handler),k(this.element,this.path,this.handler))})}function h(c){this._selection=[];"undefined"===typeof c&&(c=document.documentElement);if(c instanceof h)return c;if(c instanceof
  HTMLCollection||c instanceof NodeList){const b=this._selection=[];g.each(c,function(c,a){b.push(a)})}else if(Array.isArray(c))this._selection=c;else if(c===window||c instanceof HTMLElement||c instanceof Node)this._selection=[c];else if("string"===typeof c)this._selection=document.documentElement.querySelectorAll(c);else if(null!==c)throw b.e("ZxQuery cannot wrap object of this type.",typeof c,c),Error("ZxQuery cannot wrap object of this type.");return this}const b=m("./Logger")("TaskQueue.js"),d=
  m("./Util.js");let B=d.hasPassiveEvents();const z=[];h.prototype.length=function(){return this._selection.length};h.prototype.parent=function(c){return d.isNoU(c)?new h(this._selection[0].parentNode):new h(g.getClosest(this._selection[0],c))};h.prototype.children=function(c){return d.isNoU(c)?new h(this._selection[0].children):new h(this._selection[0].querySelectorAll(c))};h.prototype.reverse=function(){this._selection=Array.prototype.slice.call(this._selection,0).reverse();return this};h.prototype.get=
  function(c){d.isNoU(c)&&(c=0);return this._selection[c]};h.prototype.eq=function(c){const b=this._selection;let a=b[c];1<arguments.length&&(a=[],g.each(arguments,function(c,d){null!=b[d]&&a.push(b[d])}));return new h(a)};h.prototype.find=function(c){return new h(this._selection[0].querySelectorAll(c))};h.prototype.each=function(c){g.each(this._selection,c);return this};h.prototype.attr=function(c,b){const a=this;if("object"===typeof c)g.each(c,function(c,b){a.each(function(a,d){d.setAttribute(c,b)})});
  else{if("undefined"==typeof b)return this._selection[0].getAttribute(c);null===b?this._selection[0].removeAttribute(c):this.each(function(a,d){this.get().setAttribute(c,b)})}return this};h.prototype.trigger=function(c,b){let a;window.CustomEvent?a=new CustomEvent(c,{detail:b}):(a=document.createEvent("CustomEvent"),a.initCustomEvent(c,!0,!0,b));this.each(function(c,b){b.dispatchEvent(a)});return this};h.prototype.one=function(c,b){let a=!1;this.on(c,function(d,e){a||(a=!0,g(this).off(c,b),b.call(this,
  d,e,this))});return this};h.prototype.on=function(c,b){const a=c.match(/\S+/g)||[];let d;"function"!==typeof b&&(d=b,b=d.handler);this.each(function(c,e){g.each(a,function(c,a){l(e,a,b,d)})});return this};h.prototype.off=function(c,b){const a=c.match(/\S+/g)||[];this.each(function(c,d){g.each(a,function(c,a){k(d,a,b)})});return this};h.prototype.reset=function(){this.each(function(c,b){e(b)});return this};h.prototype.isEmpty=function(){return 0===this._selection[0].innerHTML.replace(/\s/g,"").length};
  h.prototype.position=function(){return null!=this._selection[0]?g.getPosition(this._selection[0]):{x:-1,y:-1,visible:!1}};h.prototype.css=function(c,b){const a=this;if("object"===typeof c)g.each(c,function(c,b){a.each(function(a,d){d.style[c]=b})});else{if(d.isNoU(b))return this._selection[0].style[c];a.each(function(a,d){d.style[c]=b})}return this};h.prototype.addClass=function(c){const b=c.match(/\S+/g)||[];g.each(this._selection,function(a,d){d.classList?g.each(b,function(c,b){d.classList.add(b)}):
  d.className+=" "+c});return this};h.prototype.hasClass=function(c){return g.hasClass(this._selection[0],c)};h.prototype.removeClass=function(c){const b=c.match(/\S+/g)||[];g.each(this._selection,function(a,d){d.classList?g.each(b,function(c,b){d.classList.remove(b)}):d.className=d.className.replace(new RegExp("(^|\\b)"+c.split(" ").join("|")+"(\\b|$)","gi")," ")});return this};h.prototype.prev=function(){return new h(this._selection[0].previousElementSibling)};h.prototype.next=function(){return new h(this._selection[0].nextElementSibling)};
  h.prototype.html=function(c){if(d.isNoU(c))return this._selection[0].innerHTML;this.each(function(b,a){a.innerHTML=c});return this};h.prototype.checked=function(c){if(d.isNoU(c)){const c=this._selection[0].checked;return null!=c&&"false"!=c&&(c||"checked"==c)}this.each(function(b,a){a.checked=c});return this};h.prototype.value=function(c){if(d.isNoU(c))return this._selection[0].value;this.each(function(b,a){a.value=c});return this};h.prototype.append=function(c){"string"===typeof c?this._selection[0].innerHTML+=
  c:this._selection[0].appendChild(c);return this};h.prototype.insert=function(c,b){c=this.children().get(c);null!==c?this._selection[0].insertBefore(b,c):this._selection[0].appendChild(b);return this};h.prototype.prepend=function(c){"string"===typeof c?this._selection[0].innerHTML=c+this._selection[0].innerHTML:this._selection[0].insertBefore(c,this._selection[0].firstElementChild);return this};h.prototype.detach=function(){const c=this._selection[0],a=c.parentNode;null!=a&&(c.__zuix_oldParent=a,c.__zuix_oldIndex=
  Array.prototype.indexOf.call(a.children,c),a.removeChild(c),b.t("Detached from parent",a,c));return this};h.prototype.attach=function(){const c=this._selection[0];null==c.parentNode&&null!=c.__zuix_oldParent&&(g(c.__zuix_oldParent).insert(c.__zuix_oldIndex,c),c.__zuix_oldParent=null,delete c.__zuix_oldParent,delete c.__zuix_oldIndex);return this};h.prototype.display=function(c){if(d.isNoU(c))return this._selection[0].style.display;g.each(this._selection,function(b,a){a.style.display=c});return this};
  h.prototype.visibility=function(c){if(d.isNoU(c))return this._selection[0].style.visibility;g.each(this._selection,function(b,a){a.style.visibility=c});return this};h.prototype.show=function(c){return this.display(null==c?"":c)};h.prototype.hide=function(){return this.display("none")};const g=function(c){return new h(c)};g.find=function(c){return g().find(c)};g.each=function(c,b){const a=null==c?0:Object.keys(c).length;if(0<a){let d=0;for(let e in c)if(c.hasOwnProperty(e)){let f=c[e];f instanceof
  Element&&(f=g(f));if(!1===b.call(f,e,c[e],f))break;d++;if(d>=a)break}}return this};g.ajax=function(c){let b;b=d.isNoU(c)||d.isNoU(c.url)?c:c.url;const a=new XMLHttpRequest;a.open("GET",b);a.onload=function(){200===a.status?d.isFunction(c.success)&&c.success(a.responseText):d.isFunction(c.error)&&c.error(a);d.isFunction(c.then)&&c.then(a)};a.send();return this};g.hasClass=function(c,b){b=b.match(/\S+/g)||[];let a=!1;g.each(b,function(b,d){if(a=c.classList?c.classList.contains(d):(new RegExp("(^| )"+
  d+"( |$)","gi")).test(c.className))return!1});return a};g.classExists=function(c){c=c.match(/\S+/g)||[];let b=!1;g.each(c,function(c,a){c=document.styleSheets;if(null!=c)for(let d=0;d<c.length;d++)try{const e=c[d].rules||c[d].cssRules;if(null!=e)for(let c=0;c<e.length;c++)if(e[c].selectorText===a){b=!0;break}}catch(q){if("SecurityError"!==q.name&&"InvalidAccessError"!==q.name)throw q;}});return b};g.wrapElement=function(c,b){c=document.createElement(c);"string"===typeof b?c.innerHTML=b:c.appendChild(b);
  return c};g.wrapCss=function(c,a){const d=/(([a-zA-Z0-9\240-\377=:-_\n,.@]+.*){([^{}]|((.*){([^}]+)[}]))*})/g;let e="",f;a=a.replace(/\/\*[\s\S]*?\*\/|([^:]|^)\/\/.*$/g,"");do if((f=d.exec(a))&&1<f.length){var k=f[2];if(null!=k&&0<k.length){k=k.replace(/\n/g,"");const b=k.split(",");let a=!1;g.each(b,function(d,f){"."===f.replace(" ","")?e+="\n"+c+" ":"@"===f.trim()[0]?(e+=f+" ",f.trim().toLowerCase().startsWith("@media")&&(a=!0)):e+="\n"+c+"\n"+f+" ";d<b.length-1&&(e+=", ")});a?(k=g.wrapCss(c,f[1].substring(f[2].length).replace(/^{([^\0]*?)}$/,
  "$1")),e+="{\n  "+k+"\n}"):e+=f[1].substring(f[2].length)+"\n"}else b.w("z$.wrapCss was unable to parse rule.",k,f)}while(f);""!==e&&(a=e);return a};g.appendCss=function(c,b,a){const e=document.head||document.getElementsByTagName("head")[0];let f=null;d.isNoU(b)?(b=document.getElementById(a),null!=b&&e.removeChild(b)):e.removeChild(b);"string"===typeof c?(f=document.createElement("style"),f.type="text/css",f.id=a,f.styleSheet?f.styleSheet.cssText=c:f.appendChild(document.createTextNode(c))):c instanceof
  Element&&(f=c);d.isNoU(f)||e.appendChild(f);return f};g.replaceCssVars=function(c,b){const a=new RegExp(/\B\$var\[(.*[^\[\]])]/g);let d="",e=0,f=0,k;for(;k=a.exec(c);){let a=k[0];if(1<k.length){var g=k[1];let c=b;if(0<g.indexOf(".")){g=g.split(".");for(let b=0;b<g.length-1&&(c=c[g[b]],"undefined"!==typeof c);b++);"undefined"!==typeof c&&(a=c[g[g.length-1]],e++)}else"undefined"!==typeof c[g]&&(a=c[g],e++)}d+=c.substr(f,k.index-f)+a;f=k.index+k[0].length}0<e&&(c=d+=c.substr(f));return c};g.replaceBraces=
  function(c,b){const a=new RegExp(/{?{.*?}?}/g);let e="",f=0,k=0;for(var g;g=a.exec(c);){if("string"===typeof g[0]&&(0===g[0].trim().length||0<=g[0].indexOf("\n"))){g=c.substr(k,g.index-k)+g[0];e+=g;k+=g.length;continue}let a=g[0];if("function"===typeof b){const c=b(g[0]);d.isNoU(c)||(a=c,f++)}e+=c.substr(k,g.index-k)+a;k=g.index+g[0].length}return 0<f?e+=c.substr(k):null};g.getClosest=function(c,b){for(;c&&c!==document;c=c.parentNode)if(c.matches(b))return c;return null};g.getPosition=function(c,
  b){var a;{var d=a=0,e=c.getBoundingClientRect();let b=c;for(;b;){if("body"===b.tagName.toLowerCase()){const c=b.scrollTop||document.documentElement.scrollTop;a+=b.offsetLeft-(b.scrollLeft||document.documentElement.scrollLeft)+b.clientLeft;d+=b.offsetTop-c+b.clientTop}else a+=b.offsetLeft-b.scrollLeft+b.clientLeft,d+=b.offsetTop-b.scrollTop+b.clientTop;b=b.offsetParent}a={x:a,y:d,rect:e}}a.visible=!1;e=c.offsetParent;if(null!=e){if(e!==document.body){for(d=e.offsetParent;null!=d&&null!==d.offsetParent&&
  d.offsetHeight===d.scrollHeight;)d=d.offsetParent;null!=d&&(e=d)}d=e.getBoundingClientRect();e===document.body&&(d={x:d.x,y:d.y,width:document.documentElement.offsetWidth||document.documentElement.clientWidth,height:document.documentElement.offsetHeight||document.documentElement.clientHeight,top:0,left:0,right:document.documentElement.clientWidth||document.documentElement.offsetWidth,bottom:document.documentElement.clientHeight||document.documentElement.offsetHeight});null==b&&(b=0);e=c.getBoundingClientRect();
  b=!(e.left-1>d.right-b||e.right+1<d.left+b||e.top-1>d.bottom-b||e.bottom+1<d.top+b);a.visible=b;a.frame={dx:(e.left+e.width/2-d.left)/d.width,dy:(e.top+e.height/2-d.top)/d.height};c=g(c);!b&&c.hasClass("--ui--visible")?(c.removeClass("--ui--visible"),a.event="exit"):b?b&&(c.hasClass("--ui--visible")?a.event="scroll":(a.event="enter",c.addClass("--ui--visible"))):a.event="off-scroll"}return a};g.ZxQuery=h;Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||
  Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(b){b=(this.document||this.ownerDocument).querySelectorAll(b);let c=b.length;for(;0<=--c&&b.item(c)!==this;);return-1<c});(function(){function b(b,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};const a=document.createEvent("CustomEvent");a.initCustomEvent(b,c.bubbles,c.cancelable,c.detail);return a}if("function"===typeof window.CustomEvent)return!1;b.prototype=window.Event.prototype;
  window.CustomEvent=b})();String.prototype.hashCode=function(){let b=0;if(0===this.length)return b;for(let c=0;c<this.length;c++){let a=this.charCodeAt(c);b=(b<<5)-b+a;b|=0}return b};String.prototype.startsWith||(String.prototype.startsWith=function(b,a){return this.substr(!a||0>a?0:+a,b.length)===b});r.exports=g},{"./Logger":2,"./Util.js":4}],6:[function(m,r,x){m=m("./zuix/Zuix.js");"object"===typeof r&&r.exports?r.exports=m.call(this):this.zuix=m.call(this)},{"./zuix/Zuix.js":12}],7:[function(m,
  r,x){r.exports=function(a){return null}},{}],8:[function(m,r,x){function a(b,a,e){h=b;this._options=null;this.contextId=null==a||null==a.contextId?null:a.contextId;this.componentId=null;this.trigger=function(b,a,c){"function"===typeof e&&e(b,a,c)};this.behavior=this._controller=this._style=this._css=this._view=this._model=this._container=null;this._eventMap=[];this._behaviorMap=[];this._c=null;this.options(a);return this}const l=m("../helpers/Logger")("ComponentContext.js"),k=m("./OptionAttributes")(),
  f=m("../helpers/ZxQuery"),e=m("../helpers/Util");let h=null;a.prototype.container=function(b){if(null==b)return this._container;b instanceof f.ZxQuery&&(b=b.get());this._container=b;return this};a.prototype.view=function(b){if("undefined"===typeof b)return this._view;b instanceof f.ZxQuery&&(b=b.get());l.t(this.componentId,"view:attach","timer:view:start");if("string"===typeof b){b={content:b};this.trigger(this,"html:parse",b);b=b.content;const a=f.wrapElement("div",b);null!=a.firstElementChild&&
  (null!=a.firstElementChild.getAttribute(k.dataUiView)?1===a.children.length&&(b=a.firstElementChild.innerHTML):b=a.innerHTML);null!=this._container?(this._view=this._container,this._view.innerHTML+=b):null!=this._view?this._view.innerHTML=b:this._view=a;f(this._view).find("script").each(function(b,a){"true"!==this.attr("zuix-loaded")&&(this.attr("zuix-loaded","true"),eval.call(window,a.innerHTML))});this.trigger(this,"view:process",f(this._view))}else b instanceof f.ZxQuery&&(b=b.get()),null!=this._container?
  (this._view=f.wrapElement("div",b.outerHTML).firstElementChild,this._view.removeAttribute(k.dataUiView),this._container.appendChild(this._view),this._view=this._container):this._view=b;b=f(this._view);!1===this._options.css?b.addClass("zuix-css-ignore"):b.removeClass("zuix-css-ignore");b.find("["+k.dataUiLoad+"]").each(function(b,a){this.attr(k.dataUiLoaded,"false")});this.modelToView();l.t(this.componentId,"view:attach","timer:view:stop");return this};a.prototype.style=function(b){if("undefined"===
  typeof b)return this._style;l.t(this.componentId,"view:style","timer:view:start");null==b||b instanceof Element?(this._css=b instanceof Element?b.innerText:b,this._style=f.appendCss(b,this._style,this.componentId)):"string"===typeof b&&(this._css=b,b={content:b},this.trigger(this,"css:parse",b),b=b.content,b=f.wrapCss("["+k.dataUiComponent+'="'+this.componentId+'"]:not(.zuix-css-ignore)',b),this._style=f.appendCss(b,this._style,this.componentId));l.t(this.componentId,"view:style","timer:view:stop");
  return this};a.prototype.model=function(b){if("undefined"===typeof b)return this._model;this._model=b;this.modelToView();null!=this._c&&e.isFunction(this._c.update)&&this._c.update.call(this._c,this._c);return this};a.prototype.controller=function(b){if("undefined"===typeof b)return this._controller;this._controller=b;return this};a.prototype.options=function(b){if(null==b)return this._options;const a=this._options=this._options||{};f.each(b,function(b,d){a[b]=d});null!=a.componentId&&(this.componentId=
  a.componentId);this.container(a.container);this.view(a.view);"undefined"!==typeof a.css&&this.style(a.css);this.controller(a.controller);this.model(a.model);return this};a.prototype.on=function(b,a){this._c.on(b,a);return this};a.prototype.loadCss=function(b,a){const d=this;e.isNoU(b)&&(b={});e.isNoU(b.caching)||(a=b.caching);let k=d.componentId+".css";e.isNoU(b.path)||(k=b.path);a||(k+="?"+(new Date).getTime());f.ajax({url:h.getResourcePath(k),success:function(a){d.style(a);e.isFunction(b.success)&&
  b.success.call(d,a,d)},error:function(a){l.e(a,d);e.isFunction(b.error)&&b.error.call(d,a,d)},then:function(){e.isFunction(b.then)&&b.then.call(d,d)}});return this};a.prototype.loadHtml=function(b,a){const d=this;let m=d.componentId;e.isNoU(b)&&(b={});e.isNoU(b.caching)||(a=b.caching);e.isNoU(b.path)||(m=b.path);var g=h.store("zuix.inlineViews");null==g&&(g=[],h.store("zuix.inlineViews",g));if(null!=g[m])d.view(g[m]),e.isFunction(b.success)&&b.success.call(d,g[m],d),e.isFunction(b.then)&&b.then.call(d,
  d);else{const c=f().find("["+k.dataUiView+'="'+m+'"]:not(['+k.dataUiComponent+'*=""])');0<c.length()?(a=c.get(0),g[m]=a.innerHTML,d.view()===a||null!=d.container()&&d.container().contains(a)?(c.attr(k.dataUiView,null),d._view=a,this.trigger(this,"view:process",f(d.view()))):d.view(a.innerHTML),e.isFunction(b.success)&&b.success.call(d,a.innerHTML,d),e.isFunction(b.then)&&b.then.call(d,d)):(g=e.isNoU(b.cext)?".html":b.cext,m==d.componentId&&(m+=g+(a?"":"?"+(new Date).getTime())),f.ajax({url:h.getResourcePath(m),
  success:function(a){d.view(a);e.isFunction(b.success)&&b.success.call(d,a,d)},error:function(a){l.e(a,d);e.isFunction(b.error)&&b.error.call(d,a,d)},then:function(){e.isFunction(b.then)&&b.then.call(d,d)}}))}return this};a.prototype.viewToModel=function(){l.t(this.componentId,"view:model","timer:vm:start");const b=this;this._model={};f(this._view).find("["+k.dataUiField+"]").each(function(a,f){if(0<this.parent("pre,code").length())return!0;a=this.attr(k.dataUiField);f=!e.isNoU(f.innerHTML)&&e.isIE()?
  f.cloneNode(!0):f;if(0<a.indexOf(".")){a=a.split(".");let d=b._model;for(let b=0;b<a.length-1;b++)"undefined"===typeof d[a[b]]&&(d[a[b]]={}),d=d[a[b]];d[a[a.length-1]]=f}else b._model[a]=f});l.t(this.componentId,"view:model","timer:vm:stop");return this};a.prototype.modelToView=function(){l.t(this.componentId,"model:view","timer:mv:start");if(null!=this._view&&null!=this._model){const a=this;f(this._view).find("["+k.dataUiField+"]").each(function(b,h){if(0<this.parent("pre,code").length())return!0;
  var d=this.attr(k.dataBindTo);null==d&&(d=this.attr(k.dataUiField));var g=f(a._view);if("function"===typeof a._model)a._model.call(g,this,d,g);else if(b=e.propertyFromPath(a._model,d),"function"===typeof b)b.call(g,this,d,g);else if(null!=b)switch(h.tagName.toLowerCase()){case "img":h.src=e.isNoU(b.src)?e.isNoU(b.innerHTML)?b:b.innerHTML:b.src;b.alt&&(h.alt=b.alt);break;case "a":h.href=e.isNoU(b.href)?e.isNoU(b.innerHTML)?b:b.innerHTML:b.getAttribute("href");b.title&&(h.title=b.title);e.isNoU(b.href)||
  e.isNoU(b.innerHTML)||""===b.innerHTML.trim()||(h.innerHTML=b.innerHTML);break;case "input":h.value=e.isNoU(b.value)?e.isNoU(b.innerHTML)?b:b.innerHTML:b.value;break;default:if(h.innerHTML=e.isNoU(b.innerHTML)?b:b.innerHTML,null!=b.attributes)for(d=0;d<b.attributes.length;d++)g=b.attributes[d],g.specified&&g.name!==k.dataUiField&&("+"===g.value[0]&&h.hasAttribute(g.name)&&(g.value=h.getAttribute(g.name)+" "+g.value.substring(1)),h.setAttribute(g.name,g.value))}})}l.t(this.componentId,"model:view",
  "timer:mv:stop");return this};r.exports=a},{"../helpers/Logger":2,"../helpers/Util":4,"../helpers/ZxQuery":5,"./OptionAttributes":11}],9:[function(m,r,x){function a(){}function l(b,a){null!=b&&(H=!b);null!=a&&(J=a);return!D&&!H}function k(b){null==b&&(b=document);F.indexOf(b)||F.push(b)}function f(b){for(let a=0;a<y.length;a++){const c=y[a];if(c.element===b)return c.waiting}return null}function e(b){null==b&&0<F.length&&(b=F.unshift());b instanceof u.ZxQuery&&(b=b.get());f(b);var a=u(b).find("["+
  t.dataUiLoad+"]:not(["+t.dataUiLoaded+"]),["+t.dataUiInclude+"]:not(["+t.dataUiLoaded+"])");a=Array.prototype.slice.call(a._selection);y.push({element:b,waiting:a});b=[];for(var c=0;c<a.length;c++){var d=a[c],n=parseInt(d.getAttribute(t.dataUiPriority));isNaN(n)&&(n=0);let f=0;var e=d.parentNode;let Q=!1;for(;null!=e&&e!==document;){f++;if(null!=e.getAttribute(t.dataUiView)){Q=!0;break}e=e.parentNode}Q||(e=new A,e.element=d,e.priority=n+1E3*f,b.push(e))}a=0;for(c=0;c<b.length;c++){d=!1;for(n=0;n<
  w.length;n++)if(b[c].element===w[n].element){d=!0;break}d||(d=b[c].element,n=d.getAttribute(t.dataUiOptions),z(d,n),w.push(b[c]),a++)}q.t("componentize:count",w.length,a);(0===a||0===F.length&&0===w.length)&&E.trigger(this,"componentize:end")}function h(){w.sort(function(b,a){return b.priority-a.priority});let b=null,a=0<w.length?w.shift():null;for(;null!=a&&null!=a.element;){const c=N(a.element);l()&&c?(a.lazy=!0,a.visible=u.getPosition(a.element,J).visible):(a.lazy=!1,a.visible=!0);if(null!=a&&
  null!=a.element&&a.visible){b={item:a,cancelable:a.lazy};break}if(0<w.length)a=w.shift();else break}return b}function b(b){e(b);b=h();null!=b&&K.append([b])}function d(a){var c=u(a);if(null!=c.attr(t.dataUiLoaded)||0<c.parent("pre,code").length())return!1;c.attr(t.dataUiLoaded,"true");let d=c.attr(t.dataUiOptions);p.isNoU(d)?d={}:(d=p.propertyFromPath(window,d),d=p.cloneObject(d)||{});var e=c.attr(t.dataUiContext);if(!p.isNoU(e)){var n=E.context(e);null!==n&&(d=n.options());d.contextId=e}p.isNoU(d.view)&&
  !c.isEmpty()?(d.view=a,d.viewDeferred=!0):p.isNoU(d.view)&&p.isNoU(d.container)&&c.isEmpty()&&(d.container=a);e=c.attr(t.dataUiLoad);if(p.isNoU(e))if(e=c.attr(t.dataUiInclude),null!=e)e=B(e),c.attr(t.dataUiInclude,e),c.attr(t.dataUiComponent,e),p.isNoU(d.controller)&&(d.controller=function(){});else return!1;else e=B(e),c.attr(t.dataUiLoad,e);n=c.attr(t.dataBindModel);!p.isNoU(n)&&0<n.length&&(d.model=p.propertyFromPath(window,n));c=c.attr(t.dataUiPriority);p.isNoU(c)||(d.priority=parseInt(c));u(a).one("component:ready",
  function(){k(a);b(a)});E.load(e,d);return!0}function B(b){var a=E.store("config");null!=a&&null!=a[location.host]&&(a=a[location.host]);a=null!=a&&null!=a.libraryPath?a.libraryPath:"https://zuixjs.github.io/zkit/lib/";b.startsWith("@lib/")&&(b=a+b.substring(5));return b}function z(b,a){"string"===typeof a&&(a=p.propertyFromPath(window,a));null!=b&&null!=a&&(null!=a.lazyLoad&&b.setAttribute(t.dataUiLazyload,a.lazyLoad.toString().toLowerCase()),null!=a.contextId&&b.setAttribute(t.dataUiContext,a.contextId.toString().toLowerCase()),
  null!=a.componentId&&b.setAttribute(t.dataUiLoad,a.componentId.toString().toLowerCase()))}function g(b){for(let a=0;a<M.length;a++){const c=M[a];if(c.element===b)return c}return null}function c(b){b={element:b};M.push(b);return b}function C(b){for(let a=0;a<v.length;a++){const c=v[a];if(c.element===b)return c}return null}function L(b){b={element:b};v.push(b);return b}function N(a){if("false"===a.getAttribute(t.dataUiLazyload))return!1;let d=g(a);if(null==d){const e=u.getClosest(a.parentNode,"["+t.dataUiLazyload+
  "=scroll],["+t.dataUiLazyload+"=true]");if(null!=e)return d=c(a),a=C(e),null==a&&(a=L(e),"scroll"===e.getAttribute(t.dataUiLazyload)&&function(a,c){let n=(new Date).getTime();u(c===document.body?window:c).on("scroll",function(){const a=(new Date).getTime();100<a-n&&(n=a,b(c))})}(this,e)),!0;if("true"===a.getAttribute(t.dataUiLazyload))return d=c(a),!0}else return!0;return!1}const t=m("./OptionAttributes")();a.prototype.componentize=function(a,c){E.trigger(this,"componentize:begin");if(null!=c){const b=
  f(a);null==b?y.push({element:a,waiting:[c]}):b.push(c)}else k(a);b(a);return this};a.prototype.applyOptions=function(a,b){z(a,b);return this};a.prototype.resolvePath=function(a){return B(a)};a.prototype.willLoadMore=function(){return 0<w.length||0<F.length};a.prototype.lazyLoad=function(a,b){return l(a,b)};a.prototype.dequeue=function(a){for(let b=0;b<w.length;b++)if(w[b].element===a){w.splice(b,1);break}};a.prototype.setHost=function(a){E=a;return this};r.exports=function(){return new a};const q=
  m("../helpers/Logger")("ComponentContext.js"),p=m("../helpers/Util"),u=m("../helpers/ZxQuery"),F=[],w=[],M=[],v=[],A=function(){return{element:null,priority:0,visible:!0,lazy:!1}},K=m("./../helpers/AsynChain")({doWork:function(a,b){u(a.element).one("component:ready",function(){b()});return d(a.element)},willBreak:function(){return!1},status:function(a){switch(a){case "done":b()}}});let H=!1,J=1,E=null,D=!1;navigator&&navigator.userAgent&&(D=(new RegExp(/bot|googlebot|crawler|spider|robot|crawling/i)).test(navigator.userAgent));
  D&&q.d(navigator.userAgent,"is a bot, ignoring `lazy-loading` option.");const y=[]},{"../helpers/Logger":2,"../helpers/Util":4,"../helpers/ZxQuery":5,"./../helpers/AsynChain":1,"./OptionAttributes":11}],10:[function(m,r,x){function a(a){const f=this;this._view=null;this.context=a;this._fieldCache=[];this.destroy=this.update=this.create=this.init=null;this._childNodes=[];this.saveView=function(){this.restoreView();this.view().children().each(function(a,d){f._childNodes.push(d)})};this.restoreView=
  function(){0<this._childNodes.length&&(f.view().html(""),l.each(f._childNodes,function(a,d){f.view().append(d)}),this._childNodes.length=0)};this.on=function(a,d){this.addEvent(a,d);return this};this.mapEvent=function(a,d,e,f){null!=d&&(d.off(e,this.eventRouter),a[e]=f,d.on(e,this.eventRouter))};this.eventRouter=function(b){const d=f.view();"function"===typeof a._behaviorMap[b.type]&&a._behaviorMap[b.type].call(d,b,b.detail,d);"function"===typeof a._eventMap[b.type]&&a._eventMap[b.type].call(d,b,
  b.detail,d)};const e=a.options();let k=null;if(null!=e.on)for(let a in e.on)e.on.hasOwnProperty(a)&&(k=e.on[a],f.addEvent(a,k));if(null!=e.behavior)for(let a in e.behavior)e.behavior.hasOwnProperty(a)&&(k=e.behavior[a],f.addBehavior(a,k));a.controller().call(this,this);return this}const l=m("../helpers/ZxQuery");a.prototype.addEvent=function(a,f){this.mapEvent(this.context._eventMap,this.view(),a,f);return this};a.prototype.addBehavior=function(a,f){this.mapEvent(this.context._behaviorMap,this.view(),
  a,f);return this};a.prototype.field=function(a){return null};a.prototype.clearCache=function(){this._fieldCache.length=0};a.prototype.view=function(a){if(null!=this.context.view()||this._view!==this.context.view())this.clearCache(),this._view=l(this.context.view());if(null!=a)return this._view.find(a);if(null!==this._view)return this._view;throw Error("Not attached to a view yet.");};a.prototype.model=function(a){if(null==a)return this.context.model();this.context.model(a);return this};a.prototype.options=
  function(){return this.context.options()};a.prototype.trigger=function(a,f,e){null==this.context._eventMap[a]&&!0!==e&&this.addEvent(a,null);!0===e?(e=this.context.container(),null==e&&(e=this.context.view()),null!=e&&l(e).trigger(a,f),this.context.trigger(this.context,a,f)):this.view().trigger(a,f);return this};a.prototype.expose=function(a,f){if("object"===typeof a){const e=this;l.each(a,function(a,b){e.context[a]=b})}else this.context[a]=f;return this};a.prototype.loadCss=function(a){this.context.loadCss(a);
  return this};a.prototype.loadHtml=function(a){this.saveView();this.context.loadHtml(a);return this};a.prototype.log={};a.prototype.for=function(a){return this};r.exports=a},{"../helpers/ZxQuery":5}],11:[function(m,r,x){const a=Object.freeze({dataBindModel:"data-bind-model",dataBindTo:"data-bind-to",dataUiComponent:"data-ui-component",dataUiContext:"data-ui-context",dataUiField:"data-ui-field",dataUiInclude:"data-ui-include",dataUiLazyload:"data-ui-lazyload",dataUiLoad:"data-ui-load",dataUiLoaded:"data-ui-loaded",
  dataUiOptions:"data-ui-options",dataUiPriority:"data-ui-priority",dataUiView:"data-ui-view",zuixLoaded:"zuix-loaded"});r.exports=function(l){return a}},{}],12:[function(m,r,x){function a(){v.setHost(this);this._store=[];this._fieldCache=[];return this}function l(a){"function"!==typeof a["for"]&&(a["for"]=function(b){return J[b]=a});return a}function k(a,b,c){p.isNoU(c)&&(c=this);null==c._fieldCache&&(c._fieldCache={});let n=null;if("undefined"===typeof c._fieldCache[a]){if(n=u(b).find("["+A.dataUiField+
  '="'+a+'"]'),null!=n&&0<n.length()&&(c._fieldCache[a]=n,1===n.length()&&p.isNoU(n.field))){const a=this;n.field=function(b){return a.field(b,n,n)}}}else n=c._fieldCache[a];return n}function f(a){let b=zuix.store("config");null!=b&&null!=b[location.host]&&(b=b[location.host]);a=v.resolvePath(a);!a.startsWith("//")&&0>a.indexOf("://")&&(a=(null!=b&&null!=b.resourcePath?b.resourcePath:"")+a);return a}function e(a,b){let n=g(a.componentId);null!==n&&null==b.controller&&null==a.controller()&&(a.controller(n.controller),
  q.t(a.componentId+":js","component:cached:js"));if(p.isNoU(b.view)){if(null!==n&&(null!=n.view&&(a.view(n.view),q.t(a.componentId+":html","component:cached:html")),!1!==b.css&&(b.css=!1,n.css_applied||(n.css_applied=!0,a.style(n.css),q.t(a.componentId+":css","component:cached:css")))),p.isNoU(a.view()))return O("resource-loader").queue(a.componentId+":html",function(){y[a.componentId]=this;a.loadHtml({cext:b.cext,caching:I,success:function(d){null==n&&(n=C(a));n.view=d;delete n.controller;!1!==b.css?
  (y[a.componentId].step(a.componentId+":css"),a.loadCss({caching:I,success:function(a){n.css=a},error:function(b){q.e(b,a)},then:function(){c(a,y[a.componentId])}})):c(a,y[a.componentId])},error:function(c){q.e(c,a);p.isFunction(b.error)&&a.error.call(a,c,a)}})},b.priority),a}else a.view(b.view);null==a.controller()?O("resource-loader").queue(a.componentId+":js",function(){y[a.componentId]=this;c(a,y[a.componentId])},K.length):c(a);return a}function h(a){if(a instanceof Element){const b=a;a=zuix.context(b);
  v.dequeue(b)}p.isNoU(a)||(p.isNoU(a._c)||(p.isNoU(a._c.view())||(a._c.view().attr(A.dataUiComponent,null),a._c.view().reset(),p.isNoU(a._c._fieldCache)||u.each(a._c._fieldCache,function(a,b){b.reset()}),a._c.view().detach()),p.isFunction(a._c.destroy)&&a._c.destroy.call(a,a)),a=a.container(),null!=a&&null!=a.parentNode&&a.parentNode.removeChild(a))}function b(a){a=new w(zuix,a,B);K.push(a);return a}function d(a,b){let c=null;if(a instanceof u.ZxQuery)a=a.get();else if("string"===typeof a){const b=
  u.find("["+A.dataUiContext+'="'+a+'"]');0<b.length()&&(a=b.get())}u.each(K,function(b,d){if(a instanceof Element&&(d.view()===a||d.container()===a)||p.objectEquals(d.contextId,a))return c=d,!1});if("function"===typeof b&&(a instanceof Element||a instanceof u.ZxQuery))if(null==c)u(a).one("component:ready",function(){c=zuix.context(this);b.call(c,c)});else b.call(c,c);return c}function B(a,b,c){p.isFunction(H[b])&&H[b].call(a,c,a)}function z(a){null!=a&&(I=a);return I}function g(a){let b=null;u.each(G,
  function(c,d){if(p.objectEquals(d.componentId,a))return b=d,!1});return b}function c(a,b){if("undefined"===typeof a.options().controller&&null===a.controller())if(q.d(a.componentId,"controller:load"),p.isNoU(b)||b.step(a.componentId+":js"),p.isFunction(J[a.componentId]))a.controller(J[a.componentId]),L(a,b);else{const c=function(b){const c=a.componentId+".js"+(I?"":"?"+(new Date).getTime());u.ajax({url:f(c),success:function(b){try{const c=b.indexOf("function"),d=b.indexOf(".load");1<d&&d<c&&(b=b.substring(0,
  d-4));const e=b.indexOf(".controller");1<e&&e<c&&(b=b.substring(e+11));const n=b.indexOf("//<--controller");0<n&&(b=b.substring(0,n));b+='\n//# sourceURL="'+a.componentId+'.js"\n';a.controller(t(b))}catch(R){q.e(Error(),R,b,a),p.isFunction(a.error)&&a.error.call(a,R,a)}},error:function(b){q.e(b,Error(),a);p.isFunction(a.error)&&a.error.call(a,b,a)},then:function(){L(a,b)}})};p.isNoU(b)?O("resource-loader").queue(a.componentId+":js",function(){c(y[a.componentId]=this)},a.options().priority):c(b)}else L(a,
  b)}function C(a){var b=a.view().innerHTML;b=u.wrapElement("div",b);b={componentId:a.componentId,view:b.innerHTML,css:a._css,controller:a.controller()};G.push(b);q.t(a.componentId,"bundle:added");return b}function L(a,b){y[a.componentId]=null;if(p.isNoU(a.view()))q.e(a.componentId,"component:view:undefined");else{let d=g(a.componentId);a.options().viewDeferred?q.w(a.componentId,"component:deferred:load"):null===d?d=C(a):null==d.controller&&(d.controller=a.controller());null!=b&&b.callback(function(){q.d(a.componentId,
  "controller:create:deferred");N(a._c)});var c=u(a.view());null==c.attr(A.dataUiContext)&&c.attr(A.dataUiContext,a.contextId);q.d(a.componentId,"component:initializing");if(p.isFunction(a.controller())){c=a._c=new M(a);c.log=m("../helpers/Logger")(a.contextId);"function"===typeof c.init&&c.init();if(!p.isNoU(c.view()))if(null==c.view().attr(A.dataUiComponent)&&c.view().attr(A.dataUiComponent,a.componentId),p.isNoU(a.model())&&!p.isNoU(a.view())&&a.viewToModel(),c.trigger("view:apply"),a.options().viewDeferred){a.options().viewDeferred=
  !1;c.saveView();null===d&&(d={componentId:a.componentId,controller:a.controller()},G.push(d),q.t(a.componentId,"bundle:added"),q.d(a.componentId,"component:deferred:load"));let e=-1;!1!==a.options().css&&(null==d.css?(-1===e&&(e=0),e++,a.loadCss({caching:I,success:function(b){null==d.css&&(d.css=b);q.d(a.componentId,"component:deferred:css",e)},then:function(){0===--e&&null!=b&&b.end()}})):a.style(d.css));!1!==a.options().html&&(null==d.view?(-1===e&&(e=0),e++,a.loadHtml({cext:a.options().cext,caching:I,
  success:function(b){null==d.view&&(d.view=b);q.d(a.componentId,"component:deferred:html",e)},error:function(b){q.e(b,a);p.isFunction(a.options().error)&&a.options().error.call(a,b,a)},then:function(){0===--e&&null!=b&&b.end()}})):a.view(d.view));-1===e&&null!=b&&b.end()}else null!=b&&b.end();null==b&&(q.d(a.componentId,"controller:create"),N(c))}else q.w(a.componentId,"component:controller:undefined")}}function N(a){q.t(a.context.componentId,"controller:init","timer:init:start");a.view().find("["+
  A.dataUiLoaded+'="false"]:not(['+A.dataUiComponent+"])").each(function(a,b){this.attr(A.dataUiLoaded,null)});a.field=function(b){b=k(b,a.view(),a);b.on=function(b,c,d,e){if("string"===typeof c){const b=c;c=function(){a.trigger(b,d,e)}}return u.ZxQuery.prototype.on.call(this,b,c)};return b};p.isFunction(a.create)&&a.create();a.trigger("view:create");p.isFunction(a.context.ready)&&a.context.ready.call(a.context,a.context);a.trigger("component:ready",a.view(),!0);q.t(a.context.componentId,"controller:init",
  "timer:init:stop");q.i(a.context.componentId,"component:loaded",a.context.contextId);if(null!=D[a.context.componentId]){const b=D[a.context.componentId];D[a.context.componentId]=null;let c;for(;null!=b&&null!=(c=b.shift());)e(c.c,c.o)}zuix.componentize(a.view())}function t(a){let b=function(a){};if("string"===typeof a)try{b=eval.call(this,a)}catch(S){q.e(this,S,a)}return b}const q=m("../helpers/Logger")("Zuix.js"),p=m("../helpers/Util"),u=m("../helpers/ZxQuery"),F=m("../helpers/TaskQueue"),w=m("./ComponentContext"),
  M=m("./ContextController"),v=m("./Componentizer")(),A=m("./OptionAttributes")();m("./ComponentCache");const K=[],H=[],J={},E=[],D={},y=[],O=function(a){p.isNoU(E[a])&&(E[a]=new F(function(a,b,c){B(a,b,c)}));return E[a]};let G=[],P=0,I=!0;a.prototype.field=function(a,b){return k.call(this,a,b)};a.prototype.load=function(a,c){{a=v.resolvePath(a);let f;p.isNoU(c)?(c={},f=new w(zuix,c,B)):(c.componentId=a,p.isNoU(c.contextId)?(!1===c&&(c={}),c.contextId="zuix-ctx-"+ ++P,f=b(c)):(f=d(c.contextId),null!==
  f?f.options(c):f=b(c)));f.componentId!=a&&(f.componentId=a);p.isFunction(c.ready)&&(f.ready=c.ready);p.isFunction(c.error)&&(f.error=c.error);null==y[a]?(y[a]=!0,c=e(f,c)):(null==D[a]&&(D[a]=[]),D[a].push({c:f,o:c}),c=f)}return c};a.prototype.unload=function(a){h(a);return this};a.prototype.controller=function(a){return l.call(this,a)};a.prototype.context=function(a,b){return d.call(this,a,b)};a.prototype.createComponent=function(a,c){null==c&&(c={});p.isNoU(c.contextId)&&(c.contextId="zuix-ctx-"+
  ++P);if(null!=d(c.contextId))throw Error("Context arelady exists.");c.container=document.createElement("div");c.componentId=a;v.applyOptions(c.container,c);return b(c)};a.prototype.trigger=function(a,b,c){B(a,b,c);return this};a.prototype.hook=function(a,b){p.isNoU(b)?delete H[a]:H[a]=b;return this};a.prototype.using=function(a,b,c){b=v.resolvePath(b);a=a.toLowerCase();const e=a+"-"+b.hashCode();if("component"===a)a=d(e),null==a?zuix.load(b,{contextId:e,view:"",priority:-10,ready:function(a){"function"===
  typeof c&&c(b,a)},error:function(){c(b,null)}}):"function"===typeof c&&c(b,a);else{const d="style"===a;if(0===u.find(a+'[id="'+e+'"]').length()){const f=document.head||document.getElementsByTagName("head")[0],h=document.createElement(a);h.type=d?"text/css":"text/javascript";h.id=e;f.appendChild(h);const k=function(a){d?h.styleSheet?h.styleSheet.cssText=a:h.appendChild(document.createTextNode(a)):h.innerText?h.innerText=a:h.appendChild(document.createTextNode(a));c&&c(b,e)},n="_res/"+a+"/"+e;a=g(n);
  null!=a?k(d?a.css:a.controller):u.ajax({url:b,success:function(a){G.push({componentId:n,view:null,css:d?a:null,controller:d?null:a,using:b});k(a)},error:function(){f.removeChild(h);c&&c(b)}})}else console.log("Resource already added "+e+"("+b+")"),c&&c(b,e)}};a.prototype.lazyLoad=function(a,b){if(null!=a)v.lazyLoad(a,b);else return v.lazyLoad();return this};a.prototype.httpCaching=function(a){if(null!=a)z(a);else return z();return this};a.prototype.componentize=function(a){v.componentize(a);return this};
  a.prototype.store=function(a,b){null!=b&&(this._store[a]=b);return this._store[a]};a.prototype.getResourcePath=function(a){return f(a)};a.prototype.bundle=function(a,b){if(p.isNoU(a))return G;if(a&&"boolean"===typeof a){q.t("bundle:start");const c=v.lazyLoad();v.lazyLoad(!1);v.componentize();"function"===typeof b&&(a=function(a){setTimeout(function(){v.willLoadMore()?(q.t("bundle:wait"),a(a)):(q.t("bundle:end"),v.lazyLoad(c),b())},1E3)},a(a))}else{for(let b=0;b<a.length;b++)a[b].css_applied&&delete a[b].css_applied,
  "string"===typeof a[b].controller&&(a[b].controller=eval(a[b].controller));G=a}return this};a.prototype.$=u;a.prototype.TaskQueue=F;a.prototype.ZxQuery=u.ZxQuery;a.prototype.dumpCache=function(){return G};a.prototype.dumpContexts=function(){return K};r.exports=function(b){const c=new a;"loading"!=document.readyState?c.componentize():document.addEventListener("DOMContentLoaded",function(){c.componentize()});q.monitor(function(a,b){p.isFunction(c.monitor)&&c.monitor(a,Array.prototype.slice.call(b))});
  return c}},{"../helpers/Logger":2,"../helpers/TaskQueue":3,"../helpers/Util":4,"../helpers/ZxQuery":5,"./ComponentCache":7,"./ComponentContext":8,"./Componentizer":9,"./ContextController":10,"./OptionAttributes":11}]},{},[6])(6)});
  //# sourceMappingURL=zuix.min.js.map
  