-
Notifications
You must be signed in to change notification settings - Fork 0
/
stampit.min.js
1 lines (1 loc) · 5.16 KB
/
stampit.min.js
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.stampit=e.stampit||{})}(this,function(e){"use strict";function t(e,r){if(void 0===r)return e;if(b(r))return(b(e)?e:[]).concat(r);if(!i(r))return r;for(var s=o(e)?e:{},p=Object.keys(r),n=0;n<p.length;n+=1){var c=p[n],a=r[c];if(void 0!==a){var f=s[c],u=i(f)||b(a)?f:{};s[c]=t(u,a)}}return s}function r(e){return"function"==typeof e}function o(e){var t=typeof e;return!!e&&("object"===t||"function"===t)}function i(e){return!!e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype}function s(){var e=C.apply([],arguments).filter(r);return 0===e.length?void 0:e}function p(e,t,o){if(b(t)){var i=t.length,s=e[o]||[];e[o]=s;for(var p=0;p<i;p+=1){var n=t[p];r(n)&&s.indexOf(n)<0&&s.push(n)}}}function n(e,t,r,i){o(t[r])&&(o(e[r])||(e[r]={}),i(e[r],t[r]))}function c(e,t,r){n(e,t,r,g)}function a(e,t,r){n(e,t,r,D)}function f(e){return function t(o){for(var i=[],s=arguments.length-1;s-- >0;)i[s]=arguments[s+1];var p=Object.create(e.methods||null);if(g(p,e.deepProperties),D(p,e.properties),Object.defineProperties(p,e.propertyDescriptors||{}),!e.initializers||0===e.initializers.length)return p;void 0===o&&(o={});for(var n=e.initializers,c=n.length,a=0;a<c;a+=1){var f=n[a];if(r(f)){var u=f.call(p,o,{instance:p,stamp:t,args:[o].concat(i)});p=void 0===u?p:u}}return p}}function u(e,t){var o=f(e);g(o,e.staticDeepProperties),D(o,e.staticProperties),Object.defineProperties(o,e.staticPropertyDescriptors||{});var i=r(o.compose)?o.compose:t;return o.compose=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return i.apply(this,e)},D(o.compose,e),o}function d(e,t){var r=t&&t.compose||t;return o(r)?(a(e,r,"methods"),a(e,r,"properties"),c(e,r,"deepProperties"),a(e,r,"propertyDescriptors"),a(e,r,"staticProperties"),c(e,r,"staticDeepProperties"),a(e,r,"staticPropertyDescriptors"),a(e,r,"configuration"),c(e,r,"deepConfiguration"),p(e,r.initializers,"initializers"),e):e}function v(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return u([this].concat(e).filter(o).reduce(d,{}),v)}function l(e){return r(e)&&r(e.compose)}function h(e,t){return function(){for(var r=arguments.length,o=Array(r);r--;)o[r]=arguments[r];return(this&&this.compose||y).call(this,(i={},i[e]=t.apply(void 0,[{}].concat(o)),i));var i}}function m(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return(this&&this.compose||y).call(this,{initializers:s.apply(void 0,e)})}function P(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return(this&&this.compose||y).call(this,{composers:s.apply(void 0,e)})}function y(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=e.filter(o).map(function(e){return l(e)?e:j(e)}),s=v.apply(this||B,i),p=s.compose.deepConfiguration&&s.compose.deepConfiguration.composers;if(b(p)&&p.length>0){for(var n=[],c=0;c<p.length;c+=1){var a=p[c];r(a)&&!n.includes(a)&&n.push(a)}s.compose.deepConfiguration.composers=n,l(this)&&i.unshift(this);for(var f=0;f<n.length;f+=1){var u=n[f],d=u({stamp:s,composables:i});s=l(d)?d:s}}return s}var g=function(e){for(var r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return r.reduce(t,e)},D=Object.assign,b=Array.isArray,C=Array.prototype.concat,j=function(e){void 0===e&&(e={});var t=e.methods,r=e.properties,i=e.props,n=e.refs,c=e.initializers,a=e.init,f=e.composers,u=e.deepProperties,d=e.deepProps,v=e.propertyDescriptors,l=e.staticProperties,h=e.statics,m=e.staticDeepProperties,P=e.deepStatics,y=e.staticPropertyDescriptors,b=e.configuration,C=e.conf,j=e.deepConfiguration,z=e.deepConf,O=o(i)||o(n)||o(r)?D({},i,n,r):void 0,x=o(d)?g({},d):void 0;x=o(u)?g(x,u):x;var A=o(h)||o(l)?D({},h,l):void 0,S=o(P)?g({},P):void 0;S=o(m)?g(S,m):S;var _=o(C)||o(b)?D({},C,b):void 0,k=o(z)?g({},z):void 0;k=o(j)?g(k,j):k;var M=s(a,c),q=s(f);q&&(k=k||{},p(k,q,"composers"));var w={};return t&&(w.methods=t),O&&(w.properties=O),M&&(w.initializers=M),x&&(w.deepProperties=x),A&&(w.staticProperties=A),t&&(w.methods=t),S&&(w.staticDeepProperties=S),v&&(w.propertyDescriptors=v),y&&(w.staticPropertyDescriptors=y),_&&(w.configuration=_),k&&(w.deepConfiguration=k),w},z=h("methods",D),O=h("properties",D),x=h("deepProperties",g),A=h("staticProperties",D),S=h("staticDeepProperties",g),_=h("configuration",D),k=h("deepConfiguration",g),M=h("propertyDescriptors",D),q=h("staticPropertyDescriptors",D),w={methods:z,properties:O,refs:O,props:O,initializers:m,init:m,composers:P,deepProperties:x,deepProps:x,staticProperties:A,statics:A,staticDeepProperties:S,deepStatics:S,configuration:_,conf:_,deepConfiguration:k,deepConf:k,propertyDescriptors:M,staticPropertyDescriptors:q},B=v({staticProperties:w},{staticProperties:{create:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return this.apply(void 0,e)},compose:y}}),E=y.bind();y.compose=E;var F=D(y,w);e.methods=z,e.properties=O,e.refs=O,e.props=O,e.initializers=m,e.init=m,e.composers=P,e.deepProperties=x,e.deepProps=x,e.staticProperties=A,e.statics=A,e.staticDeepProperties=S,e.deepStatics=S,e.configuration=_,e.conf=_,e.deepConfiguration=k,e.deepConf=k,e.propertyDescriptors=M,e.staticPropertyDescriptors=q,e.compose=E,e.default=F,Object.defineProperty(e,"__esModule",{value:!0})});