-
Notifications
You must be signed in to change notification settings - Fork 2
/
refine.min.js
19 lines (19 loc) · 6.97 KB
/
refine.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* RefineJS v1.2.3 - Powerful and flexible generator objects with the possibility of inheritance for JavaScript
* Copyright 2011-2014 Dmitrii Pakhtinov ([email protected])
* Released under the MIT license
* Update: 11/23/2014
*/
(function(R){"function"===typeof define&&define.amd?define("object"!==typeof document||"loading"!==document.readyState?[]:"refinejs",R):"object"===typeof exports&&"undefined"!==typeof module?module.exports=R():R()})(function(){function U(a,b){return function(){throw Error("'"+a+"' property is "+(b?"read":"write")+"-only");}}function Y(a){return function(){return a}}function l(a,b,i,h,K){function f(){function d(){var n;!e&&!N&&"function"===typeof o.i&&(n=o.i.apply(m?g:c,b));return n===C?g:n}var c=this,b=arguments,e=c instanceof V,m=e?b[4]:c instanceof f,p=!e||b[2]===C||D!==C?D:b[2];if(!p&&!e&&!m&&b.length&&"__refine__"in b[0])return S.call(f,b[0]);var k=O,q=r,l=K.apply({isParent:e,isInstance:m,options:h},e?
b[0]:b),v=e&&b[3]||r,g=N||v||l,o=e?b[1]:{a:l};for(E(I,function(n,J){y.call(l,n)||(l[n]=J)});k--;)if("function"!==typeof i[k]&&("string"===typeof i[k]?i[k]=Z(i[k],a):(i[k]=Y(i[k]),p=p===C?T:p)),z.prototype=q=i[k].call(new V,b,o,p,v,m),0<k&&(o.i=r),g=v=new z,!p)g.parent=q,$&&(g.__proto__=q);if(O||e||N){var w=function(n){return p?n:"function"===typeof n?function(){var J=o.a,a=J.parent;!p&&(J.parent=q);var b=n.apply(this===g||this==j?J:this,arguments);!p&&(J.parent=a);return b}:n};E(l,function(n,a){if(a&&
"object"===typeof a&&("set"in a&&(a.set=w(a.set)),"get"in a))a.get=w(a.get);g[n]=w(a)});o.a=e?o.a:g}p||(g.__refine__=f);y.call(g,t)?o.i=g[t]:y.call(g,"constructor")&&(o.i=g.constructor);if(!e&&0!==A){if(!F||G)E(G?g:A,function(a){var b=g[a],d=a,c=0;if(c=G?b&&"object"===typeof b&&"parent"!==a&&"__proto__"!==a?(y.call(b,"set")?1:0)+(y.call(b,"get")?2:0):0===a.indexOf("get ")?4:0===a.indexOf("set ")?8:F&&"toString"===a?16:0:A[a])if(G&&16!==(A[a]=c)&&x++,c&3?(z.prototype=b,b=new z):(d=a.split(" ").pop(),
8!==c&&"function"!==typeof b&&(b=function(a){return function(){return a}}(b))),F)c&22&&s.push("Public "+(c&16?"Default ":"")+"Property Get ["+d+"]","Call VBCorrectVal("+(b?"[(accessors)].["+a+"]"+(c&2?".get":"")+".call(me,[(accessors)].["+a+"])":"window.undefined")+",["+d+"])","End Property"),c&25&&s.push("Public Property Let ["+d+"](val)",c=(c&16?"Set [(accessors)].["+a+"]=val":b?"Call [(accessors)].["+a+"]"+(c&1?".set":"")+".call(me,val,[(accessors)].["+a+"])":"")+"\nEnd Property","Public Property Set ["+
d+"](val)",c);else{var f=p?C:U(d,1),e=p?C:U(d,0);if(c&1?b.set:8===c&&b)f=function(a){(c&1?b.set:b).call(this,a,b)};if(c&2?b.get:4===c&&b)e=function(){return(c&2?b.get:b).call(this,b)};y.call(g,a)&&delete g[a];L?(a=H.getOwnPropertyDescriptor(g,d),L(g,d,{enumerable:M?0:1,configurable:1,set:4===c&&a&&a.set||f,get:8===c&&a&&a.get||e})):((f=4===c&&g.__lookupSetter__(d)||f)&&g.__defineSetter__(d,f),(e=8===c&&g.__lookupGetter__(d)||e)&&g.__defineGetter__(d,e))}else F&&(50===u.length&&(s.push("Public ["+
u.join("],[")+"]"),u.length=0),u[u.length]=a)},G);G&&!(G=0)&&0===x?u=s=A=0:F&&(x&&(B="StaticClass"+P+M++,s.unshift("Class "+B),s.push((u.length?"Public ["+u.join("],[")+"]\n":"")+"Private [(accessors)]","Private Sub Class_Initialize()","Set [(accessors)]="+B+"FactoryJS()","End Sub","End Class","Function "+B+"Factory()","Set "+B+"Factory=New "+B,"End Function"),j[B+"FactoryJS"]=function(){return s},j.execVBScript(s.join("\n")),x=u=s=r),s={},o.a=j[B+"Factory"](),E(g,function(a,b){if(A.hasOwnProperty(a))if(A[a]&
3){z.prototype=g[a];s[a]=new z}else s[a]=A[a]!==8&&typeof b!=="function"?function(){return b}:g[a];else o.a[a]=(!O||p)&&typeof b==="function"&&a!=="__refine__"?function(){return b.apply(this===g||this==j?o.a:this,arguments)}:b},1),g=o.a)}return m?new d:d()}var e,m,q,F=M,G=1,d=arguments,c=d.length-1,t="constructor",B=r,s=[],u=[],x=0,A=M===r?0:{},N,k,I,D,O,Q=this instanceof l,K=d[c--]||{};if(d[c]&&"object"===typeof d[c]&&!(d[c]instanceof v)&&d[c].constructor&&d[c].constructor!==w.constructor){if(M&&
L)try{L(d[c],"t"+P,{configurable:1,set:function(a){F=a}}),d[c]["t"+P]=0,delete d[c]["t"+P]}catch(X){}N=F?r:(D=T,d[c--])}h=!d[c]||d[c]instanceof v||"object"!==typeof d[c]?"boolean"===typeof d[c]||"number"===typeof d[c]?{compact:d[c--]}:{}:d[c--];D=D||h.compact;e=h.context;m=h.extend;q=h.mixins;I=h.statics||(e||m||q||"compact"in h?{}:h);i=d[c]instanceof v?d[c--]:"function"===typeof d[c]?[d[c--]]:"string"===typeof d[c-1]&&(""+d[c--]).replace(/(^|\s)(extends|implements)(\s|$)/g,",").replace(/^[\s,]+|\s(?=\s)|[\s,]+$/g,
"").replace(/\s*,\s*/g,",").split(",")||[];k="string"===typeof d[c]&&d[c--].split(/extends|implements|,/g)||[];a=d[c--]||e||l.refineScope||(l.refineScope=j);b=(k.shift()||"").replace(/^\s+|\s+$/g,"");e=(k=k.join(",").replace(/^[\s,]+|[\s,]+$/g,"").replace(/\s*,\s*/g,","))?k.split(","):[];m=(m=m||[])instanceof v?m:[m];q=(q=q||[])instanceof v?q:[q];i=e.concat.call(e,i.concat.call(i,m.concat.call(m,q)));if(!(O=i.length)&&!(b||D!==C))D=T;if("function"!==typeof K)var W=K,K=function(){z.prototype=W.constructor.prototype;
k=new z;E(W,function(a,b){k[a]=b});return k};f.toString=function(){return"[object "+(b||"Function")+"]"};f.getInstanceOf=S;f.baseContext=a;E(I,function(a,b){f[a]=b});if(f.b=b){e=a;d=(k=b.split(".")).shift();do 0===k.length?e[t=d]=f:(d in e||(e[d]={}),e=e[d]);while(d=k.shift())}return Q?new f:f}function Q(a,b){var i=r,h=b,j,f;if("string"===typeof a){for(f=a.split(".");(j=f.shift())&&(b=b[j]););"function"===typeof b&&h===b.baseContext&&(i=b)}return i}function Z(a,b){var i=Q(a,b)||Q(a,j)||"function"===
typeof l.autoload&&l.autoload(a,b)||r;if(!i)throw Error("Parent constructor '"+a+"' not Initialized or Undefined");return i}function E(a,b,i){var h,j=t.length,f;for(h in a)if(f=a[h],(i&&f!==w[h]||y.call(a,h))&&b.call(f,h,f)===I){j=I;break}if(j&&X)for(h=0;h<j&&!(f=a[t[h]],(y.call(a,t[h])||i&&t[h]in a&&f!==w[t[h]])&&b.call(f,t[h],f)===I);h++);}function S(a){for(;a&&a.__refine__!=r;){if(a.__refine__===this)return a;a=H.getPrototypeOf?H.getPrototypeOf(a):a.__proto__}return r}var T=!0,I=!1,r=null,C=void 0,
j=("object"===typeof window?window:"undefined"!==typeof global?global:this)||{},x=j.JSON,v=j.Array,H=j.Object,V=j.Boolean,w=H.prototype,L=H.defineProperty,y=w.hasOwnProperty,$=!(H.getPrototypeOf||"__proto__"in w),z=function(){return function(){}}(),P=(new Date).getTime(),X=!{toString:1}.propertyIsEnumerable("toString"),t="toString,toLocaleString,valueOf,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,constructor".split(",");l.instanceOf=function(a,b){return!!S.call(b,a)};var M=function(a,b){function i(b){a=
b}try{L(a,"t",{set:i})}catch(h){try{a.__defineSetter__("t",i)}catch(l){}}a.t=0;a&&(a=1,"execVBscript"in j||("execScript"in j?j.execScript("Function execVBscript(code) ExecuteGlobal(code) End Function\nFunction VBCorrectVal(o,r) If IsObject(o) Then Set r=o Else r=o End If End Function","VBScript"):a=r),a&&"function"===typeof b&&(x.stringify=function(a){if(a&&!(a instanceof H)){var e={};E(a,function(a,b){"__proto__"!==a&&(e[a]=b)});arguments[0]=e}return b.apply(x,arguments)}));return a}({},x&&x.stringify);l.refineScope=l.refineScope||j;return j.refine=j.refinejs=l});