-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpanzer.min.js
3 lines (3 loc) · 6.35 KB
/
panzer.min.js
1
2
3
/* Panzer v0.3.13 + genData v3.1.0 | github.com/bemson | (c) 2014, MIT */
;!function(a,b,c){function f(a){return"function"==typeof a}function g(a){return"function"!=typeof a}function h(a){function w(a,b){this.name=a,this.value=b}if(this instanceof h)return this;var e,i,l,m,o,p,q,r,s,t,b=[["",a]],j=d.call(arguments),k=j.slice(1),n=k.filter(f),u=[],v=n.length;if(!v)return[];for(w.prototype=("function"==typeof this?this:h).prototype,l={returns:u,args:k.filter(g),params:j,loop:0,queued:0};b.length;){for(i=b.shift(),q=new w(i[0],i[1]),r=t=0,p=[i[0],i[1],i[2],l],l.continues=0,l.breaks=0,l.source=i[1];!l.continues&&v>r;)l.allowUndefined=0,o=n[r++].apply(q,p),(o!==c||l.allowUndefined)&&(m=o,t=1);if(t&&u.push(m),l.breaks)break;if("object"==typeof l.source){e=[];for(s in l.source)l.source.hasOwnProperty(s)&&e.push([s,l.source[s],q]);b=e.concat(b)}l.loop++,l.queued=b.length-1}return l.hasOwnProperty("returns")?l.returns:u}var d=a.prototype.slice;a.isArray||function(b){return b instanceof a},h.spawn=function i(){function c(e){return this instanceof c?this:a.apply("function"==typeof this?this:c,[e].concat(b,d.call(arguments).slice(1)))}var a=this,b=d.call(arguments).filter(f);return c.prototype=new a,c.spawn=i,c},h.version="3.1.0",b.genData=h}(Array,this);
!function(a,b,c,d,e,f){function h(c){function n(a,b,c,d){function u(b,c){return b===a&&c<g.pkgs.length?g.pkgs[c].inst:j}var p,s,t,g=this,m={},n={},o={af:[],ar:[],nf:[],nr:[]};for(p=0;s=a.pkgs[p];p++)"function"==typeof s.def.attrKey?o.af.push(s.def.attrKey):s.def.attrKey instanceof e&&o.ar.push(s.def.attrKey),"function"==typeof s.def.badKey?o.nf.push(s.def.badKey):s.def.badKey instanceof e&&o.nr.push(s.def.badKey),"function"==typeof s.def.prepTree&&"undefined"!=typeof(t=s.def.prepTree.call(f,c))&&(c=t);for(g.nodes=k(c,a,o),g.nodes[0].parentIndex=g.nodes[0].childIndex=0,g.nodes.unshift(k()[0]),g.nodes[0].children.push(1),g.nodes[0].name="PNULL",g.nodes[0].index=g.nodes[0].depth=g.nodes[0].lte=0,g.nodes[0].path="..//",g.nodes[0].firstChildIndex=g.nodes[0].lastChildIndex=1,g.nodes[0].ctx=1,g.tank={id:h++,currentIndex:0,targetIndex:-1,go:function(a){var b=g.nodes[a];return b&&(g.target=b,g.tank.targetIndex=b.index),g.stop=0,g.go()},stop:function(){return g.stop=1,!!g.loop},post:function(a){var b=typeof a;if(g.loop){if("function"===b)return g.posts[++i]=a,i;if("number"===b&&g.posts.hasOwnProperty(a))return delete g.posts[a],!0}return!1}},g.posts={},g.current=g.nodes[0],g.target=g.loop=0,g.pkgs=a.pkgs.map(function(a){function e(){}var b=a.name,c=a.def,d={name:b,idx:a.idx,pkg:a,inst:new c};return e.prototype=a.proxy.prototype,m[b]=d.proxy=new e,n[b]=d.inst,d.proxy.pkgs=m,d.proxy.toString=u,d.inst.pkgs=n,d.inst.tank=g.tank,d.inst.nodes=l.call(a.node,g.nodes),d}),p=0;s=g.pkgs[p];p++)s.inst.proxy=b;for(b.pkgs=m,b.toString=u,g.fire=q,p=0;s=g.pkgs[p];p++)"function"==typeof s.pkg.def.init&&s.pkg.def.init.call(s.inst,d);delete g.fire}function o(a,b){var d,c=this.pkgs[a-1];return c&&b&&"string"==typeof b&&(d=new c.proxy,"function"==typeof d[b])?d[b]:q}function p(a){function d(a){return a?a instanceof b.pkgs[c].proxy&&a.toString(b,c):void 0}function e(){}function f(){}var c,b=this;return arguments.length?"string"==typeof a&&m.test(a)?(b.pkgsIdx.hasOwnProperty(a)||(d.getSuper=function(a){return o.call(b,c,a)},d.init=d.attrKey=d.badKey=d.onBegin=d.onEnd=d.onNode=d.onEngage=d.onRelease=d.onScope=d.onTraverse=d.onTraversing=d.onTraversed=d.prepTree=d.prepNode=0,d.label=a,e.prototype=new b.KlassProxy,b.Klass.prototype=d.proxy=e.prototype,b.KlassProxy=e,d.node=f.prototype,c=d.index=b.pkgsIdx[a]=b.pkgs.push({name:a,idx:b.pkgs.length,def:d,proxy:e,node:f})-1),b.pkgs[b.pkgsIdx[a]].def):!1:b.pkgs.map(function(a){return a.name})}function q(){}var d={create:function(){function b(c,d){if(!(this instanceof b))throw new Error("Missing new operator.");new n(a,this,c,"object"==typeof d?d:{})}var a={pkgs:[],pkgsIdx:{},KlassProxy:function(){},Klass:b};return b.prototype=a.KlassProxy.prototype,b.pkg=function(){return p.apply(a,arguments)},b},version:"0.3.10"},g=b||a?c("genData"):f.genData,h=0,i=0,j={}.toString(),k=g.spawn(function(a,b,c,d){function o(c){return c.call(f,a,b)}function p(b){return b.test(a)}var l,m,e=this,g=d.args[0],h=d.args[1],i=d.returns,j=h&&a&&(h.nf.some(o)||h.nr.some(p)),k=h&&a&&(h.af.some(o)||h.ar.some(p)),n=0;if(j||k)d.source=0,k&&(c.attrs[a]=b);else if(e.parentIndex=e.previousIndex=e.nextIndex=e.firstChildIndex=e.lastChildIndex=e.childIndex=e.ctx=e.lte=-1,e.index=i.push(e),e.depth=c?c.depth+1:1,e.name=a||"PROOT",e.attrs={},e.path=c?c.path+a+"/":"//",e.children=[],c?(e.parentIndex=c.index,c.children.length||(c.firstChildIndex=e.index),e.childIndex=c.children.push(e.index)-1,c.lastChildIndex=e.index,e.childIndex&&(e.previousIndex=c.children[e.childIndex-1],i[e.previousIndex-1].nextIndex=e.index)):d.tree=b,g&&g.pkgs.length)for(;m=g.pkgs[n];n++)"function"==typeof m.def.prepNode&&"undefined"!=typeof(l=m.def.prepNode.call(f,d.source,d.tree))&&(d.source=l)}),l=g.spawn(function(a,b,c,d){var f,e=this;if(c){d.source=0;for(f in b)b.hasOwnProperty(f)&&"lte"!==f&&"ctx"!==f&&(e[f]=b[f]);return e}}),m=/\w/;return n.prototype={go:function(){var d,e,g,n,o,a=this,b=a.nodes,c=a.tank,h=0,i=a.stopped,j=a.current,k=i?j.lte:-1,l=-1,m=i?a.target.index:null;if(a.loop)return!!a.target;for(a.posts={},a.loop=1,a.fire("begin");a.loop;)!i&&!a.target||a.stop?n?(n=0,a.fire("release")):o?a.loop=0:(o=1,a.fire("end")):(o=0,m==a.target.index&&~k|~l?~l?n?(n=0,a.fire("release")):(c.currentIndex=l,a.fire("node",l,j.index),j.lte=0,j=a.current=b[l],l=-1):n?g||i||1!=k&&2!=k?(i?a.fire("traversing",k):(j.lte=k,k||(a.target=0,c.targetIndex=-1),a.fire("traverse",k)),h++,a.stop||(a.fire("traversed",k),a.stopped=0),a.stopped=a.stop,i=0,2==k?g=j.ctx=0:k=-1):(2==k?k=-1:g=j.ctx=1,a.fire("scope",j.ctx)):(n=1,a.fire("engage")):(g=1===j.ctx,k=l=-1,m=a.target.index,e=m-j.index,e?e>0&&j.index<2||!a.target.path.indexOf(j.path)?g?l=j.firstChildIndex:k=1:g?k=2:(a.target.path.indexOf(b[j.parentIndex].path)&&(e=-1),e>0?3==j.lte||2==j.lte?l=j.nextIndex:k=3:4==j.lte||2==j.lte?l=~j.previousIndex?j.previousIndex:j.parentIndex:k=4):k=g?0:1));for(d in a.posts)a.posts.hasOwnProperty(d)&&a.posts[d].call(f);return h},fire:function(a){for(var e,f,b="on"+a.charAt(0).toUpperCase()+a.substr(1),c=arguments,d=0;e=this.pkgs[d];d++)f=e.pkg.def[b],"function"==typeof f&&f.apply(e.inst,c)}},d}a?define(h):b?module.exports=h(require):f.Panzer||(f.Panzer=h())}("function"==typeof define,"undefined"!=typeof exports,Array,Object,RegExp,this);