diff --git a/bower.json b/bower.json index 08c469a..b5aeaab 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "sqwidget", "main": "sqwidget.js", - "version": "2.0.0", + "version": "2.0.6", "homepage": "https://github.com/premasagar/sqwidget", "authors": [ "Adhip Gupta ", @@ -24,11 +24,11 @@ "when": "~2.6.0", "async": "~0.2.5", "mocha": "~1.14.0", + "chai": "~1.8.1", "bonzo": "~1.3.6", "qwery": "~3.4.1", "requirejs-domready": "~2.0.1", "bean": "~1.0.4", - "requirejs": "~2.1.9", - "chai": "~1.8.1" + "requirejs": "~2.1.9" } } diff --git a/sqwidget.js b/sqwidget.js index 31d2545..5124669 100644 --- a/sqwidget.js +++ b/sqwidget.js @@ -30,4 +30,4 @@ */ !function(e,t){e._sqwidget=t()}(this,function(){var requirejs,require,define;return function(global){function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var n;for(n=0;n-1&&(!e[n]||!t(e[n],n,e));n-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){(n||!hasProp(e,i))&&(r&&"string"!=typeof t?(e[i]||(e[i]={}),mixin(e[i],t,n,r)):e[i]=t)}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function t(e){var t,n;for(t=0;e[t];t+=1)if(n=e[t],"."===n)e.splice(t,1),t-=1;else if(".."===n){if(1===t&&(".."===e[2]||".."===e[0]))break;t>0&&(e.splice(t-1,2),t-=2)}}function n(e,n,r){var i,o,a,s,u,c,l,f,d,h,p,g=n&&n.split("/"),m=g,v=q.map,y=v&&v["*"];if(e&&"."===e.charAt(0)&&(n?(m=getOwn(q.pkgs,n)?g=[n]:g.slice(0,g.length-1),e=m.concat(e.split("/")),t(e),o=getOwn(q.pkgs,i=e[0]),e=e.join("/"),o&&e===i+"/"+o.main&&(e=i)):0===e.indexOf("./")&&(e=e.substring(2))),r&&v&&(g||y)){for(s=e.split("/"),u=s.length;u>0;u-=1){if(l=s.slice(0,u).join("/"),g)for(c=g.length;c>0;c-=1)if(a=getOwn(v,g.slice(0,c).join("/")),a&&(a=getOwn(a,l))){f=a,d=u;break}if(f)break;!h&&y&&getOwn(y,l)&&(h=getOwn(y,l),p=u)}!f&&h&&(f=h,d=p),f&&(s.splice(0,d,f),e=s.join("/"))}return e}function r(e){isBrowser&&each(scripts(),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===x.contextName?(t.parentNode.removeChild(t),!0):void 0})}function i(e){var t=getOwn(q.paths,e);return t&&isArray(t)&&t.length>1?(t.shift(),x.require.undef(e),x.require([e]),!0):void 0}function o(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function a(e,t,r,i){var a,s,u,c,l=null,f=t?t.name:null,d=e,h=!0,p="";return e||(h=!1,e="_@r"+(M+=1)),c=o(e),l=c[0],e=c[1],l&&(l=n(l,f,i),s=getOwn(O,l)),e&&(l?p=s&&s.normalize?s.normalize(e,function(e){return n(e,f,i)}):n(e,f,i):(p=n(e,f,i),c=o(p),l=c[0],p=c[1],r=!0,a=x.nameToUrl(p))),u=!l||s||r?"":"_unnormalized"+(A+=1),{prefix:l,name:p,parentMap:t,unnormalized:!!u,url:a,originalName:d,isDefine:h,id:(l?l+"!"+p:p)+u}}function s(e){var t=e.id,n=getOwn(S,t);return n||(n=S[t]=new x.Module(e)),n}function u(e,t,n){var r=e.id,i=getOwn(S,r);!hasProp(O,r)||i&&!i.defineEmitComplete?(i=s(e),i.error&&"error"===t?n(i.error):i.on(t,n)):"defined"===t&&n(O[r])}function c(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(S,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function l(){globalDefQueue.length&&(apsp.apply(N,[N.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function f(e){delete S[e],delete k[e]}function d(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var o=r.id,a=getOwn(S,o);!a||e.depMatched[i]||n[o]||(getOwn(t,o)?(e.defineDep(i,O[o]),e.check()):d(a,t,n))}),n[r]=!0)}function h(){var e,t,n,o,a=1e3*q.waitSeconds,s=a&&x.startTime+a<(new Date).getTime(),u=[],l=[],f=!1,p=!0;if(!y){if(y=!0,eachProp(k,function(n){if(e=n.map,t=e.id,n.enabled&&(e.isDefine||l.push(n),!n.error))if(!n.inited&&s)i(t)?(o=!0,f=!0):(u.push(t),r(t));else if(!n.inited&&n.fetched&&e.isDefine&&(f=!0,!e.prefix))return p=!1}),s&&u.length)return n=makeError("timeout","Load timeout for modules: "+u,null,u),n.contextName=x.contextName,c(n);p&&each(l,function(e){d(e,{},{})}),s&&!o||!f||!isBrowser&&!isWebWorker||E||(E=setTimeout(function(){E=0,h()},50)),y=!1}}function p(e){hasProp(O,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function g(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function m(e){var t=e.currentTarget||e.srcElement;return g(t,x.onScriptLoad,"load","onreadystatechange"),g(t,x.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(l();N.length;){if(e=N.shift(),null===e[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));p(e)}}var y,b,x,w,E,q={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},S={},k={},T={},N=[],O={},C={},M=1,A=1;return w={require:function(e){return e.require?e.require:e.require=x.makeRequire(e.map)},exports:function(e){return e.usingExports=!0,e.map.isDefine?e.exports?e.exports:e.exports=O[e.map.id]={}:void 0},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){var t,n=getOwn(q.pkgs,e.map.id);return t=n?getOwn(q.config,e.map.id+"/"+n.main):getOwn(q.config,e.map.id),t||{}},exports:O[e.map.id]}}},b=function(e){this.events=getOwn(T,e.id)||{},this.map=e,this.shim=getOwn(q.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,n,r){r=r||{},this.inited||(this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,x.startTime=(new Date).getTime();var e=this.map;return this.shim?(x.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})),void 0):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;C[e]||(C[e]=!0,x.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,n=this.map.id,r=this.depExports,i=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{i=x.execCb(n,o,r,i)}catch(a){e=a}else i=x.execCb(n,o,r,i);if(this.map.isDefine&&(t=this.module,t&&void 0!==t.exports&&t.exports!==this.exports?i=t.exports:void 0===i&&this.usingExports&&(i=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else i=o;this.exports=i,this.map.isDefine&&!this.ignore&&(O[n]=i,req.onResourceLoad&&req.onResourceLoad(x,this.map,this.depMaps)),f(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,function(r){var i,o,l,d=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,p=x.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(d=r.normalize(d,function(e){return n(e,h,!0)})||""),o=a(e.prefix+"!"+d,this.map.parentMap),u(o,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),l=getOwn(S,o.id),l&&(this.depMaps.push(o),this.events.error&&l.on("error",bind(this,function(e){this.emit("error",e)})),l.enable()),void 0):(i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&f(e.map.id)}),c(e)}),i.fromText=bind(this,function(n,r){var o=e.name,u=a(o),l=useInteractive;r&&(n=r),l&&(useInteractive=!1),s(u),hasProp(q.config,t)&&(q.config[o]=q.config[t]);try{req.exec(n)}catch(f){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+f,f,[t]))}l&&(useInteractive=!0),this.depMaps.push(u),x.completeLoad(o),p([o],i)}),r.load(e.name,p,i,q),void 0)})),x.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,r,i;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,i=getOwn(w,e.id))return this.depExports[t]=i(this),void 0;this.depCount+=1,u(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&u(e,"error",bind(this,this.errback))}n=e.id,r=S[n],hasProp(w,n)||!r||r.enabled||x.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(S,e.id);t&&!t.enabled&&x.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},x={config:q,contextName:e,registry:S,defined:O,urlFetched:C,defQueue:N,Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var t=q.pkgs,n=q.shim,r={paths:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?"map"===t?(q.map||(q.map={}),mixin(q[t],e,!0,!0)):mixin(q[t],e,!0):q[t]=e}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=x.makeShimExports(e)),n[t]=e}),q.shim=n),e.packages&&(each(e.packages,function(e){var n;e="string"==typeof e?{name:e}:e,n=e.location,t[e.name]={name:e.name,location:n||e.name,main:(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),q.pkgs=t),eachProp(S,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t))}),(e.deps||e.callback)&&x.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,i){function o(n,r,u){var l,f,d;return i.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof n?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(w,n)?w[n](S[t.id]):req.get?req.get(x,n,t,o):(f=a(n,t,!1,!0),l=f.id,hasProp(O,l)?O[l]:c(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),x.nextTick(function(){v(),d=s(a(null,t)),d.skipMap=i.skipMap,d.init(n,r,u,{enabled:!0}),h()}),o)}return i=i||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,i=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return-1!==i&&(!a||i>1)&&(r=e.substring(i,e.length),e=e.substring(0,i)),x.nameToUrl(n(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(O,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(O,e)||hasProp(S,e)}}),t||(o.undef=function(e){l();var n=a(e,t,!0),i=getOwn(S,e);r(e),delete O[e],delete C[n.url],delete T[e],i&&(i.events.defined&&(T[e]=i.events),f(e))}),o},enable:function(e){var t=getOwn(S,e.id);t&&s(e).enable()},completeLoad:function(e){var t,n,r,o=getOwn(q.shim,e)||{},a=o.exports;for(l();N.length;){if(n=N.shift(),null===n[0]){if(n[0]=e,t)break;t=!0}else n[0]===e&&(t=!0);p(n)}if(r=getOwn(S,e),!t&&!hasProp(O,e)&&r&&!r.inited){if(!(!q.enforceDefine||a&&getGlobal(a)))return i(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));p([e,o.deps||[],o.exportsFn])}h()},nameToUrl:function(e,t,n){var r,i,o,a,s,u,c,l,f;if(req.jsExtRegExp.test(e))l=e+(t||"");else{for(r=q.paths,i=q.pkgs,s=e.split("/"),u=s.length;u>0;u-=1){if(c=s.slice(0,u).join("/"),o=getOwn(i,c),f=getOwn(r,c)){isArray(f)&&(f=f[0]),s.splice(0,u,f);break}if(o){a=e===o.name?o.location+"/"+o.main:o.location,s.splice(0,u,a);break}}l=s.join("/"),l+=t||(/^data\:|\?/.test(l)||n?"":".js"),l=("/"===l.charAt(0)||l.match(/^[\w\+\.\-]+:/)?"":q.baseUrl)+l}return q.urlArgs?l+((-1===l.indexOf("?")?"?":"&")+q.urlArgs):l},load:function(e,t){req.load(x,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=m(e);x.completeLoad(t.id)}},onScriptError:function(e){var t=m(e);return i(t.id)?void 0:c(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}},x.require=x.makeRequire(),x}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){return"interactive"===e.readyState?interactiveScript=e:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.9",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,n,r){var i,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=n,n=r):e=[]),o&&o.context&&(a=o.context),i=getOwn(contexts,a),i||(i=contexts[a]=req.s.newContext(a)),o&&i.configure(o),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e){var t=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return t.type=e.scriptType||"text/javascript",t.charset="utf-8",t.async=!0,t},req.load=function(e,t,n){var r,i=e&&e.config||{};if(isBrowser)return r=req.createNode(i,t,n),r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=n,currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{importScripts(n),e.completeLoad(t)}catch(o){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+n,o,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){return head||(head=e.parentNode),dataMain=e.getAttribute("data-main"),dataMain?(mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0):void 0}),define=function(e,t,n){var r,i;"string"!=typeof e&&(n=t,t=e,e=null),isArray(t)||(n=t,t=null),!t&&isFunction(n)&&(t=[],n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(1===n.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this),define("requirejs",function(){}),function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define("lib/bonzo/bonzo",n):t[e]=n()}("bonzo",this,function(){function e(e){return e&&e.nodeName&&(1==e.nodeType||11==e.nodeType)}function t(t,n,r){var i,o,a;if("string"==typeof t)return w.create(t);if(e(t)&&(t=[t]),r){for(a=[],i=0,o=t.length;o>i;i++)a[i]=v(n,t[i]);return a}return t}function n(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function r(e,t,n,r){for(var i,o=0,a=e.length;a>o;o++)i=r?e.length-o-1:o,t.call(n||e[i],e[i],i,e);return e}function i(t,n,r){for(var o=0,a=t.length;a>o;o++)e(t[o])&&(i(t[o].childNodes,n,r),n.call(r||t[o],t[o],o,t));return t}function o(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function a(e){return e?e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():e}function s(e){e[U]("data-node-uid")||e[H]("data-node-uid",++_);var t=e[U]("data-node-uid");return I[t]||(I[t]={})}function u(e){var t=e[U]("data-node-uid");t&&delete I[t]}function c(e){var t;try{return null===e||void 0===e?void 0:"true"===e?!0:"false"===e?!1:"null"===e?null:(t=parseFloat(e))==e?t:e}catch(n){}return void 0}function l(e,t,n){for(var r=0,i=e.length;i>r;++r)if(t.call(n||null,e[r],r,e))return!0;return!1}function f(e){return"transform"==e&&(e=X.transform)||/^transform-?[Oo]rigin$/.test(e)&&(e=X.transform+"Origin")||"float"==e&&(e=X.cssFloat),e?o(e):null}function d(e,n,i,o){var a=0,s=n||this,u=[],c=Z&&"string"==typeof e&&"<"!=e.charAt(0)?Z(e):e;return r(t(c),function(e,t){r(s,function(n){i(e,u[a++]=t>0?v(s,n):n)},null,o)},this,o),s.length=a,r(u,function(e){s[--a]=e},null,!o),s}function h(e,t,n){var r=w(e),i=r.css("position"),o=r.offset(),a="relative",s=i==a,u=[parseInt(r.css("left"),10),parseInt(r.css("top"),10)];"static"==i&&(r.css("position",a),i=a),isNaN(u[0])&&(u[0]=s?0:e.offsetLeft),isNaN(u[1])&&(u[1]=s?0:e.offsetTop),null!=t&&(e.style.left=t-o.left+u[0]+F),null!=n&&(e.style.top=n-o.top+u[1]+F)}function p(e,t){return"function"==typeof t?t(e):t}function g(e,t,n){var r=this[0];return r?null==e&&null==t?(y(r)?b():{x:r.scrollLeft,y:r.scrollTop})[n]:(y(r)?k.scrollTo(e,t):(null!=e&&(r.scrollLeft=e),null!=t&&(r.scrollTop=t)),this):this}function m(e){if(this.length=0,e){e="string"==typeof e||e.nodeType||"undefined"==typeof e.length?[e]:e,this.length=e.length;for(var t=0;t/,D=["","
",1],P=["","
",3],L=["",1],$=["_","",0,1],B={thead:D,tbody:D,tfoot:D,colgroup:D,caption:D,tr:["","
",2],th:P,td:P,col:["","
",2],fieldset:["
","
",1],legend:["
","
",2],option:L,optgroup:L,script:$,style:$,link:$,param:$,base:$},j=/^(checked|selected|disabled)$/,R=/msie/i.test(navigator.userAgent),I={},_=0,W=/^-?[\d\.]+$/,z=/^data-(.+)$/,F="px",H="setAttribute",U="getAttribute",Y="getElementsByTagName",X=function(){var e=T.createElement("p");return e.innerHTML='x
',{hrefExtended:"#x"!=e[Y]("a")[0][U]("href"),autoTbody:0!==e[Y]("tbody").length,computedStyle:T.defaultView&&T.defaultView.getComputedStyle,cssFloat:e[Y]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var t,n=["transform","webkitTransform","MozTransform","OTransform","msTransform"];for(t=0;tn;n++)r[n]=v(e||this,this[n]);return w(r)},addClass:function(e){return e=K.call(e).split(G),this.each(function(t){r(e,function(e){e&&!E(t,p(t,e))&&q(t,p(t,e))})})},removeClass:function(e){return e=K.call(e).split(G),this.each(function(t){r(e,function(e){e&&E(t,p(t,e))&&S(t,p(t,e))})})},hasClass:function(e){return e=K.call(e).split(G),l(this,function(t){return l(e,function(e){return e&&E(t,e)})})},toggleClass:function(e,t){return e=K.call(e).split(G),this.each(function(n){r(e,function(e){e&&("undefined"!=typeof t?t?!E(n,e)&&q(n,e):S(n,e):E(n,e)?S(n,e):q(n,e))})})},show:function(e){return e="string"==typeof e?e:"",this.each(function(t){t.style.display=e})},hide:function(){return this.each(function(e){e.style.display="none"})},toggle:function(e,t){return t="string"==typeof t?t:"","function"!=typeof e&&(e=null),this.each(function(n){n.style.display=n.offsetWidth||n.offsetHeight?"none":t,e&&e.call(n)})},first:function(){return w(this.length?this[0]:[])},last:function(){return w(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(O)},related:function(e){return w(this.map(function(t){for(t=t[e];t&&1!==t.nodeType;)t=t[e];return t||0},function(e){return e}))},focus:function(){return this.length&&this[0].focus(),this},blur:function(){return this.length&&this[0].blur(),this},css:function(e,t){function n(e,t,n){for(var r in i)if(i.hasOwnProperty(r)){n=i[r],(t=f(r))&&W.test(n)&&!(t in V)&&(n+=F);try{e.style[t]=p(e,n)}catch(o){}}}var r,i=e;return void 0===t&&"string"==typeof e?(t=this[0],t?t===T||t===k?(r=t===T?w.doc():w.viewport(),"width"==e?r.width:"height"==e?r.height:""):(e=f(e))?et(t,e):null:null):("string"==typeof e&&(i={},i[e]=t),!X.opasity&&"opacity"in i&&(i.filter=null!=i.opacity&&""!==i.opacity?"alpha(opacity="+100*i.opacity+")":"",i.zoom=e.zoom||1,delete i.opacity),this.each(n))},offset:function(e,t){if(e&&"object"==typeof e&&("number"==typeof e.top||"number"==typeof e.left))return this.each(function(t){h(t,e.left,e.top)});if("number"==typeof e||"number"==typeof t)return this.each(function(n){h(n,e,t)});if(!this[0])return{top:0,left:0,height:0,width:0};var n=this[0],r=n.ownerDocument.documentElement,i=n.getBoundingClientRect(),o=b(),a=n.offsetWidth,s=n.offsetHeight,u=i.top+o.y-Math.max(0,r&&r.clientTop,T.body.clientTop),c=i.left+o.x-Math.max(0,r&&r.clientLeft,T.body.clientLeft);return{top:u,left:c,height:s,width:a}},dim:function(){if(!this.length)return{height:0,width:0};var e=this[0],t=9==e.nodeType&&e.documentElement,n=t||!e.style||e.offsetWidth||e.offsetHeight?null:function(t){var n={position:e.style.position||"",visibility:e.style.visibility||"",display:e.style.display||""};return t.first().css({position:"absolute",visibility:"hidden",display:"block"}),n}(this),r=t?Math.max(e.body.scrollWidth,e.body.offsetWidth,t.scrollWidth,t.offsetWidth,t.clientWidth):e.offsetWidth,i=t?Math.max(e.body.scrollHeight,e.body.offsetHeight,t.scrollHeight,t.offsetHeight,t.clientHeight):e.offsetHeight;return n&&this.first().css(n),{height:i,width:r}},attr:function(e,t){var n,r=this[0];if("string"!=typeof e&&!(e instanceof String)){for(n in e)e.hasOwnProperty(n)&&this.attr(n,e[n]);return this}return"undefined"==typeof t?r?C.test(e)?j.test(e)&&"string"==typeof r[e]?!0:r[e]:"href"!=e&&"src"!=e||!X.hrefExtended?r[U](e):r[U](e,2):null:this.each(function(n){C.test(e)?n[e]=p(n,t):n[H](e,p(n,t))})},removeAttr:function(e){return this.each(function(t){j.test(e)?t[e]=!1:t.removeAttribute(e)})},val:function(e){return"string"==typeof e||"number"==typeof e?this.attr("value",e):this.length?this[0].value:null},data:function(e,t){var n,i,u=this[0];return"undefined"==typeof t?u?(n=s(u),"undefined"==typeof e?(r(u.attributes,function(e){(i=(""+e.name).match(z))&&(n[o(i[1])]=c(e.value))}),n):("undefined"==typeof n[e]&&(n[e]=c(this.attr("data-"+a(e)))),n[e])):null:this.each(function(n){s(n)[e]=t})},remove:function(){return this.deepEach(u),this.detach()},empty:function(){return this.each(function(e){for(i(e.childNodes,u);e.firstChild;)e.removeChild(e.firstChild)})},detach:function(){return this.each(function(e){e[O]&&e[O].removeChild(e)})},scrollTop:function(e){return g.call(this,null,e,"y")},scrollLeft:function(e){return g.call(this,e,null,"x")}},w.setQueryEngine=function(e){Z=e,delete w.setQueryEngine},w.aug=function(e,t){for(var n in e)e.hasOwnProperty(n)&&((t||m.prototype)[n]=e[n])},w.create=function(t){return"string"==typeof t&&""!==t?function(){if(A.test(t))return[x(t)];var e=t.match(/^\s*<([^\s>]+)/),n=T.createElement("div"),i=[],o=e?B[e[1].toLowerCase()]:null,a=o?o[2]+1:1,s=o&&o[3],u=O,c=X.autoTbody&&o&&""==o[0]&&!/r;r++)1===n[r].nodeType&&(t=n[i=r]);return t},w.viewport=function(){return{width:R?N.clientWidth:self.innerWidth,height:R?N.clientHeight:self.innerHeight}},w.isAncestor="compareDocumentPosition"in N?function(e,t){return 16==(16&e.compareDocumentPosition(t))}:"contains"in N?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t=t[O];)if(t===e)return!0;return!1},w}),function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define("lib/qwery/qwery",n):t[e]=n()}("qwery",this,function(){function e(){this.c={}}function t(e){return Q.g(e)||Q.s(e,"(^|\\s+)"+e+"(\\s+|$)",1)}function n(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n])}function r(e){for(var t=[],n=0,r=e.length;r>n;++n)g(e[n])?t=t.concat(e[n]):t[t.length]=e[n];return t}function i(e){for(var t=0,n=e.length,r=[];n>t;t++)r[t]=e[t];return r}function o(e){for(;(e=e.previousSibling)&&1!=e[O];);return e}function a(e){return e.match(Y)}function s(e,n,r,i,o,a,s,u,l,f,d){var h,p,g,m,v;if(1!==this[O])return!1;if(n&&"*"!==n&&this[N]&&this[N].toLowerCase()!==n)return!1;if(r&&(p=r.match(C))&&p[1]!==this.id)return!1;if(r&&(v=r.match(M)))for(h=v.length;h--;)if(!t(v[h].slice(1)).test(this.className))return!1;if(l&&y.pseudos[l]&&!y.pseudos[l](this,d))return!1;if(i&&!s){m=this.attributes;for(g in m)if(Object.prototype.hasOwnProperty.call(m,g)&&(m[g].name||g)==o)return this}return i&&!c(a,J(this,o)||"",s)?!1:this}function u(e){return G.g(e)||G.s(e,e.replace(I,"\\$1"))}function c(e,t,n){switch(e){case"=":return t==n;case"^=":return t.match(K.g("^="+n)||K.s("^="+n,"^"+u(n),1));case"$=":return t.match(K.g("$="+n)||K.s("$="+n,u(n)+"$",1));case"*=":return t.match(K.g(n)||K.s(n,u(n),1));case"~=":return t.match(K.g("~="+n)||K.s("~="+n,"(?:^|\\s+)"+u(n)+"(?:\\s+|$)",1));case"|=":return t.match(K.g("|="+n)||K.s("|="+n,"^"+u(n)+"(-|$)",1))}return 0}function l(e,t){var r,i,o,u,c,l,f,h=[],p=[],g=t,m=V.g(e)||V.s(e,e.split(U)),y=e.match(H);if(!m.length)return h;if(u=(m=m.slice(0)).pop(),m.length&&(o=m[m.length-1].match(A))&&(g=v(t,o[1])),!g)return h;for(l=a(u),c=g!==t&&9!==g[O]&&y&&/^[+~]$/.test(y[y.length-1])?function(e){for(;g=g.nextSibling;)1==g[O]&&(l[1]?l[1]==g[N].toLowerCase():1)&&(e[e.length]=g);return e}([]):g[S](l[1]||"*"),r=0,i=c.length;i>r;r++)(f=s.apply(c[r],l))&&(h[h.length]=f);return m.length?(n(h,function(e){d(e,m,y)&&(p[p.length]=e)}),p):h}function f(e,t,n){if(h(t))return e==t;if(g(t))return!!~r(t).indexOf(e);for(var i,o,u=t.split(",");t=u.pop();)if(i=V.g(t)||V.s(t,t.split(U)),o=t.match(H),i=i.slice(0),s.apply(e,a(i.pop()))&&(!i.length||d(e,i,o,n)))return!0;return!1}function d(e,t,n,r){function i(e,r,u){for(;u=X[n[r]](u,e);)if(h(u)&&s.apply(u,a(t[r]))){if(!r)return u;if(o=i(u,r-1,u))return o}}var o;return(o=i(e,t.length-1,e))&&(!r||Z(o,r))}function h(e,t){return e&&"object"==typeof e&&(t=e[O])&&(1==t||9==t)}function p(e){var t,n,r=[];e:for(t=0;t~+]/,B=/^\s+|\s*([,\s\+\~>]|$)\s*/g,j=/[\s\>\+\~]/,R=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,I=/([.*+?\^=!:${}()|\[\]\/\\])/g,_=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,W=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,z=/:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/,F=new RegExp(A.source+"|"+P.source+"|"+D.source),H=new RegExp("("+j.source+")"+R.source,"g"),U=new RegExp(j.source+R.source),Y=new RegExp(_.source+"("+W.source+")?"+"("+z.source+")?"),X={" ":function(e){return e&&e!==E&&e.parentNode},">":function(e,t){return e&&e.parentNode==t.parentNode&&e.parentNode},"~":function(e){return e&&e.previousSibling},"+":function(e,t,n,r){return e?(n=o(e))&&(r=o(t))&&n==r&&n:!1}};e.prototype={g:function(e){return this.c[e]||void 0},s:function(e,t,n){return t=n?new RegExp(t):t,this.c[e]=t}};var Q=new e,G=new e,K=new e,V=new e,Z="compareDocumentPosition"in E?function(e,t){return 16==(16&t.compareDocumentPosition(e))}:"contains"in E?function(e,t){return t=9===t[O]||t==window?E:t,t!==e&&t.contains(e)}:function(e,t){for(;e=e.parentNode;)if(e===t)return 1;return 0},J=function(){var e=w.createElement("p");return(e.innerHTML='x')&&"#x"!=e.firstChild.getAttribute("href")?function(e,t){return"class"===t?e.className:"href"===t||"src"===t?e.getAttribute(t,2):e.getAttribute(t)}:function(e,t){return e.getAttribute(t)}}(),et=!!w[q],tt=w.querySelector&&w[k],nt=function(e,t){var r,o,a=[];try{return 9!==t[O]&&$.test(e)?(n(r=e.split(","),b(t,function(e,t){o=e[k](t),1==o.length?a[a.length]=o.item(0):o.length&&(a=a.concat(i(o)))})),r.length>1&&a.length>1?p(a):a):i(t[k](e))}catch(s){}return rt(e,t)},rt=function(e,r){var i,o,a,s,u,c,f=[];if(e=e.replace(B,"$1"),o=e.match(L)){for(u=t(o[2]),i=r[S](o[1]||"*"),a=0,s=i.length;s>a;a++)u.test(i[a].className)&&(f[f.length]=i[a]);return f}return n(c=e.split(","),b(r,function(e,t,n){for(u=l(t,e),a=0,s=u.length;s>a;a++)(9===e[O]||n||Z(u[a],r))&&(f[f.length]=u[a])})),c.length>1&&f.length>1?p(f):f},it=function(e){"undefined"!=typeof e[T]&&(x=e[T]?tt?nt:rt:rt)};return it({useNativeQSA:!0}),y.configure=it,y.uniq=p,y.is=f,y.pseudos={},y}),function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define("lib/bean/bean",n):t[e]=n()}("bean",this,function(e,t){e=e||"bean",t=t||this;var n,r=window,i=t[e],o=/[^\.]*(?=\..*)\.|.*/,a=/\..*/,s="addEventListener",u="removeEventListener",c=document||{},l=c.documentElement||{},f=l[s],d=f?s:"attachEvent",h={},p=Array.prototype.slice,g=function(e,t){return e.split(t||" ")},m=function(e){return"string"==typeof e},v=function(e){return"function"==typeof e},y="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",b="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinputreadystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",x=function(e,t,n){for(n=0;ni;i++)if(d[i].reg.test(c)){h[c]=u=d[i].fix;break}for(s=u(e,this,c),i=s.length;i--;)!((a=s[i])in this)&&a in e&&(this[a]=e[a])}}};return p.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},p.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},p.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},p.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},p.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},p.prototype.clone=function(e){var t=new p(this,this.element,this.isNative);return t.currentTarget=e,t},p}(),q=function(e,t){return f||t||e!==c&&e!==r?e:l},S=function(){var e=function(e,t,n,r){var i=function(n,i){return t.apply(e,r?p.call(i,n?0:1).concat(r):i)},o=function(n,r){return t.__beanDel?t.__beanDel.ft(n.target,e):r},a=n?function(e){var t=o(e,this);return n.apply(t,arguments)?(e&&(e.currentTarget=t),i(e,arguments)):void 0}:function(e){return t.__beanDel&&(e=e.clone(o(e))),i(e,arguments)};return a.__beanDel=t.__beanDel,a},t=function(t,n,r,i,o,a,s){var u,c=w[n];"unload"==n&&(r=C(M,t,n,r,i)),c&&(c.condition&&(r=e(t,r,c.condition,a)),n=c.base||n),this.isNative=u=x[n]&&!!t[d],this.customType=!f&&!u&&n,this.element=t,this.type=n,this.original=i,this.namespaces=o,this.eventType=f||u?n:"propertychange",this.target=q(t,u),this[d]=!!this.target[d],this.root=s,this.handler=e(t,r,null,a)};return t.prototype.inNamespaces=function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},t.prototype.matches=function(e,t,n){return!(this.element!==e||t&&this.original!==t||n&&this.handler!==n)},t}(),k=function(){var e={},t=function(n,r,i,o,a,s){var u=a?"r":"$";if(r&&"*"!=r){var c,l=0,f=e[u+r],d="*"==n;if(!f)return;for(c=f.length;c>l;l++)if((d||f[l].matches(n,i,o))&&!s(f[l],f,l,r))return}else for(var h in e)h.charAt(0)==u&&t(n,h.substr(1),i,o,a,s)},n=function(t,n,r,i){var o,a=e[(i?"r":"$")+n];if(a)for(o=a.length;o--;)if(!a[o].root&&a[o].matches(t,r,null))return!0;return!1},r=function(e,n,r,i){var o=[];return t(e,n,r,null,i,function(e){return o.push(e)}),o},i=function(t){var n=!t.root&&!this.has(t.element,t.type,null,!1),r=(t.root?"r":"$")+t.type;return(e[r]||(e[r]=[])).push(t),n},o=function(n){t(n.element,n.type,null,n.handler,n.root,function(t,n,r){return n.splice(r,1),t.removed=!0,0===n.length&&delete e[(t.root?"r":"$")+t.type],!1})},a=function(){var t,n=[];for(t in e)"$"==t.charAt(0)&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:i,del:o,entries:a}}(),T=function(e){n=arguments.length?e:c.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}},N=function(e,t){if(f||!t||!e||e.propertyName=="_on"+t){var n=k.get(this,t||e.type,null,!1),r=n.length,i=0;for(e=new E(e,this,!0),t&&(e.type=t);r>i&&!e.isImmediatePropagationStopped();i++)n[i].removed||n[i].handler.call(this,e)}},O=f?function(e,t,n){e[n?s:u](t,N,!1)}:function(e,t,n,r){var i;n?(k.put(i=new S(e,r||t,function(t){N.call(e,t,r)},N,null,null,!0)),r&&null==e["_on"+r]&&(e["_on"+r]=0),i.target.attachEvent("on"+i.eventType,i.handler)):(i=k.get(e,r||t,N,!0)[0],i&&(i.target.detachEvent("on"+i.eventType,i.handler),k.del(i)))},C=function(e,t,n,r,i){return function(){r.apply(this,arguments),e(t,n,i)}},M=function(e,t,n,r){var i,o,s=t&&t.replace(a,""),u=k.get(e,s,null,!1),c={};for(i=0,o=u.length;o>i;i++)n&&u[i].original!==n||!u[i].inNamespaces(r)||(k.del(u[i]),!c[u[i].eventType]&&u[i][d]&&(c[u[i].eventType]={t:u[i].eventType,c:u[i].type}));for(i in c)k.has(e,c[i].t,null,!1)||O(e,c[i].t,!1,c[i].c)},A=function(e,t){var r=function(t,r){for(var i,o=m(e)?n(e,r):e;t&&t!==r;t=t.parentNode)for(i=o.length;i--;)if(o[i]===t)return t},i=function(e){var n=r(e.target,this);n&&t.apply(n,arguments)};return i.__beanDel={ft:r,selector:e},i},D=f?function(e,t,n){var i=c.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,r,1),n.dispatchEvent(i)}:function(e,t,n){n=q(n,e),e?n.fireEvent("on"+t,c.createEventObject()):n["_on"+t]++},P=function(e,t,n){var r,i,s,u,c=m(t);if(c&&t.indexOf(" ")>0){for(t=g(t),u=t.length;u--;)P(e,t[u],n);return e}if(i=c&&t.replace(a,""),i&&w[i]&&(i=w[i].base),!t||c)(s=c&&t.replace(o,""))&&(s=g(s,".")),M(e,i,n,s);else if(v(t))M(e,null,t);else for(r in t)t.hasOwnProperty(r)&&P(e,r,t[r]);return e},L=function(e,t,r,i){var s,u,c,l,f,m,y;{if(void 0!==r||"object"!=typeof t){for(v(r)?(f=p.call(arguments,3),i=s=r):(s=i,f=p.call(arguments,4),i=A(r,s,n)),c=g(t),this===h&&(i=C(P,e,t,i,s)),l=c.length;l--;)y=k.put(m=new S(e,c[l].replace(a,""),i,s,g(c[l].replace(o,""),"."),f,!1)),m[d]&&y&&O(e,m.eventType,!0,m.customType);return e}for(u in t)t.hasOwnProperty(u)&&L.call(this,e,u,t[u])}},$=function(e,t,n,r){return L.apply(null,m(n)?[e,n,t,r].concat(arguments.length>3?p.call(arguments,5):[]):p.call(arguments))},B=function(){return L.apply(h,arguments)},j=function(e,t,n){var r,i,s,u,c,l=g(t);for(r=l.length;r--;)if(t=l[r].replace(a,""),(u=l[r].replace(o,""))&&(u=g(u,".")),u||n||!e[d])for(c=k.get(e,t,null,!1),n=[!1].concat(n),i=0,s=c.length;s>i;i++)c[i].inNamespaces(u)&&c[i].handler.apply(e,n);else D(x[t],t,e);return e},R=function(e,t,n){for(var r,i,o=k.get(t,n,null,!1),a=o.length,s=0;a>s;s++)o[s].original&&(r=[e,o[s].type],(i=o[s].handler.__beanDel)&&r.push(i.selector),r.push(o[s].original),L.apply(null,r));return e},I={on:L,add:$,one:B,off:P,remove:P,clone:R,fire:j,Event:E,setSelectorEngine:T,noConflict:function(){return t[e]=i,this}};if(r.attachEvent){var _=function(){var e,t=k.entries();for(e in t)t[e].type&&"unload"!==t[e].type&&P(t[e].element,t[e].type);r.detachEvent("onunload",_),r.CollectGarbage&&r.CollectGarbage()};r.attachEvent("onunload",_)}return T(),I}),define("domReady",[],function(){function e(e){var t;for(t=0;t~+]/,B=/^\s+|\s*([,\s\+\~>]|$)\s*/g,j=/[\s\>\+\~]/,R=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,I=/([.*+?\^=!:${}()|\[\]\/\\])/g,_=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,W=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,z=/:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/,F=new RegExp(A.source+"|"+P.source+"|"+D.source),H=new RegExp("("+j.source+")"+R.source,"g"),U=new RegExp(j.source+R.source),Y=new RegExp(_.source+"("+W.source+")?"+"("+z.source+")?"),X={" ":function(e){return e&&e!==E&&e.parentNode},">":function(e,t){return e&&e.parentNode==t.parentNode&&e.parentNode},"~":function(e){return e&&e.previousSibling},"+":function(e,t,n,r){return e?(n=o(e))&&(r=o(t))&&n==r&&n:!1}};e.prototype={g:function(e){return this.c[e]||void 0},s:function(e,t,n){return t=n?new RegExp(t):t,this.c[e]=t}};var Q=new e,G=new e,K=new e,V=new e,Z="compareDocumentPosition"in E?function(e,t){return 16==(16&t.compareDocumentPosition(e))}:"contains"in E?function(e,t){return t=9===t[O]||t==window?E:t,t!==e&&t.contains(e)}:function(e,t){for(;e=e.parentNode;)if(e===t)return 1;return 0},J=function(){var e=w.createElement("p");return(e.innerHTML='x')&&"#x"!=e.firstChild.getAttribute("href")?function(e,t){return"class"===t?e.className:"href"===t||"src"===t?e.getAttribute(t,2):e.getAttribute(t)}:function(e,t){return e.getAttribute(t)}}(),et=!!w[q],tt=w.querySelector&&w[k],nt=function(e,t){var r,o,a=[];try{return 9!==t[O]&&$.test(e)?(n(r=e.split(","),b(t,function(e,t){o=e[k](t),1==o.length?a[a.length]=o.item(0):o.length&&(a=a.concat(i(o)))})),r.length>1&&a.length>1?p(a):a):i(t[k](e))}catch(s){}return rt(e,t)},rt=function(e,r){var i,o,a,s,u,c,f=[];if(e=e.replace(B,"$1"),o=e.match(L)){for(u=t(o[2]),i=r[S](o[1]||"*"),a=0,s=i.length;s>a;a++)u.test(i[a].className)&&(f[f.length]=i[a]);return f}return n(c=e.split(","),b(r,function(e,t,n){for(u=l(t,e),a=0,s=u.length;s>a;a++)(9===e[O]||n||Z(u[a],r))&&(f[f.length]=u[a])})),c.length>1&&f.length>1?p(f):f},it=function(e){"undefined"!=typeof e[T]&&(x=e[T]?tt?nt:rt:rt)};return it({useNativeQSA:!0}),y.configure=it,y.uniq=p,y.is=f,y.pseudos={},y}),function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define("lib/bean/bean",n):t[e]=n()}("bean",this,function(e,t){e=e||"bean",t=t||this;var n,r=window,i=t[e],o=/[^\.]*(?=\..*)\.|.*/,a=/\..*/,s="addEventListener",u="removeEventListener",c=document||{},l=c.documentElement||{},f=l[s],d=f?s:"attachEvent",h={},p=Array.prototype.slice,g=function(e,t){return e.split(t||" ")},m=function(e){return"string"==typeof e},v=function(e){return"function"==typeof e},y="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",b="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinputreadystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",x=function(e,t,n){for(n=0;ni;i++)if(d[i].reg.test(c)){h[c]=u=d[i].fix;break}for(s=u(e,this,c),i=s.length;i--;)!((a=s[i])in this)&&a in e&&(this[a]=e[a])}}};return p.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},p.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},p.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},p.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},p.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},p.prototype.clone=function(e){var t=new p(this,this.element,this.isNative);return t.currentTarget=e,t},p}(),q=function(e,t){return f||t||e!==c&&e!==r?e:l},S=function(){var e=function(e,t,n,r){var i=function(n,i){return t.apply(e,r?p.call(i,n?0:1).concat(r):i)},o=function(n,r){return t.__beanDel?t.__beanDel.ft(n.target,e):r},a=n?function(e){var t=o(e,this);return n.apply(t,arguments)?(e&&(e.currentTarget=t),i(e,arguments)):void 0}:function(e){return t.__beanDel&&(e=e.clone(o(e))),i(e,arguments)};return a.__beanDel=t.__beanDel,a},t=function(t,n,r,i,o,a,s){var u,c=w[n];"unload"==n&&(r=C(M,t,n,r,i)),c&&(c.condition&&(r=e(t,r,c.condition,a)),n=c.base||n),this.isNative=u=x[n]&&!!t[d],this.customType=!f&&!u&&n,this.element=t,this.type=n,this.original=i,this.namespaces=o,this.eventType=f||u?n:"propertychange",this.target=q(t,u),this[d]=!!this.target[d],this.root=s,this.handler=e(t,r,null,a)};return t.prototype.inNamespaces=function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},t.prototype.matches=function(e,t,n){return!(this.element!==e||t&&this.original!==t||n&&this.handler!==n)},t}(),k=function(){var e={},t=function(n,r,i,o,a,s){var u=a?"r":"$";if(r&&"*"!=r){var c,l=0,f=e[u+r],d="*"==n;if(!f)return;for(c=f.length;c>l;l++)if((d||f[l].matches(n,i,o))&&!s(f[l],f,l,r))return}else for(var h in e)h.charAt(0)==u&&t(n,h.substr(1),i,o,a,s)},n=function(t,n,r,i){var o,a=e[(i?"r":"$")+n];if(a)for(o=a.length;o--;)if(!a[o].root&&a[o].matches(t,r,null))return!0;return!1},r=function(e,n,r,i){var o=[];return t(e,n,r,null,i,function(e){return o.push(e)}),o},i=function(t){var n=!t.root&&!this.has(t.element,t.type,null,!1),r=(t.root?"r":"$")+t.type;return(e[r]||(e[r]=[])).push(t),n},o=function(n){t(n.element,n.type,null,n.handler,n.root,function(t,n,r){return n.splice(r,1),t.removed=!0,0===n.length&&delete e[(t.root?"r":"$")+t.type],!1})},a=function(){var t,n=[];for(t in e)"$"==t.charAt(0)&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:i,del:o,entries:a}}(),T=function(e){n=arguments.length?e:c.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}},N=function(e,t){if(f||!t||!e||e.propertyName=="_on"+t){var n=k.get(this,t||e.type,null,!1),r=n.length,i=0;for(e=new E(e,this,!0),t&&(e.type=t);r>i&&!e.isImmediatePropagationStopped();i++)n[i].removed||n[i].handler.call(this,e)}},O=f?function(e,t,n){e[n?s:u](t,N,!1)}:function(e,t,n,r){var i;n?(k.put(i=new S(e,r||t,function(t){N.call(e,t,r)},N,null,null,!0)),r&&null==e["_on"+r]&&(e["_on"+r]=0),i.target.attachEvent("on"+i.eventType,i.handler)):(i=k.get(e,r||t,N,!0)[0],i&&(i.target.detachEvent("on"+i.eventType,i.handler),k.del(i)))},C=function(e,t,n,r,i){return function(){r.apply(this,arguments),e(t,n,i)}},M=function(e,t,n,r){var i,o,s=t&&t.replace(a,""),u=k.get(e,s,null,!1),c={};for(i=0,o=u.length;o>i;i++)n&&u[i].original!==n||!u[i].inNamespaces(r)||(k.del(u[i]),!c[u[i].eventType]&&u[i][d]&&(c[u[i].eventType]={t:u[i].eventType,c:u[i].type}));for(i in c)k.has(e,c[i].t,null,!1)||O(e,c[i].t,!1,c[i].c)},A=function(e,t){var r=function(t,r){for(var i,o=m(e)?n(e,r):e;t&&t!==r;t=t.parentNode)for(i=o.length;i--;)if(o[i]===t)return t},i=function(e){var n=r(e.target,this);n&&t.apply(n,arguments)};return i.__beanDel={ft:r,selector:e},i},D=f?function(e,t,n){var i=c.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,r,1),n.dispatchEvent(i)}:function(e,t,n){n=q(n,e),e?n.fireEvent("on"+t,c.createEventObject()):n["_on"+t]++},P=function(e,t,n){var r,i,s,u,c=m(t);if(c&&t.indexOf(" ")>0){for(t=g(t),u=t.length;u--;)P(e,t[u],n);return e}if(i=c&&t.replace(a,""),i&&w[i]&&(i=w[i].base),!t||c)(s=c&&t.replace(o,""))&&(s=g(s,".")),M(e,i,n,s);else if(v(t))M(e,null,t);else for(r in t)t.hasOwnProperty(r)&&P(e,r,t[r]);return e},L=function(e,t,r,i){var s,u,c,l,f,m,y;{if(void 0!==r||"object"!=typeof t){for(v(r)?(f=p.call(arguments,3),i=s=r):(s=i,f=p.call(arguments,4),i=A(r,s,n)),c=g(t),this===h&&(i=C(P,e,t,i,s)),l=c.length;l--;)y=k.put(m=new S(e,c[l].replace(a,""),i,s,g(c[l].replace(o,""),"."),f,!1)),m[d]&&y&&O(e,m.eventType,!0,m.customType);return e}for(u in t)t.hasOwnProperty(u)&&L.call(this,e,u,t[u])}},$=function(e,t,n,r){return L.apply(null,m(n)?[e,n,t,r].concat(arguments.length>3?p.call(arguments,5):[]):p.call(arguments))},B=function(){return L.apply(h,arguments)},j=function(e,t,n){var r,i,s,u,c,l=g(t);for(r=l.length;r--;)if(t=l[r].replace(a,""),(u=l[r].replace(o,""))&&(u=g(u,".")),u||n||!e[d])for(c=k.get(e,t,null,!1),n=[!1].concat(n),i=0,s=c.length;s>i;i++)c[i].inNamespaces(u)&&c[i].handler.apply(e,n);else D(x[t],t,e);return e},R=function(e,t,n){for(var r,i,o=k.get(t,n,null,!1),a=o.length,s=0;a>s;s++)o[s].original&&(r=[e,o[s].type],(i=o[s].handler.__beanDel)&&r.push(i.selector),r.push(o[s].original),L.apply(null,r));return e},I={on:L,add:$,one:B,off:P,remove:P,clone:R,fire:j,Event:E,setSelectorEngine:T,noConflict:function(){return t[e]=i,this}};if(r.attachEvent){var _=function(){var e,t=k.entries();for(e in t)t[e].type&&"unload"!==t[e].type&&P(t[e].element,t[e].type);r.detachEvent("onunload",_),r.CollectGarbage&&r.CollectGarbage()};r.attachEvent("onunload",_)}return T(),I}),define("domReady",[],function(){function e(e){var t;for(t=0;t